From 9147f0c7b8f11f8dc035de67cf09c6cf333d147a Mon Sep 17 00:00:00 2001 From: Valdnet <47037905+Valdnet@users.noreply.github.com> Date: Mon, 1 Nov 2021 19:28:19 +0100 Subject: [PATCH 01/16] Fix "settings-admin.php" Signed-off-by: Valdnet <47037905+Valdnet@users.noreply.github.com> --- templates/settings-admin.php | 67 ++++++++++++++---------------------- 1 file changed, 25 insertions(+), 42 deletions(-) diff --git a/templates/settings-admin.php b/templates/settings-admin.php index 2067866b..1fe1befc 100644 --- a/templates/settings-admin.php +++ b/templates/settings-admin.php @@ -54,36 +54,19 @@ function FormatMegabytes(int $byte): string { -
- - - - - - - - - - - - - - - - - - - - - - - - - -
t('Operating System')); ?>:
t('CPU')); ?>:
t('Memory')); ?>:getMemTotal())) ?>
t('Server time')); ?>:
t('Uptime')); ?>:
-
- +
+

t('Operating System').':'); ?>

+

t('CPU').':'); ?>

+

t('Memory').':'); ?> getMemTotal())) ?>

+

t('Server time').':'); ?>

+

t('Uptime').':'); ?>

+
+ + + +
+

@@ -152,10 +135,10 @@ function FormatMegabytes(int $byte): string { t('You will get a notification once one of your disks is nearly full.')); ?>

-

t('Files:')); ?>

-

t('Storages:')); ?>

+

t('Files').':'); ?>

+

t('Storages').':'); ?>

-

t('Free Space:')); ?>

+

t('Free Space').':'); ?>

@@ -234,7 +217,7 @@ class="barchart" >

- t('Total users:')); ?> + t('Total users').':'); ?>

@@ -276,19 +259,19 @@ class="barchart"

- t('Version:')); ?> + t('Version').':'); ?>

- t('Memory Limit:')); ?> + t('Memory Limit').':'); ?>

- t('Max Execution Time:')); ?> + t('Max Execution Time').':'); ?>

- t('Upload max size:')); ?> + t('Upload max size').':'); ?>

@@ -304,15 +287,15 @@ class="barchart"

- t('Type:')); ?> + t('Type').':'); ?>

- t('Version:')); ?> + t('Version').':'); ?>

- t('Size:')); ?> + t('Size').':'); ?>

@@ -328,7 +311,7 @@ class="barchart"

t('External monitoring tool')); ?>

- t('You can connect an external monitoring tool by using this end point:')); ?> + t('You can connect an external monitoring tool by using this end point').':'); ?>

@@ -338,7 +321,7 @@ class="barchart" t('Appending "?format=json" at the end of the URL gives you the result in JSON.')); ?>

- t('To use an access token please generate one then set it using the following command:')); ?> + t('To use an access token please generate one then set it using the following command').':'); ?>

occ config:app:set serverinfo token --value yourtoken

From a6e8c565c0942e2b0a2b7a326dfa78983d6b6285 Mon Sep 17 00:00:00 2001 From: Valdnet <47037905+Valdnet@users.noreply.github.com> Date: Mon, 1 Nov 2021 19:42:46 +0100 Subject: [PATCH 02/16] Fix style.scss Signed-off-by: Valdnet <47037905+Valdnet@users.noreply.github.com> --- css/style.scss | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/css/style.scss b/css/style.scss index 9a91bfc6..ab514650 100644 --- a/css/style.scss +++ b/css/style.scss @@ -2,18 +2,6 @@ max-width: 100vw; } -.table-wrapper { - overflow-x: auto; -} - -.server-infos-table { - margin-bottom: 25px; -} - -.server-infos-table td:first-child { - width: 120px; -} - .monitoring-wrapper { display: -webkit-flex; display: flex; From a7f2330801b794f7c8989e3173430b042a3f1e3d Mon Sep 17 00:00:00 2001 From: Valdnet <47037905+Valdnet@users.noreply.github.com> Date: Mon, 1 Nov 2021 19:57:22 +0100 Subject: [PATCH 03/16] Fix "script.js" Signed-off-by: Valdnet <47037905+Valdnet@users.noreply.github.com> --- js/script.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/js/script.js b/js/script.js index 519841b8..e3c8dd55 100644 --- a/js/script.js +++ b/js/script.js @@ -145,10 +145,12 @@ function updateMemoryStatistics(memTotal, memFree, swapTotal, swapFree) { var $memFooterInfo = $('#memFooterInfo'); + var $swapFooterInfo = $('#swapFooterInfo'); var $memoryCanvas = $('#memorycanvas'); if (memTotal === 'N/A' || memFree === 'N/A') { $memFooterInfo.text(t('serverinfo', 'Memory info not available')); + $swapFooterInfo.text(t('serverinfo', 'Memory info not available')); $memoryCanvas.addClass('hidden'); return; From 81349f390bb448f305c7573632a2c2018dcc3f6c Mon Sep 17 00:00:00 2001 From: Valdnet <47037905+Valdnet@users.noreply.github.com> Date: Mon, 1 Nov 2021 20:29:33 +0100 Subject: [PATCH 04/16] Fix memory display Signed-off-by: Valdnet <47037905+Valdnet@users.noreply.github.com> --- templates/settings-admin.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/templates/settings-admin.php b/templates/settings-admin.php index 1fe1befc..dc9eda81 100644 --- a/templates/settings-admin.php +++ b/templates/settings-admin.php @@ -58,7 +58,9 @@ function FormatMegabytes(int $byte): string {

t('Operating System').':'); ?>

t('CPU').':'); ?>

-

t('Memory').':'); ?> getMemTotal())) ?>

+

t('Memory').':'); ?> + getMemTotal() > 0): ?> getMemTotal())) ?>

+

t('Server time').':'); ?>

t('Uptime').':'); ?>

From 8b3ac996008627f98496b84daa01274e2ca86444 Mon Sep 17 00:00:00 2001 From: Valdnet <47037905+Valdnet@users.noreply.github.com> Date: Mon, 1 Nov 2021 20:45:02 +0100 Subject: [PATCH 05/16] Fix display of "Unknown Processor" Signed-off-by: Valdnet <47037905+Valdnet@users.noreply.github.com> --- templates/settings-admin.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/templates/settings-admin.php b/templates/settings-admin.php index dc9eda81..cee69b15 100644 --- a/templates/settings-admin.php +++ b/templates/settings-admin.php @@ -57,7 +57,9 @@ function FormatMegabytes(int $byte): string {

t('Operating System').':'); ?>

-

t('CPU').':'); ?>

+ +

+

t('Memory').':'); ?> getMemTotal() > 0): ?> getMemTotal())) ?>

From 8ea3dfdc77d2de63928197b59fcc53bf5997acab Mon Sep 17 00:00:00 2001 From: Valdnet <47037905+Valdnet@users.noreply.github.com> Date: Tue, 2 Nov 2021 08:45:37 +0100 Subject: [PATCH 06/16] Add information about an unknown processor Signed-off-by: Valdnet <47037905+Valdnet@users.noreply.github.com> --- templates/settings-admin.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/settings-admin.php b/templates/settings-admin.php index cee69b15..f4b710a2 100644 --- a/templates/settings-admin.php +++ b/templates/settings-admin.php @@ -59,6 +59,8 @@ function FormatMegabytes(int $byte): string {

t('Operating System').':'); ?>

+ + t('Unknown Processor')) ?>

t('Memory').':'); ?> getMemTotal() > 0): ?> getMemTotal())) ?>

