1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-04 05:15:25 +02:00

style(extensions): minor update to extension UX/UI (#2538)

* style(extensions): update extension icons

* style(extensions): style update

* feat(extensions): update extension UX

* style(extensions): update extension style

* style(extension-details): update screenshot default size

* style(extensions): update overview diagram image

* refactor(support): fix support URLs
This commit is contained in:
Anthony Lapenna 2018-12-12 10:28:21 +13:00 committed by GitHub
parent f222b3cb1a
commit 5c2e714e69
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 159 additions and 83 deletions

View file

@ -1,58 +1,59 @@
angular.module('portainer.app')
.controller('ExtensionsController', ['$scope', '$state', 'ExtensionService', 'Notifications',
function ($scope, $state, ExtensionService, Notifications) {
.controller('ExtensionsController', ['$scope', '$state', 'ExtensionService', 'Notifications',
function($scope, $state, ExtensionService, Notifications) {
$scope.state = {
actionInProgress: false,
currentDate: moment().format('YYYY-MM-dd')
};
$scope.state = {
actionInProgress: false,
currentDate: moment().format('YYYY-MM-dd')
};
$scope.formValues = {
License: ''
};
$scope.formValues = {
License: ''
};
function initView() {
ExtensionService.extensions(true)
.then(function onSuccess(data) {
$scope.extensions = data;
})
.catch(function onError(err) {
Notifications.error('Failure', err, 'Unable to access extension store');
});
}
function initView() {
ExtensionService.extensions(true)
.then(function onSuccess(data) {
$scope.extensions = data;
})
.catch(function onError(err) {
$scope.extensions = [];
Notifications.error('Failure', err, 'Unable to access extension store');
});
}
$scope.enableExtension = function() {
var license = $scope.formValues.License;
$scope.enableExtension = function() {
var license = $scope.formValues.License;
$scope.state.actionInProgress = true;
ExtensionService.enable(license)
.then(function onSuccess() {
Notifications.success('Extension successfully enabled');
$state.reload();
})
.catch(function onError(err) {
Notifications.error('Failure', err, 'Unable to enable extension');
})
.finally(function final() {
$scope.state.actionInProgress = false;
});
};
$scope.state.actionInProgress = true;
ExtensionService.enable(license)
.then(function onSuccess() {
Notifications.success('Extension successfully enabled');
$state.reload();
})
.catch(function onError(err) {
Notifications.error('Failure', err, 'Unable to enable extension');
})
.finally(function final() {
$scope.state.actionInProgress = false;
});
};
$scope.isValidLicenseFormat = function(form) {
var valid = true;
$scope.isValidLicenseFormat = function(form) {
var valid = true;
if (!$scope.formValues.License) {
return;
}
if (!$scope.formValues.License) {
return;
}
if (isNaN($scope.formValues.License[0])) {
valid = false;
}
if (isNaN($scope.formValues.License[0])) {
valid = false;
}
form.extension_license.$setValidity('invalidLicense', valid);
};
form.extension_license.$setValidity('invalidLicense', valid);
};
initView();
}]);
initView();
}]);