diff --git a/public/locales/ar/common.json b/public/locales/ar/common.json index ca7b23e0..6ff5acab 100644 --- a/public/locales/ar/common.json +++ b/public/locales/ar/common.json @@ -655,5 +655,15 @@ "kavita": { "seriesCount": "Series", "totalFiles": "Files" + }, + "azurePipelines": { + "result": "Result", + "status": "Status", + "buildId": "Build ID", + "succeeded": "Succeeded", + "notStarted": "Not Started", + "failed": "Failed", + "canceled": "Canceled", + "inProgress": "In Progress" } } diff --git a/public/locales/bg/common.json b/public/locales/bg/common.json index 9f0afa40..d0dea6a9 100644 --- a/public/locales/bg/common.json +++ b/public/locales/bg/common.json @@ -655,5 +655,15 @@ "kavita": { "seriesCount": "Series", "totalFiles": "Files" + }, + "azurePipelines": { + "result": "Result", + "status": "Status", + "buildId": "Build ID", + "succeeded": "Succeeded", + "notStarted": "Not Started", + "failed": "Failed", + "canceled": "Canceled", + "inProgress": "In Progress" } } diff --git a/public/locales/ca/common.json b/public/locales/ca/common.json index 78339842..83fc95a4 100644 --- a/public/locales/ca/common.json +++ b/public/locales/ca/common.json @@ -655,5 +655,15 @@ "kavita": { "seriesCount": "Series", "totalFiles": "Files" + }, + "azurePipelines": { + "result": "Result", + "status": "Status", + "buildId": "Build ID", + "succeeded": "Succeeded", + "notStarted": "Not Started", + "failed": "Failed", + "canceled": "Canceled", + "inProgress": "In Progress" } } diff --git a/public/locales/cs/common.json b/public/locales/cs/common.json index 19cc09ba..ed5dc276 100644 --- a/public/locales/cs/common.json +++ b/public/locales/cs/common.json @@ -655,5 +655,15 @@ "kavita": { "seriesCount": "Series", "totalFiles": "Files" + }, + "azurePipelines": { + "result": "Result", + "status": "Status", + "buildId": "Build ID", + "succeeded": "Succeeded", + "notStarted": "Not Started", + "failed": "Failed", + "canceled": "Canceled", + "inProgress": "In Progress" } } diff --git a/public/locales/da/common.json b/public/locales/da/common.json index f1f161c7..797f9f4a 100644 --- a/public/locales/da/common.json +++ b/public/locales/da/common.json @@ -655,5 +655,15 @@ "kavita": { "seriesCount": "Series", "totalFiles": "Files" + }, + "azurePipelines": { + "result": "Result", + "status": "Status", + "buildId": "Build ID", + "succeeded": "Succeeded", + "notStarted": "Not Started", + "failed": "Failed", + "canceled": "Canceled", + "inProgress": "In Progress" } } diff --git a/public/locales/de/common.json b/public/locales/de/common.json index 0ed40270..8bd743ea 100644 --- a/public/locales/de/common.json +++ b/public/locales/de/common.json @@ -655,5 +655,15 @@ "kavita": { "seriesCount": "Series", "totalFiles": "Files" + }, + "azurePipelines": { + "result": "Result", + "status": "Status", + "buildId": "Build ID", + "succeeded": "Succeeded", + "notStarted": "Not Started", + "failed": "Failed", + "canceled": "Canceled", + "inProgress": "In Progress" } } diff --git a/public/locales/el/common.json b/public/locales/el/common.json index aaaaa88b..506a25d7 100644 --- a/public/locales/el/common.json +++ b/public/locales/el/common.json @@ -655,5 +655,15 @@ "kavita": { "seriesCount": "Series", "totalFiles": "Files" + }, + "azurePipelines": { + "result": "Result", + "status": "Status", + "buildId": "Build ID", + "succeeded": "Succeeded", + "notStarted": "Not Started", + "failed": "Failed", + "canceled": "Canceled", + "inProgress": "In Progress" } } diff --git a/public/locales/en/common.json b/public/locales/en/common.json index d738439e..49cf67ee 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -665,6 +665,16 @@ "seriesCount": "Series", "totalFiles": "Files" }, + "azurePipelines": { + "result": "Result", + "status": "Status", + "buildId": "Build ID", + "succeeded": "Succeeded", + "notStarted": "Not Started", + "failed": "Failed", + "canceled": "Canceled", + "inProgress": "In Progress" + }, "azurePullrequests": { "totalPrs": "Total PRs", "myPrs": "My PRs", diff --git a/public/locales/eo/common.json b/public/locales/eo/common.json index 0279feff..4a1ae6f3 100644 --- a/public/locales/eo/common.json +++ b/public/locales/eo/common.json @@ -655,5 +655,15 @@ "kavita": { "seriesCount": "Series", "totalFiles": "Files" + }, + "azurePipelines": { + "result": "Result", + "status": "Status", + "buildId": "Build ID", + "succeeded": "Succeeded", + "notStarted": "Not Started", + "failed": "Failed", + "canceled": "Canceled", + "inProgress": "In Progress" } } diff --git a/public/locales/es/common.json b/public/locales/es/common.json index 17c26d7c..9e3e6093 100644 --- a/public/locales/es/common.json +++ b/public/locales/es/common.json @@ -655,5 +655,15 @@ "kavita": { "seriesCount": "Serie", "totalFiles": "Archivos" + }, + "azurePipelines": { + "result": "Result", + "status": "Status", + "buildId": "Build ID", + "succeeded": "Succeeded", + "notStarted": "Not Started", + "failed": "Failed", + "canceled": "Canceled", + "inProgress": "In Progress" } } diff --git a/public/locales/eu/common.json b/public/locales/eu/common.json index 6eca4339..27685703 100644 --- a/public/locales/eu/common.json +++ b/public/locales/eu/common.json @@ -655,5 +655,15 @@ "kavita": { "seriesCount": "Series", "totalFiles": "Files" + }, + "azurePipelines": { + "result": "Result", + "status": "Status", + "buildId": "Build ID", + "succeeded": "Succeeded", + "notStarted": "Not Started", + "failed": "Failed", + "canceled": "Canceled", + "inProgress": "In Progress" } } diff --git a/public/locales/fi/common.json b/public/locales/fi/common.json index 705d2127..ad457f2c 100644 --- a/public/locales/fi/common.json +++ b/public/locales/fi/common.json @@ -655,5 +655,15 @@ "kavita": { "seriesCount": "Series", "totalFiles": "Files" + }, + "azurePipelines": { + "result": "Result", + "status": "Status", + "buildId": "Build ID", + "succeeded": "Succeeded", + "notStarted": "Not Started", + "failed": "Failed", + "canceled": "Canceled", + "inProgress": "In Progress" } } diff --git a/public/locales/fr/common.json b/public/locales/fr/common.json index 6ff00e8f..2000d6fe 100644 --- a/public/locales/fr/common.json +++ b/public/locales/fr/common.json @@ -655,5 +655,15 @@ "kavita": { "seriesCount": "Séries", "totalFiles": "Fichiers" + }, + "azurePipelines": { + "result": "Result", + "status": "Status", + "buildId": "Build ID", + "succeeded": "Succeeded", + "notStarted": "Not Started", + "failed": "Failed", + "canceled": "Canceled", + "inProgress": "In Progress" } } diff --git a/public/locales/he/common.json b/public/locales/he/common.json index e23f3565..78545f39 100644 --- a/public/locales/he/common.json +++ b/public/locales/he/common.json @@ -655,5 +655,15 @@ "kavita": { "seriesCount": "Series", "totalFiles": "Files" + }, + "azurePipelines": { + "result": "Result", + "status": "Status", + "buildId": "Build ID", + "succeeded": "Succeeded", + "notStarted": "Not Started", + "failed": "Failed", + "canceled": "Canceled", + "inProgress": "In Progress" } } diff --git a/public/locales/hi/common.json b/public/locales/hi/common.json index 5620a9f1..70dd22e8 100644 --- a/public/locales/hi/common.json +++ b/public/locales/hi/common.json @@ -655,5 +655,15 @@ "kavita": { "seriesCount": "Series", "totalFiles": "Files" + }, + "azurePipelines": { + "result": "Result", + "status": "Status", + "buildId": "Build ID", + "succeeded": "Succeeded", + "notStarted": "Not Started", + "failed": "Failed", + "canceled": "Canceled", + "inProgress": "In Progress" } } diff --git a/public/locales/hr/common.json b/public/locales/hr/common.json index 26f1305b..49e13492 100644 --- a/public/locales/hr/common.json +++ b/public/locales/hr/common.json @@ -105,7 +105,7 @@ "transcoding": "Prekodiranje", "bitrate": "Stopa bitova", "no_active": "Nema aktivnih prijenosa", - "plex_connection_error": "Check Plex Connection" + "plex_connection_error": "Provjeri Plex vezu" }, "nzbget": { "rate": "Stopa", @@ -655,5 +655,15 @@ "kavita": { "seriesCount": "Serije", "totalFiles": "Datoteke" + }, + "azurePipelines": { + "result": "Result", + "status": "Status", + "buildId": "Build ID", + "succeeded": "Succeeded", + "notStarted": "Not Started", + "failed": "Failed", + "canceled": "Canceled", + "inProgress": "In Progress" } } diff --git a/public/locales/hu/common.json b/public/locales/hu/common.json index b38cb94b..9c787454 100644 --- a/public/locales/hu/common.json +++ b/public/locales/hu/common.json @@ -655,5 +655,15 @@ "kavita": { "seriesCount": "Series", "totalFiles": "Files" + }, + "azurePipelines": { + "result": "Result", + "status": "Status", + "buildId": "Build ID", + "succeeded": "Succeeded", + "notStarted": "Not Started", + "failed": "Failed", + "canceled": "Canceled", + "inProgress": "In Progress" } } diff --git a/public/locales/id/common.json b/public/locales/id/common.json index 8e9cc1d2..d3cab359 100644 --- a/public/locales/id/common.json +++ b/public/locales/id/common.json @@ -655,5 +655,15 @@ "kavita": { "seriesCount": "Series", "totalFiles": "Files" + }, + "azurePipelines": { + "result": "Result", + "status": "Status", + "buildId": "Build ID", + "succeeded": "Succeeded", + "notStarted": "Not Started", + "failed": "Failed", + "canceled": "Canceled", + "inProgress": "In Progress" } } diff --git a/public/locales/it/common.json b/public/locales/it/common.json index 4eb941b3..0e45b23f 100644 --- a/public/locales/it/common.json +++ b/public/locales/it/common.json @@ -655,5 +655,15 @@ "kavita": { "seriesCount": "Serie", "totalFiles": "File" + }, + "azurePipelines": { + "result": "Result", + "status": "Status", + "buildId": "Build ID", + "succeeded": "Succeeded", + "notStarted": "Not Started", + "failed": "Failed", + "canceled": "Canceled", + "inProgress": "In Progress" } } diff --git a/public/locales/ja/common.json b/public/locales/ja/common.json index 3d09852a..5a0eccee 100644 --- a/public/locales/ja/common.json +++ b/public/locales/ja/common.json @@ -655,5 +655,15 @@ "kavita": { "seriesCount": "Series", "totalFiles": "Files" + }, + "azurePipelines": { + "result": "Result", + "status": "Status", + "buildId": "Build ID", + "succeeded": "Succeeded", + "notStarted": "Not Started", + "failed": "Failed", + "canceled": "Canceled", + "inProgress": "In Progress" } } diff --git a/public/locales/ko/common.json b/public/locales/ko/common.json index be7640a6..f1325b75 100644 --- a/public/locales/ko/common.json +++ b/public/locales/ko/common.json @@ -655,5 +655,15 @@ "kavita": { "seriesCount": "Series", "totalFiles": "Files" + }, + "azurePipelines": { + "result": "Result", + "status": "Status", + "buildId": "Build ID", + "succeeded": "Succeeded", + "notStarted": "Not Started", + "failed": "Failed", + "canceled": "Canceled", + "inProgress": "In Progress" } } diff --git a/public/locales/lv/common.json b/public/locales/lv/common.json index 9b95cfe8..696b4d85 100644 --- a/public/locales/lv/common.json +++ b/public/locales/lv/common.json @@ -655,5 +655,15 @@ "kavita": { "seriesCount": "Series", "totalFiles": "Files" + }, + "azurePipelines": { + "status": "Status", + "buildId": "Build ID", + "succeeded": "Succeeded", + "notStarted": "Not Started", + "failed": "Failed", + "canceled": "Canceled", + "result": "Result", + "inProgress": "In Progress" } } diff --git a/public/locales/ms/common.json b/public/locales/ms/common.json index f34bc2f4..a25ed71f 100644 --- a/public/locales/ms/common.json +++ b/public/locales/ms/common.json @@ -655,5 +655,15 @@ "kavita": { "seriesCount": "Series", "totalFiles": "Files" + }, + "azurePipelines": { + "result": "Result", + "status": "Status", + "buildId": "Build ID", + "succeeded": "Succeeded", + "notStarted": "Not Started", + "failed": "Failed", + "canceled": "Canceled", + "inProgress": "In Progress" } } diff --git a/public/locales/nb-NO/common.json b/public/locales/nb-NO/common.json index 8f55f79c..38dd3012 100644 --- a/public/locales/nb-NO/common.json +++ b/public/locales/nb-NO/common.json @@ -655,5 +655,15 @@ "kavita": { "seriesCount": "Series", "totalFiles": "Filer" + }, + "azurePipelines": { + "result": "Result", + "status": "Status", + "buildId": "Build ID", + "succeeded": "Succeeded", + "notStarted": "Not Started", + "failed": "Failed", + "canceled": "Canceled", + "inProgress": "In Progress" } } diff --git a/public/locales/nl/common.json b/public/locales/nl/common.json index aabb0624..5bcce505 100644 --- a/public/locales/nl/common.json +++ b/public/locales/nl/common.json @@ -655,5 +655,15 @@ "kavita": { "seriesCount": "Series", "totalFiles": "Files" + }, + "azurePipelines": { + "result": "Result", + "status": "Status", + "buildId": "Build ID", + "succeeded": "Succeeded", + "notStarted": "Not Started", + "failed": "Failed", + "canceled": "Canceled", + "inProgress": "In Progress" } } diff --git a/public/locales/pl/common.json b/public/locales/pl/common.json index bb26b3a9..c44da833 100644 --- a/public/locales/pl/common.json +++ b/public/locales/pl/common.json @@ -655,5 +655,15 @@ "kavita": { "seriesCount": "Series", "totalFiles": "Files" + }, + "azurePipelines": { + "result": "Result", + "status": "Status", + "buildId": "Build ID", + "succeeded": "Succeeded", + "notStarted": "Not Started", + "failed": "Failed", + "canceled": "Canceled", + "inProgress": "In Progress" } } diff --git a/public/locales/pt-BR/common.json b/public/locales/pt-BR/common.json index f9f11e8a..55e45757 100644 --- a/public/locales/pt-BR/common.json +++ b/public/locales/pt-BR/common.json @@ -655,5 +655,15 @@ "kavita": { "seriesCount": "Series", "totalFiles": "Files" + }, + "azurePipelines": { + "result": "Result", + "status": "Status", + "buildId": "Build ID", + "succeeded": "Succeeded", + "notStarted": "Not Started", + "failed": "Failed", + "canceled": "Canceled", + "inProgress": "In Progress" } } diff --git a/public/locales/pt/common.json b/public/locales/pt/common.json index ebe2bf87..add4573a 100644 --- a/public/locales/pt/common.json +++ b/public/locales/pt/common.json @@ -664,5 +664,15 @@ "kavita": { "seriesCount": "Series", "totalFiles": "Files" + }, + "azurePipelines": { + "result": "Result", + "status": "Status", + "buildId": "Build ID", + "succeeded": "Succeeded", + "notStarted": "Not Started", + "failed": "Failed", + "canceled": "Canceled", + "inProgress": "In Progress" } } diff --git a/public/locales/ro/common.json b/public/locales/ro/common.json index 03030efc..96fd22b4 100644 --- a/public/locales/ro/common.json +++ b/public/locales/ro/common.json @@ -655,5 +655,15 @@ "kavita": { "seriesCount": "Series", "totalFiles": "Files" + }, + "azurePipelines": { + "result": "Result", + "status": "Status", + "buildId": "Build ID", + "succeeded": "Succeeded", + "notStarted": "Not Started", + "failed": "Failed", + "canceled": "Canceled", + "inProgress": "In Progress" } } diff --git a/public/locales/ru/common.json b/public/locales/ru/common.json index a0cf1c94..ed23a2a9 100644 --- a/public/locales/ru/common.json +++ b/public/locales/ru/common.json @@ -655,5 +655,15 @@ "kavita": { "seriesCount": "Series", "totalFiles": "Files" + }, + "azurePipelines": { + "inProgress": "In Progress", + "result": "Result", + "status": "Status", + "buildId": "Build ID", + "succeeded": "Succeeded", + "notStarted": "Not Started", + "failed": "Failed", + "canceled": "Canceled" } } diff --git a/public/locales/sk/common.json b/public/locales/sk/common.json index 1fbb4ca8..710b5007 100644 --- a/public/locales/sk/common.json +++ b/public/locales/sk/common.json @@ -655,5 +655,15 @@ "kavita": { "seriesCount": "Series", "totalFiles": "Files" + }, + "azurePipelines": { + "result": "Result", + "status": "Status", + "buildId": "Build ID", + "succeeded": "Succeeded", + "notStarted": "Not Started", + "failed": "Failed", + "canceled": "Canceled", + "inProgress": "In Progress" } } diff --git a/public/locales/sl/common.json b/public/locales/sl/common.json index 1f05dabd..60cee85f 100644 --- a/public/locales/sl/common.json +++ b/public/locales/sl/common.json @@ -655,5 +655,15 @@ "kavita": { "seriesCount": "Serije", "totalFiles": "Datoteke" + }, + "azurePipelines": { + "result": "Result", + "status": "Status", + "buildId": "Build ID", + "succeeded": "Succeeded", + "notStarted": "Not Started", + "failed": "Failed", + "canceled": "Canceled", + "inProgress": "In Progress" } } diff --git a/public/locales/sr/common.json b/public/locales/sr/common.json index 1755cd6f..bb387d90 100644 --- a/public/locales/sr/common.json +++ b/public/locales/sr/common.json @@ -655,5 +655,15 @@ "kavita": { "seriesCount": "Series", "totalFiles": "Files" + }, + "azurePipelines": { + "result": "Result", + "status": "Status", + "buildId": "Build ID", + "succeeded": "Succeeded", + "notStarted": "Not Started", + "failed": "Failed", + "canceled": "Canceled", + "inProgress": "In Progress" } } diff --git a/public/locales/sv/common.json b/public/locales/sv/common.json index beec1e63..d432afc4 100644 --- a/public/locales/sv/common.json +++ b/public/locales/sv/common.json @@ -655,5 +655,15 @@ "kavita": { "totalFiles": "Files", "seriesCount": "Series" + }, + "azurePipelines": { + "result": "Result", + "status": "Status", + "buildId": "Build ID", + "succeeded": "Succeeded", + "notStarted": "Not Started", + "failed": "Failed", + "canceled": "Canceled", + "inProgress": "In Progress" } } diff --git a/public/locales/te/common.json b/public/locales/te/common.json index 8647276c..a73051a4 100644 --- a/public/locales/te/common.json +++ b/public/locales/te/common.json @@ -655,5 +655,15 @@ "kavita": { "totalFiles": "Files", "seriesCount": "Series" + }, + "azurePipelines": { + "result": "Result", + "status": "Status", + "buildId": "Build ID", + "succeeded": "Succeeded", + "notStarted": "Not Started", + "failed": "Failed", + "canceled": "Canceled", + "inProgress": "In Progress" } } diff --git a/public/locales/th/common.json b/public/locales/th/common.json index fdbe0a08..64300953 100644 --- a/public/locales/th/common.json +++ b/public/locales/th/common.json @@ -655,5 +655,15 @@ "kavita": { "seriesCount": "Series", "totalFiles": "Files" + }, + "azurePipelines": { + "result": "Result", + "status": "Status", + "buildId": "Build ID", + "succeeded": "Succeeded", + "notStarted": "Not Started", + "failed": "Failed", + "canceled": "Canceled", + "inProgress": "In Progress" } } diff --git a/public/locales/tr/common.json b/public/locales/tr/common.json index b6138c69..0aac8e9f 100644 --- a/public/locales/tr/common.json +++ b/public/locales/tr/common.json @@ -655,5 +655,15 @@ "kavita": { "seriesCount": "Series", "totalFiles": "Files" + }, + "azurePipelines": { + "result": "Result", + "status": "Status", + "buildId": "Build ID", + "succeeded": "Succeeded", + "notStarted": "Not Started", + "failed": "Failed", + "canceled": "Canceled", + "inProgress": "In Progress" } } diff --git a/public/locales/uk/common.json b/public/locales/uk/common.json index 4e1a0cc9..3a5b2817 100644 --- a/public/locales/uk/common.json +++ b/public/locales/uk/common.json @@ -655,5 +655,15 @@ "kavita": { "seriesCount": "Серій", "totalFiles": "Файлів" + }, + "azurePipelines": { + "failed": "Failed", + "result": "Result", + "status": "Status", + "buildId": "Build ID", + "succeeded": "Succeeded", + "notStarted": "Not Started", + "canceled": "Canceled", + "inProgress": "In Progress" } } diff --git a/public/locales/vi/common.json b/public/locales/vi/common.json index a865f6c2..d3341c7a 100644 --- a/public/locales/vi/common.json +++ b/public/locales/vi/common.json @@ -655,5 +655,15 @@ "kavita": { "seriesCount": "Series", "totalFiles": "Files" + }, + "azurePipelines": { + "result": "Result", + "status": "Status", + "buildId": "Build ID", + "succeeded": "Succeeded", + "notStarted": "Not Started", + "failed": "Failed", + "canceled": "Canceled", + "inProgress": "In Progress" } } diff --git a/public/locales/yue/common.json b/public/locales/yue/common.json index a9f72f53..91775685 100644 --- a/public/locales/yue/common.json +++ b/public/locales/yue/common.json @@ -655,5 +655,15 @@ "kavita": { "seriesCount": "Series", "totalFiles": "Files" + }, + "azurePipelines": { + "result": "Result", + "status": "Status", + "buildId": "Build ID", + "succeeded": "Succeeded", + "notStarted": "Not Started", + "failed": "Failed", + "canceled": "Canceled", + "inProgress": "In Progress" } } diff --git a/public/locales/zh-CN/common.json b/public/locales/zh-CN/common.json index b22992b6..448893aa 100644 --- a/public/locales/zh-CN/common.json +++ b/public/locales/zh-CN/common.json @@ -655,5 +655,15 @@ "kavita": { "seriesCount": "Series", "totalFiles": "Files" + }, + "azurePipelines": { + "result": "Result", + "status": "Status", + "buildId": "Build ID", + "succeeded": "Succeeded", + "notStarted": "Not Started", + "failed": "Failed", + "canceled": "Canceled", + "inProgress": "In Progress" } } diff --git a/public/locales/zh-Hant/common.json b/public/locales/zh-Hant/common.json index e2652aeb..2f9d8622 100644 --- a/public/locales/zh-Hant/common.json +++ b/public/locales/zh-Hant/common.json @@ -655,5 +655,15 @@ "kavita": { "seriesCount": "Series", "totalFiles": "Files" + }, + "azurePipelines": { + "result": "Result", + "status": "Status", + "buildId": "Build ID", + "succeeded": "Succeeded", + "notStarted": "Not Started", + "failed": "Failed", + "canceled": "Canceled", + "inProgress": "In Progress" } } diff --git a/src/components/widgets/glances/glances.jsx b/src/components/widgets/glances/glances.jsx index e5cf3fbd..cf580630 100644 --- a/src/components/widgets/glances/glances.jsx +++ b/src/components/widgets/glances/glances.jsx @@ -37,7 +37,7 @@ export default function Widget({ options }) { { options.cputemp && } { options.disk && !Array.isArray(options.disk) && } - { options.disk && Array.isArray(options.disk) && options.disk.map((disk) => )} + { options.disk && Array.isArray(options.disk) && options.disk.map((disk) => ) } { options.uptime && } { options.label && } ; @@ -50,7 +50,7 @@ export default function Widget({ options }) { if (options.cputemp && cpuSensors) { try { mainTemp = cpuSensors.reduce((acc, s) => acc + s.value, 0) / cpuSensors.length; - maxTemp = Math.max(cpuSensors.reduce((acc, s) => acc + s.warning, 0) / cpuSensors.length, maxTemp); + maxTemp = Math.max(cpuSensors.reduce((acc, s) => acc + (s.warning > 0 ? s.warning : 0), 0) / cpuSensors.length, maxTemp); if (unit === "fahrenheit") { mainTemp = convertToFahrenheit(mainTemp); maxTemp = convertToFahrenheit(maxTemp); @@ -108,7 +108,7 @@ export default function Widget({ options }) { expanded={options.expanded} /> {disks.map((disk) => ( - : // fallback to homepage logo - - - - - - + + + + - + + + + - - - - + + + } diff --git a/src/components/widgets/openmeteo/icon.jsx b/src/components/widgets/openmeteo/icon.jsx deleted file mode 100644 index 12d93fcb..00000000 --- a/src/components/widgets/openmeteo/icon.jsx +++ /dev/null @@ -1,7 +0,0 @@ -import mapIcon from "utils/weather/openmeteo-condition-map"; - -export default function Icon({ condition, timeOfDay }) { - const IconComponent = mapIcon(condition, timeOfDay); - - return ; -} diff --git a/src/components/widgets/openmeteo/openmeteo.jsx b/src/components/widgets/openmeteo/openmeteo.jsx index 040a3b6b..0614d925 100644 --- a/src/components/widgets/openmeteo/openmeteo.jsx +++ b/src/components/widgets/openmeteo/openmeteo.jsx @@ -10,8 +10,7 @@ import ContainerButton from "../widget/container_button"; import WidgetIcon from "../widget/widget_icon"; import PrimaryText from "../widget/primary_text"; import SecondaryText from "../widget/secondary_text"; - -import Icon from "./icon"; +import mapIcon from "../../../utils/weather/openmeteo-condition-map"; function Widget({ options }) { const { t } = useTranslation(); @@ -33,10 +32,8 @@ function Widget({ options }) { } const unit = options.units === "metric" ? "celsius" : "fahrenheit"; - const weatherInfo = { - condition: data.current_weather.weathercode, - timeOfDay: data.current_weather.time > data.daily.sunrise[0] && data.current_weather.time < data.daily.sunset[0] ? "day" : "night" - }; + const condition = data.current_weather.weathercode; + const timeOfDay = data.current_weather.time > data.daily.sunrise[0] && data.current_weather.time < data.daily.sunset[0] ? "day" : "night"; return @@ -47,8 +44,8 @@ function Widget({ options }) { unit, })} - {t(`wmo.${data.current_weather.weathercode}-${weatherInfo.timeOfDay}`)} - + {t(`wmo.${data.current_weather.weathercode}-${timeOfDay}`)} + ; } diff --git a/src/components/widgets/openweathermap/icon.jsx b/src/components/widgets/openweathermap/icon.jsx deleted file mode 100644 index a2b01ba1..00000000 --- a/src/components/widgets/openweathermap/icon.jsx +++ /dev/null @@ -1,7 +0,0 @@ -import mapIcon from "utils/weather/owm-condition-map"; - -export default function Icon({ condition, timeOfDay }) { - const IconComponent = mapIcon(condition, timeOfDay); - - return ; -} diff --git a/src/components/widgets/openweathermap/weather.jsx b/src/components/widgets/openweathermap/weather.jsx index a857f13a..32c81f06 100644 --- a/src/components/widgets/openweathermap/weather.jsx +++ b/src/components/widgets/openweathermap/weather.jsx @@ -10,9 +10,7 @@ import ContainerButton from "../widget/container_button"; import PrimaryText from "../widget/primary_text"; import SecondaryText from "../widget/secondary_text"; import WidgetIcon from "../widget/widget_icon"; - -import Icon from "./icon"; - +import mapIcon from "../../../utils/weather/owm-condition-map"; function Widget({ options }) { const { t, i18n } = useTranslation(); @@ -35,15 +33,13 @@ function Widget({ options }) { const unit = options.units === "metric" ? "celsius" : "fahrenheit"; - const weatherInfo = { - condition: data.weather[0].id, - timeOfDay: data.dt > data.sys.sunrise && data.dt < data.sys.sunset ? "day" : "night" - }; + const condition = data.weather[0].id; + const timeOfDay = data.dt > data.sys.sunrise && data.dt < data.sys.sunset ? "day" : "night"; return {options.label && `${options.label}, ` }{t("common.number", { value: data.main.temp, style: "unit", unit })} {data.weather[0].description} - + ; } diff --git a/src/components/widgets/weather/icon.jsx b/src/components/widgets/weather/icon.jsx deleted file mode 100644 index 79406ae7..00000000 --- a/src/components/widgets/weather/icon.jsx +++ /dev/null @@ -1,7 +0,0 @@ -import mapIcon from "utils/weather/condition-map"; - -export default function Icon({ condition, timeOfDay }) { - const IconComponent = mapIcon(condition, timeOfDay); - - return ; -} diff --git a/src/components/widgets/weather/weather.jsx b/src/components/widgets/weather/weather.jsx index 702ea669..20d4eeee 100644 --- a/src/components/widgets/weather/weather.jsx +++ b/src/components/widgets/weather/weather.jsx @@ -10,8 +10,7 @@ import PrimaryText from "../widget/primary_text"; import SecondaryText from "../widget/secondary_text"; import WidgetIcon from "../widget/widget_icon"; import ContainerButton from "../widget/container_button"; - -import Icon from "./icon"; +import mapIcon from "../../../utils/weather/condition-map"; function Widget({ options }) { const { t, i18n } = useTranslation(); @@ -33,10 +32,8 @@ function Widget({ options }) { } const unit = options.units === "metric" ? "celsius" : "fahrenheit"; - const weatherInfo = { - condition: data.current.condition.code, - timeOfDay: data.current.is_day ? "day" : "night", - }; + const condition = data.current.condition.code; + const timeOfDay = data.current.is_day ? "day" : "night"; return @@ -48,7 +45,7 @@ function Widget({ options }) { })} {data.current.condition.text} - + ; } diff --git a/src/components/widgets/widget/widget_icon.jsx b/src/components/widgets/widget/widget_icon.jsx index 9766a879..557cba01 100644 --- a/src/components/widgets/widget/widget_icon.jsx +++ b/src/components/widgets/widget/widget_icon.jsx @@ -1,6 +1,5 @@ -export default function WidgetIcon({ icon, size = "s", pulse = false, weatherInfo = {} }) { +export default function WidgetIcon({ icon, size = "s", pulse = false }) { const Icon = icon; - const { condition, timeOfDay } = weatherInfo; let additionalClasses = "text-theme-800 dark:text-theme-200 "; switch (size) { @@ -14,5 +13,5 @@ export default function WidgetIcon({ icon, size = "s", pulse = false, weatherInf additionalClasses += "animate-pulse "; } - return ; + return ; } diff --git a/src/utils/config/service-helpers.js b/src/utils/config/service-helpers.js index c26281c7..e99582b2 100644 --- a/src/utils/config/service-helpers.js +++ b/src/utils/config/service-helpers.js @@ -290,6 +290,7 @@ export function cleanServiceGroups(groups) { enableNowPlaying, volume, // diskstation widget, enableQueue, // sonarr/radarr + node, // Proxmox } = cleanedService.widget; let fieldsList = fields; @@ -300,7 +301,7 @@ export function cleanServiceGroups(groups) { fieldsList = null; } } - + cleanedService.widget = { type, fields: fieldsList || null, @@ -323,6 +324,9 @@ export function cleanServiceGroups(groups) { if (type === "unifi") { if (site) cleanedService.widget.site = site; } + if (type === "proxmox") { + if (node) cleanedService.widget.node = node; + } if (type === "kubernetes") { if (namespace) cleanedService.widget.namespace = namespace; if (app) cleanedService.widget.app = app; diff --git a/src/utils/proxy/handlers/credentialed.js b/src/utils/proxy/handlers/credentialed.js index 5e4ecb64..2eadc11b 100644 --- a/src/utils/proxy/handlers/credentialed.js +++ b/src/utils/proxy/handlers/credentialed.js @@ -62,7 +62,7 @@ export default async function credentialedProxyHandler(req, res, map) { headers.Authorization = `Basic ${Buffer.from(`${widget.username}:${widget.password}`).toString("base64")}`; } } - else if (widget.type === "azurePullrequests") { + else if (widget.type === "azurePipelines" || widget.type === "azurePullrequests") { headers.Authorization = `Basic ${Buffer.from(`$:${widget.key}`).toString("base64")}`; } else { headers["X-API-Key"] = `${widget.key}`; diff --git a/src/widgets/azurePipelines/component.jsx b/src/widgets/azurePipelines/component.jsx new file mode 100644 index 00000000..a47296f3 --- /dev/null +++ b/src/widgets/azurePipelines/component.jsx @@ -0,0 +1,36 @@ +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: pipelineData, error: pipelineError } = useWidgetAPI(widget); + + if (pipelineError) { + return ; + } + + if (!pipelineData || !Array.isArray(pipelineData.value)) { + return ( + + + + + ); + } + + return ( + + {pipelineData.value[0].result ? + : + + } + + + ); +} diff --git a/src/widgets/azurePipelines/widget.js b/src/widgets/azurePipelines/widget.js new file mode 100644 index 00000000..708266d2 --- /dev/null +++ b/src/widgets/azurePipelines/widget.js @@ -0,0 +1,8 @@ +import credentialedProxyHandler from "utils/proxy/handlers/credentialed"; + +const widget = { + api: "https://dev.azure.com/{organization}/{project}/_apis/build/Builds?branchName={branchName}&definitions={definitionId}", + proxyHandler: credentialedProxyHandler, +}; + +export default widget; \ No newline at end of file diff --git a/src/widgets/components.js b/src/widgets/components.js index 23158743..e5b03e53 100644 --- a/src/widgets/components.js +++ b/src/widgets/components.js @@ -5,6 +5,7 @@ const components = { audiobookshelf: dynamic(() => import("./audiobookshelf/component")), authentik: dynamic(() => import("./authentik/component")), autobrr: dynamic(() => import("./autobrr/component")), + azurePipelines: dynamic(() => import("./azurePipelines/component")), azurePullrequests: dynamic(() => import("./azurePullrequests/component")), bazarr: dynamic(() => import("./bazarr/component")), caddy: dynamic(() => import("./caddy/component")), diff --git a/src/widgets/proxmox/component.jsx b/src/widgets/proxmox/component.jsx index e022be6e..10151f59 100644 --- a/src/widgets/proxmox/component.jsx +++ b/src/widgets/proxmox/component.jsx @@ -4,6 +4,7 @@ import Container from "components/services/widget/container"; import Block from "components/services/widget/block"; import useWidgetAPI from "utils/proxy/use-widget-api"; + function calcRunning(total, current) { return current.status === "running" ? total + 1 : total; } @@ -25,29 +26,40 @@ export default function Component({ service }) { - + ); } const { data } = clusterData ; - const vms = data.filter(item => item.type === "qemu" && item.template === 0) || []; - const lxc = data.filter(item => item.type === "lxc" && item.template === 0) || []; - const nodes = data.filter(item => item.type === "node") || []; - + const vms = data.filter(item => item.type === "qemu" && item.template === 0 && (widget.node === undefined || widget.node === item.node)) || []; + const lxc = data.filter(item => item.type === "lxc" && item.template === 0 && (widget.node === undefined || widget.node === item.node)) || []; + const nodes = data.filter(item => item.type === "node" && (widget.node === undefined || widget.node === item.node)) || []; const runningVMs = vms.reduce(calcRunning, 0); const runningLXC = lxc.reduce(calcRunning, 0); - // TODO: support more than one node - // TODO: better handling of cluster with zero nodes - const node = nodes.length > 0 ? nodes[0] : { cpu: 0.0, mem: 0, maxmem: 0 }; + if (nodes.length === 0) { + return ( + + + + + + + ); + } + + const maxMemory = nodes.reduce((sum, n) => n.maxmem + sum, 0); + const usedMemory = nodes.reduce((sum, n) => n.mem + sum, 0); + const maxCpu = nodes.reduce((sum, n) => n.maxcpu + sum, 0); + const usedCpu = nodes.reduce((sum, n) => (n.cpu * n.maxcpu) + sum, 0); return ( - - + + ); } diff --git a/src/widgets/widgets.js b/src/widgets/widgets.js index fbfb2823..b0dc63da 100644 --- a/src/widgets/widgets.js +++ b/src/widgets/widgets.js @@ -2,6 +2,7 @@ import adguard from "./adguard/widget"; import audiobookshelf from "./audiobookshelf/widget"; import authentik from "./authentik/widget"; import autobrr from "./autobrr/widget"; +import azurePipelines from "./azurePipelines/widget"; import azurePullrequests from "./azurePullrequests/widget"; import bazarr from "./bazarr/widget"; import caddy from "./caddy/widget"; @@ -92,6 +93,7 @@ const widgets = { audiobookshelf, authentik, autobrr, + azurePipelines, azurePullrequests, bazarr, caddy,