From ab51c27eff6103e5be62a9492a69ffd84d0971df Mon Sep 17 00:00:00 2001 From: Valdnet <47037905+Valdnet@users.noreply.github.com> Date: Tue, 2 Nov 2021 08:47:43 +0100 Subject: [PATCH 07/16] Change case of letter Signed-off-by: Valdnet <47037905+Valdnet@users.noreply.github.com> --- js/script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/script.js b/js/script.js index e3c8dd55..4fedbb44 100644 --- a/js/script.js +++ b/js/script.js @@ -139,7 +139,7 @@ }); } - $cpuFooterInfo.text(t('serverinfo', 'Load average') + ": " + cpu1 + " (" + t('serverinfo', 'Last minute') + ")"); + $cpuFooterInfo.text(t('serverinfo', 'Load average') + ": " + cpu1 + " (" + t('serverinfo', 'last minute') + ")"); cpuLoadLine.append(new Date().getTime(), cpu1); } From 0bd9f4b92c0a06a92c2f6cd9c4fd303ed73e4b52 Mon Sep 17 00:00:00 2001 From: Valdnet <47037905+Valdnet@users.noreply.github.com> Date: Tue, 2 Nov 2021 09:19:37 +0100 Subject: [PATCH 08/16] Correct code Signed-off-by: Valdnet <47037905+Valdnet@users.noreply.github.com> --- templates/settings-admin.php | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/settings-admin.php b/templates/settings-admin.php index f4b710a2..8a76592d 100644 --- a/templates/settings-admin.php +++ b/templates/settings-admin.php @@ -57,6 +57,7 @@ function FormatMegabytes(int $byte): string {

t('Operating System').':'); ?>

+

t('CPU').':'); ?>

From d996b3d4ec42b2df55fe14b9edd8f274da209484 Mon Sep 17 00:00:00 2001 From: Valdnet <47037905+Valdnet@users.noreply.github.com> Date: Tue, 2 Nov 2021 09:56:10 +0100 Subject: [PATCH 09/16] l10n: Change size of letters Signed-off-by: Valdnet <47037905+Valdnet@users.noreply.github.com> --- templates/settings-admin.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/settings-admin.php b/templates/settings-admin.php index 8a76592d..bbb83a3b 100644 --- a/templates/settings-admin.php +++ b/templates/settings-admin.php @@ -270,11 +270,11 @@ class="barchart"

- t('Memory Limit').':'); ?> + t('Memory limit').':'); ?>

- t('Max Execution Time').':'); ?> + t('Max execution time').':'); ?>

From aa376065a0d900f5ce3e690435849705a680944b Mon Sep 17 00:00:00 2001 From: Valdnet <47037905+Valdnet@users.noreply.github.com> Date: Tue, 2 Nov 2021 10:17:29 +0100 Subject: [PATCH 10/16] Improve appearance in "External monitoring tool" Signed-off-by: Valdnet <47037905+Valdnet@users.noreply.github.com> --- css/style.scss | 3 +++ 1 file changed, 3 insertions(+) diff --git a/css/style.scss b/css/style.scss index ab514650..add3d5e1 100644 --- a/css/style.scss +++ b/css/style.scss @@ -5,6 +5,9 @@ .monitoring-wrapper { display: -webkit-flex; display: flex; + position: left; + max-width: 50%; + min-width: 50%; } .monitoring-wrapper > input { From 5b018949661545f3f365f8c9dd59b5f9c243f7c3 Mon Sep 17 00:00:00 2001 From: Valdnet <47037905+Valdnet@users.noreply.github.com> Date: Tue, 2 Nov 2021 10:19:28 +0100 Subject: [PATCH 11/16] Improve appearance in "External monitoring tool" Signed-off-by: Valdnet <47037905+Valdnet@users.noreply.github.com> --- templates/settings-admin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/settings-admin.php b/templates/settings-admin.php index bbb83a3b..1e1ed001 100644 --- a/templates/settings-admin.php +++ b/templates/settings-admin.php @@ -314,7 +314,7 @@ class="barchart"

-
+

t('External monitoring tool')); ?>

