Only show address when connected (fixes #58)

The configured address is visible in the config dialog.
This commit is contained in:
Jakob Borg committed 2014-02-11 14:34:47 +01:00
1 parent 3a5b816125
commit 478300f6d8
3 files changed
+49 -49

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, 0xbd, 0xb, 0x7c, 0x24, 0xd9, 0x59, 0x1f, 0xda, 0xbb, 0xf6, 0x7a, 0x6d, 0xed, 0x82, 0x1, 0x13, 0x8c, 0xe3, 0xe4, 0x47, 0xa9, 0x76, 0x56, 0x53, 0xb5, 0x2a, 0xb5, 0xa4, 0xd9, 0x97, 0xdd, 0xa5, 0x9a, 0xb6, 0x46, 0xa3, 0x79, 0xec, 0x8c, 0x66, 0x66, 0xa5, 0x99, 0xd9, 0xd9, 0xd5, 0x68, 0xd7, 0xf5, 0xea, 0xc7, 0xa8, 0xbb, 0xba, 0xa7, 0xab, 0x5b, 0x1a, 0x8d, 0xd4, 0x36, 0x37, 0x21, 0x1, 0xf2, 0x73, 0xc, 0x21, 0xc9, 0xcf, 0xc1, 0xe0, 0x4, 0xe2, 0xdc, 0x1f, 0x8f, 0xdc, 0x60, 0xe2, 0xe4, 0x86, 0xbc, 0x30, 0x49, 0xc, 0x24, 0x60, 0xf3, 0x8, 0x37, 0xf, 0x1e, 0x37, 0x5c, 0x92, 0x5f, 0x20, 0xc1, 0x37, 0x26, 0x98, 0x40, 0x82, 0x7d, 0x43, 0xb8, 0xff, 0xef, 0x3b, 0xa7, 0xaa, 0x4e, 0x75, 0xb7, 0x34, 0xd2, 0x78, 0x17, 0xdb, 0xd0, 0x35, 0xf3, 0x57, 0xd7, 0xe3, 0xd4, 0x39, 0xa7, 0xce, 0xe3, 0x3b, 0xdf, 0xf7, 0x9d, 0xef, 0x7c, 0xe7, 0x91, 0x42, 0xa1, 0x50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xe9, 0xde, 0x31, 0xe6, 0x2c, 0xed, 0x1d, 0xda, 0x13, 0x9a, 0x91, 0x6, 0xb9, 0xdc, 0xeb, 0x9e, 0xda, 0xe9, 0x86, 0xf1, 0xd5, 0x56, 0xd7, 0x6d, 0x68, 0x33, 0xc9, 0x17, 0xfb, 0xad, 0x28, 0xa, 0xfd, 0x6e, 0xbd, 0x15, 0xc5, 0xc3, 0xc1, 0x4c, 0x6d, 0x56, 0xeb, 0x6, 0xe6, 0x21, 0x3f, 0x61, 0xff, 0xb4, 0xcf, 0x47, 0x87, 0x49, 0x5a, 0xd, 0xb5, 0x6f, 0xca, 0xdd, 0xce, 0xce, 0x40, 0x61, 0x54, 0x5a, 0x1d, 0xcd, 0xd8, 0x72, 0x3b, 0x5a, 0x3d, 0xd0, 0xea, 0x11, 0x67, 0x6b, 0xb0, 0xbc, 0x64, 0x82, 0x59, 0xa5, 0x14, 0xf6, 0xad, 0x7b, 0x7a, 0x98, 0x7b, 0xda, 0xee, 0x84, 0x5b, 0xa7, 0xdd, 0x6e, 0x88, 0x27, 0x51, 0x6b, 0x3b, 0x9f, 0x21, 0x4a, 0xb5, 0x1b, 0xe0, 0x89, 0x81, 0x47, 0xf8, 0xb0, 0x24, 0x2c, 0xe5, 0x7e, 0x7e, 0x6e, 0x6e, 0x6e, 0x38, 0x34, 0x85, 0x73, 0x34, 0xa, 0x53, 0xc4, 0xa9, 0xa1, 0x7c, 0xe0,Line truncated
var Resources embed.PackedResourceMap = embed.PackedResourceMap{0x1f, 0x8b, 0x8, 0x0, 0x0, 0x9, 0x6e, 0x88, 0x2, 0xff, 0xec, 0xfd, 0xb, 0x70, 0x24, 0x59, 0x76, 0x1e, 0x6, 0x17, 0x87, 0xcb, 0xe5, 0xa, 0xbb, 0x5c, 0x72, 0x25, 0x85, 0x9e, 0xff, 0x2f, 0x15, 0x72, 0x7b, 0xd1, 0x99, 0x83, 0x44, 0x1, 0xe8, 0x99, 0xdd, 0x9d, 0xcd, 0x44, 0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0x95, 0xe9, 0x75, 0xe1, 0xbd, 0xac, 0xcd, 0x60, 0x32, 0x16, 0xcd, 0xb0, 0xe6, 0xce, 0x7b, 0xad, 0x1a, 0xa9, 0xf4, 0x76, 0x38, 0x8a, 0xf, 0xaf, 0xfb, 0xe3, 0x18, 0x6f, 0x92, 0xc1, 0x91, 0x3b, 0xdb, 0xd2, 0xdd, 0x68, 0x4e, 0x1b, 0x44, 0x88, 0x6e, 0x22, 0x3e, 0xda, 0x52, 0x25, 0x40, 0xd, 0xb6, 0xbe, 0xb6, 0xb6, 0x66, 0x17, Line truncated
+37 -37
View File
@@ -1,7 +1,7 @@
/*jslint browser: true, continue: true, plusplus: true */
/*global $: false, angular: false */
"use strict";
'use strict';
var syncthing = angular.module('syncthing', []);
@@ -11,24 +11,24 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http) {
$scope.connections = {};
$scope.config = {};
$scope.myID = "";
$scope.myID = '';
$scope.nodes = [];
// Strings before bools look better
$scope.settings = [
{id: 'ListenStr', descr: "Sync Protocol Listen Addresses", type: 'string', restart: true},
{id: 'GUIAddress', descr: "GUI Listen Address", type: 'string', restart: true},
{id: 'MaxSendKbps', descr: "Outgoing Rate Limit (KBps)", type: 'string', restart: true},
{id: 'RescanIntervalS', descr: "Rescan Interval (s)", type: 'string', restart: true},
{id: 'ReconnectIntervalS', descr: "Reconnect Interval (s)", type: 'string', restart: true},
{id: 'ParallelRequests', descr: "Max Outstanding Requests", type: 'string', restart: true},
{id: 'MaxChangeKbps', descr: "Max File Change Rate (KBps)", type: 'string', restart: true},
{id: 'ListenStr', descr: 'Sync Protocol Listen Addresses', type: 'string', restart: true},
{id: 'GUIAddress', descr: 'GUI Listen Address', type: 'string', restart: true},
{id: 'MaxSendKbps', descr: 'Outgoing Rate Limit (KBps)', type: 'string', restart: true},
{id: 'RescanIntervalS', descr: 'Rescan Interval (s)', type: 'string', restart: true},
{id: 'ReconnectIntervalS', descr: 'Reconnect Interval (s)', type: 'string', restart: true},
{id: 'ParallelRequests', descr: 'Max Outstanding Requests', type: 'string', restart: true},
{id: 'MaxChangeKbps', descr: 'Max File Change Rate (KBps)', type: 'string', restart: true},
{id: 'ReadOnly', descr: "Read Only", type: 'bool', restart: true},
{id: 'AllowDelete', descr: "Allow Delete", type: 'bool', restart: true},
{id: 'FollowSymlinks', descr: "Follow Symlinks", type: 'bool', restart: true},
{id: 'GlobalAnnEnabled', descr: "Global Announce", type: 'bool', restart: true},
{id: 'LocalAnnEnabled', descr: "Local Announce", type: 'bool', restart: true},
{id: 'ReadOnly', descr: 'Read Only', type: 'bool', restart: true},
{id: 'AllowDelete', descr: 'Allow Delete', type: 'bool', restart: true},
{id: 'FollowSymlinks', descr: 'Follow Symlinks', type: 'bool', restart: true},
{id: 'GlobalAnnEnabled', descr: 'Global Announce', type: 'bool', restart: true},
{id: 'LocalAnnEnabled', descr: 'Local Announce', type: 'bool', restart: true},
];
function modelGetSucceeded() {
@@ -58,16 +58,16 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http) {
return a.NodeID > b.NodeID;
}
$http.get("/rest/version").success(function (data) {
$http.get('/rest/version').success(function (data) {
$scope.version = data;
});
$http.get("/rest/system").success(function (data) {
$http.get('/rest/system').success(function (data) {
$scope.system = data;
$scope.myID = data.myID;
$http.get("/rest/config").success(function (data) {
$http.get('/rest/config').success(function (data) {
$scope.config = data;
$scope.config.Options.ListenStr = $scope.config.Options.ListenAddress.join(", ");
$scope.config.Options.ListenStr = $scope.config.Options.ListenAddress.join(', ');
var nodes = $scope.config.Repositories[0].Nodes;
nodes.sort(nodeCompare);
@@ -76,16 +76,16 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http) {
});
$scope.refresh = function () {
$http.get("/rest/system").success(function (data) {
$http.get('/rest/system').success(function (data) {
$scope.system = data;
});
$http.get("/rest/model").success(function (data) {
$http.get('/rest/model').success(function (data) {
$scope.model = data;
modelGetSucceeded();
}).error(function () {
modelGetFailed();
});
$http.get("/rest/connections").success(function (data) {
$http.get('/rest/connections').success(function (data) {
var now = Date.now(),
td = (now - prevDate) / 1000,
id;
@@ -105,15 +105,15 @@ 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.inbps += data[id].inbps;
$scope.outbps += data[id].outbps;
}
$scope.connections = data;
});
$http.get("/rest/need").success(function (data) {
$http.get('/rest/need').success(function (data) {
var i, name;
for (i = 0; i < data.length; i++) {
name = data[i].Name.split("/");
name = data[i].Name.split('/');
data[i].ShortName = name[name.length - 1];
}
data.sort(function (a, b) {
@@ -131,35 +131,35 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http) {
$scope.nodeIcon = function (nodeCfg) {
if ($scope.connections[nodeCfg.NodeID]) {
return "ok";
return 'ok';
}
return "minus";
return 'minus';
};
$scope.nodeStatus = function (nodeCfg) {
if ($scope.connections[nodeCfg.NodeID]) {
return "Connected";
return 'Connected';
}
return "Disconnected";
return 'Disconnected';
};
$scope.nodeIcon = function (nodeCfg) {
if ($scope.connections[nodeCfg.NodeID]) {
return "ok";
return 'ok';
}
return "minus";
return 'minus';
};
$scope.nodeClass = function (nodeCfg) {
var conn = $scope.connections[nodeCfg.NodeID];
if (conn) {
return "success";
return 'success';
}
return "info";
return 'info';
};
$scope.nodeAddr = function (nodeCfg) {
@@ -167,7 +167,7 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http) {
if (conn) {
return conn.Address;
}
return nodeCfg.Addresses.join(", ");
return '(unknown address)';
};
$scope.nodeVer = function (nodeCfg) {
@@ -178,7 +178,7 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http) {
if (conn) {
return conn.ClientVersion;
}
return "";
return '(unknown version)';
};
$scope.nodeName = function (nodeCfg) {
@@ -197,12 +197,12 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http) {
$scope.editNode = function (nodeCfg) {
$scope.currentNode = nodeCfg;
$scope.editingExisting = true;
$scope.currentNode.AddressesStr = nodeCfg.Addresses.join(", ");
$scope.currentNode.AddressesStr = nodeCfg.Addresses.join(', ');
$('#editNode').modal({backdrop: 'static', keyboard: false});
};
$scope.addNode = function () {
$scope.currentNode = {NodeID: "", AddressesStr: "dynamic"};
$scope.currentNode = {NodeID: '', AddressesStr: 'dynamic'};
$scope.editingExisting = false;
$('#editNode').modal({backdrop: 'static', keyboard: false});
};
+11 -11
View File
@@ -40,6 +40,10 @@ html, body {
border-top: none;
}
thead tr th {
text-align: center;
}
</style>
</head>
@@ -76,7 +80,7 @@ html, body {
<tbody>
<!-- myself -->
<tr class="text-muted" ng-repeat="nodeCfg in thisNode()">
<td style="width:13%">
<td style="width:13%" class="text-center">
<span class="label label-default">
<span class="glyphicon glyphicon-ok"></span> This node
</span>
@@ -85,18 +89,14 @@ html, body {
<span class="text-monospace">{{nodeName(nodeCfg)}}</span>
</td>
<td style="width:20%">{{version}}</td>
<td style="width:25%"></td>
<td style="width:25%">(this node)</td>
<td style="width:10%" class="text-right">
<span ng-show="nodeCfg.NodeID != myID">
{{inbps | metric}}bps
<span class="text-muted glyphicon glyphicon-chevron-down"></span>
</span>
{{inbps | metric}}bps
<span class="text-muted glyphicon glyphicon-chevron-down"></span>
</td>
<td style="width:10%" class="text-right">
<span ng-show="nodeCfg.NodeID != myID">
{{outbps | metric}}bps
<span class="text-muted glyphicon glyphicon-chevron-up"></span>
</span>
{{outbps | metric}}bps
<span class="text-muted glyphicon glyphicon-chevron-up"></span>
</td>
<td class="text-right">
<button type="button" ng-click="editNode(nodeCfg)" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-pencil"></span> Edit</button>
@@ -104,7 +104,7 @@ html, body {
</tr>
<!-- all other nodes -->
<tr ng-repeat="nodeCfg in otherNodes()">
<td>
<td class="text-center">
<span class="label label-{{nodeClass(nodeCfg)}}">
<span class="glyphicon glyphicon-{{nodeIcon(nodeCfg)}}"></span> {{nodeStatus(nodeCfg)}}
</span>