diff --git a/dashboard/src/js/client.js b/dashboard/src/js/client.js index 95a48161b..d426b708f 100644 --- a/dashboard/src/js/client.js +++ b/dashboard/src/js/client.js @@ -2110,6 +2110,26 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout }); }; + Client.prototype.systemInfo = function (callback) { + get('/api/v1/system/info', null, function (error, data, status) { + if (error) return callback(error); + if (status !== 200) return callback(new ClientError(status, data)); + + console.log(data) + + callback(null, data.info); + }); + }; + + Client.prototype.cpus = function (callback) { + get('/api/v1/system/cpus', null, function (error, data, status) { + if (error) return callback(error); + if (status !== 200) return callback(new ClientError(status, data)); + + callback(null, data.cpus); + }); + }; + Client.prototype.memory = function (callback) { get('/api/v1/system/memory', null, function (error, data, status) { if (error) return callback(error); diff --git a/dashboard/src/theme.scss b/dashboard/src/theme.scss index a6c41ef49..665d8f746 100644 --- a/dashboard/src/theme.scss +++ b/dashboard/src/theme.scss @@ -1088,6 +1088,10 @@ multiselect { max-width: 970px; } +.card-expand { + max-width: initial; +} + .text-success { color: #5CB85C; } diff --git a/dashboard/src/views/system.html b/dashboard/src/views/system.html index 3a2a2d4fb..ff5526d14 100644 --- a/dashboard/src/views/system.html +++ b/dashboard/src/views/system.html @@ -11,8 +11,45 @@
-
+
+

+ Server +

+ +
+
+
Platform Version
+
v{{ config.version }} ({{ config.ubuntuVersion }})
+
+
+
Vendor
+
{{ info.sysVendor }}
+
+
+
Product
+
{{ info.productName }}
+
+
+
CPU
+
{{ cpus.length + ' Core "' + cpus[0].model + '"' }}
+
+
+
Memory
+
{{ memory.memory | prettyDiskSize }} RAM and {{ memory.swap | prettyDiskSize }} Swap
+
+
+
Uptime
+
{{ info.uptimeSecs }}
+
+
+
Cloudron Creation Time
+
{{ info.activationTime | prettyDate }}
+
+
+
+ +

Graphs
diff --git a/dashboard/src/views/system.js b/dashboard/src/views/system.js index 1167e12bb..e4c5c76ab 100644 --- a/dashboard/src/views/system.js +++ b/dashboard/src/views/system.js @@ -2,6 +2,7 @@ /* global angular */ /* global $ */ +/* global TASK_TYPES */ /* global Chart */ angular.module('Application').controller('SystemController', ['$scope', '$location', '$timeout', 'Client', function ($scope, $location, $timeout, Client) { @@ -9,6 +10,8 @@ angular.module('Application').controller('SystemController', ['$scope', '$locati $scope.config = Client.getConfig(); $scope.memory = null; + $scope.cpus = null; + $scope.info = null; $scope.volumesById = {}; // https://stackoverflow.com/questions/1484506/random-color-generator @@ -321,6 +324,20 @@ angular.module('Application').controller('SystemController', ['$scope', '$locati }; Client.onReady(function () { + Client.cpus(function (error, cpus) { + if (error) console.error(error); + $scope.cpus = cpus; + }); + + Client.systemInfo(function (error, info) { + if (error) console.error(error); + + // prettify for UI + info.uptimeSecs = moment.duration(info.uptimeSecs, 'seconds').locale(navigator.language).humanize(); + + $scope.info = info; + }); + Client.memory(function (error, memory) { if (error) console.error(error);