Always show local node, and summarize traffic stats (fixes #43)

This commit is contained in:
Jakob Borg committed 2014-02-05 21:30:04 +01:00
1 parent 9bd4fa5008
commit 1aefc50e35
3 files changed
+41 -32

No files matched your search

+1 -1
View File
@@ -3,4 +3,4 @@ package auto
import "github.com/cratonica/embed"
var Resources embed.PackedResourceMap = embed.PackedResourceMap{0x1f, 0x8b, 0x8, 0x0, 0x0, 0x9, 0x6e, 0x88, 0x2, 0xff, 0xec, 0xfd, 0x5b, 0x8c, 0x23, 0x59, 0xb7, 0x20, 0x4, 0xe7, 0x5c, 0xfe, 0x7f, 0xc0, 0x33, 0xdf, 0x9c, 0xa3, 0x19, 0x60, 0xe0, 0x85, 0x71, 0xc6, 0x97, 0xc7, 0x1d, 0x51, 0xde, 0xe9, 0x74, 0x56, 0xf7, 0x77, 0x8b, 0xc8, 0x28, 0x9f, 0xac, 0xac, 0xac, 0x5b, 0x57, 0x66, 0x55, 0x67, 0x66, 0x55, 0x5f, 0x9c, 0xee, 0x9e, 0x1d, 0x17, 0x5f, 0xda, 0x76, 0xd8, 0xe5, 0xb0, 0x33, 0x2b, 0x2b, 0x6d, 0x90, 0x78, 0x2, 0x21, 0xe6, 0x79, 0x74, 0x84, 0x84, 0x78, 0x82, 0x27, 0x84, 0xd0, 0x8, 0x1, 0x3, 0x6f, 0x20, 0x4, 0xcc, 0x3, 0xe2, 0x79, 0xc4, 0x3, 0x2, 0x9, 0xd0, 0x91, 0x6, 0x71, 0x91, 0x10, 0x67, 0x66, 0x60, 0xad, 0xb5, 0xaf, 0x11, 0x76, 0x56, 0x77, 0x9f, 0xf3, 0xcd, 0x79, 0x80, 0xca, 0xee, 0x28, 0x47, 0xec, 0xd8, 0xb1, 0xaf, 0x6b, 0xaf, 0xbd, 0xd6, 0xda, 0xeb, 0xf2, 0x3b, 0x5b, 0x5b, 0x5b, 0x8d, 0x41, 0x96, 0xa4, 0xef, 0x1a, 0xfd, 0xf9, 0x78, 0xd4, 0xc8, 0xaf, 0xa7, 0x5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c, 0x3f, 0xb9, 0xe, 0x9d, 0x6c, 0x92, 0xa4, 0x47, 0xdd, 0x5e, 0xe3, 0x14, 0x7e, 0x9f, 0x3d, 0xaa, 0x6e, 0x87, 0xd5, 0xf1, 0xcd, 0xb3, 0x47, 0xce, 0x83, 0xf, 0x96, 0x73, 0x30, 0x4f, 0xaa, 0xf1, 0x88, 0xe7, 0x79, 0xe8, 0xcc, 0xd3, 0x77, 0xf3, 0xdd, 0xd9, 0xa0, 0xd7, 0x9f, 0xff, 0xd0, 0x37, 0x7b, 0xf3, 0xe4, 0xc1, 0xf, 0xb6, 0xee, 0xf6, 0x16, 0x1b, 0x74, 0x98, 0x24, 0x33, 0x57, 0xb6, 0xcc, 0x5b, 0xad, 0x7e, 0xa8, 0x2d, 0xbf, 0xbd, 0x8a, 0xdf, 0xa4, 0x7f, 0xda, 0xf5, 0x8a, 0xe9, 0xb0, 0x7, 0x73, 0x3c, 0xc9, 0x26, 0x90, 0x18, 0xa7, 0xce, 0x3, 0xd1, 0x28, 0x6b, 0x7a, 0x96, 0x55, 0x98, 0xb5, 0xd9, 0x7c, 0xb5, 0x3a, 0xd8, 0xc3, 0xef, 0x1e, 0xfc, 0xa9, 0xb4, 0xf0, 0x47, 0x54, 0xb5, 0xb1, 0x37, 0xbd, 0xd1, 0xcd, 0xb4, 0x3f, 0x88, 0x27, 0x59, 0x55, 0xdf, 0xed, 0x8a, 0x1e, 0x3d, 0x83, 0x5b, 0x6b, 0x9c, 0x9d, 0x7, 0xLine truncated
var Resources embed.PackedResourceMap = embed.PackedResourceMap{0x1f, 0x8b, 0x8, 0x0, 0x0, 0x9, 0x6e, 0x88, 0x2, 0xff, 0xec, 0xbd, 0x9, 0x78, 0x24, 0x5b, 0x56, 0x1e, 0x98, 0xbd, 0x83, 0x9a, 0xa6, 0x1b, 0x1a, 0x1b, 0xb0, 0x8d, 0x9, 0x45, 0x57, 0xab, 0x22, 0x9e, 0x42, 0x29, 0xa9, 0xde, 0xeb, 0x2d, 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x6e, 0xf, 0xfa, 0x97, 0xe, 0xfb, 0x51, 0x7a, 0xb7, 0xdb, 0xf7, 0xda, 0xda, 0xc2, 0x84, 0x9a, 0x8f, 0x47, 0x33, 0xb5, 0x45, 0xad, 0x1f, 0x9a, 0x67, 0xac, 0xc2, 0xc9, 0x79, 0x5f, 0x9f, 0xd0, 0xe4, 0xe5, 0xf2, 0xa0, 0x1, 0xc6, 0x73, 0x90, 0x31, 0x8b, 0xb6, 0xac, 0x3c, 0xc6, 0x6b, 0xbc, 0x9d, 0x1c, 0xf9, 0xb1, 0x92, 0xa0, 0xb7, 0x79, 0x17, 0x95, 0x31, 0xLine truncated
+5 -19
View File
@@ -51,11 +51,8 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http) {
$scope.config = data;
var nodes = $scope.config.Repositories[0].Nodes;
nodes = nodes.filter(function (x) { return x.NodeID != $scope.myID; });
nodes.sort(function (a, b) {
if (a.NodeID == $scope.myID)
return -1;
if (b.NodeID == $scope.myID)
return 1;
if (a.NodeID < b.NodeID)
return -1;
return a.NodeID > b.NodeID;
@@ -79,6 +76,8 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http) {
var td = (now - prevDate) / 1000;
prevDate = now;
$scope.inbps = 0
$scope.outbps = 0
for (var id in data) {
try {
data[id].inbps = Math.max(0, 8 * (data[id].InBytesTotal - $scope.connections[id].InBytesTotal) / td);
@@ -87,6 +86,8 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http) {
data[id].inbps = 0;
data[id].outbps = 0;
}
$scope.inbps += data[id].outbps;
$scope.outbps += data[id].inbps;
}
$scope.connections = data;
});
@@ -110,10 +111,6 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http) {
};
$scope.nodeIcon = function (nodeCfg) {
if (nodeCfg.NodeID === $scope.myID) {
return "ok";
}
if ($scope.connections[nodeCfg.NodeID]) {
return "ok";
}
@@ -122,10 +119,6 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http) {
};
$scope.nodeClass = function (nodeCfg) {
if (nodeCfg.NodeID === $scope.myID) {
return "default";
}
var conn = $scope.connections[nodeCfg.NodeID];
if (conn) {
return "success";
@@ -135,9 +128,6 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http) {
};
$scope.nodeAddr = function (nodeCfg) {
if (nodeCfg.NodeID === $scope.myID) {
return "this node";
}
var conn = $scope.connections[nodeCfg.NodeID];
if (conn) {
return conn.Address;
@@ -211,10 +201,6 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http) {
}
$scope.nodes.sort(function (a, b) {
if (a.NodeID == $scope.myID)
return -1;
if (b.NodeID == $scope.myID)
return 1;
if (a.NodeID < b.NodeID)
return -1;
return a.NodeID > b.NodeID;
+35 -12
View File
@@ -74,7 +74,34 @@ html, body {
<div class="panel-heading"><h3 class="panel-title">Cluster</h3></div>
<table class="table table-condensed">
<tbody>
<tr ng-repeat="nodeCfg in nodes" ng-class="{'text-muted': nodeCfg.NodeID == myID}">
<!-- myself -->
<tr class="text-muted">
<td>
<span class="label label-default">
<span class="glyphicon glyphicon-ok"></span>
</span>
</td>
<td>
<span class="text-monospace">{{myID | short}}</span>
</td>
<td>{{version}}</td>
<td>this node</td>
<td class="text-right">
<span ng-show="nodeCfg.NodeID != myID">
{{inbps | metric}}bps
<span class="text-muted glyphicon glyphicon-chevron-down"></span>
</span>
</td>
<td class="text-right">
<span ng-show="nodeCfg.NodeID != myID">
{{outbps | metric}}bps
<span class="text-muted glyphicon glyphicon-chevron-up"></span>
</span>
</td>
<td class="text-right"></td>
</tr>
<!-- all other nodes -->
<tr ng-repeat="nodeCfg in nodes">
<td>
<span class="label label-{{nodeClass(nodeCfg)}}">
<span class="glyphicon glyphicon-{{nodeIcon(nodeCfg)}}"></span>
@@ -90,19 +117,15 @@ html, body {
{{nodeAddr(nodeCfg)}}
</td>
<td class="text-right">
<span ng-show="nodeCfg.NodeID != myID">
<abbr title="{{connections[nodeCfg.NodeID].InBytesTotal | binary}}B">{{connections[nodeCfg.NodeID].inbps | metric}}bps</abbr>
<span class="text-muted glyphicon glyphicon-chevron-down"></span>
</span>
<abbr title="{{connections[nodeCfg.NodeID].InBytesTotal | binary}}B">{{connections[nodeCfg.NodeID].inbps | metric}}bps</abbr>
<span class="text-muted glyphicon glyphicon-chevron-down"></span>
</td>
<td class="text-right">
<span ng-show="nodeCfg.NodeID != myID">
<abbr title="{{connections[nodeCfg.NodeID].OutBytesTotal | binary}}B">{{connections[nodeCfg.NodeID].outbps | metric}}bps</abbr>
<span class="text-muted glyphicon glyphicon-chevron-up"></span>
</span>
<abbr title="{{connections[nodeCfg.NodeID].OutBytesTotal | binary}}B">{{connections[nodeCfg.NodeID].outbps | metric}}bps</abbr>
<span class="text-muted glyphicon glyphicon-chevron-up"></span>
</td>
<td class="text-right">
<button ng-show="nodeCfg.NodeID != myID" type="button" ng-click="editNode(nodeCfg)" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-pencil"></span> Edit</button>
<button type="button" ng-click="editNode(nodeCfg)" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-pencil"></span> Edit</button>
</td>
</tr>
<tr>
@@ -225,8 +248,8 @@ html, body {
</div>
</form>
<div ng-show="!editingExisting">
When adding a new node, keep in mind that <em>this node</em> must be added on the other side too. The Node ID of this node is:
<pre>{{myID}}</pre>
When adding a new node, keep in mind that <em>this node</em> must be added on the other side too. The Node ID of this node is:
<pre>{{myID}}</pre>
</div>
</div>
<div class="modal-footer">