From 3084c2f391f98e80707122f5f847d7d362fc6040 Mon Sep 17 00:00:00 2001 From: Valdnet <47037905+Valdnet@users.noreply.github.com> Date: Thu, 18 Nov 2021 09:49:02 +0100 Subject: [PATCH 12/16] Concatenate a colon with a text string Signed-off-by: Valdnet <47037905+Valdnet@users.noreply.github.com> --- templates/settings-admin.php | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/templates/settings-admin.php b/templates/settings-admin.php index 1e1ed001..eda6c362 100644 --- a/templates/settings-admin.php +++ b/templates/settings-admin.php @@ -56,18 +56,18 @@ function FormatMegabytes(int $byte): string {

-

t('Operating System').':'); ?>

-

t('CPU').':'); ?> +

t('Operating System:')); ?>

+

t('CPU:')); ?>

t('Unknown Processor')) ?>

-

t('Memory').':'); ?> +

t('Memory:')); ?> getMemTotal() > 0): ?> getMemTotal())) ?>

-

t('Server time').':'); ?>

-

t('Uptime').':'); ?>

+

t('Server time:')); ?>

+

t('Uptime:')); ?>

@@ -142,10 +142,10 @@ function FormatMegabytes(int $byte): string { t('You will get a notification once one of your disks is nearly full.')); ?>
-

t('Files').':'); ?>

-

t('Storages').':'); ?>

+

t('Files:')); ?>

+

t('Storages:')); ?>

-

t('Free Space').':'); ?>

+

t('Free Space:')); ?>

@@ -224,7 +224,7 @@ class="barchart" >

- t('Total users').':'); ?> + t('Total users:')); ?>

@@ -266,19 +266,19 @@ class="barchart"

- t('Version').':'); ?> + t('Version:')); ?>

- t('Memory limit').':'); ?> + t('Memory limit:')); ?>

- t('Max execution time').':'); ?> + t('Max execution time:')); ?>

- t('Upload max size').':'); ?> + t('Upload max size:')); ?>

@@ -294,15 +294,15 @@ class="barchart"

- t('Type').':'); ?> + t('Type:')); ?>

- t('Version').':'); ?> + t('Version:')); ?>

- t('Size').':'); ?> + t('Size:')); ?>

@@ -318,7 +318,7 @@ class="barchart"

t('External monitoring tool')); ?>

- t('You can connect an external monitoring tool by using this end point').':'); ?> + t('You can connect an external monitoring tool by using this end point:')); ?>

@@ -328,7 +328,7 @@ class="barchart" t('Appending "?format=json" at the end of the URL gives you the result in JSON.')); ?>

- t('To use an access token please generate one then set it using the following command').':'); ?> + t('To use an access token please generate one then set it using the following command:')); ?>

occ config:app:set serverinfo token --value yourtoken

