diff options
author | Simon Rettberg | 2015-09-29 15:22:36 +0200 |
---|---|---|
committer | Simon Rettberg | 2015-09-29 15:22:36 +0200 |
commit | 2af587476d8509ddb4d119f61424d82c49b0695e (patch) | |
tree | a0beba886c476630aec6bc68b0d477ae5f142ab2 | |
parent | [vmstore] Only save config if mounting succeeded (diff) | |
download | slx-admin-2af587476d8509ddb4d119f61424d82c49b0695e.tar.gz slx-admin-2af587476d8509ddb4d119f61424d82c49b0695e.tar.xz slx-admin-2af587476d8509ddb4d119f61424d82c49b0695e.zip |
[systemstatus] i18n of storage mount error strings
-rw-r--r-- | lang/de/templates/systemstatus/diskstat.json | 4 | ||||
-rw-r--r-- | lang/en/templates/systemstatus/diskstat.json | 4 | ||||
-rw-r--r-- | modules/systemstatus.inc.php | 28 | ||||
-rw-r--r-- | templates/systemstatus/diskstat.html | 11 |
4 files changed, 32 insertions, 15 deletions
diff --git a/lang/de/templates/systemstatus/diskstat.json b/lang/de/templates/systemstatus/diskstat.json index 2f61fd58..59706e26 100644 --- a/lang/de/templates/systemstatus/diskstat.json +++ b/lang/de/templates/systemstatus/diskstat.json @@ -1,6 +1,10 @@ { "lang_capacity": "Kapazit\u00e4t", + "lang_foundStore": "Vorgefunden:", "lang_free": "Frei", + "lang_goToStoreConf": "Zur VM-Store-Konfiguration wechseln", + "lang_storeMissingExpected": "VM-Store nicht eingebunden. Erwartet:", + "lang_storeNotConfigured": "Kein VM-Store konfiguriert!", "lang_systemPartition": "Systempartition", "lang_vmStore": "VM-Speicher", "lang_vmStoreError": "Fehler beim Ermitteln des verf\u00fcgbaren Speicherplatzes am VM-Speicherort. Bitte \u00fcberpr\u00fcfen Sie die Konfiguration." diff --git a/lang/en/templates/systemstatus/diskstat.json b/lang/en/templates/systemstatus/diskstat.json index fafb9187..d7bedfe5 100644 --- a/lang/en/templates/systemstatus/diskstat.json +++ b/lang/en/templates/systemstatus/diskstat.json @@ -1,6 +1,10 @@ { "lang_capacity": "Capacity", + "lang_foundStore": "Found:", "lang_free": "Free", + "lang_goToStoreConf": "Go to VM store configuration", + "lang_storeMissingExpected": "VM store not mounted. Expected:", + "lang_storeNotConfigured": "No VM store configured!", "lang_systemPartition": "System Partition", "lang_vmStore": "VM Store", "lang_vmStoreError": "Error when determining the available disk space on the VM location. Please check the configuration." diff --git a/modules/systemstatus.inc.php b/modules/systemstatus.inc.php index 0106ab9d..253b0849 100644 --- a/modules/systemstatus.inc.php +++ b/modules/systemstatus.inc.php @@ -104,27 +104,27 @@ class Page_SystemStatus extends Page ); } } + $data = array( + 'store' => $storeUsage, + 'system' => $systemUsage + ); // Determine if proper vm store is being used - if ($store === '<local>') - $storeError = false; - else - $storeError = 'VM-Store nicht eingebunden! Erwartet: ' . $store; + if ($store !== '<local>') { + $data['storeMissing'] = $store; + } foreach ($task['data']['list'] as $entry) { - if ($entry['mountPoint'] === CONFIG_VMSTORE_DIR && $store !== $entry['fileSystem']) { - $storeError = 'Falscher VM-Store eingebunden! Erwartet: ' . $store . ' vorgefunden: ' . $entry['fileSystem']; + if ($entry['mountPoint'] !== CONFIG_VMSTORE_DIR) + continue; + if ($store !== $entry['fileSystem']) { + $data['wrongStore'] = $entry['fileSystem']; break; - } elseif ($entry['mountPoint'] === CONFIG_VMSTORE_DIR) { - $storeError = false; } + $data['storeMissing'] = false; } } else { - $storeError = 'Storage not configured'; + $data['notConfigured'] = true; } - echo Render::parse('systemstatus/diskstat', array( - 'store' => $storeUsage, - 'system' => $systemUsage, - 'storeError' => $storeError - )); + echo Render::parse('systemstatus/diskstat', $data); } protected function ajaxAddressList() diff --git a/templates/systemstatus/diskstat.html b/templates/systemstatus/diskstat.html index 019dda1a..218ed8f1 100644 --- a/templates/systemstatus/diskstat.html +++ b/templates/systemstatus/diskstat.html @@ -21,7 +21,16 @@ {{/store}} </div> <div class="clearfix"></div> -<div>{{storeError}}</div> +{{#notConfigured}} +<div>{{lang_storeNotConfigured}}</div> +{{/notConfigured}} +{{#storeMissing}} +<div>{{lang_storeMissingExpected}} {{storeMissing}}</div> +{{/storeMissing}} +{{#wrongStore}} +<div>{{lang_foundStore}} {{wrongStore}}</div> +{{/wrongStore}} +<a href="?do=VmStore">{{lang_goToStoreConf}}</a> <script type="text/javascript"> {{#store}} Circles.create({ |