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

fix(UI) Update all network pages EE-3509 (#7324)

* EE-3509 update all network pages

* EE-3509 update access control panel and network container table
This commit is contained in:
Rex Wang 2022-07-25 07:57:18 +08:00 committed by GitHub
parent 5f5cb36df1
commit 5b3f099f4e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 71 additions and 60 deletions

View file

@ -5,7 +5,7 @@ import { r2a } from '@/react-tools/react2angular';
import { TeamMembership, Role } from '@/portainer/teams/types';
import { useUserMembership } from '@/portainer/users/queries';
import { Widget, WidgetBody, WidgetTitle } from '@@/Widget';
import { Table, TableContainer, TableTitle } from '@@/datatables';
import { Button } from '@@/buttons';
import { ResourceControlType, ResourceId } from '../types';
@ -45,9 +45,9 @@ export function AccessControlPanel({
return (
<div className="row">
<div className="col-sm-12">
<Widget>
<WidgetTitle title="Access control" icon="fa-eye" />
<WidgetBody className="no-padding">
<TableContainer>
<TableTitle label="Access control" icon="eye" featherIcon />
<Table className="no-padding">
<AccessControlPanelDetails
resourceType={resourceType}
resourceControl={resourceControl}
@ -73,8 +73,8 @@ export function AccessControlPanel({
onUpdateSuccess={handleUpdateSuccess}
/>
)}
</WidgetBody>
</Widget>
</Table>
</TableContainer>
</div>
</div>
);

View file

@ -3,13 +3,14 @@
<!-- access-control-switch -->
<div class="form-group">
<div class="col-sm-12">
<label for="ownership" class="control-label text-left">
Enable access control
<portainer-tooltip message="'When enabled, you can restrict the access and management of this resource.'"></portainer-tooltip>
</label>
<label class="switch" style="margin-left: 20px">
<input name="ownership" type="checkbox" ng-model="$ctrl.formData.AccessControlEnabled" /><i data-cy="portainer-accessMgmtToggle"></i>
</label>
<por-switch-field
label-class="'col-sm-2'"
checked="$ctrl.formData.AccessControlEnabled"
label="'Enable access control'"
tooltip="'When enabled, you can restrict the access and management of this resource.'"
on-change="($ctrl.onChangeEnablement)"
data-cy="portainer-accessMgmtToggle"
></por-switch-field>
</div>
</div>
<!-- !access-control-switch -->

View file

@ -3,12 +3,13 @@ import { ResourceControlOwnership as RCO } from '@/portainer/access-control/type
angular.module('portainer.app').controller('porAccessControlFormController', [
'$q',
'$scope',
'UserService',
'TeamService',
'Notifications',
'Authentication',
'ResourceControlService',
function ($q, UserService, TeamService, Notifications, Authentication, ResourceControlService) {
function ($q, $scope, UserService, TeamService, Notifications, Authentication, ResourceControlService) {
var ctrl = this;
ctrl.RCO = RCO;
@ -79,6 +80,12 @@ angular.module('portainer.app').controller('porAccessControlFormController', [
.catch(function error(err) {
Notifications.error('Failure', err, 'Unable to retrieve access control information');
});
this.onChangeEnablement = function (enable) {
$scope.$evalAsync(() => {
ctrl.formData.AccessControlEnabled = enable;
});
};
}
},
]);