From d1da34a942d4b26dcc77ce0de364b33cf23d327c Mon Sep 17 00:00:00 2001 From: Valdnet <47037905+Valdnet@users.noreply.github.com> Date: Fri, 26 Nov 2021 11:36:02 +0100 Subject: [PATCH 13/16] Add an argument Signed-off-by: Valdnet <47037905+Valdnet@users.noreply.github.com> Co-authored-by: Thomas Citharel --- js/script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/script.js b/js/script.js index 4fedbb44..be8ecd1c 100644 --- a/js/script.js +++ b/js/script.js @@ -139,7 +139,7 @@ }); } - $cpuFooterInfo.text(t('serverinfo', 'Load average') + ": " + cpu1 + " (" + t('serverinfo', 'last minute') + ")"); + $cpuFooterInfo.text(t('serverinfo', 'Load average {cpu} (last minute)', { cpu: cpu1 })); cpuLoadLine.append(new Date().getTime(), cpu1); } From 31deaa84ec1280fb89fda08a8d2a0679432b5170 Mon Sep 17 00:00:00 2001 From: Valdnet <47037905+Valdnet@users.noreply.github.com> Date: Sat, 27 Nov 2021 08:06:02 +0100 Subject: [PATCH 14/16] Added condition for "SWAP" Signed-off-by: Valdnet <47037905+Valdnet@users.noreply.github.com> --- js/script.js | 52 +++++++++++++++++++++++++++++++++++----------------- 1 file changed, 35 insertions(+), 17 deletions(-) diff --git a/js/script.js b/js/script.js index be8ecd1c..9e821443 100644 --- a/js/script.js +++ b/js/script.js @@ -139,25 +139,31 @@ }); } - $cpuFooterInfo.text(t('serverinfo', 'Load average {cpu} (last minute)', { cpu: cpu1 })); + $cpuFooterInfo.text(t('serverinfo', 'Load average: {cpu} (last minute)', { cpu: cpu1 })); cpuLoadLine.append(new Date().getTime(), cpu1); } + + function isMemoryStat(memTotal, memFree) { + if (memTotal === 'N/A' || memFree === 'N/A') { + return false; + } else { + return true; + } + } + + function isSwapStat(swapTotal, swapFree) { + if (swapTotal === 'N/A' || swapFree === 'N/A') { + return false; + } else { + return true; + } + } function updateMemoryStatistics(memTotal, memFree, swapTotal, swapFree) { var $memFooterInfo = $('#memFooterInfo'); var $swapFooterInfo = $('#swapFooterInfo'); var $memoryCanvas = $('#memorycanvas'); - if (memTotal === 'N/A' || memFree === 'N/A') { - $memFooterInfo.text(t('serverinfo', 'Memory info not available')); - $swapFooterInfo.text(t('serverinfo', 'Memory info not available')); - $memoryCanvas.addClass('hidden'); - return; - - } else if ($memoryCanvas.hasClass('hidden')) { - $memoryCanvas.removeClass('hidden'); - } - var memTotalBytes = memTotal * 1024, memUsageBytes = (memTotal - memFree) * 1024, memTotalGB = memTotal / (1024 * 1024), @@ -198,12 +204,24 @@ }); } - $memFooterInfo - .text("RAM: " + t('serverinfo', 'Total') + ": " + OC.Util.humanFileSize(memTotalBytes) + " - " + t('serverinfo', 'Current usage') + ": " + OC.Util.humanFileSize(memUsageBytes)); - memoryUsageLine.append(new Date().getTime(), memUsageGB); - $('#swapFooterInfo') - .text("SWAP: " + t('serverinfo', 'Total') + ": " + OC.Util.humanFileSize(swapTotalBytes) + " - " + t('serverinfo', 'Current usage') + ": " + OC.Util.humanFileSize(swapUsageBytes)); - swapUsageLine.append(new Date().getTime(), swapUsageGB); + if (isMemoryStat(memTotal, memFree)) { + $memFooterInfo.text(t('serverinfo','RAM: Total: {memTotalBytes}/Current usage: {memUsageBytes}', { memTotalBytes: OC.Util.humanFileSize(memTotalBytes), memUsageBytes: OC.Util.humanFileSize(memUsageBytes) })); + memoryUsageLine.append(new Date().getTime(), memUsageGB); + + if ($memoryCanvas.hasClass('hidden')) { + $memoryCanvas.removeClass('hidden'); + } + } else { + $memFooterInfo.text(t('serverinfo', 'RAM info not available')); + $memoryCanvas.addClass('hidden'); + } + + if (isSwapStat(swapTotal, swapFree)) { + $swapFooterInfo.text(t('serverinfo','SWAP: Total: {swapTotalBytes}/Current usage: {swapUsageBytes}', { swapTotalBytes: OC.Util.humanFileSize(swapTotalBytes), swapUsageBytes: OC.Util.humanFileSize(swapUsageBytes) })); + swapUsageLine.append(new Date().getTime(), swapUsageGB); + } else { + $swapFooterInfo.text(t('serverinfo', 'SWAP info not available')); + } } function updateShareStatistics() { From fbb6c29dc3c42b41b7507a781039cd34332fd0ac Mon Sep 17 00:00:00 2001 From: Valdnet <47037905+Valdnet@users.noreply.github.com> Date: Sat, 27 Nov 2021 08:16:06 +0100 Subject: [PATCH 15/16] Fall back from exporting colons from text string Signed-off-by: Valdnet <47037905+Valdnet@users.noreply.github.com> --- templates/settings-admin.php | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/templates/settings-admin.php b/templates/settings-admin.php index eda6c362..1e1ed001 100644 --- a/templates/settings-admin.php +++ b/templates/settings-admin.php @@ -56,18 +56,18 @@ function FormatMegabytes(int $byte): string {

-

t('Operating System:')); ?>

-

t('CPU:')); ?> +

