diff options
author | Simon Rettberg | 2019-02-21 21:47:38 +0100 |
---|---|---|
committer | Simon Rettberg | 2019-02-21 21:47:38 +0100 |
commit | d5d84d8a78e3cb2a20a0aa496e5f2911167cd11f (patch) | |
tree | 92a3fff18a9bec837a05db182b0294c8dbf19abc /modules-available/dnbd3 | |
parent | [statistics] Improve display of non-client runmode machines (diff) | |
download | slx-admin-d5d84d8a78e3cb2a20a0aa496e5f2911167cd11f.tar.gz slx-admin-d5d84d8a78e3cb2a20a0aa496e5f2911167cd11f.tar.xz slx-admin-d5d84d8a78e3cb2a20a0aa496e5f2911167cd11f.zip |
[dnbd3] Show image idle time in proxy details
Diffstat (limited to 'modules-available/dnbd3')
-rw-r--r-- | modules-available/dnbd3/lang/de/module.json | 1 | ||||
-rw-r--r-- | modules-available/dnbd3/lang/de/template-tags.json | 1 | ||||
-rw-r--r-- | modules-available/dnbd3/lang/en/module.json | 1 | ||||
-rw-r--r-- | modules-available/dnbd3/lang/en/template-tags.json | 1 | ||||
-rw-r--r-- | modules-available/dnbd3/page.inc.php | 11 | ||||
-rw-r--r-- | modules-available/dnbd3/templates/page-proxy-images.html | 6 |
6 files changed, 19 insertions, 2 deletions
diff --git a/modules-available/dnbd3/lang/de/module.json b/modules-available/dnbd3/lang/de/module.json index cf748a49..e0f79451 100644 --- a/modules-available/dnbd3/lang/de/module.json +++ b/modules-available/dnbd3/lang/de/module.json @@ -1,4 +1,5 @@ { "module_name": "DNBD3", + "now": "jetzt", "page_title": "DNBD3-Verwaltung" }
\ No newline at end of file diff --git a/modules-available/dnbd3/lang/de/template-tags.json b/modules-available/dnbd3/lang/de/template-tags.json index 22c74b7d..0c4a973f 100644 --- a/modules-available/dnbd3/lang/de/template-tags.json +++ b/modules-available/dnbd3/lang/de/template-tags.json @@ -62,6 +62,7 @@ "lang_storageSize": "Speichergr\u00f6\u00dfe", "lang_test": "Testen", "lang_txTotal": "Gesamt gesendet", + "lang_unusedFor": "Ungenutzt", "lang_uplink": "Uplink", "lang_uptime": "Aktuelle Laufzeit", "lang_wantToDelete": "Wollen Sie diesen Server wirklich entfernen? (Rebooten\/Ausschalten muss in diesem Fall manuell vorgenommen werden)" diff --git a/modules-available/dnbd3/lang/en/module.json b/modules-available/dnbd3/lang/en/module.json index d2bb6fd3..2c042af4 100644 --- a/modules-available/dnbd3/lang/en/module.json +++ b/modules-available/dnbd3/lang/en/module.json @@ -1,4 +1,5 @@ { "module_name": "DNBD3", + "now": "now", "page_title": "DNBD3 management" }
\ No newline at end of file diff --git a/modules-available/dnbd3/lang/en/template-tags.json b/modules-available/dnbd3/lang/en/template-tags.json index 932b899a..e80f6e1b 100644 --- a/modules-available/dnbd3/lang/en/template-tags.json +++ b/modules-available/dnbd3/lang/en/template-tags.json @@ -62,6 +62,7 @@ "lang_storageSize": "Storage size", "lang_test": "Test", "lang_txTotal": "Total sent", + "lang_unusedFor": "Unused", "lang_uplink": "Uplink", "lang_uptime": "Uptime", "lang_wantToDelete": "Do you really want to delete this server? (Reboot\/Shutdown has to be done manually)" diff --git a/modules-available/dnbd3/page.inc.php b/modules-available/dnbd3/page.inc.php index d8dd6cb8..d2e8162b 100644 --- a/modules-available/dnbd3/page.inc.php +++ b/modules-available/dnbd3/page.inc.php @@ -197,7 +197,7 @@ class Page_Dnbd3 extends Page $server['uptime'] += ($NOW - $server['dnbd3lastseen']); } $server['dnbd3lastseen_s'] = $server['dnbd3lastseen'] ? Util::prettyTime($server['dnbd3lastseen']) : '-'; - $server['uptime_s'] = $server['uptime'] ? floor($server['uptime'] / 86400) . 'd ' . gmdate('H:i', $server['uptime']) : '-'; + $server['uptime_s'] = $server['uptime'] ? Util::formatDuration($server['uptime']) : '-'; $server['totalup_s'] = Util::readableFileSize($server['totalup']); $server['totaldown_s'] = Util::readableFileSize($server['totaldown']); if ($server['disktotal'] > 0) { @@ -362,6 +362,15 @@ class Page_Dnbd3 extends Page $sort1 = $sort2 = []; foreach ($stats['images'] as &$image) { $image['size_s'] = Util::readableFileSize($image['size']); + if (isset($image['idle'])) { + if ($image['idle'] < 90) { + $image['idle_s'] = Dictionary::translate('now'); + } elseif ($image['idle'] < $stats['uptime']) { + $image['idle_s'] = Util::formatDuration($image['idle'], false); + } else { + $image['idle_s'] = '∞'; + } + } $sort1[] = $image['users']; $sort2[] = $image['name']; } diff --git a/modules-available/dnbd3/templates/page-proxy-images.html b/modules-available/dnbd3/templates/page-proxy-images.html index 7e30de20..ff420ffd 100644 --- a/modules-available/dnbd3/templates/page-proxy-images.html +++ b/modules-available/dnbd3/templates/page-proxy-images.html @@ -6,6 +6,7 @@ <th class="text-right slx-smallcol">{{lang_clients}}</th> <th class="text-right slx-smallcol">{{lang_size}}</th> <th class="text-right slx-smallcol">{{lang_complete}}</th> + <th class="text-right slx-smallcol">{{lang_unusedFor}}</th> <th class="slx-smallcol">{{lang_uplink}}</th> </tr> {{#images}} @@ -22,10 +23,13 @@ <td class="text-right text-nowrap"> {{complete}} % </td> + <td class="text-right text-nowrap"> + {{idle_s}} + </td> <td class="text-nowrap"> {{uplinkServer}} </td> </tr> {{/images}} </table> -</div>
\ No newline at end of file +</div> |