cmd/syncthing: Refactor out staticsServer (prev. embeddedStatic) a bit

The purpose of this operation is to separate the serving of GUI assets a
bit from the serving of the REST API. It's by no means complete. The end
goal is something like a combined server type that embeds a statics
server and an API server and wraps it in authentication and HTTPS and
stuff, plus possibly a named pipe server that only provides the API and
does not wrap in the same authentication etc.

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3273
This commit is contained in:
Jakob Borg
2016-06-07 07:46:45 +00:00
committed by Audrius Butkevicius
parent b7e186b370
commit 03a8027efc
5 changed files with 195 additions and 171 deletions

View File

@@ -49,6 +49,7 @@ angular.module('syncthing.core')
$scope.failedCurrentFolder = undefined;
$scope.failedPageSize = 10;
$scope.scanProgress = {};
$scope.themes = [];
$scope.localStateTotal = {
bytes: 0,
@@ -88,6 +89,7 @@ angular.module('syncthing.core')
refreshConnectionStats();
refreshDeviceStats();
refreshFolderStats();
refreshThemes();
$http.get(urlbase + '/system/version').success(function (data) {
if ($scope.version.version && $scope.version.version !== data.version) {
@@ -599,6 +601,12 @@ angular.module('syncthing.core')
}).error($scope.emitHTTPError);
}, 2500);
var refreshThemes = debounce(function () {
$http.get("themes.json").success(function (data) { // no urlbase here as this is served by the asset handler
$scope.themes = data.themes;
}).error($scope.emitHTTPError);
}, 2500);
$scope.refresh = function () {
refreshSystem();
refreshConnectionStats();
@@ -627,7 +635,7 @@ angular.module('syncthing.core')
return 'outofsync';
}
if (state === 'scanning') {
return state;
return state;
}
if (folderCfg.devices.length <= 1) {