t('Operating System').':'); ?>

+

t('CPU').':'); ?>

t('Unknown Processor')) ?>

-

t('Memory:')); ?> +

t('Memory').':'); ?> getMemTotal() > 0): ?> getMemTotal())) ?>

-

t('Server time:')); ?>

-

t('Uptime:')); ?>

+

t('Server time').':'); ?>

+

t('Uptime').':'); ?>

@@ -142,10 +142,10 @@ function FormatMegabytes(int $byte): string { t('You will get a notification once one of your disks is nearly full.')); ?> -

t('Files:')); ?>

-

t('Storages:')); ?>

+

t('Files').':'); ?>

+

t('Storages').':'); ?>

-

t('Free Space:')); ?>

+

t('Free Space').':'); ?>

@@ -224,7 +224,7 @@ class="barchart" >

- t('Total users:')); ?> + t('Total users').':'); ?>

@@ -266,19 +266,19 @@ class="barchart"

- t('Version:')); ?> + t('Version').':'); ?>

- t('Memory limit:')); ?> + t('Memory limit').':'); ?>

- t('Max execution time:')); ?> + t('Max execution time').':'); ?>

- t('Upload max size:')); ?> + t('Upload max size').':'); ?>

@@ -294,15 +294,15 @@ class="barchart"

- t('Type:')); ?> + t('Type').':'); ?>

- t('Version:')); ?> + t('Version').':'); ?>

- t('Size:')); ?> + t('Size').':'); ?>

@@ -318,7 +318,7 @@ class="barchart"

t('External monitoring tool')); ?>

- t('You can connect an external monitoring tool by using this end point:')); ?> + t('You can connect an external monitoring tool by using this end point').':'); ?>

@@ -328,7 +328,7 @@ class="barchart" t('Appending "?format=json" at the end of the URL gives you the result in JSON.')); ?>

- t('To use an access token please generate one then set it using the following command:')); ?> + t('To use an access token please generate one then set it using the following command').':'); ?>

occ config:app:set serverinfo token --value yourtoken

From 25f7dcc04dc961408a9f05f616c9d172d522e3c8 Mon Sep 17 00:00:00 2001 From: Valdnet <47037905+Valdnet@users.noreply.github.com> Date: Tue, 30 Nov 2021 14:12:40 +0100 Subject: [PATCH 16/16] l10n: Change "Mails" to "Emails" Signed-off-by: Valdnet <47037905+Valdnet@users.noreply.github.com> --- js/script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/script.js b/js/script.js index 9e821443..6fa41ea6 100644 --- a/js/script.js +++ b/js/script.js @@ -251,7 +251,7 @@ t('serverinfo', 'Users'), t('serverinfo', 'Groups'), t('serverinfo', 'Links'), - t('serverinfo', 'Mails'), + t('serverinfo', 'Emails'), t('serverinfo', 'Federated sent'), t('serverinfo', 'Federated received'), t('serverinfo', 'Talk conversations'),