-
-
Notifications
You must be signed in to change notification settings - Fork 82
/
Copy pathhydra-updates.js
48 lines (39 loc) · 1.73 KB
/
hydra-updates.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
angular
.module('nzbhydraApp')
.directive('hydraupdates', hydraupdates);
function hydraupdates() {
return {
templateUrl: 'static/html/directives/updates.html',
controller: controller
};
function controller($scope, UpdateService) {
$scope.loadingPromise = UpdateService.getInfos().then(function (response) {
$scope.currentVersion = response.data.currentVersion;
$scope.latestVersion = response.data.latestVersion;
$scope.latestVersionIsBeta = response.data.latestVersionIsBeta;
$scope.betaVersion = response.data.betaVersion;
$scope.updateAvailable = response.data.updateAvailable;
$scope.betaUpdateAvailable = response.data.betaUpdateAvailable;
$scope.latestVersionIgnored = response.data.latestVersionIgnored;
$scope.changelog = response.data.changelog;
$scope.updatedExternally = response.data.updatedExternally;
$scope.wrapperOutdated = response.data.wrapperOutdated;
$scope.showUpdateBannerOnUpdatedExternally = response.data.showUpdateBannerOnUpdatedExternally;
if ($scope.updatedExternally && !$scope.showUpdateBannerOnUpdatedExternally) {
$scope.updateAvailable = false;
}
});
UpdateService.getVersionHistory().then(function (response) {
$scope.versionHistory = response.data;
});
$scope.update = function (version) {
UpdateService.update(version);
};
$scope.showChangelog = function (version) {
UpdateService.showChanges(version);
};
$scope.forceUpdate = function () {
UpdateService.update($scope.latestVersion)
};
}
}