diff --git a/src/ui_ng/lib/src/push-image/copy-input.html.ts b/src/ui_ng/lib/src/push-image/copy-input.html.ts index 631c0b8c4..4006358b4 100644 --- a/src/ui_ng/lib/src/push-image/copy-input.html.ts +++ b/src/ui_ng/lib/src/push-image/copy-input.html.ts @@ -8,7 +8,7 @@ export const COPY_INPUT_HTML = ` - + diff --git a/src/ui_ng/src/app/replication/replication-rule/replication-rule.component.ts b/src/ui_ng/src/app/replication/replication-rule/replication-rule.component.ts index 311316cab..1ccb7d7b7 100644 --- a/src/ui_ng/src/app/replication/replication-rule/replication-rule.component.ts +++ b/src/ui_ng/src/app/replication/replication-rule/replication-rule.component.ts @@ -471,6 +471,7 @@ export class ReplicationRuleComponent implements OnInit, OnDestroy { this.repService.updateEndpoint(endpointId, pullData) .then((res: any) => { this.saveRuleOpe(); + this.firstEndpointData = Object.assign({}, this.realEndpointData); }) .catch((error: any) => { this.inProgress = false; diff --git a/src/ui_ng/src/app/replication/replication-rule/replication-rule.html b/src/ui_ng/src/app/replication/replication-rule/replication-rule.html index b0e1105b8..d2ea5266c 100644 --- a/src/ui_ng/src/app/replication/replication-rule/replication-rule.html +++ b/src/ui_ng/src/app/replication/replication-rule/replication-rule.html @@ -58,7 +58,7 @@
diff --git a/src/ui_ng/src/app/user/user.component.html b/src/ui_ng/src/app/user/user.component.html index fe8abb160..6914135f3 100644 --- a/src/ui_ng/src/app/user/user.component.html +++ b/src/ui_ng/src/app/user/user.component.html @@ -13,7 +13,7 @@ - + {{'USER.COLUMN_NAME' | translate}} {{'USER.COLUMN_ADMIN' | translate}} diff --git a/src/ui_ng/src/app/user/user.component.ts b/src/ui_ng/src/app/user/user.component.ts index 473d219a7..48ca425d8 100644 --- a/src/ui_ng/src/app/user/user.component.ts +++ b/src/ui_ng/src/app/user/user.component.ts @@ -94,6 +94,10 @@ export class UserComponent implements OnInit, OnDestroy { return false; } + get onlySelf(): boolean { + return this.selectedRow.length === 1 && this.isMySelf(this.selectedRow[0].user_id); + } + private isMatchFilterTerm(terms: string, testedItem: string): boolean { return testedItem.toLowerCase().indexOf(terms.toLowerCase()) !== -1; } @@ -222,17 +226,17 @@ export class UserComponent implements OnInit, OnDestroy { deleteUsers(users: User[]): void { let userArr: string[] = []; this.batchDelectionInfos = []; - if (users && users.length) { - for (let i = 0; i < users.length; i++) { + if (this.onlySelf) { + return; + } - if (this.isMySelf(users[i].user_id)) { - continue; //Double confirm - } - let initBatchMessage = new BatchInfo (); - initBatchMessage.name = users[i].username; - this.batchDelectionInfos.push(initBatchMessage); - userArr.push(users[i].username); - } + if (users && users.length) { + users.forEach(user => { + let initBatchMessage = new BatchInfo (); + initBatchMessage.name = user.username; + this.batchDelectionInfos.push(initBatchMessage); + userArr.push(user.username); + }) this.deletionDialogService.addBatchInfoList(this.batchDelectionInfos); //Confirm deletion let msg: ConfirmationMessage = new ConfirmationMessage( @@ -252,7 +256,14 @@ export class UserComponent implements OnInit, OnDestroy { let promiseLists: any[] = []; if (users && users.length) { users.forEach(user => { - promiseLists.push(this.delOperate(user.user_id, user.username)); + let findedList = this.batchDelectionInfos.find(data => data.name === user.username); + if (this.isMySelf(user.user_id)) { + this.translate.get('BATCH.DELETED_FAILURE').subscribe(res => { + findedList = BathInfoChanges(findedList, res, false, true); + }); + } else { + promiseLists.push(this.delOperate(user.user_id, user.username)); + } }); Promise.all(promiseLists).then((item) => {