diff --git a/src/js/client.js b/src/js/client.js index 6895f12aa..1db984705 100644 --- a/src/js/client.js +++ b/src/js/client.js @@ -100,6 +100,18 @@ angular.module('Application').filter('prettyDiskSize', function () { return function (size, fallback) { return prettyByteSize(size, fallback) || 'Not available yet'; }; }); +angular.module('Application').filter('trKeyFromPeriod', function () { + return function (period) { + if (period === 6) return 'app.graphs.period.6h'; + if (period === 12) return 'app.graphs.period.12h'; + if (period === 24) return 'app.graphs.period.24h'; + if (period === 24*7) return 'app.graphs.period.7d'; + if (period === 24*30) return 'app.graphs.period.30d'; + + return ''; + }; +}); + angular.module('Application').filter('prettyDate', function () { // http://ejohn.org/files/pretty.js return function prettyDate(utc) { diff --git a/src/translation/de.json b/src/translation/de.json index a4eea8b69..a5df6369d 100644 --- a/src/translation/de.json +++ b/src/translation/de.json @@ -1400,7 +1400,6 @@ "30d": "30 Tage", "12h": "12 Stunden" }, - "selectPeriod": "Periode {{ period }} auswählen", "memoryTitle": "Speicher (RAM + Swap) in MB" }, "uninstallTabTitle": "Deinstallieren", diff --git a/src/translation/en.json b/src/translation/en.json index 8b7f6c568..b915105f2 100644 --- a/src/translation/en.json +++ b/src/translation/en.json @@ -1198,12 +1198,12 @@ } }, "graphs": { - "selectPeriod": "Select Period {{ period }}", "period": { "12h": "12 hours", "24h": "24 hours", "7d": "7 days", - "30d": "30 days" + "30d": "30 days", + "6h": "6 hours" }, "memoryTitle": "Memory (RAM + Swap) in MB" }, diff --git a/src/translation/es.json b/src/translation/es.json index e3663a15e..7ee42a7ad 100644 --- a/src/translation/es.json +++ b/src/translation/es.json @@ -799,7 +799,6 @@ "30d": "30 días", "7d": "7 días" }, - "selectPeriod": "Seleccionar Periodo {{ period }}", "memoryTitle": "Memoria (RAM + Swap) en Mb" }, "states": { diff --git a/src/translation/fr.json b/src/translation/fr.json index e7ceb2fdb..2cb9b6890 100644 --- a/src/translation/fr.json +++ b/src/translation/fr.json @@ -886,8 +886,7 @@ "7d": "7 jours", "24h": "24 heures", "12h": "12 heures" - }, - "selectPeriod": "Période sélectionnée {{ period }}" + } }, "resources": { "memory": { diff --git a/src/translation/it.json b/src/translation/it.json index e5a10ae16..3ff335faa 100644 --- a/src/translation/it.json +++ b/src/translation/it.json @@ -329,8 +329,7 @@ "7d": "7 giorni", "24h": "24 ore", "12h": "12 ore" - }, - "selectPeriod": "Seleziona Periodo {{ period }}" + } }, "storage": { "mounts": { diff --git a/src/translation/nl.json b/src/translation/nl.json index a5b4c5939..75661280a 100644 --- a/src/translation/nl.json +++ b/src/translation/nl.json @@ -741,7 +741,6 @@ } }, "graphs": { - "selectPeriod": "Selecteer periode {{ period }}", "period": { "24h": "24 uur", "12h": "12 uur", diff --git a/src/translation/vi.json b/src/translation/vi.json index 24b1baa31..862181ab1 100644 --- a/src/translation/vi.json +++ b/src/translation/vi.json @@ -1237,8 +1237,7 @@ "7d": "7 ngày trước", "24h": "24 tiếng trước", "12h": "12 tiếng trước" - }, - "selectPeriod": "Chọn giai đoạn {{ period }}" + } }, "storage": { "mounts": { diff --git a/src/translation/zh_Hans.json b/src/translation/zh_Hans.json index dd1adb36e..8e4717881 100644 --- a/src/translation/zh_Hans.json +++ b/src/translation/zh_Hans.json @@ -1351,7 +1351,6 @@ "title": "域名冲突" }, "graphs": { - "selectPeriod": "选择时间范围 {{ period }}", "period": { "12h": "12 小时", "24h": "24 小时", diff --git a/src/views/app.html b/src/views/app.html index d12e3751b..7f0cbe6c9 100644 --- a/src/views/app.html +++ b/src/views/app.html @@ -839,14 +839,14 @@
diff --git a/src/views/app.js b/src/views/app.js index 6ec677bbf..ac41b3eec 100644 --- a/src/views/app.js +++ b/src/views/app.js @@ -650,13 +650,11 @@ angular.module('Application').controller('AppController', ['$scope', '$location' error: {}, period: 12, // set as 12 because disk graphs is only collected twice a day - periodLabel: '12 hours', memoryChart: null, diskChart: null, - setPeriod: function (hours, label) { + setPeriod: function (hours) { $scope.graphs.period = hours; - $scope.graphs.periodLabel = label; $scope.graphs.show(); }, diff --git a/src/views/system.html b/src/views/system.html index 47697f546..7cf1d5aa9 100644 --- a/src/views/system.html +++ b/src/views/system.html @@ -66,14 +66,14 @@ diff --git a/src/views/system.js b/src/views/system.js index dc9b9e638..80d4fdf53 100644 --- a/src/views/system.js +++ b/src/views/system.js @@ -154,13 +154,11 @@ angular.module('Application').controller('SystemController', ['$scope', '$locati error: {}, period: 6, - periodLabel: '6 hours', memoryChart: null, diskChart: null, - setPeriod: function (hours, label) { + setPeriod: function (hours) { $scope.graphs.period = hours; - $scope.graphs.periodLabel = label; $scope.graphs.show(); },