diff --git a/src/ui/auth/ldap/ldap.go b/src/ui/auth/ldap/ldap.go index 16f8cb48b..235013c3d 100644 --- a/src/ui/auth/ldap/ldap.go +++ b/src/ui/auth/ldap/ldap.go @@ -59,7 +59,8 @@ func (l *Auth) Authenticate(m models.AuthModel) (*models.User, error) { ldapUsers, err := ldapUtils.SearchUser(ldapConfs) if err != nil { - return nil, fmt.Errorf("ldap search fail: %v", err) + log.Warningf("ldap search fail: %v", err) + return nil, nil } if len(ldapUsers) == 0 { diff --git a/src/ui_ng/src/app/repository/repository.service.ts b/src/ui_ng/src/app/repository/repository.service.ts index 642a338b8..03dcfe9bd 100644 --- a/src/ui_ng/src/app/repository/repository.service.ts +++ b/src/ui_ng/src/app/repository/repository.service.ts @@ -61,7 +61,7 @@ export class RepositoryService { tags.forEach(t=>{ for(let i = 0; i < signatures.length; i++) { if(signatures[i].tag === t.tag) { - t.signed = true; + t.signed = 1; break; } } @@ -69,7 +69,7 @@ export class RepositoryService { return tags; }) .catch(error=>{ - return tags; + return Observable.of(tags); }) }) .catch(error=>Observable.throw(error)); diff --git a/src/ui_ng/src/app/repository/tag-repository/tag-repository.component.html b/src/ui_ng/src/app/repository/tag-repository/tag-repository.component.html index eb7fc8fc4..4d38410c7 100644 --- a/src/ui_ng/src/app/repository/tag-repository/tag-repository.component.html +++ b/src/ui_ng/src/app/repository/tag-repository/tag-repository.component.html @@ -25,22 +25,26 @@ {{'REPOSITORY.ARCHITECTURE' | translate}} {{'REPOSITORY.OS' | translate}} - - - - - - {{t.tag}} - {{t.pullCommand}} - - - - - {{t.author}} - {{t.created | date: 'short'}} - {{t.dockerVersion}} - {{t.architecture}} - {{t.os}} + + + + + + {{t.tag}} + {{t.pullCommand}} + + + + + + {{'REPOSITORY.NOTARY_IS_UNDETERMINED' | translate}} + + + {{t.author}} + {{t.created | date: 'short'}} + {{t.dockerVersion}} + {{t.architecture}} + {{t.os}} {{tags ? tags.length : 0}} {{'REPOSITORY.ITEMS' | translate}} \ No newline at end of file diff --git a/src/ui_ng/src/app/repository/tag-repository/tag-repository.component.ts b/src/ui_ng/src/app/repository/tag-repository/tag-repository.component.ts index 5c5db27df..0036fde71 100644 --- a/src/ui_ng/src/app/repository/tag-repository/tag-repository.component.ts +++ b/src/ui_ng/src/app/repository/tag-repository/tag-repository.component.ts @@ -69,7 +69,6 @@ export class TagRepositoryComponent implements OnInit, OnDestroy { private appConfigService: AppConfigService, private session: SessionService, private ref: ChangeDetectorRef){ - this.subscription = this.deletionDialogService.confirmationConfirm$.subscribe( message => { if (message && @@ -118,19 +117,31 @@ export class TagRepositoryComponent implements OnInit, OnDestroy { retrieve() { this.tags = []; + this.repositoryService + .listTags(this.repoName) + .subscribe( + items => this.listTags(items), + error => this.messageHandlerService.handleError(error)); + if(this.withNotary) { this.repositoryService - .listTagsWithVerifiedSignatures(this.repoName) + .listNotarySignatures(this.repoName) .subscribe( - items => this.listTags(items), - error => this.messageHandlerService.handleError(error)); - } else { - this.repositoryService - .listTags(this.repoName) - .subscribe( - items => this.listTags(items), - error => this.messageHandlerService.handleError(error)); - } + signatures => { + this.tags.forEach((t, n)=>{ + let signed = false; + for(let i = 0; i < signatures.length; i++) { + if (signatures[i].tag === t.tag) { + signed = true; + break; + } + } + this.tags[n].signed = (signed) ? 1 : 0; + this.ref.markForCheck(); + }); + }, + error => console.error('Cannot determine the signature of this tag.')); + } } listTags(tags: Tag[]): void { diff --git a/src/ui_ng/src/app/repository/tag-view.ts b/src/ui_ng/src/app/repository/tag-view.ts index 63d5523b0..9c164be09 100644 --- a/src/ui_ng/src/app/repository/tag-view.ts +++ b/src/ui_ng/src/app/repository/tag-view.ts @@ -14,7 +14,7 @@ export class TagView { tag: string; pullCommand: string; - signed: boolean; + signed: number = -1; author: string; created: Date; dockerVersion: string; diff --git a/src/ui_ng/src/app/repository/tag.ts b/src/ui_ng/src/app/repository/tag.ts index 5a7b70979..9c9087ed0 100644 --- a/src/ui_ng/src/app/repository/tag.ts +++ b/src/ui_ng/src/app/repository/tag.ts @@ -36,5 +36,5 @@ export class Tag { } ]; }; - signed: boolean; + signed: number; } \ No newline at end of file diff --git a/src/ui_ng/src/app/shared/session.service.ts b/src/ui_ng/src/app/shared/session.service.ts index 902a0e5c0..b6ba8755c 100644 --- a/src/ui_ng/src/app/shared/session.service.ts +++ b/src/ui_ng/src/app/shared/session.service.ts @@ -68,12 +68,11 @@ export class SessionService { //Submit signin form to backend (NOT restful service) signIn(signInCredential: SignInCredential): Promise { //Build the form package - const body = new URLSearchParams(); - body.set('principal', signInCredential.principal); - body.set('password', signInCredential.password); + let queryParam:string = 'principal=' + encodeURIComponent(signInCredential.principal) + + '&password=' + encodeURIComponent(signInCredential.password); //Trigger Http - return this.http.post(signInUrl, body.toString(), { headers: this.formHeaders }) + return this.http.post(signInUrl, queryParam, { headers: this.formHeaders }) .toPromise() .then(() => null) .catch(error => this.handleError(error)); diff --git a/src/ui_ng/src/i18n/lang/en-us-lang.json b/src/ui_ng/src/i18n/lang/en-us-lang.json index 749021087..07d76b2f5 100644 --- a/src/ui_ng/src/i18n/lang/en-us-lang.json +++ b/src/ui_ng/src/i18n/lang/en-us-lang.json @@ -327,7 +327,8 @@ "POP_REPOS": "Popular Repositories", "DELETED_REPO_SUCCESS": "Deleted repository successfully.", "DELETED_TAG_SUCCESS": "Deleted tag successfully.", - "COPY": "Copy" + "COPY": "Copy", + "NOTARY_IS_UNDETERMINED": "Cannot determine the signature of this tag." }, "ALERT": { "FORM_CHANGE_CONFIRMATION": "Some changes are not saved yet. Do you want to cancel?" diff --git a/src/ui_ng/src/i18n/lang/zh-cn-lang.json b/src/ui_ng/src/i18n/lang/zh-cn-lang.json index fae39b8c0..c25a4fe7c 100644 --- a/src/ui_ng/src/i18n/lang/zh-cn-lang.json +++ b/src/ui_ng/src/i18n/lang/zh-cn-lang.json @@ -327,7 +327,8 @@ "POP_REPOS": "受欢迎的镜像仓库", "DELETED_REPO_SUCCESS": "成功删除镜像仓库。", "DELETED_TAG_SUCCESS": "成功删除镜像标签。", - "COPY": "复制" + "COPY": "复制", + "NOTARY_IS_UNDETERMINED": "无法确定镜像标签签名。" }, "ALERT": { "FORM_CHANGE_CONFIRMATION": "表单内容改变,确认是否取消?"