Archived
Restart from web gui (fixes #50)
This commit is contained in:
1 parent
a26ce61d92
commit
2cbe81f1c7
5 files changed
+225
-171
No files matched your search
+1
-1
@@ -3,4 +3,4 @@ package auto
|
|||||||
|
|
||||||
import "github.com/cratonica/embed"
|
import "github.com/cratonica/embed"
|
||||||
|
|
||||||
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, 0x76, 0x11, 0x8d, 0x46, 0xbf, 0xa6, 0xd1, 0xdd, 0x3, 0x74, 0xf7, 0x3c, 0xa, 0x35, 0xb3, 0xf9, 0xaa, 0xc7, 0xa0, 0x2a, 0xab, 0xba, 0xb2, 0xa, 0x68, 0xc, 0x50, 0x92, 0x49, 0x59, 0x36, 0x5f, 0x7e, 0x88, 0xb6, 0x25, 0x4a, 0xc, 0xd3, 0x7a, 0x30, 0xfc, 0xa0, 0xc4, 0x87, 0x1d, 0xb2, 0x14, 0x52, 0x90, 0xc, 0xd1, 0x61, 0x9b, 0x22, 0x4d, 0x8b, 0x96, 0xa5, 0x8, 0x7, 0x15, 0xa, 0x91, 0x16, 0x43, 0xb2, 0x2c, 0xd9, 0x12, 0x49, 0xf9, 0x21, 0x93, 0x41, 0xd2, 0xdf, 0x39, 0xf7, 0xde, 0xcc, 0x9b, 0x59, 0x5, 0x74, 0xf7, 0xec, 0x90, 0x54, 0x58, 0xc8, 0xee, 0x83, 0xca, 0xbc, 0x79, 0xf3, 0x3e, 0xcf, 0x3d, 0xf7, 0x9c, 0x73, 0xcf, 0x3d, 0xf7, 0x93, 0x95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, 0x5d, 0xa9, 0x5e, 0x4a, 0xc3, 0xc1, 0x30, 0xae, 0x85, 0x83, 0x24, 0x89, 0xc3, 0x71, 0x77, 0x90, 0xa4, 0x33, 0xb1, 0xac, 0xea, 0x6a, 0x75, 0x1c, 0x59, 0xee, 0x4c, 0xce, 0xe3, 0xd1, 0x71, 0xf5, 0x64, 0x26, 0x74, 0x3a, 0xb7, 0x84, 0xc8, 0x60, 0xdc, 0x4d, 0x26, 0xf1, 0x6c, 0x2a, 0xdd, 0x56, 0xd5, 0x5c, 0xa4, 0xe2, 0xd5, 0x3a, 0x7e, 0x7a, 0xff, 0x28, 0x79, 0x30, 0x42, 0x81, 0x46, 0xe3, 0x63, 0xb3, 0x1b, 0x59, 0x56, 0x29, 0xfd, 0xd6, 0x60, 0x54, 0x45, 0x78, 0xb5, 0x9b, 0x70, 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
|
var Resources embed.PackedResourceMap = embed.PackedResourceMap{0x1f, 0x8b, 0x8, 0x0, 0x0, 0x9, 0x6e, 0x88, 0x2, 0xff, 0xec, 0xbd, 0x6b, 0x90, 0x24, 0xc9, 0x96, 0x16, 0x56, 0x7b, 0xb5, 0xf7, 0xee, 0xa5, 0x76, 0xf7, 0x2e, 0x8f, 0x15, 0x32, 0x1, 0x42, 0x59, 0x71, 0x8b, 0xea, 0x88, 0xc9, 0xa8, 0xac, 0xaa, 0x9e, 0xd9, 0xfb, 0x88, 0xa8, 0x98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 0xe9, 0x77, 0x6a, 0xe6, 0x1a, 0x75, 0xaf, 0xd1, 0xf3, 0xd3, 0xc7, 0x67, 0xc9, 0x93, 0x29, 0x3a, 0x34, 0x9d, 0x9d, 0x9b, 0xfd, 0xc8, 0xb2, 0x4a, 0xf5, 0x77, 0xc6, 0xd3, 0x1a, 0xf2, 0x6b, 0xfd, 0x84, 0x3f, 0x99, 0x1e, 0x17, 0x9e, 0xcb, 0xaf, 0x19, 0xcf, 0x67, 0x2, 0xc, 0xdb, 0x6e, 0xd5, 0x6Line truncated
|
||||||
@@ -11,6 +11,8 @@ import (
|
|||||||
"github.com/codegangsta/martini"
|
"github.com/codegangsta/martini"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var configInSync = true
|
||||||
|
|
||||||
func startGUI(addr string, m *model.Model) {
|
func startGUI(addr string, m *model.Model) {
|
||||||
router := martini.NewRouter()
|
router := martini.NewRouter()
|
||||||
router.Get("/", getRoot)
|
router.Get("/", getRoot)
|
||||||
@@ -18,10 +20,12 @@ func startGUI(addr string, m *model.Model) {
|
|||||||
router.Get("/rest/model", restGetModel)
|
router.Get("/rest/model", restGetModel)
|
||||||
router.Get("/rest/connections", restGetConnections)
|
router.Get("/rest/connections", restGetConnections)
|
||||||
router.Get("/rest/config", restGetConfig)
|
router.Get("/rest/config", restGetConfig)
|
||||||
|
router.Get("/rest/config/sync", restGetConfigInSync)
|
||||||
router.Get("/rest/need", restGetNeed)
|
router.Get("/rest/need", restGetNeed)
|
||||||
router.Get("/rest/system", restGetSystem)
|
router.Get("/rest/system", restGetSystem)
|
||||||
|
|
||||||
router.Post("/rest/config", restPostConfig)
|
router.Post("/rest/config", restPostConfig)
|
||||||
|
router.Post("/rest/restart", restPostRestart)
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
mr := martini.New()
|
mr := martini.New()
|
||||||
@@ -79,9 +83,18 @@ func restPostConfig(req *http.Request) {
|
|||||||
log.Println(err)
|
log.Println(err)
|
||||||
} else {
|
} else {
|
||||||
saveConfig()
|
saveConfig()
|
||||||
|
configInSync = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func restGetConfigInSync(w http.ResponseWriter) {
|
||||||
|
json.NewEncoder(w).Encode(map[string]bool{"configInSync": configInSync})
|
||||||
|
}
|
||||||
|
|
||||||
|
func restPostRestart(req *http.Request) {
|
||||||
|
restart()
|
||||||
|
}
|
||||||
|
|
||||||
type guiFile model.File
|
type guiFile model.File
|
||||||
|
|
||||||
func (f guiFile) MarshalJSON() ([]byte, error) {
|
func (f guiFile) MarshalJSON() ([]byte, error) {
|
||||||
|
|||||||
+18
-7
@@ -13,16 +13,17 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http) {
|
|||||||
$scope.config = {};
|
$scope.config = {};
|
||||||
$scope.myID = '';
|
$scope.myID = '';
|
||||||
$scope.nodes = [];
|
$scope.nodes = [];
|
||||||
|
$scope.configInSync = true;
|
||||||
|
|
||||||
// Strings before bools look better
|
// Strings before bools look better
|
||||||
$scope.settings = [
|
$scope.settings = [
|
||||||
{id: 'ListenStr', descr: 'Sync Protocol Listen Addresses', type: 'string', restart: true},
|
{id: 'ListenStr', descr: 'Sync Protocol Listen Addresses', type: 'text', restart: true},
|
||||||
{id: 'GUIAddress', descr: 'GUI Listen Address', type: 'string', restart: true},
|
{id: 'GUIAddress', descr: 'GUI Listen Address', type: 'text', restart: true},
|
||||||
{id: 'MaxSendKbps', descr: 'Outgoing Rate Limit (KBps)', type: 'string', restart: true},
|
{id: 'MaxSendKbps', descr: 'Outgoing Rate Limit (KBps)', type: 'number', restart: true},
|
||||||
{id: 'RescanIntervalS', descr: 'Rescan Interval (s)', type: 'string', restart: true},
|
{id: 'RescanIntervalS', descr: 'Rescan Interval (s)', type: 'number', restart: true},
|
||||||
{id: 'ReconnectIntervalS', descr: 'Reconnect Interval (s)', type: 'string', restart: true},
|
{id: 'ReconnectIntervalS', descr: 'Reconnect Interval (s)', type: 'number', restart: true},
|
||||||
{id: 'ParallelRequests', descr: 'Max Outstanding Requests', type: 'string', restart: true},
|
{id: 'ParallelRequests', descr: 'Max Outstanding Requests', type: 'number', restart: true},
|
||||||
{id: 'MaxChangeKbps', descr: 'Max File Change Rate (KBps)', type: 'string', restart: true},
|
{id: 'MaxChangeKbps', descr: 'Max File Change Rate (KBps)', type: 'number', restart: true},
|
||||||
|
|
||||||
{id: 'ReadOnly', descr: 'Read Only', type: 'bool', restart: true},
|
{id: 'ReadOnly', descr: 'Read Only', type: 'bool', restart: true},
|
||||||
{id: 'AllowDelete', descr: 'Allow Delete', type: 'bool', restart: true},
|
{id: 'AllowDelete', descr: 'Allow Delete', type: 'bool', restart: true},
|
||||||
@@ -73,6 +74,9 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http) {
|
|||||||
nodes.sort(nodeCompare);
|
nodes.sort(nodeCompare);
|
||||||
$scope.nodes = nodes;
|
$scope.nodes = nodes;
|
||||||
});
|
});
|
||||||
|
$http.get('/rest/config/sync').success(function (data) {
|
||||||
|
$scope.configInSync = data.configInSync;
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$scope.refresh = function () {
|
$scope.refresh = function () {
|
||||||
@@ -189,11 +193,17 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
$scope.saveSettings = function () {
|
$scope.saveSettings = function () {
|
||||||
|
$scope.configInSync = false;
|
||||||
$scope.config.Options.ListenAddress = $scope.config.Options.ListenStr.split(',').map(function (x) { return x.trim(); });
|
$scope.config.Options.ListenAddress = $scope.config.Options.ListenStr.split(',').map(function (x) { return x.trim(); });
|
||||||
$http.post('/rest/config', JSON.stringify($scope.config), {headers: {'Content-Type': 'application/json'}});
|
$http.post('/rest/config', JSON.stringify($scope.config), {headers: {'Content-Type': 'application/json'}});
|
||||||
$('#settingsTable').collapse('hide');
|
$('#settingsTable').collapse('hide');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$scope.restart = function () {
|
||||||
|
$http.post('/rest/restart');
|
||||||
|
$scope.configInSync = true;
|
||||||
|
};
|
||||||
|
|
||||||
$scope.editNode = function (nodeCfg) {
|
$scope.editNode = function (nodeCfg) {
|
||||||
$scope.currentNode = nodeCfg;
|
$scope.currentNode = nodeCfg;
|
||||||
$scope.editingExisting = true;
|
$scope.editingExisting = true;
|
||||||
@@ -230,6 +240,7 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http) {
|
|||||||
$scope.saveNode = function () {
|
$scope.saveNode = function () {
|
||||||
var nodeCfg, done, i;
|
var nodeCfg, done, i;
|
||||||
|
|
||||||
|
$scope.configInSync = false;
|
||||||
$('#editNode').modal('hide');
|
$('#editNode').modal('hide');
|
||||||
nodeCfg = $scope.currentNode;
|
nodeCfg = $scope.currentNode;
|
||||||
nodeCfg.Addresses = nodeCfg.AddressesStr.split(',').map(function (x) { return x.trim(); });
|
nodeCfg.Addresses = nodeCfg.AddressesStr.split(',').map(function (x) { return x.trim(); });
|
||||||
|
|||||||
+158
-158
@@ -11,25 +11,10 @@
|
|||||||
<title>syncthing</title>
|
<title>syncthing</title>
|
||||||
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet">
|
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet">
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
html, body {
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
#wrap{
|
|
||||||
padding-top: 20px;
|
|
||||||
min-height: 100%;
|
|
||||||
height: auto;
|
|
||||||
margin: 0 auto -50px;
|
|
||||||
padding: 20px 0 50px 0;
|
|
||||||
}
|
|
||||||
#footer {
|
|
||||||
height: 50px;
|
|
||||||
padding: 12px;
|
|
||||||
background-color: #f5f5f5;
|
|
||||||
}
|
|
||||||
|
|
||||||
.header {
|
body {
|
||||||
border-bottom: 1px solid #e5e5e5;
|
padding-top: 70px;
|
||||||
padding-bottom: 10px;
|
padding-bottom: 70px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.text-monospace {
|
.text-monospace {
|
||||||
@@ -44,170 +29,185 @@ thead tr th {
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.logo {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
top: -5px;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body ng-controller="SyncthingCtrl">
|
<body ng-controller="SyncthingCtrl">
|
||||||
<div id="wrap">
|
<div class="navbar navbar-fixed-top navbar-default">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="page-header">
|
<a class="navbar-brand"><img class="logo" src="st-logo-128.png" width="32" height="32"> Syncthing</a>
|
||||||
<h1 class="text-muted"><img width="64" height="64" src="st-logo-128.png"> syncthing</h1>
|
<div ng-if="!configInSync">
|
||||||
|
<form class="navbar-form navbar-right">
|
||||||
|
<button type="button" class="btn btn-primary" ng-click="restart()">Restart Now</button>
|
||||||
|
</form>
|
||||||
|
<p class="navbar-text navbar-right">The configuration has been changed but not activated. Syncthing must restart to activate the new configuration.</p>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="container">
|
||||||
<div class="col-md-12">
|
<div class="row">
|
||||||
<div class="panel" ng-class="{'panel-success': model.needBytes === 0, 'panel-primary': model.needBytes !== 0}">
|
<div class="col-md-12">
|
||||||
<div class="panel-heading"><h3 class="panel-title">Synchronization</h3></div>
|
<div class="panel panel-info">
|
||||||
<div class="panel-body">
|
<div class="panel-heading"><h3 class="panel-title">Cluster</h3></div>
|
||||||
<div class="progress">
|
<table class="table table-condensed">
|
||||||
<div class="progress-bar" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100"
|
<tbody>
|
||||||
ng-class="{'progress-bar-success': model.needBytes === 0, 'progress-bar-info': model.needBytes !== 0}"
|
<!-- myself -->
|
||||||
style="width: {{100 * model.inSyncBytes / model.globalBytes | number:2}}%;">
|
<tr class="text-muted" ng-repeat="nodeCfg in thisNode()">
|
||||||
{{100 * model.inSyncBytes / model.globalBytes | alwaysNumber | number:0}}%
|
<td style="width:13%" class="text-center">
|
||||||
</div>
|
<span class="label label-default">
|
||||||
|
<span class="glyphicon glyphicon-ok"></span> This node
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
<td style="width:12%">
|
||||||
|
<span class="text-monospace">{{nodeName(nodeCfg)}}</span>
|
||||||
|
</td>
|
||||||
|
<td style="width:20%">{{version}}</td>
|
||||||
|
<td style="width:25%">(this node)</td>
|
||||||
|
<td style="width:10%" class="text-right">
|
||||||
|
{{inbps | metric}}bps
|
||||||
|
<span class="text-muted glyphicon glyphicon-chevron-down"></span>
|
||||||
|
</td>
|
||||||
|
<td style="width:10%" class="text-right">
|
||||||
|
{{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>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<!-- all other nodes -->
|
||||||
|
<tr ng-repeat="nodeCfg in otherNodes()">
|
||||||
|
<td class="text-center">
|
||||||
|
<span class="label label-{{nodeClass(nodeCfg)}}">
|
||||||
|
<span class="glyphicon glyphicon-{{nodeIcon(nodeCfg)}}"></span> {{nodeStatus(nodeCfg)}}
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<span class="text-monospace">{{nodeName(nodeCfg)}}</span>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{nodeVer(nodeCfg)}}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{nodeAddr(nodeCfg)}}
|
||||||
|
</td>
|
||||||
|
<td class="text-right">
|
||||||
|
<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">
|
||||||
|
<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 type="button" ng-click="editNode(nodeCfg)" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-pencil"></span> Edit</button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="text-right">
|
||||||
|
<button type="button" class="btn btn-default btn-xs" ng-click="addNode()"><span class="glyphicon glyphicon-plus"></span> Add</button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="panel panel-info">
|
||||||
|
<div class="panel-heading"><h3 class="panel-title">Repository</h3></div>
|
||||||
|
<div class="panel-body">
|
||||||
|
<p>Cluster contains {{model.globalFiles | alwaysNumber}} files, {{model.globalBytes | binary}}B
|
||||||
|
<span class="text-muted">(+{{model.globalDeleted | alwaysNumber}} delete records)</span></p>
|
||||||
|
|
||||||
|
<p>Local repository has {{model.localFiles | alwaysNumber}} files, {{model.localBytes | binary}}B
|
||||||
|
<span class="text-muted">(+{{model.localDeleted | alwaysNumber}} delete records)</span></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="panel" ng-class="{'panel-success': model.needBytes === 0, 'panel-primary': model.needBytes !== 0}">
|
||||||
|
<div class="panel-heading"><h3 class="panel-title">Synchronization</h3></div>
|
||||||
|
<div class="panel-body">
|
||||||
|
<div class="progress">
|
||||||
|
<div class="progress-bar" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100"
|
||||||
|
ng-class="{'progress-bar-success': model.needBytes === 0, 'progress-bar-info': model.needBytes !== 0}"
|
||||||
|
style="width: {{100 * model.inSyncBytes / model.globalBytes | number:2}}%;">
|
||||||
|
{{100 * model.inSyncBytes / model.globalBytes | alwaysNumber | number:0}}%
|
||||||
</div>
|
</div>
|
||||||
<p ng-show="model.needBytes > 0">Need {{model.needFiles | alwaysNumber}} files, {{model.needBytes | binary}}B</p>
|
|
||||||
</div>
|
</div>
|
||||||
|
<p ng-show="model.needBytes > 0">Need {{model.needFiles | alwaysNumber}} files, {{model.needBytes | binary}}B</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-6">
|
||||||
<div class="panel panel-info">
|
<div class="panel panel-info">
|
||||||
<div class="panel-heading"><h3 class="panel-title">Cluster</h3></div>
|
<div class="panel-heading"><h3 class="panel-title">System</h3></div>
|
||||||
<table class="table table-condensed">
|
<div class="panel-body">
|
||||||
<tbody>
|
<p>{{system.sys | binary}}B RAM allocated, {{system.alloc | binary}}B in use</p>
|
||||||
<!-- myself -->
|
<p>{{system.cpuPercent | alwaysNumber | natural:1}}% CPU, {{system.goroutines | alwaysNumber}} goroutines</p>
|
||||||
<tr class="text-muted" ng-repeat="nodeCfg in thisNode()">
|
|
||||||
<td style="width:13%" class="text-center">
|
|
||||||
<span class="label label-default">
|
|
||||||
<span class="glyphicon glyphicon-ok"></span> This node
|
|
||||||
</span>
|
|
||||||
</td>
|
|
||||||
<td style="width:12%">
|
|
||||||
<span class="text-monospace">{{nodeName(nodeCfg)}}</span>
|
|
||||||
</td>
|
|
||||||
<td style="width:20%">{{version}}</td>
|
|
||||||
<td style="width:25%">(this node)</td>
|
|
||||||
<td style="width:10%" class="text-right">
|
|
||||||
{{inbps | metric}}bps
|
|
||||||
<span class="text-muted glyphicon glyphicon-chevron-down"></span>
|
|
||||||
</td>
|
|
||||||
<td style="width:10%" class="text-right">
|
|
||||||
{{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>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<!-- all other nodes -->
|
|
||||||
<tr ng-repeat="nodeCfg in otherNodes()">
|
|
||||||
<td class="text-center">
|
|
||||||
<span class="label label-{{nodeClass(nodeCfg)}}">
|
|
||||||
<span class="glyphicon glyphicon-{{nodeIcon(nodeCfg)}}"></span> {{nodeStatus(nodeCfg)}}
|
|
||||||
</span>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<span class="text-monospace">{{nodeName(nodeCfg)}}</span>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
{{nodeVer(nodeCfg)}}
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
{{nodeAddr(nodeCfg)}}
|
|
||||||
</td>
|
|
||||||
<td class="text-right">
|
|
||||||
<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">
|
|
||||||
<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 type="button" ng-click="editNode(nodeCfg)" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-pencil"></span> Edit</button>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td></td>
|
|
||||||
<td></td>
|
|
||||||
<td></td>
|
|
||||||
<td></td>
|
|
||||||
<td></td>
|
|
||||||
<td></td>
|
|
||||||
<td class="text-right">
|
|
||||||
<button type="button" class="btn btn-default btn-xs" ng-click="addNode()"><span class="glyphicon glyphicon-plus"></span> Add</button>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
<div class="row">
|
<div class="panel panel-info">
|
||||||
<div class="col-md-6">
|
<div class="panel-heading"><h3 class="panel-title"><a href="" data-toggle="collapse" data-target="#settingsTable">Settings</a></h3></div>
|
||||||
<div class="panel panel-info">
|
<div id="settingsTable" class="panel-collapse collapse">
|
||||||
<div class="panel-heading"><h3 class="panel-title">Repository</h3></div>
|
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<p>Cluster contains {{model.globalFiles | alwaysNumber}} files, {{model.globalBytes | binary}}B
|
<form role="form">
|
||||||
<span class="text-muted">(+{{model.globalDeleted | alwaysNumber}} delete records)</span></p>
|
<div class="form-group" ng-repeat="setting in settings">
|
||||||
|
<div ng-if="setting.type == 'text' || setting.type == 'number'">
|
||||||
<p>Local repository has {{model.localFiles | alwaysNumber}} files, {{model.localBytes | binary}}B
|
<label for="{{setting.id}}">{{setting.descr}}</label>
|
||||||
<span class="text-muted">(+{{model.localDeleted | alwaysNumber}} delete records)</span></p>
|
<input id="{{setting.id}}" class="form-control" type="{{setting.type}}" ng-model="config.Options[setting.id]"></input>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-md-6">
|
|
||||||
<div class="panel panel-info">
|
|
||||||
<div class="panel-heading"><h3 class="panel-title">System</h3></div>
|
|
||||||
<div class="panel-body">
|
|
||||||
<p>{{system.sys | binary}}B RAM allocated, {{system.alloc | binary}}B in use</p>
|
|
||||||
<p>{{system.cpuPercent | alwaysNumber | natural:1}}% CPU, {{system.goroutines | alwaysNumber}} goroutines</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-6">
|
|
||||||
<div class="panel panel-info">
|
|
||||||
<div class="panel-heading"><h3 class="panel-title"><a href="" data-toggle="collapse" data-target="#settingsTable">Settings</a></h3></div>
|
|
||||||
<div id="settingsTable" class="panel-collapse collapse">
|
|
||||||
<div class="panel-body">
|
|
||||||
<form role="form">
|
|
||||||
<div class="form-group" ng-repeat="setting in settings">
|
|
||||||
<div ng-if="setting.type == 'string'">
|
|
||||||
<label for="{{setting.id}}">{{setting.descr}}</label>
|
|
||||||
<input id="{{setting.id}}" class="form-control" type="text" ng-model="config.Options[setting.id]"></input>
|
|
||||||
</div>
|
|
||||||
<div class="checkbox" ng-if="setting.type == 'bool'">
|
|
||||||
<label>
|
|
||||||
{{setting.descr}} <input id="{{setting.id}}" type="checkbox" ng-model="config.Options[setting.id]"></input>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
<div class="checkbox" ng-if="setting.type == 'bool'">
|
||||||
</div>
|
<label>
|
||||||
<div class="panel-footer">
|
{{setting.descr}} <input id="{{setting.id}}" type="checkbox" ng-model="config.Options[setting.id]"></input>
|
||||||
<button type="button" class="btn btn-sm btn-default" ng-click="saveSettings()">Save</button>
|
</label>
|
||||||
<small><span class="text-muted">Changes take effect when restarting syncthing.</span></small>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div class="panel-footer">
|
||||||
|
<button type="button" class="btn btn-sm btn-default" ng-click="saveSettings()">Save</button>
|
||||||
|
<small><span class="text-muted">Changes take effect when restarting syncthing.</span></small>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="footer" class="text-center">
|
|
||||||
syncthing {{version}}
|
<div class="navbar navbar-default navbar-fixed-bottom">
|
||||||
| <a href="https://github.com/calmh/syncthing/releases">Latest Release</a>
|
<div class="container">
|
||||||
| <a href="https://github.com/calmh/syncthing/wiki">Documentation</a>
|
<p class="navbar-text">{{version}}</p>
|
||||||
| <a href="https://github.com/calmh/syncthing/issues">Bugs</a>
|
<ul class="nav navbar-nav navbar-right">
|
||||||
| <a href="https://github.com/calmh/syncthing">Source Code</a>
|
<li><a class="navbar-link" href="https://github.com/calmh/syncthing/releases">Latest Release</a></li>
|
||||||
|
<li><a class="navbar-link" href="https://github.com/calmh/syncthing/wiki">Documentation</a></li>
|
||||||
|
<li><a class="navbar-link" href="https://github.com/calmh/syncthing/issues">Bugs</a></li>
|
||||||
|
<li><a class="navbar-link" href="https://github.com/calmh/syncthing">Source Code</a></li>
|
||||||
|
</ul>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="networkError" class="modal fade">
|
<div id="networkError" class="modal fade">
|
||||||
|
|||||||
@@ -32,11 +32,12 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
showVersion bool
|
showVersion bool
|
||||||
confDir string
|
confDir string
|
||||||
trace string
|
trace string
|
||||||
profiler string
|
profiler string
|
||||||
verbose bool
|
verbose bool
|
||||||
|
startupDelay int
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -48,9 +49,14 @@ func main() {
|
|||||||
flag.StringVar(&profiler, "debug.profiler", "", "(addr)")
|
flag.StringVar(&profiler, "debug.profiler", "", "(addr)")
|
||||||
flag.BoolVar(&showVersion, "version", false, "Show version")
|
flag.BoolVar(&showVersion, "version", false, "Show version")
|
||||||
flag.BoolVar(&verbose, "v", false, "Be more verbose")
|
flag.BoolVar(&verbose, "v", false, "Be more verbose")
|
||||||
|
flag.IntVar(&startupDelay, "delay", 0, "Startup delay (s)")
|
||||||
flag.Usage = usageFor(flag.CommandLine, "syncthing [options]")
|
flag.Usage = usageFor(flag.CommandLine, "syncthing [options]")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
|
if startupDelay > 0 {
|
||||||
|
time.Sleep(time.Duration(startupDelay) * time.Second)
|
||||||
|
}
|
||||||
|
|
||||||
if showVersion {
|
if showVersion {
|
||||||
fmt.Println(Version)
|
fmt.Println(Version)
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
@@ -264,6 +270,30 @@ func main() {
|
|||||||
select {}
|
select {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func restart() {
|
||||||
|
infoln("Restarting")
|
||||||
|
args := os.Args
|
||||||
|
doAppend := true
|
||||||
|
for _, arg := range args {
|
||||||
|
if arg == "-delay" {
|
||||||
|
doAppend = false
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if doAppend {
|
||||||
|
args = append(args, "-delay", "2")
|
||||||
|
}
|
||||||
|
proc, err := os.StartProcess(os.Args[0], args, &os.ProcAttr{
|
||||||
|
Env: os.Environ(),
|
||||||
|
Files: []*os.File{os.Stdin, os.Stdout, os.Stderr},
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
fatalln(err)
|
||||||
|
}
|
||||||
|
proc.Release()
|
||||||
|
os.Exit(0)
|
||||||
|
}
|
||||||
|
|
||||||
var saveConfigCh = make(chan struct{})
|
var saveConfigCh = make(chan struct{})
|
||||||
|
|
||||||
func saveConfigLoop(cfgFile string) {
|
func saveConfigLoop(cfgFile string) {
|
||||||
|
|||||||
Reference in new issue
Block a user