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

Revert "feat(ACI): add UAC to ACI (#4952)" (#4982)

This reverts commit 12cf4a00f0.
This commit is contained in:
LP B 2021-04-13 15:56:43 +02:00 committed by GitHub
parent 12cf4a00f0
commit 2f95b449aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 18 additions and 410 deletions

View file

@ -49,13 +49,6 @@
<th>
Published Ports
</th>
<th>
<a ng-click="$ctrl.changeOrderBy('ResourceControl.Ownership')">
Ownership
<i class="fa fa-sort-alpha-down" aria-hidden="true" ng-if="$ctrl.state.orderBy === 'ResourceControl.Ownership' && !$ctrl.state.reverseOrder"></i>
<i class="fa fa-sort-alpha-up" aria-hidden="true" ng-if="$ctrl.state.orderBy === 'ResourceControl.Ownership' && $ctrl.state.reverseOrder"></i>
</a>
</th>
</tr>
</thead>
<tbody>
@ -77,12 +70,6 @@
</a>
<span ng-if="item.Ports.length == 0">-</span>
</td>
<td>
<span>
<i ng-class="item.ResourceControl.Ownership | ownershipicon" aria-hidden="true"></i>
{{ item.ResourceControl.Ownership ? item.ResourceControl.Ownership : item.ResourceControl.Ownership = $ctrl.RCO.ADMINISTRATORS }}
</span>
</td>
</tr>
<tr ng-if="!$ctrl.dataset">
<td colspan="3" class="text-center text-muted">Loading...</td>

View file

@ -2,7 +2,7 @@ angular.module('portainer.azure').component('containergroupsDatatable', {
templateUrl: './containerGroupsDatatable.html',
controller: 'GenericDatatableController',
bindings: {
titleText: '@',
title: '@',
titleIcon: '@',
dataset: '<',
tableKey: '@',

View file

@ -1,6 +1,3 @@
import { AccessControlFormData } from 'Portainer/components/accessControlForm/porAccessControlFormModel';
import { ResourceControlViewModel } from 'Portainer/models/resourceControl/resourceControl';
export function ContainerGroupDefaultModel() {
this.Location = '';
this.OSType = 'Linux';
@ -16,7 +13,6 @@ export function ContainerGroupDefaultModel() {
];
this.CPU = 1;
this.Memory = 1;
this.AccessControlData = new AccessControlFormData();
}
export function ContainerGroupViewModel(data) {
@ -34,10 +30,6 @@ export function ContainerGroupViewModel(data) {
this.AllocatePublicIP = data.properties.ipAddress.type === 'Public';
this.CPU = container.properties.resources.requests.cpu;
this.Memory = container.properties.resources.requests.memoryInGB;
if (data.Portainer && data.Portainer.ResourceControl) {
this.ResourceControl = new ResourceControlViewModel(data.Portainer.ResourceControl);
}
}
export function CreateContainerGroupRequest(model) {

View file

@ -131,8 +131,4 @@
</rd-widget-body>
</rd-widget>
</div>
<!-- access-control-panel -->
<por-access-control-panel ng-if="$ctrl.container" resource-id="$ctrl.container.Id" resource-control="$ctrl.container.ResourceControl" resource-type="'container-group'">
</por-access-control-panel>
<!-- !access-control-panel -->
</div>

View file

@ -6,9 +6,7 @@ angular.module('portainer.azure').controller('AzureCreateContainerInstanceContro
'$state',
'AzureService',
'Notifications',
'Authentication',
'ResourceControlService',
function ($q, $scope, $state, AzureService, Notifications, Authentication, ResourceControlService) {
function ($q, $scope, $state, AzureService, Notifications) {
var allResourceGroups = [];
var allProviders = [];
@ -44,12 +42,12 @@ angular.module('portainer.azure').controller('AzureCreateContainerInstanceContro
$scope.state.actionInProgress = true;
AzureService.createContainerGroup(model, subscriptionId, resourceGroupName)
.then(applyResourceControl)
.then(() => {
.then(function success() {
Notifications.success('Container successfully created', model.Name);
$state.go('azure.containerinstances');
})
.catch(function error(err) {
err = err.data ? err.data.error : err;
Notifications.error('Failure', err, 'Unable to create container');
})
.finally(function final() {
@ -57,14 +55,6 @@ angular.module('portainer.azure').controller('AzureCreateContainerInstanceContro
});
};
function applyResourceControl(newResourceGroup) {
const userId = Authentication.getUserDetails().ID;
const resourceControl = newResourceGroup.Portainer.ResourceControl;
const accessControlData = $scope.model.AccessControlData;
return ResourceControlService.applyResourceControl(userId, accessControlData, resourceControl);
}
function validateForm(model) {
if (!model.Ports || !model.Ports.length || model.Ports.every((port) => !port.host || !port.container)) {
return 'At least one port binding is required';
@ -83,7 +73,7 @@ angular.module('portainer.azure').controller('AzureCreateContainerInstanceContro
}
function initView() {
$scope.model = new ContainerGroupDefaultModel();
var model = new ContainerGroupDefaultModel();
AzureService.subscriptions()
.then(function success(data) {
@ -103,6 +93,8 @@ angular.module('portainer.azure').controller('AzureCreateContainerInstanceContro
var containerInstancesProviders = data.containerInstancesProviders;
allProviders = containerInstancesProviders;
$scope.model = model;
var selectedSubscription = $scope.state.selectedSubscription;
updateResourceGroupsAndLocations(selectedSubscription, resourceGroups, containerInstancesProviders);
})

View file

@ -157,9 +157,6 @@
</div>
</div>
<!-- !memory-input -->
<!-- access-control -->
<por-access-control-form form-data="model.AccessControlData"></por-access-control-form>
<!-- !access-control -->
<!-- actions -->
<div class="col-sm-12 form-section-title">
Actions

View file

@ -7,7 +7,6 @@ export const ResourceControlTypeString = Object.freeze({
STACK: 'stack',
VOLUME: 'volume',
CUSTOM_TEMPLATE: 'custom-template',
CONTAINER_GROUP: 'container-group',
});
/**
@ -22,5 +21,4 @@ export const ResourceControlTypeInt = Object.freeze({
STACK: 6,
CONFIG: 7,
CUSTOM_TEMPLATE: 8,
CONTAINER_GROUP: 9,
});

View file

@ -26,8 +26,6 @@ angular.module('portainer.app').factory('Notifications', [
msg = e.data.message;
} else if (e.data && e.data.content) {
msg = e.data.content;
} else if (e.data && e.data.error) {
msg = e.data.error;
} else if (e.message) {
msg = e.message;
} else if (e.err && e.err.data && e.err.data.length > 0 && e.err.data[0].message) {