mirror of
https://github.com/portainer/portainer.git
synced 2025-07-30 10:49:40 +02:00
fix(services): prevent adding volume without source and target (#4538)
* feat(services): check that target mounts are non empty * feat(services): prevent creating service when no source * refactor(services): remove ng-form * fix(services): check that every volume is valid
This commit is contained in:
parent
5f2f7a87ab
commit
067257df2b
5 changed files with 51 additions and 19 deletions
|
@ -520,6 +520,12 @@ angular.module('portainer.docker').controller('CreateServiceController', [
|
|||
return true;
|
||||
}
|
||||
|
||||
$scope.volumesAreValid = volumesAreValid;
|
||||
function volumesAreValid() {
|
||||
const volumes = $scope.formValues.Volumes;
|
||||
return volumes.every((volume) => volume.Target && volume.Source);
|
||||
}
|
||||
|
||||
$scope.create = function createService() {
|
||||
var accessControlData = $scope.formValues.AccessControlData;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue