diff --git a/src/ui_ng/angular-cli.json b/src/ui_ng/angular-cli.json index e68629169..87732b1de 100644 --- a/src/ui_ng/angular-cli.json +++ b/src/ui_ng/angular-cli.json @@ -8,7 +8,8 @@ "outDir": "dist", "assets": [ "images", - "favicon.ico" + "favicon.ico", + "setting.json" ], "index": "index.html", "main": "main.ts", diff --git a/src/ui_ng/lib/src/push-image/copy-input.component.ts b/src/ui_ng/lib/src/push-image/copy-input.component.ts index 081a7c8f1..1ce7f3b73 100644 --- a/src/ui_ng/lib/src/push-image/copy-input.component.ts +++ b/src/ui_ng/lib/src/push-image/copy-input.component.ts @@ -1,4 +1,4 @@ -import { Component, Input, Output, EventEmitter } from '@angular/core'; +import { Component, Input, Output, EventEmitter, OnInit } from '@angular/core'; import { COPY_INPUT_HTML } from './copy-input.html'; import { PUSH_IMAGE_STYLE } from './push-image.css'; @@ -14,16 +14,19 @@ export const enum CopyStatus { providers: [] }) -export class CopyInputComponent { + +export class CopyInputComponent implements OnInit { @Input() inputSize: number = 40; @Input() headerTitle: string = "Copy Input"; @Input() defaultValue: string = "N/A"; + @Input() iconMode: boolean = false; state: CopyStatus = CopyStatus.NORMAL; @Output() onCopySuccess: EventEmitter = new EventEmitter(); @Output() onCopyError: EventEmitter = new EventEmitter(); + ngOnInit(): void { } onSuccess($event: any): void { this.state = CopyStatus.SUCCESS; this.onCopySuccess.emit($event); @@ -38,6 +41,10 @@ export class CopyInputComponent { this.state = CopyStatus.NORMAL; } + setPullCommendShow(): void { + this.iconMode = false; + } + public get isCopied(): boolean { return this.state === CopyStatus.SUCCESS; } 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 408345d66..4f43749d1 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 @@ -1,15 +1,19 @@ export const COPY_INPUT_HTML: string = `
-
+
{{headerTitle}}
- + - + + + +
+
`; \ No newline at end of file diff --git a/src/ui_ng/lib/src/push-image/push-image.css.ts b/src/ui_ng/lib/src/push-image/push-image.css.ts index 78ee359c5..ce9ac53ad 100644 --- a/src/ui_ng/lib/src/push-image/push-image.css.ts +++ b/src/ui_ng/lib/src/push-image/push-image.css.ts @@ -43,4 +43,7 @@ export const PUSH_IMAGE_STYLE: string = ` .btn-font { font-size: 14px !important; } +.hide{ + display:none; +} `; \ No newline at end of file diff --git a/src/ui_ng/lib/src/tag/tag.component.html.ts b/src/ui_ng/lib/src/tag/tag.component.html.ts index eb77c920c..228bb8136 100644 --- a/src/ui_ng/lib/src/tag/tag.component.html.ts +++ b/src/ui_ng/lib/src/tag/tag.component.html.ts @@ -15,12 +15,12 @@ export const TAG_TEMPLATE = `

{{repoName}}

- {{'REPOSITORY.TAG' | translate}} - {{'REPOSITORY.SIZE' | translate}} - {{'REPOSITORY.PULL_COMMAND' | translate}} - {{'VULNERABILITY.SINGULAR' | translate}} + {{'REPOSITORY.TAG' | translate}} + {{'REPOSITORY.SIZE' | translate}} + {{'REPOSITORY.PULL_COMMAND' | translate}} + {{'VULNERABILITY.SINGULAR' | translate}} {{'REPOSITORY.SIGNED' | translate}} - {{'REPOSITORY.AUTHOR' | translate}} + {{'REPOSITORY.AUTHOR' | translate}} {{'REPOSITORY.CREATED' | translate}} {{'REPOSITORY.DOCKER_VERSION' | translate}} {{'TGA.PLACEHOLDER' | translate }} @@ -30,13 +30,15 @@ export const TAG_TEMPLATE = ` - - {{t.name}} + + {{t.name}} {{t.name}} - {{t.size}} - docker pull {{registryUrl}}/{{repoName}}:{{t.name}} - + {{t.size}} + + + + @@ -47,7 +49,7 @@ export const TAG_TEMPLATE = ` {{'REPOSITORY.NOTARY_IS_UNDETERMINED' | translate}} - {{t.author}} + {{t.author}} {{t.created | date: 'short'}} {{t.docker_version}} diff --git a/src/ui_ng/lib/src/tag/tag.component.spec.ts b/src/ui_ng/lib/src/tag/tag.component.spec.ts index 2dfb306c1..f58f57acb 100644 --- a/src/ui_ng/lib/src/tag/tag.component.spec.ts +++ b/src/ui_ng/lib/src/tag/tag.component.spec.ts @@ -18,6 +18,7 @@ import { Observable, Subscription } from 'rxjs/Rx'; import { ChannelService } from '../channel/index'; import { JobLogViewerComponent } from '../job-log-viewer/index'; +import {CopyInputComponent} from "../push-image/copy-input.component"; describe('TagComponent (inline template)', () => { @@ -53,7 +54,8 @@ describe('TagComponent (inline template)', () => { ConfirmationDialogComponent, VULNERABILITY_DIRECTIVES, FILTER_DIRECTIVES, - JobLogViewerComponent + JobLogViewerComponent, + CopyInputComponent ], providers: [ ErrorHandler, diff --git a/src/ui_ng/lib/src/tag/tag.component.ts b/src/ui_ng/lib/src/tag/tag.component.ts index f934cf120..c0fe3f087 100644 --- a/src/ui_ng/lib/src/tag/tag.component.ts +++ b/src/ui_ng/lib/src/tag/tag.component.ts @@ -50,6 +50,7 @@ import { import { TranslateService } from '@ngx-translate/core'; import { State, Comparator } from 'clarity-angular'; +import {CopyInputComponent} from "../push-image/copy-input.component"; @Component({ selector: 'hbr-tag', @@ -91,6 +92,8 @@ export class TagComponent implements OnInit { confirmationDialog: ConfirmationDialogComponent; @ViewChild('digestTarget') textInput: ElementRef; + @ViewChild('copyInput') copyInput: CopyInputComponent; + constructor( private errorHandler: ErrorHandler, @@ -253,7 +256,7 @@ export class TagComponent implements OnInit { } } - //Get vulnerability scanning status + //Get vulnerability scanning status scanStatus(t: Tag): string { if (t && t.scan_overview && t.scan_overview.scan_status) { return t.scan_overview.scan_status; @@ -285,4 +288,9 @@ export class TagComponent implements OnInit { this.channel.publishScanEvent(this.repoName + "/" + tagId); } } + + //pull command + onCpError($event: any): void { + this.copyInput.setPullCommendShow(); + } } diff --git a/src/ui_ng/package.json b/src/ui_ng/package.json index 9432f633b..df9696851 100644 --- a/src/ui_ng/package.json +++ b/src/ui_ng/package.json @@ -31,7 +31,7 @@ "clarity-icons": "^0.9.8", "clarity-ui": "^0.9.8", "core-js": "^2.4.1", - "harbor-ui": "0.4.72", + "harbor-ui": "0.4.83", "intl": "^1.2.5", "mutationobserver-shim": "^0.3.2", "ngx-cookie": "^1.0.0", diff --git a/src/ui_ng/src/app/account/sign-in/sign-in.component.css b/src/ui_ng/src/app/account/sign-in/sign-in.component.css index dbc820b4a..f9251f47c 100644 --- a/src/ui_ng/src/app/account/sign-in/sign-in.component.css +++ b/src/ui_ng/src/app/account/sign-in/sign-in.component.css @@ -24,7 +24,7 @@ flex-direction: column; height: auto; position: relative; - margin-left: 1px; + border-left: 1px solid #eee; } .login-wrapper-override { diff --git a/src/ui_ng/src/app/account/sign-in/sign-in.component.html b/src/ui_ng/src/app/account/sign-in/sign-in.component.html index 2000863d5..359a89b92 100644 --- a/src/ui_ng/src/app/account/sign-in/sign-in.component.html +++ b/src/ui_ng/src/app/account/sign-in/sign-in.component.html @@ -1,4 +1,4 @@ -