mirror of
https://github.com/portainer/portainer.git
synced 2025-08-02 20:35:25 +02:00
* 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 vars
This commit is contained in:
parent
46da95ecfb
commit
e58acd7dd6
67 changed files with 121 additions and 146 deletions
|
@ -141,7 +141,7 @@ function (PaginationService, DatatableService, EndpointProvider) {
|
|||
PaginationService.setPaginationLimit(this.tableKey, this.state.paginatedItemLimit);
|
||||
};
|
||||
|
||||
this.applyFilters = function(value, index, array) {
|
||||
this.applyFilters = function(value) {
|
||||
var container = value;
|
||||
var filters = ctrl.filters;
|
||||
for (var i = 0; i < filters.state.values.length; i++) {
|
||||
|
|
|
@ -52,7 +52,7 @@ function (PaginationService, DatatableService) {
|
|||
PaginationService.setPaginationLimit(this.tableKey, this.state.paginatedItemLimit);
|
||||
};
|
||||
|
||||
this.applyFilters = function(value, index, array) {
|
||||
this.applyFilters = function(value) {
|
||||
var image = value;
|
||||
var filters = ctrl.filters;
|
||||
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;
|
||||
for (var i = 0; i < filters.state.values.length; i++) {
|
||||
var filter = filters.state.values[i];
|
||||
|
|
|
@ -6,7 +6,7 @@ function ($state, ServiceService, ServiceHelper, Notifications, ModalService, Im
|
|||
var config = ServiceHelper.serviceToConfig(service.Model);
|
||||
config.Mode.Replicated.Replicas = service.Replicas;
|
||||
ServiceService.update(service, config)
|
||||
.then(function success(data) {
|
||||
.then(function success() {
|
||||
Notifications.success('Service successfully scaled', 'New replica count: ' + service.Replicas);
|
||||
$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.
|
||||
config.TaskTemplate.ForceUpdate++;
|
||||
ServiceService.update(service, config)
|
||||
.then(function success(data) {
|
||||
.then(function success() {
|
||||
Notifications.success('Service successfully updated', service.Name);
|
||||
})
|
||||
.catch(function error(err) {
|
||||
|
|
|
@ -52,7 +52,7 @@ function (PaginationService, DatatableService) {
|
|||
PaginationService.setPaginationLimit(this.tableKey, this.state.paginatedItemLimit);
|
||||
};
|
||||
|
||||
this.applyFilters = function(value, index, array) {
|
||||
this.applyFilters = function(value) {
|
||||
var volume = value;
|
||||
var filters = ctrl.filters;
|
||||
if ((volume.dangling && filters.usage.showUnusedVolumes)
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
angular.module('portainer.docker')
|
||||
.controller('LogViewerController', ['clipboard',
|
||||
function (clipboard) {
|
||||
var ctrl = this;
|
||||
|
||||
this.state = {
|
||||
copySupported: clipboard.supported,
|
||||
|
|
|
@ -35,12 +35,6 @@ angular.module('portainer.docker')
|
|||
for (var v in container.Mounts) {
|
||||
if ({}.hasOwnProperty.call(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 containerPath = mount.Destination;
|
||||
if (name && containerPath) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
function ServiceViewModel(data, runningTasks, allTasks, nodes) {
|
||||
function ServiceViewModel(data, runningTasks, allTasks) {
|
||||
this.Model = data;
|
||||
this.Id = data.ID;
|
||||
this.Tasks = [];
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
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';
|
||||
var service = {};
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ function ($scope, $transition$, $state, ConfigService, Notifications) {
|
|||
|
||||
$scope.removeConfig = function removeConfig(configId) {
|
||||
ConfigService.remove(configId)
|
||||
.then(function success(data) {
|
||||
.then(function success() {
|
||||
Notifications.success('Config successfully removed');
|
||||
$state.go('docker.configs', {});
|
||||
})
|
||||
|
|
|
@ -12,7 +12,7 @@ function ($scope, $transition$, ContainerService, ImageService, EndpointProvider
|
|||
$scope.containerCommands = [];
|
||||
|
||||
// Ensure the socket is closed before leaving the view
|
||||
$scope.$on('$stateChangeStart', function (event, next, current) {
|
||||
$scope.$on('$stateChangeStart', function () {
|
||||
if (socket && socket !== null) {
|
||||
socket.close();
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ function ($scope, $transition$, ContainerService, ImageService, EndpointProvider
|
|||
socket = new WebSocket(url);
|
||||
|
||||
$scope.state.connected = true;
|
||||
socket.onopen = function(evt) {
|
||||
socket.onopen = function() {
|
||||
term = new Terminal();
|
||||
|
||||
term.on('data', function (data) {
|
||||
|
@ -88,10 +88,10 @@ function ($scope, $transition$, ContainerService, ImageService, EndpointProvider
|
|||
socket.onmessage = function (e) {
|
||||
term.write(e.data);
|
||||
};
|
||||
socket.onerror = function (error) {
|
||||
socket.onerror = function () {
|
||||
$scope.state.connected = false;
|
||||
};
|
||||
socket.onclose = function(evt) {
|
||||
socket.onclose = function() {
|
||||
$scope.state.connected = false;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -282,8 +282,8 @@ function ($q, $scope, $state, $timeout, $transition$, $filter, Container, Contai
|
|||
return config;
|
||||
}
|
||||
|
||||
|
||||
function loadFromContainerCmd(d) {
|
||||
|
||||
function loadFromContainerCmd() {
|
||||
if ($scope.config.Cmd) {
|
||||
$scope.config.Cmd = ContainerHelper.commandArrayToString($scope.config.Cmd);
|
||||
} else {
|
||||
|
@ -291,7 +291,7 @@ function ($q, $scope, $state, $timeout, $transition$, $filter, Container, Contai
|
|||
}
|
||||
}
|
||||
|
||||
function loadFromContainerPortBindings(d) {
|
||||
function loadFromContainerPortBindings() {
|
||||
var bindings = [];
|
||||
for (var p in $scope.config.HostConfig.PortBindings) {
|
||||
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 = [];
|
||||
for (var e in $scope.config.Env) {
|
||||
if ({}.hasOwnProperty.call($scope.config.Env, e)) {
|
||||
|
@ -397,7 +397,7 @@ function ($q, $scope, $state, $timeout, $transition$, $filter, Container, Contai
|
|||
$scope.config.Env = envArr;
|
||||
}
|
||||
|
||||
function loadFromContainerLabels(d) {
|
||||
function loadFromContainerLabels() {
|
||||
for (var l in $scope.config.Labels) {
|
||||
if ({}.hasOwnProperty.call($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) {
|
||||
$scope.formValues.Console = 'both';
|
||||
} 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 = [];
|
||||
for (var dev in $scope.config.HostConfig.Devices) {
|
||||
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;
|
||||
}
|
||||
|
||||
function loadFromContainerImageConfig(d) {
|
||||
function loadFromContainerImageConfig() {
|
||||
var imageInfo = ImageHelper.extractImageAndRegistryFromRepository($scope.config.Image);
|
||||
RegistryService.retrieveRegistryFromRepository($scope.config.Image)
|
||||
.then(function success(data) {
|
||||
|
|
|
@ -56,7 +56,7 @@ function ($q, $scope, $state, $transition$, $filter, Commit, ContainerHelper, Co
|
|||
|
||||
function executeContainerAction(id, action, successMessage, errorMessage) {
|
||||
action(id)
|
||||
.then(function success(data) {
|
||||
.then(function success() {
|
||||
Notifications.success(successMessage, id);
|
||||
update();
|
||||
})
|
||||
|
@ -104,7 +104,7 @@ function ($q, $scope, $state, $transition$, $filter, Commit, ContainerHelper, Co
|
|||
$scope.renameContainer = function () {
|
||||
var container = $scope.container;
|
||||
ContainerService.renameContainer($transition$.params().id, container.newContainerName)
|
||||
.then(function success(data) {
|
||||
.then(function success() {
|
||||
container.Name = container.newContainerName;
|
||||
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.state.leaveNetworkInProgress = true;
|
||||
NetworkService.disconnectContainer(networkId, container.Id, false)
|
||||
.then(function success(data) {
|
||||
.then(function success() {
|
||||
Notifications.success('Container left network', container.Id);
|
||||
$state.reload();
|
||||
})
|
||||
|
@ -135,7 +135,7 @@ function ($q, $scope, $state, $transition$, $filter, Commit, ContainerHelper, Co
|
|||
$scope.containerJoinNetwork = function containerJoinNetwork(container, networkId) {
|
||||
$scope.state.joinNetworkInProgress = true;
|
||||
NetworkService.connectContainer(networkId, container.Id)
|
||||
.then(function success(data) {
|
||||
.then(function success() {
|
||||
Notifications.success('Container joined network', container.Id);
|
||||
$state.reload();
|
||||
})
|
||||
|
@ -151,7 +151,7 @@ function ($q, $scope, $state, $transition$, $filter, Commit, ContainerHelper, Co
|
|||
var image = $scope.config.Image;
|
||||
var registry = $scope.config.Registry;
|
||||
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();
|
||||
Notifications.success('Container commited', $transition$.params().id);
|
||||
}, function (e) {
|
||||
|
|
|
@ -27,10 +27,6 @@ function ($scope, $transition$, $interval, ContainerService, Notifications, Http
|
|||
}
|
||||
}
|
||||
|
||||
function update(logs) {
|
||||
$scope.logs = logs;
|
||||
}
|
||||
|
||||
function setUpdateRepeater(skipHeaders) {
|
||||
var refreshRate = $scope.state.refreshRate;
|
||||
$scope.repeater = $interval(function() {
|
||||
|
|
|
@ -29,7 +29,7 @@ function ($q, $scope, $transition$, $state, $timeout, ImageService, RegistryServ
|
|||
var registry = $scope.formValues.Registry;
|
||||
|
||||
ImageService.tagImage($transition$.params().id, image, registry.URL)
|
||||
.then(function success(data) {
|
||||
.then(function success() {
|
||||
Notifications.success('Image successfully tagged');
|
||||
$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;
|
||||
return ImageService.pushImage(repository, registry);
|
||||
})
|
||||
.then(function success(data) {
|
||||
.then(function success() {
|
||||
Notifications.success('Image successfully pushed', repository);
|
||||
})
|
||||
.catch(function error(err) {
|
||||
|
@ -63,7 +63,7 @@ function ($q, $scope, $transition$, $state, $timeout, ImageService, RegistryServ
|
|||
var registry = data;
|
||||
return ImageService.pullImage(repository, registry, false);
|
||||
})
|
||||
.then(function success(data) {
|
||||
.then(function success() {
|
||||
Notifications.success('Image successfully pulled', repository);
|
||||
})
|
||||
.catch(function error(err) {
|
||||
|
|
|
@ -21,7 +21,7 @@ function ($scope, $state, ImageService, Notifications, ModalService, HttpRequest
|
|||
|
||||
$scope.state.actionInProgress = true;
|
||||
ImageService.pullImage(image, registry, false)
|
||||
.then(function success(data) {
|
||||
.then(function success() {
|
||||
Notifications.success('Image successfully pulled', image);
|
||||
$state.reload();
|
||||
})
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
angular.module('portainer.docker')
|
||||
.controller('NetworkController', ['$scope', '$state', '$transition$', '$filter', 'NetworkService', 'Container', 'ContainerHelper', 'Notifications', 'HttpRequestHelper',
|
||||
function ($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, Notifications, HttpRequestHelper) {
|
||||
|
||||
$scope.removeNetwork = function removeNetwork(networkId) {
|
||||
$scope.removeNetwork = function removeNetwork() {
|
||||
NetworkService.remove($transition$.params().id, $transition$.params().id)
|
||||
.then(function success(data) {
|
||||
.then(function success() {
|
||||
Notifications.success('Network removed', $transition$.params().id);
|
||||
$state.go('docker.networks', {});
|
||||
})
|
||||
|
@ -16,7 +16,7 @@ function ($scope, $state, $transition$, $filter, NetworkService, Container, Cont
|
|||
$scope.containerLeaveNetwork = function containerLeaveNetwork(network, container) {
|
||||
HttpRequestHelper.setPortainerAgentTargetHeader(container.NodeName);
|
||||
NetworkService.disconnectContainer($transition$.params().id, container.Id, false)
|
||||
.then(function success(data) {
|
||||
.then(function success() {
|
||||
Notifications.success('Container left network', $transition$.params().id);
|
||||
$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.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');
|
||||
$state.go('docker.nodes.node', {id: node.Id}, {reload: true});
|
||||
}, function (e) {
|
||||
|
|
|
@ -4,7 +4,7 @@ function ($scope, $transition$, $state, SecretService, Notifications) {
|
|||
|
||||
$scope.removeSecret = function removeSecret(secretId) {
|
||||
SecretService.remove(secretId)
|
||||
.then(function success(data) {
|
||||
.then(function success() {
|
||||
Notifications.success('Secret successfully removed');
|
||||
$state.go('docker.secrets', {});
|
||||
})
|
||||
|
|
|
@ -142,7 +142,7 @@ function ($q, $scope, $state, $timeout, Service, ServiceHelper, ConfigService, C
|
|||
$scope.formValues.ContainerLabels.splice(index, 1);
|
||||
};
|
||||
|
||||
$scope.addLogDriverOpt = function(value) {
|
||||
$scope.addLogDriverOpt = function() {
|
||||
$scope.formValues.LogDriverOpts.push({ name: '', value: ''});
|
||||
};
|
||||
|
||||
|
@ -492,7 +492,6 @@ function ($q, $scope, $state, $timeout, Service, ServiceHelper, ConfigService, C
|
|||
|
||||
function initView() {
|
||||
var apiVersion = $scope.applicationState.endpoint.apiVersion;
|
||||
var provider = $scope.applicationState.endpoint.mode.provider;
|
||||
|
||||
$q.all({
|
||||
volumes: VolumeService.volumes(),
|
||||
|
|
|
@ -125,7 +125,7 @@ function ($q, $scope, $transition$, $state, $location, $timeout, $anchorScroll,
|
|||
updateServiceArray(service, 'ServiceMounts', service.ServiceMounts);
|
||||
}
|
||||
};
|
||||
$scope.updateMount = function updateMount(service, mount) {
|
||||
$scope.updateMount = function updateMount(service) {
|
||||
updateServiceArray(service, 'ServiceMounts', service.ServiceMounts);
|
||||
};
|
||||
$scope.addPlacementConstraint = function addPlacementConstraint(service) {
|
||||
|
@ -138,7 +138,7 @@ function ($q, $scope, $transition$, $state, $location, $timeout, $anchorScroll,
|
|||
updateServiceArray(service, 'ServiceConstraints', service.ServiceConstraints);
|
||||
}
|
||||
};
|
||||
$scope.updatePlacementConstraint = function(service, constraint) {
|
||||
$scope.updatePlacementConstraint = function(service) {
|
||||
updateServiceArray(service, 'ServiceConstraints', service.ServiceConstraints);
|
||||
};
|
||||
|
||||
|
@ -152,7 +152,7 @@ function ($q, $scope, $transition$, $state, $location, $timeout, $anchorScroll,
|
|||
updateServiceArray(service, 'ServicePreferences', service.ServicePreferences);
|
||||
}
|
||||
};
|
||||
$scope.updatePlacementPreference = function(service, constraint) {
|
||||
$scope.updatePlacementPreference = function(service) {
|
||||
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' });
|
||||
};
|
||||
$scope.updatePublishedPort = function updatePublishedPort(service, portMapping) {
|
||||
$scope.updatePublishedPort = function updatePublishedPort(service) {
|
||||
updateServiceArray(service, 'Ports', service.Ports);
|
||||
};
|
||||
$scope.removePortPublishedBinding = function removePortPublishedBinding(service, index) {
|
||||
|
@ -203,7 +203,7 @@ function ($q, $scope, $transition$, $state, $location, $timeout, $anchorScroll,
|
|||
updateServiceArray(service, 'Hosts', service.Hosts);
|
||||
}
|
||||
};
|
||||
$scope.updateHostsEntry = function(service, entry) {
|
||||
$scope.updateHostsEntry = function(service) {
|
||||
updateServiceArray(service, 'Hosts', service.Hosts);
|
||||
};
|
||||
|
||||
|
@ -340,7 +340,7 @@ function ($q, $scope, $transition$, $state, $location, $timeout, $anchorScroll,
|
|||
function removeService() {
|
||||
$scope.state.deletionInProgress = true;
|
||||
ServiceService.remove($scope.service)
|
||||
.then(function success(data) {
|
||||
.then(function success() {
|
||||
Notifications.success('Service successfully deleted');
|
||||
$state.go('docker.services', {});
|
||||
})
|
||||
|
@ -377,7 +377,7 @@ function ($q, $scope, $transition$, $state, $location, $timeout, $anchorScroll,
|
|||
config.TaskTemplate.ForceUpdate++;
|
||||
$scope.state.updateInProgress = true;
|
||||
ServiceService.update(service, config)
|
||||
.then(function success(data) {
|
||||
.then(function success() {
|
||||
Notifications.success('Service successfully updated', service.Name);
|
||||
$scope.cancelChanges({});
|
||||
initView();
|
||||
|
|
|
@ -82,7 +82,7 @@ function ($q, $scope, $state, VolumeService, PluginService, ResourceControlServi
|
|||
var userId = userDetails.ID;
|
||||
return ResourceControlService.applyResourceControl('volume', volumeIdentifier, userId, accessControlData, []);
|
||||
})
|
||||
.then(function success(data) {
|
||||
.then(function success() {
|
||||
Notifications.success('Volume successfully created');
|
||||
$state.go('docker.volumes', {}, {reload: true});
|
||||
})
|
||||
|
|
|
@ -4,7 +4,7 @@ function ($scope, $state, $transition$, VolumeService, ContainerService, Notific
|
|||
|
||||
$scope.removeVolume = function removeVolume() {
|
||||
VolumeService.remove($scope.volume)
|
||||
.then(function success(data) {
|
||||
.then(function success() {
|
||||
Notifications.success('Volume successfully removed', $transition$.params().id);
|
||||
$state.go('docker.volumes', {});
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue