From 2e54f586a2b3b40c71c74ce2f40a43f73c5c01f6 Mon Sep 17 00:00:00 2001 From: beucismis Date: Sun, 12 Feb 2023 21:12:11 +0000 Subject: [PATCH 1/5] Translated using Weblate (Turkish) Currently translated at 95.7% (317 of 331 strings) Translation: Homepage/Homepage Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/tr/ --- public/locales/tr/common.json | 160 +++++++++++++++++----------------- 1 file changed, 80 insertions(+), 80 deletions(-) diff --git a/public/locales/tr/common.json b/public/locales/tr/common.json index e9609734..68fdd787 100644 --- a/public/locales/tr/common.json +++ b/public/locales/tr/common.json @@ -3,10 +3,10 @@ "missing_type": "Kayıp Araç Türü: {{type}}", "api_error": "API Hatası", "status": "Durum", - "information": "Information", + "information": "Bilgi", "url": "URL", - "raw_error": "Raw Error", - "response_data": "Response Data" + "raw_error": "Ham Hata", + "response_data": "Yanıt Verisi" }, "weather": { "current": "Mevcut Konum", @@ -18,7 +18,7 @@ "placeholder": "Ara…" }, "resources": { - "cpu": "İşlemci", + "cpu": "CPU", "total": "Toplam", "free": "Boşta", "used": "Kullanımda", @@ -40,7 +40,7 @@ "devices": "Aygıtlar", "lan_devices": "LAN Aygıtları", "wlan_devices": "WLAN Aygıtları", - "empty_data": "Subsystem status unknown" + "empty_data": "Alt sistem durumu bilinmiyor" }, "docker": { "rx": "Gelen Veri", @@ -48,8 +48,8 @@ "mem": "Bellek", "cpu": "İşlemci", "offline": "Çevrimdışı", - "error": "Error", - "unknown": "Unknown" + "error": "Hata", + "unknown": "Bilinmiyor" }, "emby": { "playing": "Oynatılıyor", @@ -91,7 +91,7 @@ }, "qbittorrent": { "download": "İndirme", - "upload": "Yükleme", + "upload": "Yükle", "leech": "İsteyen", "seed": "Sunan" }, @@ -134,7 +134,7 @@ "pending": "Bekliyor", "approved": "Onaylı", "available": "Kullanılabilir", - "processing": "Processing" + "processing": "İşleniyor" }, "pihole": { "queries": "Sorgular", @@ -282,7 +282,7 @@ "quicklaunch": { "bookmark": "Yer İmi", "service": "Hizmet", - "search": "Search", + "search": "Ara", "custom": "Custom" }, "homebridge": { @@ -327,146 +327,146 @@ "total": "Toplam" }, "gluetun": { - "public_ip": "Public IP", - "region": "Region", - "country": "Country" + "public_ip": "Açık IP", + "region": "Bölge", + "country": "Ülke" }, "hdhomerun": { - "channels": "Channels", + "channels": "Kanallar", "hd": "HD" }, "ping": { - "error": "Error", + "error": "Hata", "ping": "Ping" }, "scrutiny": { - "passed": "Passed", - "failed": "Failed", - "unknown": "Unknown" + "passed": "Geçti", + "failed": "Başarısız", + "unknown": "Bilinmeyen" }, "paperlessngx": { - "inbox": "Inbox", - "total": "Total" + "inbox": "Gelen Kutusu", + "total": "Toplam" }, "deluge": { - "download": "Download", - "upload": "Upload", + "download": "İndir", + "upload": "Yükle", "leech": "Leech", - "seed": "Seed" + "seed": "Tohum" }, "flood": { - "download": "Download", - "upload": "Upload", + "download": "İndir", + "upload": "Yükle", "leech": "Leech", - "seed": "Seed" + "seed": "Tohum" }, "tdarr": { - "queue": "Queue", - "processed": "Processed", - "errored": "Errored", - "saved": "Saved" + "queue": "Sıra", + "processed": "İşlendi", + "errored": "Hatalı", + "saved": "Kaydedildi" }, "miniflux": { - "read": "Read", - "unread": "Unread" + "read": "Oku", + "unread": "Okunmamış" }, "nextdns": { - "wait": "Please Wait", - "no_devices": "No Device Data Received" + "wait": "Lütfen Bekle", + "no_devices": "Cihaz Verisi Alınamadı" }, "common": { "bibyterate": "{{value, rate(bits: false; binary: true)}}", "bibitrate": "{{value, rate(bits: true; binary: true)}}" }, "omada": { - "connectedAp": "Connected APs", - "activeUser": "Active devices", - "alerts": "Alerts", - "connectedGateway": "Connected gateways", - "connectedSwitches": "Connected switches" + "connectedAp": "Bağlı AP'ler", + "activeUser": "Aktif cihazlar", + "alerts": "Alarmlar", + "connectedGateway": "Bağlı ağ geçitleri", + "connectedSwitches": "Bağlı anahtarlar" }, "downloadstation": { - "download": "Download", - "upload": "Upload", + "download": "İndir", + "upload": "Yükle", "leech": "Leech", - "seed": "Seed" + "seed": "Tohum" }, "mikrotik": { - "cpuLoad": "CPU Load", - "memoryUsed": "Memory Used", - "uptime": "Uptime", + "cpuLoad": "CPU Yükü", + "memoryUsed": "Bellek Kullanımı", + "uptime": "Çalışma Süresi", "numberOfLeases": "Leases" }, "xteve": { - "streams_all": "All Streams", - "streams_active": "Active Streams", - "streams_xepg": "XEPG Channels" + "streams_all": "Tüm Akışlar", + "streams_active": "Aktif Akışlar", + "streams_xepg": "XEPG Kanalları" }, "opnsense": { - "cpu": "CPU Load", - "memory": "Active Memory", - "wanUpload": "WAN Upload", - "wanDownload": "WAN Download" + "cpu": "CPU Yükü", + "memory": "Aktif Bellek", + "wanUpload": "WAN Yükleme", + "wanDownload": "WAN İndirme" }, "moonraker": { - "printer_state": "Printer State", - "print_status": "Print Status", - "print_progress": "Progress", - "layers": "Layers" + "printer_state": "Yazıcı Durumu", + "print_status": "Yazıcı Durumu", + "print_progress": "İlerleme", + "layers": "Katmanlar" }, "medusa": { "wanted": "Wanted", - "queued": "Queued", - "series": "Series" + "queued": "Kuyrukta", + "series": "Seri" }, "octoprint": { - "printer_state": "Status", - "temp_tool": "Tool temp", - "temp_bed": "Bed temp", + "printer_state": "Durum", + "temp_tool": "Araç sıcaklığı", + "temp_bed": "Yatak sıcaklığı", "job_completion": "Completion" }, "cloudflared": { "origin_ip": "Origin IP", - "status": "Status" + "status": "Durum" }, "proxmoxbackupserver": { "datastore_usage": "Datastore", "failed_tasks_24h": "Failed Tasks 24h", "cpu_usage": "CPU", - "memory_usage": "Memory" + "memory_usage": "Bellek" }, "immich": { - "users": "Users", - "photos": "Photos", - "videos": "Videos", - "storage": "Storage" + "users": "Kullanıcılar", + "photos": "Fotoğraflar", + "videos": "Videolar", + "storage": "Depo" }, "uptimekuma": { "up": "Sites Up", "down": "Sites Down", - "uptime": "Uptime", + "uptime": "Çalışma Süresi", "incident": "Incident", "m": "m" }, "komga": { - "libraries": "Libraries", + "libraries": "Kütüphane", "series": "Series", - "books": "Books" + "books": "Kitaplar" }, "mylar": { - "series": "Series", - "issues": "Issues", - "wanted": "Wanted" + "series": "Seriler", + "issues": "Sorunlar", + "wanted": "Aranan" }, "photoprism": { - "albums": "Albums", - "photos": "Photos", - "videos": "Videos", - "people": "People" + "albums": "Albümler", + "photos": "Fotoğraflar", + "videos": "Videolar", + "people": "İnsan" }, "diskstation": { - "days": "Days", - "uptime": "Uptime", - "volumeAvailable": "Available" + "days": "Gün", + "uptime": "Çalışma Süresi", + "volumeAvailable": "Mevcut" } } From ebe58769f65c335f8d40665ca33809fc21d887af Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Mon, 13 Feb 2023 20:22:15 -0800 Subject: [PATCH 2/5] fix fileflows widget labels --- public/locales/en/common.json | 6 ++++++ src/widgets/fileflows/component.jsx | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/public/locales/en/common.json b/public/locales/en/common.json index 0efa1150..37ff7baa 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -477,5 +477,11 @@ "photos": "Photos", "videos": "Videos", "people": "People" + }, + "fileflows": { + "queue": "Queue", + "processing": "Processing", + "processed": "Processed", + "time": "Time" } } \ No newline at end of file diff --git a/src/widgets/fileflows/component.jsx b/src/widgets/fileflows/component.jsx index 7065a655..274ed76d 100755 --- a/src/widgets/fileflows/component.jsx +++ b/src/widgets/fileflows/component.jsx @@ -28,10 +28,10 @@ export default function Component({ service }) { return ( - - - - + + + + ); } From 794bef961b61dabe77eecd8746b733883110c051 Mon Sep 17 00:00:00 2001 From: Mbarmem Date: Mon, 13 Feb 2023 15:20:22 +0300 Subject: [PATCH 3/5] Add Grafana widget --- src/widgets/components.js | 1 + src/widgets/grafana/component.jsx | 40 +++++++++++++++++++++++++++++++ src/widgets/grafana/widget.js | 14 +++++++++++ src/widgets/widgets.js | 2 ++ 4 files changed, 57 insertions(+) create mode 100755 src/widgets/grafana/component.jsx create mode 100755 src/widgets/grafana/widget.js diff --git a/src/widgets/components.js b/src/widgets/components.js index 9623c63d..8c5c42e7 100644 --- a/src/widgets/components.js +++ b/src/widgets/components.js @@ -18,6 +18,7 @@ const components = { flood: dynamic(() => import("./flood/component")), gluetun: dynamic(() => import("./gluetun/component")), gotify: dynamic(() => import("./gotify/component")), + grafana: dynamic(() => import("./grafana/component")), hdhomerun: dynamic(() => import("./hdhomerun/component")), homebridge: dynamic(() => import("./homebridge/component")), jackett: dynamic(() => import("./jackett/component")), diff --git a/src/widgets/grafana/component.jsx b/src/widgets/grafana/component.jsx new file mode 100755 index 00000000..2aba23ba --- /dev/null +++ b/src/widgets/grafana/component.jsx @@ -0,0 +1,40 @@ +import { useTranslation } from "next-i18next"; + +import Container from "components/services/widget/container"; +import Block from "components/services/widget/block"; +import useWidgetAPI from "utils/proxy/use-widget-api"; + +export default function Component({ service }) { + const { t } = useTranslation(); + + const { widget } = service; + const { data: alertsData, error: alertsError } = useWidgetAPI(widget, "alerts"); + + if (alertsError) { + return ; + } + + if (!alertsData) { + return ( + + + + + ); + } + + const totalAlerts = Object.keys(alertsData).length; + let alertsTriggered = 0; + Object.keys(alertsData).forEach((key) => { + if (alertsData[key].state === "alerting") { + alertsTriggered += 1; + } + }); + + return ( + + + + + ); +} diff --git a/src/widgets/grafana/widget.js b/src/widgets/grafana/widget.js new file mode 100755 index 00000000..6ab53db0 --- /dev/null +++ b/src/widgets/grafana/widget.js @@ -0,0 +1,14 @@ +import genericProxyHandler from "utils/proxy/handlers/generic"; + +const widget = { + api: "{url}/api/{endpoint}", + proxyHandler: genericProxyHandler, + + mappings: { + alerts: { + endpoint: "alerts", + }, + }, +}; + +export default widget; \ No newline at end of file diff --git a/src/widgets/widgets.js b/src/widgets/widgets.js index ff2a2787..111da7eb 100644 --- a/src/widgets/widgets.js +++ b/src/widgets/widgets.js @@ -13,6 +13,7 @@ import fileflows from "./fileflows/widget"; import flood from "./flood/widget"; import gluetun from "./gluetun/widget"; import gotify from "./gotify/widget"; +import grafana from "./grafana/widget"; import hdhomerun from "./hdhomerun/widget"; import homebridge from "./homebridge/widget"; import jackett from "./jackett/widget"; @@ -80,6 +81,7 @@ const widgets = { flood, gluetun, gotify, + grafana, hdhomerun, homebridge, jackett, From ce9852ac9bc590a430ee24c21143a84af16dbae0 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Mon, 13 Feb 2023 20:24:57 -0800 Subject: [PATCH 4/5] Cleanup grafana widget + fix labels --- public/locales/en/common.json | 4 ++++ src/widgets/grafana/component.jsx | 12 ++---------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/public/locales/en/common.json b/public/locales/en/common.json index 37ff7baa..c902f91c 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -483,5 +483,9 @@ "processing": "Processing", "processed": "Processed", "time": "Time" + }, + "grafana": { + "totalalerts": "Total Alerts", + "alertstriggered": "Alerts Triggered" } } \ No newline at end of file diff --git a/src/widgets/grafana/component.jsx b/src/widgets/grafana/component.jsx index 2aba23ba..2d6520dd 100755 --- a/src/widgets/grafana/component.jsx +++ b/src/widgets/grafana/component.jsx @@ -23,18 +23,10 @@ export default function Component({ service }) { ); } - const totalAlerts = Object.keys(alertsData).length; - let alertsTriggered = 0; - Object.keys(alertsData).forEach((key) => { - if (alertsData[key].state === "alerting") { - alertsTriggered += 1; - } - }); - return ( - - + + a.state === "alerting").length })} /> ); } From c07e67573fbc0fc5be59160d774d706451ff2455 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Mon, 13 Feb 2023 20:53:45 -0800 Subject: [PATCH 5/5] Add grafana stats --- public/locales/en/common.json | 2 ++ src/widgets/grafana/component.jsx | 13 +++++++++---- src/widgets/grafana/widget.js | 6 ++++++ 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/public/locales/en/common.json b/public/locales/en/common.json index c902f91c..98f2b796 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -485,6 +485,8 @@ "time": "Time" }, "grafana": { + "dashboards": "Dashboards", + "datasources": "Data Sources", "totalalerts": "Total Alerts", "alertstriggered": "Alerts Triggered" } diff --git a/src/widgets/grafana/component.jsx b/src/widgets/grafana/component.jsx index 2d6520dd..98d4c42b 100755 --- a/src/widgets/grafana/component.jsx +++ b/src/widgets/grafana/component.jsx @@ -8,15 +8,18 @@ export default function Component({ service }) { const { t } = useTranslation(); const { widget } = service; + const { data: statsData, error: statsError } = useWidgetAPI(widget, "stats"); const { data: alertsData, error: alertsError } = useWidgetAPI(widget, "alerts"); - if (alertsError) { - return ; + if (statsError || alertsError) { + return ; } - if (!alertsData) { + if (!statsData || !alertsData) { return ( + + @@ -25,7 +28,9 @@ export default function Component({ service }) { return ( - + + + a.state === "alerting").length })} /> ); diff --git a/src/widgets/grafana/widget.js b/src/widgets/grafana/widget.js index 6ab53db0..64051925 100755 --- a/src/widgets/grafana/widget.js +++ b/src/widgets/grafana/widget.js @@ -8,6 +8,12 @@ const widget = { alerts: { endpoint: "alerts", }, + stats: { + endpoint: "admin/stats", + validate: [ + "dashboards" + ] + }, }, };