Lines Matching full:scope
13 '$scope', '$window', 'APIUtils', 'dataService', '$location',
16 $scope, $window, APIUtils, dataService, $location, $anchorScroll, argument
18 $scope.dataService = dataService;
21 $scope.gotoAnchor = function() {
26 $scope.firmwares = [];
27 $scope.bmcActiveVersion = '';
28 $scope.hostActiveVersion = '';
29 $scope.activate_confirm = false;
30 $scope.delete_image_id = '';
31 $scope.delete_image_version = '';
32 $scope.activate_image_id = '';
33 $scope.activate_image_version = '';
34 $scope.activate_image_type = '';
35 $scope.priority_image_id = '';
36 $scope.priority_image_version = '';
37 $scope.priority_from = -1;
38 $scope.priority_to = -1;
39 $scope.confirm_priority = false;
40 $scope.file_empty = true;
41 $scope.uploading = false;
42 $scope.activate = {reboot: true};
47 $scope.error = {modal_title: '', title: '', desc: '', type: 'warning'};
49 $scope.activateImage = function(imageId, imageVersion, imageType) {
50 $scope.activate_image_id = imageId;
51 $scope.activate_image_version = imageVersion;
52 $scope.activate_image_type = imageType;
53 $scope.activate_confirm = true;
95 $scope.activateConfirmed = function() {
96 APIUtils.activateImage($scope.activate_image_id)
99 $scope.loadFirmwares();
107 waitForActive($scope.activate_image_id)
110 $scope.loadFirmwares();
117 if ($scope.activate.reboot &&
118 ($scope.activate_image_type == 'BMC')) {
128 if ($scope.activate.reboot &&
129 ($scope.activate_image_type == 'Host')) {
133 if ($scope.isServerOff()) {
141 $scope.activate_confirm = false;
158 $scope.uploading = true;
173 $scope.isServerOff = function() {
177 $scope.upload = function() {
178 if ($scope.file) {
179 $scope.uploading = true;
180 APIUtils.uploadImage($scope.file)
183 $scope.uploading = false;
185 'Image file "' + $scope.file.name +
187 $scope.file = '';
188 $scope.loadFirmwares();
191 $scope.uploading = false;
217 if (response.data.length === $scope.firmwares.length + 1) {
233 $scope.download = function() {
234 if (!$scope.download_host || !$scope.download_filename) {
240 $scope.downloading = true;
243 $scope.firmwares = response.data;
247 .downloadImage($scope.download_host, $scope.download_filename)
257 $scope.download_host = '';
258 $scope.download_filename = '';
259 $scope.downloading = false;
261 $scope.loadFirmwares();
266 'Image file from TFTP server "' + $scope.download_host +
268 $scope.downloading = false;
272 $scope.changePriority = function(imageId, imageVersion, from, to) {
273 $scope.priority_image_id = imageId;
274 $scope.priority_image_version = imageVersion;
275 $scope.priority_from = from;
276 $scope.priority_to = to;
277 $scope.confirm_priority = true;
280 $scope.confirmChangePriority = function() {
281 $scope.loading = true;
282 APIUtils.changePriority($scope.priority_image_id, $scope.priority_to)
284 $scope.loading = false;
288 $scope.loadFirmwares();
291 $scope.confirm_priority = false;
293 $scope.deleteImage = function(imageId, imageVersion) {
294 $scope.delete_image_id = imageId;
295 $scope.delete_image_version = imageVersion;
296 $scope.confirm_delete = true;
298 $scope.confirmDeleteImage = function() {
299 $scope.loading = true;
300 APIUtils.deleteImage($scope.delete_image_id).then(function(response) {
301 $scope.loading = false;
305 $scope.loadFirmwares();
308 $scope.confirm_delete = false;
311 $scope.filters = {bmc: {imageType: 'BMC'}, host: {imageType: 'Host'}};
313 $scope.loadFirmwares = function() {
315 $scope.firmwares = result.data;
316 $scope.bmcActiveVersion = result.bmcActiveVersion;
317 $scope.hostActiveVersion = result.hostActiveVersion;
321 $scope.loadFirmwares();