mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-31 22:11:51 +00:00
Merge pull request #1619 from calmh/gui-version
GUI version string includes OS and Arch
This commit is contained in:
commit
ef7ce6c7e1
@ -326,7 +326,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th><span class="glyphicon glyphicon-tag"></span> <span translate>Version</span></th>
|
||||
<td class="text-right">{{version}}</td>
|
||||
<td class="text-right">{{versionString()}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -39,6 +39,7 @@ angular.module('syncthing.core')
|
||||
$scope.deviceStats = {};
|
||||
$scope.folderStats = {};
|
||||
$scope.progress = {};
|
||||
$scope.version = {};
|
||||
|
||||
$(window).bind('beforeunload', function () {
|
||||
navigatingAway = true;
|
||||
@ -75,7 +76,7 @@ angular.module('syncthing.core')
|
||||
refreshFolderStats();
|
||||
|
||||
$http.get(urlbase + '/system/version').success(function (data) {
|
||||
$scope.version = data.version;
|
||||
$scope.version = data;
|
||||
}).error($scope.emitHTTPError);
|
||||
|
||||
$http.get(urlbase + '/svc/report').success(function (data) {
|
||||
@ -1212,6 +1213,30 @@ angular.module('syncthing.core')
|
||||
}).error($scope.emitHTTPError);
|
||||
};
|
||||
|
||||
$scope.versionString = function () {
|
||||
if (!$scope.version.version) {
|
||||
return '';
|
||||
}
|
||||
|
||||
var os = {
|
||||
'darwin': 'Mac OS X',
|
||||
'dragonfly': 'DragonFly BSD',
|
||||
'freebsd': 'FreeBSD',
|
||||
'openbsd': 'OpenBSD',
|
||||
'netbsd': 'NetBSD',
|
||||
'linux': 'Linux',
|
||||
'windows': 'Windows',
|
||||
'solaris': 'Solaris',
|
||||
}[$scope.version.os];
|
||||
|
||||
var arch ={
|
||||
'386': '32 bit',
|
||||
'amd64': '64 bit',
|
||||
}[$scope.version.arch];
|
||||
|
||||
return $scope.version.version + ', ' + os + ' (' + arch + ')';
|
||||
};
|
||||
|
||||
// pseudo main. called on all definitions assigned
|
||||
initController();
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user