Improve notary cmd on UI

Signed-off-by: AllForNothing <sshijun@vmware.com>
This commit is contained in:
AllForNothing 2020-09-14 18:39:22 +08:00
parent 49c80f954c
commit 60c2350088

View File

@ -34,7 +34,7 @@ class InitTag {
name = "";
}
const DeleteTagWithNotoryCommand1 = 'notary -s https://';
const DeleteTagWithNotoryCommand2 = ' -d ~/.docker/trust remove -p ';
const DeleteTagWithNotoryCommand2 = ':4443 -d ~/.docker/trust remove -p ';
@Component({
selector: 'artifact-tag',
templateUrl: './artifact-tag.component.html',
@ -256,7 +256,12 @@ export class ArtifactTagComponent implements OnInit, OnDestroy {
}
}
}
deletePort(url): string {
if (url && url.indexOf(':') !== -1) {
return url.split(':')[0];
}
return url;
}
delOperate(tag: Tag): Observable<any> | null {
// init operation info
let operMessage = new OperateInfo();
@ -268,10 +273,10 @@ export class ArtifactTagComponent implements OnInit, OnDestroy {
if (tag.signed) {
forkJoin(this.translateService.get("BATCH.DELETED_FAILURE"),
this.translateService.get("REPOSITORY.DELETION_SUMMARY_TAG_DENIED")).subscribe(res => {
let wrongInfo: string = res[1] + DeleteTagWithNotoryCommand1 + this.registryUrl +
const wrongInfo: string = res[1] + DeleteTagWithNotoryCommand1 + this.deletePort(this.registryUrl) +
DeleteTagWithNotoryCommand2 +
this.registryUrl + "/" + this.repositoryName +
" " + name;
" " + tag.name;
operateChanges(operMessage, OperationState.failure, wrongInfo);
});
return of(null);