mirror of https://github.com/portainer/portainer
* chore(eslint): update esllint and remove unused variables
* chore(eslint-config): change no-unused-vars to warn * chore(eslint): remove unused variables * chore(eslint): allow unused globals * fixup! chore(eslint): allow unused globals * chore(eslint): remove commented unused vars * fixup! chore(eslint): remove commented unused varspull/2210/head
parent
46da95ecfb
commit
e58acd7dd6
|
@ -141,7 +141,10 @@ rules:
|
||||||
no-undef-init: error
|
no-undef-init: error
|
||||||
no-undef: off
|
no-undef: off
|
||||||
no-undefined: off
|
no-undefined: off
|
||||||
no-unused-vars: off
|
no-unused-vars:
|
||||||
|
- warn
|
||||||
|
-
|
||||||
|
vars: local
|
||||||
no-use-before-define: off
|
no-use-before-define: off
|
||||||
|
|
||||||
# Node.js and CommonJS
|
# Node.js and CommonJS
|
||||||
|
|
|
@ -48,7 +48,7 @@ function initAnalytics(Analytics, $rootScope) {
|
||||||
Analytics.offline(false);
|
Analytics.offline(false);
|
||||||
Analytics.registerScriptTags();
|
Analytics.registerScriptTags();
|
||||||
Analytics.registerTrackers();
|
Analytics.registerTrackers();
|
||||||
$rootScope.$on('$stateChangeSuccess', function (event, toState, toParams, fromState, fromParams) {
|
$rootScope.$on('$stateChangeSuccess', function (event, toState) {
|
||||||
Analytics.trackPage(toState.url);
|
Analytics.trackPage(toState.url);
|
||||||
Analytics.pageView();
|
Analytics.pageView();
|
||||||
});
|
});
|
||||||
|
|
|
@ -15,7 +15,7 @@ function ContainerGroupDefaultModel() {
|
||||||
this.Memory = 1;
|
this.Memory = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
function ContainerGroupViewModel(data, subscriptionId, resourceGroupName) {
|
function ContainerGroupViewModel(data) {
|
||||||
this.Id = data.id;
|
this.Id = data.id;
|
||||||
this.Name = data.name;
|
this.Name = data.name;
|
||||||
this.Location = data.location;
|
this.Location = data.location;
|
||||||
|
|
|
@ -30,7 +30,7 @@ function AzureServiceFactory($q, Azure, SubscriptionService, ResourceGroupServic
|
||||||
|
|
||||||
service.aggregate = function(resourcesBySubcription) {
|
service.aggregate = function(resourcesBySubcription) {
|
||||||
var aggregatedResources = [];
|
var aggregatedResources = [];
|
||||||
Object.keys(resourcesBySubcription).forEach(function(key, index) {
|
Object.keys(resourcesBySubcription).forEach(function(key) {
|
||||||
aggregatedResources = aggregatedResources.concat(resourcesBySubcription[key]);
|
aggregatedResources = aggregatedResources.concat(resourcesBySubcription[key]);
|
||||||
});
|
});
|
||||||
return aggregatedResources;
|
return aggregatedResources;
|
||||||
|
|
|
@ -31,7 +31,7 @@ function ($q, $scope, $state, AzureService, Notifications) {
|
||||||
|
|
||||||
$scope.state.actionInProgress = true;
|
$scope.state.actionInProgress = true;
|
||||||
AzureService.createContainerGroup(model, subscriptionId, resourceGroupName)
|
AzureService.createContainerGroup(model, subscriptionId, resourceGroupName)
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
Notifications.success('Container successfully created', model.Name);
|
Notifications.success('Container successfully created', model.Name);
|
||||||
$state.go('azure.containerinstances');
|
$state.go('azure.containerinstances');
|
||||||
})
|
})
|
||||||
|
|
|
@ -141,7 +141,7 @@ function (PaginationService, DatatableService, EndpointProvider) {
|
||||||
PaginationService.setPaginationLimit(this.tableKey, this.state.paginatedItemLimit);
|
PaginationService.setPaginationLimit(this.tableKey, this.state.paginatedItemLimit);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.applyFilters = function(value, index, array) {
|
this.applyFilters = function(value) {
|
||||||
var container = value;
|
var container = value;
|
||||||
var filters = ctrl.filters;
|
var filters = ctrl.filters;
|
||||||
for (var i = 0; i < filters.state.values.length; i++) {
|
for (var i = 0; i < filters.state.values.length; i++) {
|
||||||
|
|
|
@ -52,7 +52,7 @@ function (PaginationService, DatatableService) {
|
||||||
PaginationService.setPaginationLimit(this.tableKey, this.state.paginatedItemLimit);
|
PaginationService.setPaginationLimit(this.tableKey, this.state.paginatedItemLimit);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.applyFilters = function(value, index, array) {
|
this.applyFilters = function(value) {
|
||||||
var image = value;
|
var image = value;
|
||||||
var filters = ctrl.filters;
|
var filters = ctrl.filters;
|
||||||
if ((image.ContainerCount === 0 && filters.usage.showUnusedImages)
|
if ((image.ContainerCount === 0 && filters.usage.showUnusedImages)
|
||||||
|
|
|
@ -15,7 +15,7 @@ function (DatatableService) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
this.applyFilters = function(item, index, array) {
|
this.applyFilters = function(item) {
|
||||||
var filters = ctrl.filters;
|
var filters = ctrl.filters;
|
||||||
for (var i = 0; i < filters.state.values.length; i++) {
|
for (var i = 0; i < filters.state.values.length; i++) {
|
||||||
var filter = filters.state.values[i];
|
var filter = filters.state.values[i];
|
||||||
|
|
|
@ -6,7 +6,7 @@ function ($state, ServiceService, ServiceHelper, Notifications, ModalService, Im
|
||||||
var config = ServiceHelper.serviceToConfig(service.Model);
|
var config = ServiceHelper.serviceToConfig(service.Model);
|
||||||
config.Mode.Replicated.Replicas = service.Replicas;
|
config.Mode.Replicated.Replicas = service.Replicas;
|
||||||
ServiceService.update(service, config)
|
ServiceService.update(service, config)
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
Notifications.success('Service successfully scaled', 'New replica count: ' + service.Replicas);
|
Notifications.success('Service successfully scaled', 'New replica count: ' + service.Replicas);
|
||||||
$state.reload();
|
$state.reload();
|
||||||
})
|
})
|
||||||
|
@ -53,7 +53,7 @@ function ($state, ServiceService, ServiceHelper, Notifications, ModalService, Im
|
||||||
// value or an increment of the counter value to force an update.
|
// value or an increment of the counter value to force an update.
|
||||||
config.TaskTemplate.ForceUpdate++;
|
config.TaskTemplate.ForceUpdate++;
|
||||||
ServiceService.update(service, config)
|
ServiceService.update(service, config)
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
Notifications.success('Service successfully updated', service.Name);
|
Notifications.success('Service successfully updated', service.Name);
|
||||||
})
|
})
|
||||||
.catch(function error(err) {
|
.catch(function error(err) {
|
||||||
|
|
|
@ -52,7 +52,7 @@ function (PaginationService, DatatableService) {
|
||||||
PaginationService.setPaginationLimit(this.tableKey, this.state.paginatedItemLimit);
|
PaginationService.setPaginationLimit(this.tableKey, this.state.paginatedItemLimit);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.applyFilters = function(value, index, array) {
|
this.applyFilters = function(value) {
|
||||||
var volume = value;
|
var volume = value;
|
||||||
var filters = ctrl.filters;
|
var filters = ctrl.filters;
|
||||||
if ((volume.dangling && filters.usage.showUnusedVolumes)
|
if ((volume.dangling && filters.usage.showUnusedVolumes)
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
angular.module('portainer.docker')
|
angular.module('portainer.docker')
|
||||||
.controller('LogViewerController', ['clipboard',
|
.controller('LogViewerController', ['clipboard',
|
||||||
function (clipboard) {
|
function (clipboard) {
|
||||||
var ctrl = this;
|
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
copySupported: clipboard.supported,
|
copySupported: clipboard.supported,
|
||||||
|
|
|
@ -35,12 +35,6 @@ angular.module('portainer.docker')
|
||||||
for (var v in container.Mounts) {
|
for (var v in container.Mounts) {
|
||||||
if ({}.hasOwnProperty.call(container.Mounts, v)) {
|
if ({}.hasOwnProperty.call(container.Mounts, v)) {
|
||||||
var mount = container.Mounts[v];
|
var mount = container.Mounts[v];
|
||||||
var volume = {
|
|
||||||
'type': mount.Type,
|
|
||||||
'name': mount.Name || mount.Source,
|
|
||||||
'containerPath': mount.Destination,
|
|
||||||
'readOnly': mount.RW === false
|
|
||||||
};
|
|
||||||
var name = mount.Name || mount.Source;
|
var name = mount.Name || mount.Source;
|
||||||
var containerPath = mount.Destination;
|
var containerPath = mount.Destination;
|
||||||
if (name && containerPath) {
|
if (name && containerPath) {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
function ServiceViewModel(data, runningTasks, allTasks, nodes) {
|
function ServiceViewModel(data, runningTasks, allTasks) {
|
||||||
this.Model = data;
|
this.Model = data;
|
||||||
this.Id = data.ID;
|
this.Id = data.ID;
|
||||||
this.Tasks = [];
|
this.Tasks = [];
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
angular.module('portainer.docker')
|
angular.module('portainer.docker')
|
||||||
.factory('VolumeService', ['$q', 'Volume', 'VolumeHelper', 'ResourceControlService', 'UserService', 'TeamService', function VolumeServiceFactory($q, Volume, VolumeHelper, ResourceControlService, UserService, TeamService) {
|
.factory('VolumeService', ['$q', 'Volume', 'VolumeHelper', 'ResourceControlService', function VolumeServiceFactory($q, Volume, VolumeHelper, ResourceControlService) {
|
||||||
'use strict';
|
'use strict';
|
||||||
var service = {};
|
var service = {};
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ function ($scope, $transition$, $state, ConfigService, Notifications) {
|
||||||
|
|
||||||
$scope.removeConfig = function removeConfig(configId) {
|
$scope.removeConfig = function removeConfig(configId) {
|
||||||
ConfigService.remove(configId)
|
ConfigService.remove(configId)
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
Notifications.success('Config successfully removed');
|
Notifications.success('Config successfully removed');
|
||||||
$state.go('docker.configs', {});
|
$state.go('docker.configs', {});
|
||||||
})
|
})
|
||||||
|
|
|
@ -12,7 +12,7 @@ function ($scope, $transition$, ContainerService, ImageService, EndpointProvider
|
||||||
$scope.containerCommands = [];
|
$scope.containerCommands = [];
|
||||||
|
|
||||||
// Ensure the socket is closed before leaving the view
|
// Ensure the socket is closed before leaving the view
|
||||||
$scope.$on('$stateChangeStart', function (event, next, current) {
|
$scope.$on('$stateChangeStart', function () {
|
||||||
if (socket && socket !== null) {
|
if (socket && socket !== null) {
|
||||||
socket.close();
|
socket.close();
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,7 @@ function ($scope, $transition$, ContainerService, ImageService, EndpointProvider
|
||||||
socket = new WebSocket(url);
|
socket = new WebSocket(url);
|
||||||
|
|
||||||
$scope.state.connected = true;
|
$scope.state.connected = true;
|
||||||
socket.onopen = function(evt) {
|
socket.onopen = function() {
|
||||||
term = new Terminal();
|
term = new Terminal();
|
||||||
|
|
||||||
term.on('data', function (data) {
|
term.on('data', function (data) {
|
||||||
|
@ -88,10 +88,10 @@ function ($scope, $transition$, ContainerService, ImageService, EndpointProvider
|
||||||
socket.onmessage = function (e) {
|
socket.onmessage = function (e) {
|
||||||
term.write(e.data);
|
term.write(e.data);
|
||||||
};
|
};
|
||||||
socket.onerror = function (error) {
|
socket.onerror = function () {
|
||||||
$scope.state.connected = false;
|
$scope.state.connected = false;
|
||||||
};
|
};
|
||||||
socket.onclose = function(evt) {
|
socket.onclose = function() {
|
||||||
$scope.state.connected = false;
|
$scope.state.connected = false;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -283,7 +283,7 @@ function ($q, $scope, $state, $timeout, $transition$, $filter, Container, Contai
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function loadFromContainerCmd(d) {
|
function loadFromContainerCmd() {
|
||||||
if ($scope.config.Cmd) {
|
if ($scope.config.Cmd) {
|
||||||
$scope.config.Cmd = ContainerHelper.commandArrayToString($scope.config.Cmd);
|
$scope.config.Cmd = ContainerHelper.commandArrayToString($scope.config.Cmd);
|
||||||
} else {
|
} else {
|
||||||
|
@ -291,7 +291,7 @@ function ($q, $scope, $state, $timeout, $transition$, $filter, Container, Contai
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadFromContainerPortBindings(d) {
|
function loadFromContainerPortBindings() {
|
||||||
var bindings = [];
|
var bindings = [];
|
||||||
for (var p in $scope.config.HostConfig.PortBindings) {
|
for (var p in $scope.config.HostConfig.PortBindings) {
|
||||||
if ({}.hasOwnProperty.call($scope.config.HostConfig.PortBindings, p)) {
|
if ({}.hasOwnProperty.call($scope.config.HostConfig.PortBindings, p)) {
|
||||||
|
@ -386,7 +386,7 @@ function ($q, $scope, $state, $timeout, $transition$, $filter, Container, Contai
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadFromContainerEnvironmentVariables(d) {
|
function loadFromContainerEnvironmentVariables() {
|
||||||
var envArr = [];
|
var envArr = [];
|
||||||
for (var e in $scope.config.Env) {
|
for (var e in $scope.config.Env) {
|
||||||
if ({}.hasOwnProperty.call($scope.config.Env, e)) {
|
if ({}.hasOwnProperty.call($scope.config.Env, e)) {
|
||||||
|
@ -397,7 +397,7 @@ function ($q, $scope, $state, $timeout, $transition$, $filter, Container, Contai
|
||||||
$scope.config.Env = envArr;
|
$scope.config.Env = envArr;
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadFromContainerLabels(d) {
|
function loadFromContainerLabels() {
|
||||||
for (var l in $scope.config.Labels) {
|
for (var l in $scope.config.Labels) {
|
||||||
if ({}.hasOwnProperty.call($scope.config.Labels, l)) {
|
if ({}.hasOwnProperty.call($scope.config.Labels, l)) {
|
||||||
$scope.formValues.Labels.push({ name: l, value: $scope.config.Labels[l]});
|
$scope.formValues.Labels.push({ name: l, value: $scope.config.Labels[l]});
|
||||||
|
@ -405,7 +405,7 @@ function ($q, $scope, $state, $timeout, $transition$, $filter, Container, Contai
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadFromContainerConsole(d) {
|
function loadFromContainerConsole() {
|
||||||
if ($scope.config.OpenStdin && $scope.config.Tty) {
|
if ($scope.config.OpenStdin && $scope.config.Tty) {
|
||||||
$scope.formValues.Console = 'both';
|
$scope.formValues.Console = 'both';
|
||||||
} else if (!$scope.config.OpenStdin && $scope.config.Tty) {
|
} else if (!$scope.config.OpenStdin && $scope.config.Tty) {
|
||||||
|
@ -417,7 +417,7 @@ function ($q, $scope, $state, $timeout, $transition$, $filter, Container, Contai
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadFromContainerDevices(d) {
|
function loadFromContainerDevices() {
|
||||||
var path = [];
|
var path = [];
|
||||||
for (var dev in $scope.config.HostConfig.Devices) {
|
for (var dev in $scope.config.HostConfig.Devices) {
|
||||||
if ({}.hasOwnProperty.call($scope.config.HostConfig.Devices, dev)) {
|
if ({}.hasOwnProperty.call($scope.config.HostConfig.Devices, dev)) {
|
||||||
|
@ -428,7 +428,7 @@ function ($q, $scope, $state, $timeout, $transition$, $filter, Container, Contai
|
||||||
$scope.config.HostConfig.Devices = path;
|
$scope.config.HostConfig.Devices = path;
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadFromContainerImageConfig(d) {
|
function loadFromContainerImageConfig() {
|
||||||
var imageInfo = ImageHelper.extractImageAndRegistryFromRepository($scope.config.Image);
|
var imageInfo = ImageHelper.extractImageAndRegistryFromRepository($scope.config.Image);
|
||||||
RegistryService.retrieveRegistryFromRepository($scope.config.Image)
|
RegistryService.retrieveRegistryFromRepository($scope.config.Image)
|
||||||
.then(function success(data) {
|
.then(function success(data) {
|
||||||
|
|
|
@ -56,7 +56,7 @@ function ($q, $scope, $state, $transition$, $filter, Commit, ContainerHelper, Co
|
||||||
|
|
||||||
function executeContainerAction(id, action, successMessage, errorMessage) {
|
function executeContainerAction(id, action, successMessage, errorMessage) {
|
||||||
action(id)
|
action(id)
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
Notifications.success(successMessage, id);
|
Notifications.success(successMessage, id);
|
||||||
update();
|
update();
|
||||||
})
|
})
|
||||||
|
@ -104,7 +104,7 @@ function ($q, $scope, $state, $transition$, $filter, Commit, ContainerHelper, Co
|
||||||
$scope.renameContainer = function () {
|
$scope.renameContainer = function () {
|
||||||
var container = $scope.container;
|
var container = $scope.container;
|
||||||
ContainerService.renameContainer($transition$.params().id, container.newContainerName)
|
ContainerService.renameContainer($transition$.params().id, container.newContainerName)
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
container.Name = container.newContainerName;
|
container.Name = container.newContainerName;
|
||||||
Notifications.success('Container successfully renamed', container.Name);
|
Notifications.success('Container successfully renamed', container.Name);
|
||||||
})
|
})
|
||||||
|
@ -120,7 +120,7 @@ function ($q, $scope, $state, $transition$, $filter, Commit, ContainerHelper, Co
|
||||||
$scope.containerLeaveNetwork = function containerLeaveNetwork(container, networkId) {
|
$scope.containerLeaveNetwork = function containerLeaveNetwork(container, networkId) {
|
||||||
$scope.state.leaveNetworkInProgress = true;
|
$scope.state.leaveNetworkInProgress = true;
|
||||||
NetworkService.disconnectContainer(networkId, container.Id, false)
|
NetworkService.disconnectContainer(networkId, container.Id, false)
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
Notifications.success('Container left network', container.Id);
|
Notifications.success('Container left network', container.Id);
|
||||||
$state.reload();
|
$state.reload();
|
||||||
})
|
})
|
||||||
|
@ -135,7 +135,7 @@ function ($q, $scope, $state, $transition$, $filter, Commit, ContainerHelper, Co
|
||||||
$scope.containerJoinNetwork = function containerJoinNetwork(container, networkId) {
|
$scope.containerJoinNetwork = function containerJoinNetwork(container, networkId) {
|
||||||
$scope.state.joinNetworkInProgress = true;
|
$scope.state.joinNetworkInProgress = true;
|
||||||
NetworkService.connectContainer(networkId, container.Id)
|
NetworkService.connectContainer(networkId, container.Id)
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
Notifications.success('Container joined network', container.Id);
|
Notifications.success('Container joined network', container.Id);
|
||||||
$state.reload();
|
$state.reload();
|
||||||
})
|
})
|
||||||
|
@ -151,7 +151,7 @@ function ($q, $scope, $state, $transition$, $filter, Commit, ContainerHelper, Co
|
||||||
var image = $scope.config.Image;
|
var image = $scope.config.Image;
|
||||||
var registry = $scope.config.Registry;
|
var registry = $scope.config.Registry;
|
||||||
var imageConfig = ImageHelper.createImageConfigForCommit(image, registry.URL);
|
var imageConfig = ImageHelper.createImageConfigForCommit(image, registry.URL);
|
||||||
Commit.commitContainer({id: $transition$.params().id, tag: imageConfig.tag, repo: imageConfig.repo}, function (d) {
|
Commit.commitContainer({id: $transition$.params().id, tag: imageConfig.tag, repo: imageConfig.repo}, function () {
|
||||||
update();
|
update();
|
||||||
Notifications.success('Container commited', $transition$.params().id);
|
Notifications.success('Container commited', $transition$.params().id);
|
||||||
}, function (e) {
|
}, function (e) {
|
||||||
|
|
|
@ -27,10 +27,6 @@ function ($scope, $transition$, $interval, ContainerService, Notifications, Http
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function update(logs) {
|
|
||||||
$scope.logs = logs;
|
|
||||||
}
|
|
||||||
|
|
||||||
function setUpdateRepeater(skipHeaders) {
|
function setUpdateRepeater(skipHeaders) {
|
||||||
var refreshRate = $scope.state.refreshRate;
|
var refreshRate = $scope.state.refreshRate;
|
||||||
$scope.repeater = $interval(function() {
|
$scope.repeater = $interval(function() {
|
||||||
|
|
|
@ -29,7 +29,7 @@ function ($q, $scope, $transition$, $state, $timeout, ImageService, RegistryServ
|
||||||
var registry = $scope.formValues.Registry;
|
var registry = $scope.formValues.Registry;
|
||||||
|
|
||||||
ImageService.tagImage($transition$.params().id, image, registry.URL)
|
ImageService.tagImage($transition$.params().id, image, registry.URL)
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
Notifications.success('Image successfully tagged');
|
Notifications.success('Image successfully tagged');
|
||||||
$state.go('docker.images.image', {id: $transition$.params().id}, {reload: true});
|
$state.go('docker.images.image', {id: $transition$.params().id}, {reload: true});
|
||||||
})
|
})
|
||||||
|
@ -45,7 +45,7 @@ function ($q, $scope, $transition$, $state, $timeout, ImageService, RegistryServ
|
||||||
var registry = data;
|
var registry = data;
|
||||||
return ImageService.pushImage(repository, registry);
|
return ImageService.pushImage(repository, registry);
|
||||||
})
|
})
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
Notifications.success('Image successfully pushed', repository);
|
Notifications.success('Image successfully pushed', repository);
|
||||||
})
|
})
|
||||||
.catch(function error(err) {
|
.catch(function error(err) {
|
||||||
|
@ -63,7 +63,7 @@ function ($q, $scope, $transition$, $state, $timeout, ImageService, RegistryServ
|
||||||
var registry = data;
|
var registry = data;
|
||||||
return ImageService.pullImage(repository, registry, false);
|
return ImageService.pullImage(repository, registry, false);
|
||||||
})
|
})
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
Notifications.success('Image successfully pulled', repository);
|
Notifications.success('Image successfully pulled', repository);
|
||||||
})
|
})
|
||||||
.catch(function error(err) {
|
.catch(function error(err) {
|
||||||
|
|
|
@ -21,7 +21,7 @@ function ($scope, $state, ImageService, Notifications, ModalService, HttpRequest
|
||||||
|
|
||||||
$scope.state.actionInProgress = true;
|
$scope.state.actionInProgress = true;
|
||||||
ImageService.pullImage(image, registry, false)
|
ImageService.pullImage(image, registry, false)
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
Notifications.success('Image successfully pulled', image);
|
Notifications.success('Image successfully pulled', image);
|
||||||
$state.reload();
|
$state.reload();
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
angular.module('portainer.docker')
|
angular.module('portainer.docker')
|
||||||
.controller('NetworkController', ['$scope', '$state', '$transition$', '$filter', 'NetworkService', 'Container', 'ContainerHelper', 'Notifications', 'HttpRequestHelper',
|
.controller('NetworkController', ['$scope', '$state', '$transition$', '$filter', 'NetworkService', 'Container', 'Notifications', 'HttpRequestHelper',
|
||||||
function ($scope, $state, $transition$, $filter, NetworkService, Container, ContainerHelper, Notifications, HttpRequestHelper) {
|
function ($scope, $state, $transition$, $filter, NetworkService, Container, Notifications, HttpRequestHelper) {
|
||||||
|
|
||||||
$scope.removeNetwork = function removeNetwork(networkId) {
|
$scope.removeNetwork = function removeNetwork() {
|
||||||
NetworkService.remove($transition$.params().id, $transition$.params().id)
|
NetworkService.remove($transition$.params().id, $transition$.params().id)
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
Notifications.success('Network removed', $transition$.params().id);
|
Notifications.success('Network removed', $transition$.params().id);
|
||||||
$state.go('docker.networks', {});
|
$state.go('docker.networks', {});
|
||||||
})
|
})
|
||||||
|
@ -16,7 +16,7 @@ function ($scope, $state, $transition$, $filter, NetworkService, Container, Cont
|
||||||
$scope.containerLeaveNetwork = function containerLeaveNetwork(network, container) {
|
$scope.containerLeaveNetwork = function containerLeaveNetwork(network, container) {
|
||||||
HttpRequestHelper.setPortainerAgentTargetHeader(container.NodeName);
|
HttpRequestHelper.setPortainerAgentTargetHeader(container.NodeName);
|
||||||
NetworkService.disconnectContainer($transition$.params().id, container.Id, false)
|
NetworkService.disconnectContainer($transition$.params().id, container.Id, false)
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
Notifications.success('Container left network', $transition$.params().id);
|
Notifications.success('Container left network', $transition$.params().id);
|
||||||
$state.go('docker.networks.network', { id: network.Id }, { reload: true });
|
$state.go('docker.networks.network', { id: network.Id }, { reload: true });
|
||||||
})
|
})
|
||||||
|
|
|
@ -52,7 +52,7 @@ function ($scope, $state, $transition$, LabelHelper, Node, NodeHelper, Task, Not
|
||||||
config.Role = node.Role;
|
config.Role = node.Role;
|
||||||
config.Labels = LabelHelper.fromKeyValueToLabelHash(node.Labels);
|
config.Labels = LabelHelper.fromKeyValueToLabelHash(node.Labels);
|
||||||
|
|
||||||
Node.update({ id: node.Id, version: node.Version }, config, function (data) {
|
Node.update({ id: node.Id, version: node.Version }, config, function () {
|
||||||
Notifications.success('Node successfully updated', 'Node updated');
|
Notifications.success('Node successfully updated', 'Node updated');
|
||||||
$state.go('docker.nodes.node', {id: node.Id}, {reload: true});
|
$state.go('docker.nodes.node', {id: node.Id}, {reload: true});
|
||||||
}, function (e) {
|
}, function (e) {
|
||||||
|
|
|
@ -4,7 +4,7 @@ function ($scope, $transition$, $state, SecretService, Notifications) {
|
||||||
|
|
||||||
$scope.removeSecret = function removeSecret(secretId) {
|
$scope.removeSecret = function removeSecret(secretId) {
|
||||||
SecretService.remove(secretId)
|
SecretService.remove(secretId)
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
Notifications.success('Secret successfully removed');
|
Notifications.success('Secret successfully removed');
|
||||||
$state.go('docker.secrets', {});
|
$state.go('docker.secrets', {});
|
||||||
})
|
})
|
||||||
|
|
|
@ -142,7 +142,7 @@ function ($q, $scope, $state, $timeout, Service, ServiceHelper, ConfigService, C
|
||||||
$scope.formValues.ContainerLabels.splice(index, 1);
|
$scope.formValues.ContainerLabels.splice(index, 1);
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.addLogDriverOpt = function(value) {
|
$scope.addLogDriverOpt = function() {
|
||||||
$scope.formValues.LogDriverOpts.push({ name: '', value: ''});
|
$scope.formValues.LogDriverOpts.push({ name: '', value: ''});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -492,7 +492,6 @@ function ($q, $scope, $state, $timeout, Service, ServiceHelper, ConfigService, C
|
||||||
|
|
||||||
function initView() {
|
function initView() {
|
||||||
var apiVersion = $scope.applicationState.endpoint.apiVersion;
|
var apiVersion = $scope.applicationState.endpoint.apiVersion;
|
||||||
var provider = $scope.applicationState.endpoint.mode.provider;
|
|
||||||
|
|
||||||
$q.all({
|
$q.all({
|
||||||
volumes: VolumeService.volumes(),
|
volumes: VolumeService.volumes(),
|
||||||
|
|
|
@ -125,7 +125,7 @@ function ($q, $scope, $transition$, $state, $location, $timeout, $anchorScroll,
|
||||||
updateServiceArray(service, 'ServiceMounts', service.ServiceMounts);
|
updateServiceArray(service, 'ServiceMounts', service.ServiceMounts);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
$scope.updateMount = function updateMount(service, mount) {
|
$scope.updateMount = function updateMount(service) {
|
||||||
updateServiceArray(service, 'ServiceMounts', service.ServiceMounts);
|
updateServiceArray(service, 'ServiceMounts', service.ServiceMounts);
|
||||||
};
|
};
|
||||||
$scope.addPlacementConstraint = function addPlacementConstraint(service) {
|
$scope.addPlacementConstraint = function addPlacementConstraint(service) {
|
||||||
|
@ -138,7 +138,7 @@ function ($q, $scope, $transition$, $state, $location, $timeout, $anchorScroll,
|
||||||
updateServiceArray(service, 'ServiceConstraints', service.ServiceConstraints);
|
updateServiceArray(service, 'ServiceConstraints', service.ServiceConstraints);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
$scope.updatePlacementConstraint = function(service, constraint) {
|
$scope.updatePlacementConstraint = function(service) {
|
||||||
updateServiceArray(service, 'ServiceConstraints', service.ServiceConstraints);
|
updateServiceArray(service, 'ServiceConstraints', service.ServiceConstraints);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -152,7 +152,7 @@ function ($q, $scope, $transition$, $state, $location, $timeout, $anchorScroll,
|
||||||
updateServiceArray(service, 'ServicePreferences', service.ServicePreferences);
|
updateServiceArray(service, 'ServicePreferences', service.ServicePreferences);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
$scope.updatePlacementPreference = function(service, constraint) {
|
$scope.updatePlacementPreference = function(service) {
|
||||||
updateServiceArray(service, 'ServicePreferences', service.ServicePreferences);
|
updateServiceArray(service, 'ServicePreferences', service.ServicePreferences);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -162,7 +162,7 @@ function ($q, $scope, $transition$, $state, $location, $timeout, $anchorScroll,
|
||||||
}
|
}
|
||||||
service.Ports.push({ PublishedPort: '', TargetPort: '', Protocol: 'tcp', PublishMode: 'ingress' });
|
service.Ports.push({ PublishedPort: '', TargetPort: '', Protocol: 'tcp', PublishMode: 'ingress' });
|
||||||
};
|
};
|
||||||
$scope.updatePublishedPort = function updatePublishedPort(service, portMapping) {
|
$scope.updatePublishedPort = function updatePublishedPort(service) {
|
||||||
updateServiceArray(service, 'Ports', service.Ports);
|
updateServiceArray(service, 'Ports', service.Ports);
|
||||||
};
|
};
|
||||||
$scope.removePortPublishedBinding = function removePortPublishedBinding(service, index) {
|
$scope.removePortPublishedBinding = function removePortPublishedBinding(service, index) {
|
||||||
|
@ -203,7 +203,7 @@ function ($q, $scope, $transition$, $state, $location, $timeout, $anchorScroll,
|
||||||
updateServiceArray(service, 'Hosts', service.Hosts);
|
updateServiceArray(service, 'Hosts', service.Hosts);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
$scope.updateHostsEntry = function(service, entry) {
|
$scope.updateHostsEntry = function(service) {
|
||||||
updateServiceArray(service, 'Hosts', service.Hosts);
|
updateServiceArray(service, 'Hosts', service.Hosts);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -340,7 +340,7 @@ function ($q, $scope, $transition$, $state, $location, $timeout, $anchorScroll,
|
||||||
function removeService() {
|
function removeService() {
|
||||||
$scope.state.deletionInProgress = true;
|
$scope.state.deletionInProgress = true;
|
||||||
ServiceService.remove($scope.service)
|
ServiceService.remove($scope.service)
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
Notifications.success('Service successfully deleted');
|
Notifications.success('Service successfully deleted');
|
||||||
$state.go('docker.services', {});
|
$state.go('docker.services', {});
|
||||||
})
|
})
|
||||||
|
@ -377,7 +377,7 @@ function ($q, $scope, $transition$, $state, $location, $timeout, $anchorScroll,
|
||||||
config.TaskTemplate.ForceUpdate++;
|
config.TaskTemplate.ForceUpdate++;
|
||||||
$scope.state.updateInProgress = true;
|
$scope.state.updateInProgress = true;
|
||||||
ServiceService.update(service, config)
|
ServiceService.update(service, config)
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
Notifications.success('Service successfully updated', service.Name);
|
Notifications.success('Service successfully updated', service.Name);
|
||||||
$scope.cancelChanges({});
|
$scope.cancelChanges({});
|
||||||
initView();
|
initView();
|
||||||
|
|
|
@ -82,7 +82,7 @@ function ($q, $scope, $state, VolumeService, PluginService, ResourceControlServi
|
||||||
var userId = userDetails.ID;
|
var userId = userDetails.ID;
|
||||||
return ResourceControlService.applyResourceControl('volume', volumeIdentifier, userId, accessControlData, []);
|
return ResourceControlService.applyResourceControl('volume', volumeIdentifier, userId, accessControlData, []);
|
||||||
})
|
})
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
Notifications.success('Volume successfully created');
|
Notifications.success('Volume successfully created');
|
||||||
$state.go('docker.volumes', {}, {reload: true});
|
$state.go('docker.volumes', {}, {reload: true});
|
||||||
})
|
})
|
||||||
|
|
|
@ -4,7 +4,7 @@ function ($scope, $state, $transition$, VolumeService, ContainerService, Notific
|
||||||
|
|
||||||
$scope.removeVolume = function removeVolume() {
|
$scope.removeVolume = function removeVolume() {
|
||||||
VolumeService.remove($scope.volume)
|
VolumeService.remove($scope.volume)
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
Notifications.success('Volume successfully removed', $transition$.params().id);
|
Notifications.success('Volume successfully removed', $transition$.params().id);
|
||||||
$state.go('docker.volumes', {});
|
$state.go('docker.volumes', {});
|
||||||
})
|
})
|
||||||
|
|
|
@ -178,7 +178,7 @@ angular.module('extension.storidge')
|
||||||
return label + ': ' + processedValue + '/s';
|
return label + ': ' + processedValue + '/s';
|
||||||
}
|
}
|
||||||
|
|
||||||
function bytePerSecBasedAxisLabel(value, index, values) {
|
function bytePerSecBasedAxisLabel(value) {
|
||||||
if (value > 5) {
|
if (value > 5) {
|
||||||
return filesize(value, {base: 10, round: 1});
|
return filesize(value, {base: 10, round: 1});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
angular.module('extension.storidge')
|
angular.module('extension.storidge')
|
||||||
.controller('StoridgeMonitorController', ['$q', '$scope', '$interval', '$document', 'Notifications', 'StoridgeClusterService', 'StoridgeChartService', 'ModalService',
|
.controller('StoridgeMonitorController', ['$q', '$scope', '$interval', '$document', 'Notifications', 'StoridgeClusterService', 'StoridgeChartService',
|
||||||
function ($q, $scope, $interval, $document, Notifications, StoridgeClusterService, StoridgeChartService, ModalService) {
|
function ($q, $scope, $interval, $document, Notifications, StoridgeClusterService, StoridgeChartService) {
|
||||||
|
|
||||||
$scope.$on('$destroy', function() {
|
$scope.$on('$destroy', function() {
|
||||||
stopRepeater();
|
stopRepeater();
|
||||||
|
|
|
@ -30,7 +30,7 @@ function ($scope, $state, $transition$, Notifications, StoridgeProfileService) {
|
||||||
|
|
||||||
$scope.state.actionInProgress = true;
|
$scope.state.actionInProgress = true;
|
||||||
StoridgeProfileService.create(profile)
|
StoridgeProfileService.create(profile)
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
Notifications.success('Profile successfully created');
|
Notifications.success('Profile successfully created');
|
||||||
$state.go('storidge.profiles');
|
$state.go('storidge.profiles');
|
||||||
})
|
})
|
||||||
|
|
|
@ -31,7 +31,7 @@ function ($scope, $state, $transition$, Notifications, StoridgeProfileService, M
|
||||||
|
|
||||||
$scope.state.updateInProgress = true;
|
$scope.state.updateInProgress = true;
|
||||||
StoridgeProfileService.update(profile)
|
StoridgeProfileService.update(profile)
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
Notifications.success('Profile successfully updated');
|
Notifications.success('Profile successfully updated');
|
||||||
$state.go('storidge.profiles');
|
$state.go('storidge.profiles');
|
||||||
})
|
})
|
||||||
|
@ -58,7 +58,7 @@ function ($scope, $state, $transition$, Notifications, StoridgeProfileService, M
|
||||||
|
|
||||||
$scope.state.deleteInProgress = true;
|
$scope.state.deleteInProgress = true;
|
||||||
StoridgeProfileService.delete(profile.Name)
|
StoridgeProfileService.delete(profile.Name)
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
Notifications.success('Profile successfully deleted');
|
Notifications.success('Profile successfully deleted');
|
||||||
$state.go('storidge.profiles');
|
$state.go('storidge.profiles');
|
||||||
})
|
})
|
||||||
|
|
|
@ -38,7 +38,7 @@ function ($q, $scope, $state, Notifications, StoridgeProfileService) {
|
||||||
|
|
||||||
$scope.state.actionInProgress = true;
|
$scope.state.actionInProgress = true;
|
||||||
StoridgeProfileService.create(model)
|
StoridgeProfileService.create(model)
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
Notifications.success('Profile successfully created');
|
Notifications.success('Profile successfully created');
|
||||||
$state.reload();
|
$state.reload();
|
||||||
})
|
})
|
||||||
|
|
|
@ -22,7 +22,7 @@ function ($q, $state, UserService, TeamService, ResourceControlService, Notifica
|
||||||
ctrl.authorizedTeams = [];
|
ctrl.authorizedTeams = [];
|
||||||
ctrl.availableTeams = [];
|
ctrl.availableTeams = [];
|
||||||
|
|
||||||
ctrl.confirmUpdateOwnership = function (force) {
|
ctrl.confirmUpdateOwnership = function () {
|
||||||
if (!validateForm()) {
|
if (!validateForm()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -77,7 +77,7 @@ function ($q, $state, UserService, TeamService, ResourceControlService, Notifica
|
||||||
|
|
||||||
ResourceControlService.applyResourceControlChange(ctrl.resourceType, resourceId,
|
ResourceControlService.applyResourceControlChange(ctrl.resourceType, resourceId,
|
||||||
ctrl.resourceControl, ownershipParameters)
|
ctrl.resourceControl, ownershipParameters)
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
Notifications.success('Access control successfully updated');
|
Notifications.success('Access control successfully updated');
|
||||||
$state.reload();
|
$state.reload();
|
||||||
})
|
})
|
||||||
|
|
|
@ -52,7 +52,7 @@ function (AccessService, Notifications) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ctrl.updateAccess({ userAccesses: authorizedUserIDs, teamAccesses: authorizedTeamIDs })
|
ctrl.updateAccess({ userAccesses: authorizedUserIDs, teamAccesses: authorizedTeamIDs })
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
removeFromAccesses(access, ctrl.accesses);
|
removeFromAccesses(access, ctrl.accesses);
|
||||||
ctrl.authorizedAccesses.push(access);
|
ctrl.authorizedAccesses.push(access);
|
||||||
Notifications.success('Accesses successfully updated');
|
Notifications.success('Accesses successfully updated');
|
||||||
|
@ -74,7 +74,7 @@ function (AccessService, Notifications) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ctrl.updateAccess({ userAccesses: authorizedUserIDs, teamAccesses: authorizedTeamIDs })
|
ctrl.updateAccess({ userAccesses: authorizedUserIDs, teamAccesses: authorizedTeamIDs })
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
removeFromAccesses(access, ctrl.authorizedAccesses);
|
removeFromAccesses(access, ctrl.authorizedAccesses);
|
||||||
ctrl.accesses.push(access);
|
ctrl.accesses.push(access);
|
||||||
Notifications.success('Accesses successfully updated');
|
Notifications.success('Accesses successfully updated');
|
||||||
|
@ -96,7 +96,7 @@ function (AccessService, Notifications) {
|
||||||
|
|
||||||
ctrl.unauthorizeAllAccesses = function() {
|
ctrl.unauthorizeAllAccesses = function() {
|
||||||
ctrl.updateAccess({ userAccesses: [], teamAccesses: [] })
|
ctrl.updateAccess({ userAccesses: [], teamAccesses: [] })
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
moveAccesses(ctrl.authorizedAccesses, ctrl.accesses);
|
moveAccesses(ctrl.authorizedAccesses, ctrl.accesses);
|
||||||
Notifications.success('Accesses successfully updated');
|
Notifications.success('Accesses successfully updated');
|
||||||
})
|
})
|
||||||
|
@ -111,7 +111,7 @@ function (AccessService, Notifications) {
|
||||||
var authorizedTeamIDs = accessData.teamIDs;
|
var authorizedTeamIDs = accessData.teamIDs;
|
||||||
|
|
||||||
ctrl.updateAccess({ userAccesses: authorizedUserIDs, teamAccesses: authorizedTeamIDs })
|
ctrl.updateAccess({ userAccesses: authorizedUserIDs, teamAccesses: authorizedTeamIDs })
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
moveAccesses(ctrl.accesses, ctrl.authorizedAccesses);
|
moveAccesses(ctrl.accesses, ctrl.authorizedAccesses);
|
||||||
Notifications.success('Accesses successfully updated');
|
Notifications.success('Accesses successfully updated');
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
angular.module('portainer.app').component('endpointList', {
|
angular.module('portainer.app').component('endpointList', {
|
||||||
templateUrl: 'app/portainer/components/endpoint-list/endpointList.html',
|
templateUrl: 'app/portainer/components/endpoint-list/endpointList.html',
|
||||||
controller: function() {
|
controller: function() {
|
||||||
var ctrl = this;
|
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
textFilter: ''
|
textFilter: ''
|
||||||
};
|
};
|
||||||
|
|
|
@ -3,7 +3,7 @@ angular.module('portainer.app')
|
||||||
var directive = {
|
var directive = {
|
||||||
requires: '^rdHeader',
|
requires: '^rdHeader',
|
||||||
transclude: true,
|
transclude: true,
|
||||||
link: function (scope, iElement, iAttrs) {
|
link: function (scope) {
|
||||||
scope.username = Authentication.getUserDetails().username;
|
scope.username = Authentication.getUserDetails().username;
|
||||||
},
|
},
|
||||||
template: '<div class="breadcrumb-links"><div class="pull-left" ng-transclude></div><div class="pull-right" ng-if="username"><a ui-sref="portainer.account" style="margin-right: 5px;"><u><i class="fa fa-wrench" aria-hidden="true"></i> my account </u></a><a ui-sref="portainer.auth({logout: true})" class="text-danger" style="margin-right: 25px;"><u><i class="fa fa-sign-out-alt" aria-hidden="true"></i> log out</u></a></div></div>',
|
template: '<div class="breadcrumb-links"><div class="pull-left" ng-transclude></div><div class="pull-right" ng-if="username"><a ui-sref="portainer.account" style="margin-right: 5px;"><u><i class="fa fa-wrench" aria-hidden="true"></i> my account </u></a><a ui-sref="portainer.auth({logout: true})" class="text-danger" style="margin-right: 25px;"><u><i class="fa fa-sign-out-alt" aria-hidden="true"></i> log out</u></a></div></div>',
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
angular.module('portainer.app')
|
angular.module('portainer.app')
|
||||||
.directive('rdHeaderTitle', ['Authentication', 'StateManager', function rdHeaderTitle(Authentication, StateManager) {
|
.directive('rdHeaderTitle', ['Authentication', function rdHeaderTitle(Authentication) {
|
||||||
var directive = {
|
var directive = {
|
||||||
requires: '^rdHeader',
|
requires: '^rdHeader',
|
||||||
scope: {
|
scope: {
|
||||||
titleText: '@'
|
titleText: '@'
|
||||||
},
|
},
|
||||||
link: function (scope, iElement, iAttrs) {
|
link: function (scope) {
|
||||||
scope.username = Authentication.getUserDetails().username;
|
scope.username = Authentication.getUserDetails().username;
|
||||||
},
|
},
|
||||||
transclude: true,
|
transclude: true,
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
angular.module('portainer.app')
|
angular.module('portainer.app')
|
||||||
.controller('TagSelectorController', function () {
|
.controller('TagSelectorController', function () {
|
||||||
|
|
||||||
var ctrl = this;
|
|
||||||
|
|
||||||
this.$onChanges = function(changes) {
|
this.$onChanges = function(changes) {
|
||||||
if(angular.isDefined(changes.tags.currentValue)) {
|
if(angular.isDefined(changes.tags.currentValue)) {
|
||||||
this.tags = _.difference(changes.tags.currentValue, this.model);
|
this.tags = _.difference(changes.tags.currentValue, this.model);
|
||||||
|
@ -14,7 +12,7 @@ angular.module('portainer.app')
|
||||||
noResult: false
|
noResult: false
|
||||||
};
|
};
|
||||||
|
|
||||||
this.selectTag = function($item, $model, $label) {
|
this.selectTag = function($item) {
|
||||||
this.state.selectedValue = '';
|
this.state.selectedValue = '';
|
||||||
this.model.push($item);
|
this.model.push($item);
|
||||||
this.tags = _.remove(this.tags, function(item) {
|
this.tags = _.remove(this.tags, function(item) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
angular.module('portainer.app')
|
angular.module('portainer.app')
|
||||||
.factory('TemplateHelper', ['$filter', function TemplateHelperFactory($filter) {
|
.factory('TemplateHelper', [function TemplateHelperFactory() {
|
||||||
'use strict';
|
'use strict';
|
||||||
var helper = {};
|
var helper = {};
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ angular.module('portainer.app')
|
||||||
return labels;
|
return labels;
|
||||||
};
|
};
|
||||||
|
|
||||||
helper.EnvToStringArray = function(templateEnvironment, containerMapping) {
|
helper.EnvToStringArray = function(templateEnvironment) {
|
||||||
var env = [];
|
var env = [];
|
||||||
templateEnvironment.forEach(function(envvar) {
|
templateEnvironment.forEach(function(envvar) {
|
||||||
if (envvar.value || envvar.set) {
|
if (envvar.value || envvar.set) {
|
||||||
|
|
|
@ -48,7 +48,7 @@ function StackServiceFactory($q, Stack, ResourceControlService, FileUploadServic
|
||||||
|
|
||||||
return Stack.migrate({ id: stack.Id, endpointId: stack.EndpointId }, { EndpointID: targetEndpointId, SwarmID: swarm.Id }).$promise;
|
return Stack.migrate({ id: stack.Id, endpointId: stack.EndpointId }, { EndpointID: targetEndpointId, SwarmID: swarm.Id }).$promise;
|
||||||
})
|
})
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
deferred.resolve();
|
deferred.resolve();
|
||||||
})
|
})
|
||||||
.catch(function error(err) {
|
.catch(function error(err) {
|
||||||
|
@ -67,7 +67,7 @@ function StackServiceFactory($q, Stack, ResourceControlService, FileUploadServic
|
||||||
EndpointProvider.setEndpointID(targetEndpointId);
|
EndpointProvider.setEndpointID(targetEndpointId);
|
||||||
|
|
||||||
Stack.migrate({ id: stack.Id, endpointId: stack.EndpointId }, { EndpointID: targetEndpointId }).$promise
|
Stack.migrate({ id: stack.Id, endpointId: stack.EndpointId }, { EndpointID: targetEndpointId }).$promise
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
deferred.resolve();
|
deferred.resolve();
|
||||||
})
|
})
|
||||||
.catch(function error(err) {
|
.catch(function error(err) {
|
||||||
|
@ -204,7 +204,7 @@ function StackServiceFactory($q, Stack, ResourceControlService, FileUploadServic
|
||||||
var deferred = $q.defer();
|
var deferred = $q.defer();
|
||||||
|
|
||||||
Stack.remove({ id: stack.Id ? stack.Id : stack.Name, external: external, endpointId: endpointId }).$promise
|
Stack.remove({ id: stack.Id ? stack.Id : stack.Name, external: external, endpointId: endpointId }).$promise
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
if (stack.ResourceControl && stack.ResourceControl.Id) {
|
if (stack.ResourceControl && stack.ResourceControl.Id) {
|
||||||
return ResourceControlService.deleteResourceControl(stack.ResourceControl.Id);
|
return ResourceControlService.deleteResourceControl(stack.ResourceControl.Id);
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,7 @@ angular.module('portainer.app')
|
||||||
return Teams.remove({id: id}).$promise;
|
return Teams.remove({id: id}).$promise;
|
||||||
};
|
};
|
||||||
|
|
||||||
service.updateTeam = function(id, name, members, leaders) {
|
service.updateTeam = function(id, name) {
|
||||||
var payload = {
|
var payload = {
|
||||||
Name: name
|
Name: name
|
||||||
};
|
};
|
||||||
|
|
|
@ -83,7 +83,7 @@ angular.module('portainer.app')
|
||||||
return service.updateUser(id, newPassword, undefined);
|
return service.updateUser(id, newPassword, undefined);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
deferred.resolve();
|
deferred.resolve();
|
||||||
})
|
})
|
||||||
.catch(function error(err) {
|
.catch(function error(err) {
|
||||||
|
@ -142,7 +142,7 @@ angular.module('portainer.app')
|
||||||
var deferred = $q.defer();
|
var deferred = $q.defer();
|
||||||
|
|
||||||
Users.checkAdminUser({}).$promise
|
Users.checkAdminUser({}).$promise
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
deferred.resolve(true);
|
deferred.resolve(true);
|
||||||
})
|
})
|
||||||
.catch(function error(err) {
|
.catch(function error(err) {
|
||||||
|
|
|
@ -139,14 +139,14 @@ angular.module('portainer.app')
|
||||||
return label + ': ' + processedValue;
|
return label + ': ' + processedValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
function byteBasedAxisLabel(value, index, values) {
|
function byteBasedAxisLabel(value) {
|
||||||
if (value > 5) {
|
if (value > 5) {
|
||||||
return filesize(value, {base: 10, round: 1});
|
return filesize(value, {base: 10, round: 1});
|
||||||
}
|
}
|
||||||
return value.toFixed(1) + 'B';
|
return value.toFixed(1) + 'B';
|
||||||
}
|
}
|
||||||
|
|
||||||
function percentageBasedAxisLabel(value, index, values) {
|
function percentageBasedAxisLabel(value) {
|
||||||
if (value > 1) {
|
if (value > 1) {
|
||||||
return Math.round(value) + '%';
|
return Math.round(value) + '%';
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ angular.module('portainer.app')
|
||||||
dockerfile: path
|
dockerfile: path
|
||||||
},
|
},
|
||||||
ignoreLoadingBar: true,
|
ignoreLoadingBar: true,
|
||||||
transformResponse: function(data, headers) {
|
transformResponse: function(data) {
|
||||||
return jsonObjectsToArrayHandler(data);
|
return jsonObjectsToArrayHandler(data);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -59,7 +59,7 @@ angular.module('portainer.app')
|
||||||
box.find('.bootbox-input-checkbox').prop('checked', optionToggled);
|
box.find('.bootbox-input-checkbox').prop('checked', optionToggled);
|
||||||
};
|
};
|
||||||
|
|
||||||
service.confirmAccessControlUpdate = function(callback, msg) {
|
service.confirmAccessControlUpdate = function(callback) {
|
||||||
service.confirm({
|
service.confirm({
|
||||||
title: 'Are you sure ?',
|
title: 'Are you sure ?',
|
||||||
message: 'Changing the ownership of this resource will potentially restrict its management to some users.',
|
message: 'Changing the ownership of this resource will potentially restrict its management to some users.',
|
||||||
|
|
|
@ -97,7 +97,7 @@ function StateManagerFactory($q, SystemService, InfoHelper, LocalStorage, Settin
|
||||||
var cacheValidity = now - applicationState.validity;
|
var cacheValidity = now - applicationState.validity;
|
||||||
if (cacheValidity > APPLICATION_CACHE_VALIDITY) {
|
if (cacheValidity > APPLICATION_CACHE_VALIDITY) {
|
||||||
loadApplicationState()
|
loadApplicationState()
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
deferred.resolve(state);
|
deferred.resolve(state);
|
||||||
})
|
})
|
||||||
.catch(function error(err) {
|
.catch(function error(err) {
|
||||||
|
@ -110,7 +110,7 @@ function StateManagerFactory($q, SystemService, InfoHelper, LocalStorage, Settin
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
loadApplicationState()
|
loadApplicationState()
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
deferred.resolve(state);
|
deferred.resolve(state);
|
||||||
})
|
})
|
||||||
.catch(function error(err) {
|
.catch(function error(err) {
|
||||||
|
|
|
@ -60,8 +60,6 @@ function ($q, $scope, $state, $filter, EndpointService, GroupService, TagService
|
||||||
};
|
};
|
||||||
|
|
||||||
function createAzureEndpoint(name, applicationId, tenantId, authenticationKey, groupId, tags) {
|
function createAzureEndpoint(name, applicationId, tenantId, authenticationKey, groupId, tags) {
|
||||||
var endpoint;
|
|
||||||
|
|
||||||
$scope.state.actionInProgress = true;
|
$scope.state.actionInProgress = true;
|
||||||
EndpointService.createAzureEndpoint(name, applicationId, tenantId, authenticationKey, groupId, tags)
|
EndpointService.createAzureEndpoint(name, applicationId, tenantId, authenticationKey, groupId, tags)
|
||||||
.then(function success() {
|
.then(function success() {
|
||||||
|
|
|
@ -45,7 +45,7 @@ function ($q, $scope, $state, $transition$, $filter, EndpointService, GroupServi
|
||||||
|
|
||||||
$scope.state.actionInProgress = true;
|
$scope.state.actionInProgress = true;
|
||||||
EndpointService.updateEndpoint(endpoint.Id, payload)
|
EndpointService.updateEndpoint(endpoint.Id, payload)
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
Notifications.success('Endpoint updated', $scope.endpoint.Name);
|
Notifications.success('Endpoint updated', $scope.endpoint.Name);
|
||||||
EndpointProvider.setEndpointPublicURL(endpoint.PublicURL);
|
EndpointProvider.setEndpointPublicURL(endpoint.PublicURL);
|
||||||
$state.go('portainer.endpoints', {}, {reload: true});
|
$state.go('portainer.endpoints', {}, {reload: true});
|
||||||
|
|
|
@ -17,7 +17,7 @@ function ($q, $scope, $state, $transition$, GroupService, EndpointService, TagSe
|
||||||
|
|
||||||
$scope.state.actionInProgress = true;
|
$scope.state.actionInProgress = true;
|
||||||
GroupService.updateGroup(model, associatedEndpoints)
|
GroupService.updateGroup(model, associatedEndpoints)
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
Notifications.success('Group successfully updated');
|
Notifications.success('Group successfully updated');
|
||||||
$state.go('portainer.groups', {}, {reload: true});
|
$state.go('portainer.groups', {}, {reload: true});
|
||||||
})
|
})
|
||||||
|
|
|
@ -22,7 +22,7 @@ function ($q, $scope, $state, Authentication, EndpointService, EndpointHelper, G
|
||||||
|
|
||||||
function triggerSnapshot() {
|
function triggerSnapshot() {
|
||||||
EndpointService.snapshot()
|
EndpointService.snapshot()
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
Notifications.success('Success', 'Endpoints updated');
|
Notifications.success('Success', 'Endpoints updated');
|
||||||
$state.reload();
|
$state.reload();
|
||||||
})
|
})
|
||||||
|
|
|
@ -29,13 +29,9 @@ function ($scope, $state, EndpointService, StateManager, Notifications) {
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.createLocalEndpoint = function() {
|
$scope.createLocalEndpoint = function() {
|
||||||
var name = 'local';
|
|
||||||
var URL = '';
|
|
||||||
var endpoint;
|
|
||||||
|
|
||||||
$scope.state.actionInProgress = true;
|
$scope.state.actionInProgress = true;
|
||||||
EndpointService.createLocalEndpoint()
|
EndpointService.createLocalEndpoint()
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
$state.go('portainer.home');
|
$state.go('portainer.home');
|
||||||
})
|
})
|
||||||
.catch(function error(err) {
|
.catch(function error(err) {
|
||||||
|
@ -78,11 +74,9 @@ function ($scope, $state, EndpointService, StateManager, Notifications) {
|
||||||
};
|
};
|
||||||
|
|
||||||
function createAzureEndpoint(name, applicationId, tenantId, authenticationKey) {
|
function createAzureEndpoint(name, applicationId, tenantId, authenticationKey) {
|
||||||
var endpoint;
|
|
||||||
|
|
||||||
$scope.state.actionInProgress = true;
|
$scope.state.actionInProgress = true;
|
||||||
EndpointService.createAzureEndpoint(name, applicationId, tenantId, authenticationKey, 1, [])
|
EndpointService.createAzureEndpoint(name, applicationId, tenantId, authenticationKey, 1, [])
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
$state.go('portainer.home');
|
$state.go('portainer.home');
|
||||||
})
|
})
|
||||||
.catch(function error(err) {
|
.catch(function error(err) {
|
||||||
|
@ -94,10 +88,9 @@ function ($scope, $state, EndpointService, StateManager, Notifications) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function createRemoteEndpoint(name, type, URL, PublicURL, TLS, TLSSkipVerify, TLSSKipClientVerify, TLSCAFile, TLSCertFile, TLSKeyFile) {
|
function createRemoteEndpoint(name, type, URL, PublicURL, TLS, TLSSkipVerify, TLSSKipClientVerify, TLSCAFile, TLSCertFile, TLSKeyFile) {
|
||||||
var endpoint;
|
|
||||||
$scope.state.actionInProgress = true;
|
$scope.state.actionInProgress = true;
|
||||||
EndpointService.createRemoteEndpoint(name, type, URL, PublicURL, 1, [], TLS, TLSSkipVerify, TLSSKipClientVerify, TLSCAFile, TLSCertFile, TLSKeyFile)
|
EndpointService.createRemoteEndpoint(name, type, URL, PublicURL, 1, [], TLS, TLSSkipVerify, TLSSKipClientVerify, TLSCAFile, TLSCertFile, TLSKeyFile)
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
$state.go('portainer.home');
|
$state.go('portainer.home');
|
||||||
})
|
})
|
||||||
.catch(function error(err) {
|
.catch(function error(err) {
|
||||||
|
|
|
@ -12,7 +12,7 @@ function ($scope, $cookieStore, StateManager) {
|
||||||
|
|
||||||
$scope.applicationState = StateManager.getState();
|
$scope.applicationState = StateManager.getState();
|
||||||
|
|
||||||
$scope.$watch($scope.getWidth, function(newValue, oldValue) {
|
$scope.$watch($scope.getWidth, function(newValue) {
|
||||||
if (newValue >= mobileView) {
|
if (newValue >= mobileView) {
|
||||||
if (angular.isDefined($cookieStore.get('toggle'))) {
|
if (angular.isDefined($cookieStore.get('toggle'))) {
|
||||||
$scope.toggle = ! $cookieStore.get('toggle') ? false : true;
|
$scope.toggle = ! $cookieStore.get('toggle') ? false : true;
|
||||||
|
|
|
@ -36,7 +36,7 @@ function ($scope, $state, RegistryService, Notifications) {
|
||||||
|
|
||||||
$scope.state.actionInProgress = true;
|
$scope.state.actionInProgress = true;
|
||||||
RegistryService.createRegistry(registryName, registryURL, authentication, username, password)
|
RegistryService.createRegistry(registryName, registryURL, authentication, username, password)
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
Notifications.success('Registry successfully created');
|
Notifications.success('Registry successfully created');
|
||||||
$state.go('portainer.registries');
|
$state.go('portainer.registries');
|
||||||
})
|
})
|
||||||
|
|
|
@ -15,7 +15,7 @@ function ($scope, $state, $transition$, $filter, RegistryService, Notifications)
|
||||||
registry.Password = $scope.formValues.Password;
|
registry.Password = $scope.formValues.Password;
|
||||||
$scope.state.actionInProgress = true;
|
$scope.state.actionInProgress = true;
|
||||||
RegistryService.updateRegistry(registry)
|
RegistryService.updateRegistry(registry)
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
Notifications.success('Registry successfully updated');
|
Notifications.success('Registry successfully updated');
|
||||||
$state.go('portainer.registries');
|
$state.go('portainer.registries');
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
angular.module('portainer.app')
|
angular.module('portainer.app')
|
||||||
.controller('RegistriesController', ['$q', '$scope', '$state', 'RegistryService', 'DockerHubService', 'ModalService', 'Notifications', 'PaginationService',
|
.controller('RegistriesController', ['$q', '$scope', '$state', 'RegistryService', 'DockerHubService', 'ModalService', 'Notifications',
|
||||||
function ($q, $scope, $state, RegistryService, DockerHubService, ModalService, Notifications, PaginationService) {
|
function ($q, $scope, $state, RegistryService, DockerHubService, ModalService, Notifications) {
|
||||||
|
|
||||||
$scope.state = {
|
$scope.state = {
|
||||||
actionInProgress: false
|
actionInProgress: false
|
||||||
|
@ -15,7 +15,7 @@ function ($q, $scope, $state, RegistryService, DockerHubService, ModalService, N
|
||||||
dockerhub.Password = $scope.formValues.dockerHubPassword;
|
dockerhub.Password = $scope.formValues.dockerHubPassword;
|
||||||
$scope.state.actionInProgress = true;
|
$scope.state.actionInProgress = true;
|
||||||
DockerHubService.update(dockerhub)
|
DockerHubService.update(dockerhub)
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
Notifications.success('DockerHub registry updated');
|
Notifications.success('DockerHub registry updated');
|
||||||
})
|
})
|
||||||
.catch(function error(err) {
|
.catch(function error(err) {
|
||||||
|
|
|
@ -39,11 +39,11 @@ function ($q, $scope, Notifications, SettingsService, FileUploadService) {
|
||||||
|
|
||||||
$scope.state.connectivityCheckInProgress = true;
|
$scope.state.connectivityCheckInProgress = true;
|
||||||
$q.when(!uploadRequired || FileUploadService.uploadLDAPTLSFiles(TLSCAFile, null, null))
|
$q.when(!uploadRequired || FileUploadService.uploadLDAPTLSFiles(TLSCAFile, null, null))
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
addLDAPDefaultPort(settings, $scope.LDAPSettings.TLSConfig.TLS);
|
addLDAPDefaultPort(settings, $scope.LDAPSettings.TLSConfig.TLS);
|
||||||
return SettingsService.checkLDAPConnectivity(settings);
|
return SettingsService.checkLDAPConnectivity(settings);
|
||||||
})
|
})
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
$scope.state.failedConnectivityCheck = false;
|
$scope.state.failedConnectivityCheck = false;
|
||||||
$scope.state.successfulConnectivityCheck = true;
|
$scope.state.successfulConnectivityCheck = true;
|
||||||
Notifications.success('Connection to LDAP successful');
|
Notifications.success('Connection to LDAP successful');
|
||||||
|
@ -68,11 +68,11 @@ function ($q, $scope, Notifications, SettingsService, FileUploadService) {
|
||||||
|
|
||||||
$scope.state.actionInProgress = true;
|
$scope.state.actionInProgress = true;
|
||||||
$q.when(!uploadRequired || FileUploadService.uploadLDAPTLSFiles(TLSCAFile, null, null))
|
$q.when(!uploadRequired || FileUploadService.uploadLDAPTLSFiles(TLSCAFile, null, null))
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
addLDAPDefaultPort(settings, $scope.LDAPSettings.TLSConfig.TLS);
|
addLDAPDefaultPort(settings, $scope.LDAPSettings.TLSConfig.TLS);
|
||||||
return SettingsService.update(settings);
|
return SettingsService.update(settings);
|
||||||
})
|
})
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
Notifications.success('Authentication settings updated');
|
Notifications.success('Authentication settings updated');
|
||||||
})
|
})
|
||||||
.catch(function error(err) {
|
.catch(function error(err) {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
angular.module('portainer.app')
|
angular.module('portainer.app')
|
||||||
.controller('SettingsController', ['$scope', '$state', 'Notifications', 'SettingsService', 'StateManager', 'DEFAULT_TEMPLATES_URL',
|
.controller('SettingsController', ['$scope', '$state', 'Notifications', 'SettingsService', 'StateManager',
|
||||||
function ($scope, $state, Notifications, SettingsService, StateManager, DEFAULT_TEMPLATES_URL) {
|
function ($scope, $state, Notifications, SettingsService, StateManager) {
|
||||||
|
|
||||||
$scope.state = {
|
$scope.state = {
|
||||||
actionInProgress: false
|
actionInProgress: false
|
||||||
|
@ -53,7 +53,7 @@ function ($scope, $state, Notifications, SettingsService, StateManager, DEFAULT_
|
||||||
|
|
||||||
function updateSettings(settings) {
|
function updateSettings(settings) {
|
||||||
SettingsService.update(settings)
|
SettingsService.update(settings)
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
Notifications.success('Settings updated');
|
Notifications.success('Settings updated');
|
||||||
StateManager.updateLogo(settings.LogoURL);
|
StateManager.updateLogo(settings.LogoURL);
|
||||||
StateManager.updateSnapshotInterval(settings.SnapshotInterval);
|
StateManager.updateSnapshotInterval(settings.SnapshotInterval);
|
||||||
|
|
|
@ -114,7 +114,7 @@ function ($scope, $state, StackService, Authentication, Notifications, FormValid
|
||||||
}
|
}
|
||||||
$scope.state.actionInProgress = true;
|
$scope.state.actionInProgress = true;
|
||||||
action(name, method)
|
action(name, method)
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
return ResourceControlService.applyResourceControl('stack', name, userId, accessControlData, []);
|
return ResourceControlService.applyResourceControl('stack', name, userId, accessControlData, []);
|
||||||
})
|
})
|
||||||
.then(function success() {
|
.then(function success() {
|
||||||
|
|
|
@ -65,7 +65,7 @@ function ($q, $scope, $state, $transition$, StackService, NodeService, ServiceSe
|
||||||
|
|
||||||
$scope.state.migrationInProgress = true;
|
$scope.state.migrationInProgress = true;
|
||||||
migrateRequest(stack, targetEndpointId)
|
migrateRequest(stack, targetEndpointId)
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
Notifications.success('Stack successfully migrated', stack.Name);
|
Notifications.success('Stack successfully migrated', stack.Name);
|
||||||
$state.go('portainer.stacks', {}, {reload: true});
|
$state.go('portainer.stacks', {}, {reload: true});
|
||||||
})
|
})
|
||||||
|
@ -108,7 +108,7 @@ function ($q, $scope, $state, $transition$, StackService, NodeService, ServiceSe
|
||||||
|
|
||||||
$scope.state.actionInProgress = true;
|
$scope.state.actionInProgress = true;
|
||||||
StackService.updateStack(stack, stackFile, env, prune)
|
StackService.updateStack(stack, stackFile, env, prune)
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
Notifications.success('Stack successfully deployed');
|
Notifications.success('Stack successfully deployed');
|
||||||
$state.reload();
|
$state.reload();
|
||||||
})
|
})
|
||||||
|
|
|
@ -45,7 +45,7 @@ function ($scope, $state, TagService, Notifications) {
|
||||||
$scope.createTag = function() {
|
$scope.createTag = function() {
|
||||||
var tagName = $scope.formValues.Name;
|
var tagName = $scope.formValues.Name;
|
||||||
TagService.createTag(tagName)
|
TagService.createTag(tagName)
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
Notifications.success('Tag successfully created', tagName);
|
Notifications.success('Tag successfully created', tagName);
|
||||||
$state.reload();
|
$state.reload();
|
||||||
})
|
})
|
||||||
|
|
|
@ -45,7 +45,7 @@ function ($q, $scope, $state, $transition$, TeamService, UserService, TeamMember
|
||||||
|
|
||||||
$scope.promoteToLeader = function(user) {
|
$scope.promoteToLeader = function(user) {
|
||||||
TeamMembershipService.updateMembership(user.MembershipId, user.Id, $scope.team.Id, 1)
|
TeamMembershipService.updateMembership(user.MembershipId, user.Id, $scope.team.Id, 1)
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
$scope.leaderCount++;
|
$scope.leaderCount++;
|
||||||
user.TeamRole = 'Leader';
|
user.TeamRole = 'Leader';
|
||||||
Notifications.success('User is now team leader', user.Username);
|
Notifications.success('User is now team leader', user.Username);
|
||||||
|
@ -57,7 +57,7 @@ function ($q, $scope, $state, $transition$, TeamService, UserService, TeamMember
|
||||||
|
|
||||||
$scope.demoteToMember = function(user) {
|
$scope.demoteToMember = function(user) {
|
||||||
TeamMembershipService.updateMembership(user.MembershipId, user.Id, $scope.team.Id, 2)
|
TeamMembershipService.updateMembership(user.MembershipId, user.Id, $scope.team.Id, 2)
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
user.TeamRole = 'Member';
|
user.TeamRole = 'Member';
|
||||||
$scope.leaderCount--;
|
$scope.leaderCount--;
|
||||||
Notifications.success('User is now team member', user.Username);
|
Notifications.success('User is now team member', user.Username);
|
||||||
|
@ -109,7 +109,7 @@ function ($q, $scope, $state, $transition$, TeamService, UserService, TeamMember
|
||||||
teamMembershipQueries.push(TeamMembershipService.deleteMembership(user.MembershipId));
|
teamMembershipQueries.push(TeamMembershipService.deleteMembership(user.MembershipId));
|
||||||
});
|
});
|
||||||
$q.all(teamMembershipQueries)
|
$q.all(teamMembershipQueries)
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
$scope.users = $scope.users.concat($scope.teamMembers);
|
$scope.users = $scope.users.concat($scope.teamMembers);
|
||||||
$scope.teamMembers = [];
|
$scope.teamMembers = [];
|
||||||
Notifications.success('All users successfully removed');
|
Notifications.success('All users successfully removed');
|
||||||
|
@ -133,7 +133,7 @@ function ($q, $scope, $state, $transition$, TeamService, UserService, TeamMember
|
||||||
|
|
||||||
function deleteTeam() {
|
function deleteTeam() {
|
||||||
TeamService.deleteTeam($scope.team.Id)
|
TeamService.deleteTeam($scope.team.Id)
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
Notifications.success('Team successfully deleted', $scope.team.Name);
|
Notifications.success('Team successfully deleted', $scope.team.Name);
|
||||||
$state.go('portainer.teams');
|
$state.go('portainer.teams');
|
||||||
})
|
})
|
||||||
|
|
|
@ -30,7 +30,7 @@ function ($q, $scope, $state, TeamService, UserService, ModalService, Notificati
|
||||||
|
|
||||||
$scope.state.actionInProgress = true;
|
$scope.state.actionInProgress = true;
|
||||||
TeamService.createTeam(teamName, leaderIds)
|
TeamService.createTeam(teamName, leaderIds)
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
Notifications.success('Team successfully created', teamName);
|
Notifications.success('Team successfully created', teamName);
|
||||||
$state.reload();
|
$state.reload();
|
||||||
})
|
})
|
||||||
|
|
|
@ -65,7 +65,6 @@ function ($scope, $q, $state, $transition$, $anchorScroll, ContainerService, Ima
|
||||||
var generatedVolumeIds = [];
|
var generatedVolumeIds = [];
|
||||||
VolumeService.createXAutoGeneratedLocalVolumes(generatedVolumeCount)
|
VolumeService.createXAutoGeneratedLocalVolumes(generatedVolumeCount)
|
||||||
.then(function success(data) {
|
.then(function success(data) {
|
||||||
var volumeResourceControlQueries = [];
|
|
||||||
angular.forEach(data, function (volume) {
|
angular.forEach(data, function (volume) {
|
||||||
var volumeId = volume.Id;
|
var volumeId = volume.Id;
|
||||||
generatedVolumeIds.push(volumeId);
|
generatedVolumeIds.push(volumeId);
|
||||||
|
@ -73,7 +72,7 @@ function ($scope, $q, $state, $transition$, $anchorScroll, ContainerService, Ima
|
||||||
TemplateService.updateContainerConfigurationWithVolumes(templateConfiguration, template, data);
|
TemplateService.updateContainerConfigurationWithVolumes(templateConfiguration, template, data);
|
||||||
return ImageService.pullImage(template.Image, { URL: template.Registry }, true);
|
return ImageService.pullImage(template.Image, { URL: template.Registry }, true);
|
||||||
})
|
})
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
return ContainerService.createAndStartContainer(templateConfiguration);
|
return ContainerService.createAndStartContainer(templateConfiguration);
|
||||||
})
|
})
|
||||||
.then(function success(data) {
|
.then(function success(data) {
|
||||||
|
@ -109,7 +108,7 @@ function ($scope, $q, $state, $transition$, $anchorScroll, ContainerService, Ima
|
||||||
|
|
||||||
var endpointId = EndpointProvider.endpointID();
|
var endpointId = EndpointProvider.endpointID();
|
||||||
StackService.createComposeStackFromGitRepository(stackName, repositoryOptions, template.Env, endpointId)
|
StackService.createComposeStackFromGitRepository(stackName, repositoryOptions, template.Env, endpointId)
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
return ResourceControlService.applyResourceControl('stack', stackName, userId, accessControlData, []);
|
return ResourceControlService.applyResourceControl('stack', stackName, userId, accessControlData, []);
|
||||||
})
|
})
|
||||||
.then(function success() {
|
.then(function success() {
|
||||||
|
@ -141,7 +140,7 @@ function ($scope, $q, $state, $transition$, $anchorScroll, ContainerService, Ima
|
||||||
|
|
||||||
var endpointId = EndpointProvider.endpointID();
|
var endpointId = EndpointProvider.endpointID();
|
||||||
StackService.createSwarmStackFromGitRepository(stackName, repositoryOptions, template.Env, endpointId)
|
StackService.createSwarmStackFromGitRepository(stackName, repositoryOptions, template.Env, endpointId)
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
return ResourceControlService.applyResourceControl('stack', stackName, userId, accessControlData, []);
|
return ResourceControlService.applyResourceControl('stack', stackName, userId, accessControlData, []);
|
||||||
})
|
})
|
||||||
.then(function success() {
|
.then(function success() {
|
||||||
|
@ -167,7 +166,6 @@ function ($scope, $q, $state, $transition$, $anchorScroll, ContainerService, Ima
|
||||||
}
|
}
|
||||||
|
|
||||||
var template = $scope.state.selectedTemplate;
|
var template = $scope.state.selectedTemplate;
|
||||||
var templatesKey = $scope.templatesKey;
|
|
||||||
|
|
||||||
$scope.state.actionInProgress = true;
|
$scope.state.actionInProgress = true;
|
||||||
if (template.Type === 2) {
|
if (template.Type === 2) {
|
||||||
|
|
|
@ -25,7 +25,7 @@ function ($q, $scope, $state, $transition$, UserService, ModalService, Notificat
|
||||||
$scope.updatePermissions = function() {
|
$scope.updatePermissions = function() {
|
||||||
var role = $scope.formValues.Administrator ? 1 : 2;
|
var role = $scope.formValues.Administrator ? 1 : 2;
|
||||||
UserService.updateUser($scope.user.Id, undefined, role)
|
UserService.updateUser($scope.user.Id, undefined, role)
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
var newRole = role === 1 ? 'administrator' : 'user';
|
var newRole = role === 1 ? 'administrator' : 'user';
|
||||||
Notifications.success('Permissions successfully updated', $scope.user.Username + ' is now ' + newRole);
|
Notifications.success('Permissions successfully updated', $scope.user.Username + ' is now ' + newRole);
|
||||||
$state.reload();
|
$state.reload();
|
||||||
|
@ -37,7 +37,7 @@ function ($q, $scope, $state, $transition$, UserService, ModalService, Notificat
|
||||||
|
|
||||||
$scope.updatePassword = function() {
|
$scope.updatePassword = function() {
|
||||||
UserService.updateUser($scope.user.Id, $scope.formValues.newPassword, undefined)
|
UserService.updateUser($scope.user.Id, $scope.formValues.newPassword, undefined)
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
Notifications.success('Password successfully updated');
|
Notifications.success('Password successfully updated');
|
||||||
$state.reload();
|
$state.reload();
|
||||||
})
|
})
|
||||||
|
@ -48,7 +48,7 @@ function ($q, $scope, $state, $transition$, UserService, ModalService, Notificat
|
||||||
|
|
||||||
function deleteUser() {
|
function deleteUser() {
|
||||||
UserService.deleteUser($scope.user.Id)
|
UserService.deleteUser($scope.user.Id)
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
Notifications.success('User successfully deleted', $scope.user.Username);
|
Notifications.success('User successfully deleted', $scope.user.Username);
|
||||||
$state.go('portainer.users');
|
$state.go('portainer.users');
|
||||||
})
|
})
|
||||||
|
|
|
@ -38,7 +38,7 @@ function ($q, $scope, $state, $sanitize, UserService, TeamService, TeamMembershi
|
||||||
teamIds.push(team.Id);
|
teamIds.push(team.Id);
|
||||||
});
|
});
|
||||||
UserService.createUser(username, password, role, teamIds)
|
UserService.createUser(username, password, role, teamIds)
|
||||||
.then(function success(data) {
|
.then(function success() {
|
||||||
Notifications.success('User successfully created', username);
|
Notifications.success('User successfully created', username);
|
||||||
$state.reload();
|
$state.reload();
|
||||||
})
|
})
|
||||||
|
|
|
@ -106,7 +106,6 @@ module.exports = function (grunt) {
|
||||||
|
|
||||||
var autoprefixer = require('autoprefixer');
|
var autoprefixer = require('autoprefixer');
|
||||||
var cssnano = require('cssnano');
|
var cssnano = require('cssnano');
|
||||||
var fs = require('fs');
|
|
||||||
|
|
||||||
gruntfile_cfg.config = {
|
gruntfile_cfg.config = {
|
||||||
dev: { options: { variables: { 'environment': 'development' }}},
|
dev: { options: { variables: { 'environment': 'development' }}},
|
||||||
|
|
Loading…
Reference in New Issue