From ea41acfff51b1cf312d69badac281b5e80fdf453 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Wed, 5 Feb 2014 22:42:23 +0100 Subject: [PATCH] Clarify status badges and fix column widths (fixes #53) --- gui/app.js | 16 ++++++++++++++++ gui/index.html | 18 +++++++++--------- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/gui/app.js b/gui/app.js index c5a430da..3f80135d 100644 --- a/gui/app.js +++ b/gui/app.js @@ -118,6 +118,22 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http) { return "minus"; }; + $scope.nodeStatus = function (nodeCfg) { + if ($scope.connections[nodeCfg.NodeID]) { + return "Connected"; + } + + return "Disconnected"; + }; + + $scope.nodeIcon = function (nodeCfg) { + if ($scope.connections[nodeCfg.NodeID]) { + return "ok"; + } + + return "minus"; + }; + $scope.nodeClass = function (nodeCfg) { var conn = $scope.connections[nodeCfg.NodeID]; if (conn) { diff --git a/gui/index.html b/gui/index.html index 284f79a3..31e09255 100644 --- a/gui/index.html +++ b/gui/index.html @@ -76,35 +76,35 @@ html, body { - + - + This node - + {{myID | short}} - {{version}} - this node - + {{version}} + + {{inbps | metric}}bps - + {{outbps | metric}}bps - + - + {{nodeStatus(nodeCfg)}}