define(function () { app.registerController('AdminCtrl', ['$scope', '$http', '$sce', '$uibModal', '$rootScope', function ($scope, $http, $sce, $modal, $rootScope) { $scope.upgrade = JSON.parse(JSON.stringify($scope.semaphore)); if ($scope.upgrade && $scope.upgrade.updateBody) { $scope.upgrade.updateBody = $sce.trustAsHtml($scope.upgrade.updateBody); } $scope.checkUpdate = function () { $http.get('/upgrade').success(function (upgrade) { if (!upgrade) return; if (upgrade.updateBody) { upgrade.updateBody = $sce.trustAsHtml(upgrade.updateBody); } $scope.upgrade = upgrade; }); } $scope.doUpgrade = function () { var upgradeModal = $modal.open({ template: '
Server has upgraded. It was automatically stopped, if it isn\'t restarted automatically by a process manager please log in and start semaphore again.