From 503a33293737456d378cc6c3e9c4f4b84de1d54b Mon Sep 17 00:00:00 2001 From: kunw Date: Wed, 5 Apr 2017 18:51:37 +0800 Subject: [PATCH 1/6] Fix UX issues. --- .../create-edit-destination.component.ts | 2 +- src/ui_ng/src/app/replication/replication.component.ts | 2 +- .../app/repository/tag-repository/tag-repository.component.ts | 2 +- .../confirmation-dialog/confirmation-dialog.component.html | 2 +- .../shared/confirmation-dialog/confirmation-dialog.component.ts | 2 ++ .../shared/create-edit-policy/create-edit-policy.component.ts | 2 +- src/ui_ng/src/i18n/lang/en-us-lang.json | 2 +- 7 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/ui_ng/src/app/replication/create-edit-destination/create-edit-destination.component.ts b/src/ui_ng/src/app/replication/create-edit-destination/create-edit-destination.component.ts index 0e55f7d63..65a996983 100644 --- a/src/ui_ng/src/app/replication/create-edit-destination/create-edit-destination.component.ts +++ b/src/ui_ng/src/app/replication/create-edit-destination/create-edit-destination.component.ts @@ -209,7 +209,7 @@ export class CreateEditDestinationComponent implements AfterViewChecked { for(let i in data) { let current = data[i]; let origin = this.initVal[this.mappedName[i]]; - if(current && current !== origin) { + if(this.actionType === ActionType.EDIT && this.editable && !current || current && current !== origin) { this.hasChanged = true; break; } else { diff --git a/src/ui_ng/src/app/replication/replication.component.ts b/src/ui_ng/src/app/replication/replication.component.ts index b743634b3..a3ea9cae0 100644 --- a/src/ui_ng/src/app/replication/replication.component.ts +++ b/src/ui_ng/src/app/replication/replication.component.ts @@ -68,7 +68,7 @@ export class ReplicationComponent implements OnInit { changedJobs: Job[]; initSelectedId: number; - policies: Policy[];retrieve + policies: Policy[]; jobs: Job[]; jobsTotalRecordCount: number; 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 f430a5904..0b53e6a4f 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 @@ -144,7 +144,7 @@ export class TagRepositoryComponent implements OnInit, OnDestroy { titleKey = 'REPOSITORY.DELETION_TITLE_TAG_DENIED'; summaryKey = 'REPOSITORY.DELETION_SUMMARY_TAG_DENIED'; confirmOnly = true; - content = 'notary -s https://' + this.registryUrl + ' -d ~/.docker/trust remove -p ' + this.registryUrl + '/' + this.repoName + ':' + tag.tag; + content = 'notary -s https://' + this.registryUrl + ':4443 -d ~/.docker/trust remove -p ' + this.registryUrl + '/' + this.repoName + ' ' + tag.tag; } else { titleKey = 'REPOSITORY.DELETION_TITLE_TAG'; summaryKey = 'REPOSITORY.DELETION_SUMMARY_TAG'; diff --git a/src/ui_ng/src/app/shared/confirmation-dialog/confirmation-dialog.component.html b/src/ui_ng/src/app/shared/confirmation-dialog/confirmation-dialog.component.html index 2da45b849..fe56db9b8 100644 --- a/src/ui_ng/src/app/shared/confirmation-dialog/confirmation-dialog.component.html +++ b/src/ui_ng/src/app/shared/confirmation-dialog/confirmation-dialog.component.html @@ -8,6 +8,6 @@ \ No newline at end of file diff --git a/src/ui_ng/src/app/shared/confirmation-dialog/confirmation-dialog.component.ts b/src/ui_ng/src/app/shared/confirmation-dialog/confirmation-dialog.component.ts index 044009d2c..da1501948 100644 --- a/src/ui_ng/src/app/shared/confirmation-dialog/confirmation-dialog.component.ts +++ b/src/ui_ng/src/app/shared/confirmation-dialog/confirmation-dialog.component.ts @@ -17,6 +17,7 @@ export class ConfirmationDialogComponent implements OnDestroy { opened: boolean = false; dialogTitle: string = ""; dialogContent: string = ""; + buttonKey: string = 'BUTTON.OK'; confirmOnly: boolean = false; message: ConfirmationMessage; private annouceSubscription: Subscription; @@ -29,6 +30,7 @@ export class ConfirmationDialogComponent implements OnDestroy { this.dialogContent = msg.message; this.message = msg; this.confirmOnly = this.message.confirmOnly; + this.buttonKey = this.confirmOnly ? 'BUTTON.CLOSE' : 'BUTTON.OK'; this.translate.get(this.dialogTitle).subscribe((res: string) => this.dialogTitle = res); this.translate.get(this.dialogContent, { 'param': msg.param }).subscribe((res: string) => this.dialogContent = res); //Open dialog diff --git a/src/ui_ng/src/app/shared/create-edit-policy/create-edit-policy.component.ts b/src/ui_ng/src/app/shared/create-edit-policy/create-edit-policy.component.ts index eb82bbade..041582a1b 100644 --- a/src/ui_ng/src/app/shared/create-edit-policy/create-edit-policy.component.ts +++ b/src/ui_ng/src/app/shared/create-edit-policy/create-edit-policy.component.ts @@ -293,7 +293,7 @@ export class CreateEditPolicyComponent implements OnInit, AfterViewChecked { for(let i in data) { let origin = this.initVal[i]; let current = data[i]; - if(current && current !== origin) { + if(this.actionType === ActionType.EDIT && !this.readonly && !current || current && current !== origin) { this.hasChanged = true; break; } else { 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 d217bf03f..ffe64b8ea 100644 --- a/src/ui_ng/src/i18n/lang/en-us-lang.json +++ b/src/ui_ng/src/i18n/lang/en-us-lang.json @@ -309,7 +309,7 @@ "DELETION_TITLE_TAG": "Confirm Tag Deletion", "DELETION_SUMMARY_TAG": "Do you want to delete tag {{param}}?", "DELETION_TITLE_TAG_DENIED": "Signed Tag can't be deleted", - "DELETION_SUMMARY_TAG_DENIED": "The tag must be removed from the Notary before it can be deleted.\nDelete from Notary via this command:\n {{param}}", + "DELETION_SUMMARY_TAG_DENIED": "The tag must be removed from the Notary before it can be deleted.\nDelete from Notary via this command:\n{{param}}", "FILTER_FOR_REPOSITORIES": "Filter Repositories", "TAG": "Tag", "SIGNED": "Signed", From dfda6b4772b160656bcd222540517ca4fb426196 Mon Sep 17 00:00:00 2001 From: Steven Zou Date: Wed, 5 Apr 2017 18:37:27 +0800 Subject: [PATCH 2/6] fix gauge bug --- src/ui_ng/angular-cli.json | 2 +- .../src/app/shared/gauge/gauge.component.ts | 16 ++++++++++------ .../statictics/statistics-panel.component.html | 2 +- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/ui_ng/angular-cli.json b/src/ui_ng/angular-cli.json index a33a2dbf0..e68629169 100644 --- a/src/ui_ng/angular-cli.json +++ b/src/ui_ng/angular-cli.json @@ -28,8 +28,8 @@ "../node_modules/clarity-icons/clarity-icons.min.js", "../node_modules/web-animations-js/web-animations.min.js" ], + "environmentSource": "environments/environment.ts", "environments": { - "source": "environments/environment.ts", "dev": "environments/environment.ts", "prod": "environments/environment.prod.ts" } diff --git a/src/ui_ng/src/app/shared/gauge/gauge.component.ts b/src/ui_ng/src/app/shared/gauge/gauge.component.ts index 398c3e4e3..f945fca94 100644 --- a/src/ui_ng/src/app/shared/gauge/gauge.component.ts +++ b/src/ui_ng/src/app/shared/gauge/gauge.component.ts @@ -29,7 +29,7 @@ export class GaugeComponent implements AfterViewInit { private _colorTwo: string; private _size: string = "small"; //Support small, medium, large private _title: string = "UNKNOWN"; //Lang key - private _used: number = 0; + private _free: number = 0; private _threasHold: number = 0; /** @@ -127,12 +127,12 @@ export class GaugeComponent implements AfterViewInit { } @Input() - get used(): number { - return this._used; + get free(): number { + return this._free; } - set used(u: number) { - this._used = u; + set free(u: number) { + this._free = u; this.determineColors(); } @@ -156,7 +156,11 @@ export class GaugeComponent implements AfterViewInit { private determineColors() { let percent: number = 0; if (this._threasHold !== 0) { - percent = (this._used / this._threasHold) * 100; + let used:number = this._threasHold - this._free; + if(used < 0){ + used = 0; + } + percent = (used / this._threasHold) * 100; } while (percent > 100) { diff --git a/src/ui_ng/src/app/shared/statictics/statistics-panel.component.html b/src/ui_ng/src/app/shared/statictics/statistics-panel.component.html index ad42bcc70..7fbbd7d25 100644 --- a/src/ui_ng/src/app/shared/statictics/statistics-panel.component.html +++ b/src/ui_ng/src/app/shared/statictics/statistics-panel.component.html @@ -37,7 +37,7 @@
- +
From a1769ac6dc410bb84e3bb19ce3921bcd4a7eb367 Mon Sep 17 00:00:00 2001 From: Steven Zou Date: Wed, 5 Apr 2017 19:00:02 +0800 Subject: [PATCH 3/6] fix free storage info bug --- src/ui_ng/src/app/shared/gauge/gauge.component.html | 2 +- src/ui_ng/src/app/shared/gauge/gauge.component.ts | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/ui_ng/src/app/shared/gauge/gauge.component.html b/src/ui_ng/src/app/shared/gauge/gauge.component.html index 372bf8f41..51c36e082 100644 --- a/src/ui_ng/src/app/shared/gauge/gauge.component.html +++ b/src/ui_ng/src/app/shared/gauge/gauge.component.html @@ -5,7 +5,7 @@
- {{used}} + {{free}}
diff --git a/src/ui_ng/src/app/shared/gauge/gauge.component.ts b/src/ui_ng/src/app/shared/gauge/gauge.component.ts index f945fca94..8f6e5a275 100644 --- a/src/ui_ng/src/app/shared/gauge/gauge.component.ts +++ b/src/ui_ng/src/app/shared/gauge/gauge.component.ts @@ -136,6 +136,10 @@ export class GaugeComponent implements AfterViewInit { this.determineColors(); } + get used(): number { + return this._threasHold - this._free; + } + @Input() get threasHold(): number { return this._threasHold; @@ -156,8 +160,8 @@ export class GaugeComponent implements AfterViewInit { private determineColors() { let percent: number = 0; if (this._threasHold !== 0) { - let used:number = this._threasHold - this._free; - if(used < 0){ + let used: number = this._threasHold - this._free; + if (used < 0) { used = 0; } percent = (used / this._threasHold) * 100; From d7f8317382a0e9e0cf22b86e558a675dc0588a31 Mon Sep 17 00:00:00 2001 From: Steven Zou Date: Wed, 5 Apr 2017 19:11:16 +0800 Subject: [PATCH 4/6] change free to used --- src/ui_ng/src/app/shared/gauge/gauge.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui_ng/src/app/shared/gauge/gauge.component.html b/src/ui_ng/src/app/shared/gauge/gauge.component.html index 51c36e082..372bf8f41 100644 --- a/src/ui_ng/src/app/shared/gauge/gauge.component.html +++ b/src/ui_ng/src/app/shared/gauge/gauge.component.html @@ -5,7 +5,7 @@
- {{free}} + {{used}}
From a6f88aaac8e1a3ed1661392d872690df77606895 Mon Sep 17 00:00:00 2001 From: wy65701436 Date: Wed, 5 Apr 2017 22:53:09 -0700 Subject: [PATCH 5/6] fix issue 1916 --- make/docker-compose.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make/docker-compose.tpl b/make/docker-compose.tpl index e3eb6c0be..72338c915 100644 --- a/make/docker-compose.tpl +++ b/make/docker-compose.tpl @@ -7,7 +7,7 @@ services: volumes: - /var/log/harbor/:/var/log/docker/:z ports: - - 1514:514 + - 127.0.0.1:1514:514 networks: - harbor registry: From 26a25825531f83bad72a42b8247f8c833bd77159 Mon Sep 17 00:00:00 2001 From: kunw Date: Thu, 6 Apr 2017 15:05:48 +0800 Subject: [PATCH 6/6] Refine expression. --- .../create-edit-destination.component.ts | 2 +- .../shared/create-edit-policy/create-edit-policy.component.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ui_ng/src/app/replication/create-edit-destination/create-edit-destination.component.ts b/src/ui_ng/src/app/replication/create-edit-destination/create-edit-destination.component.ts index 65a996983..0672cc503 100644 --- a/src/ui_ng/src/app/replication/create-edit-destination/create-edit-destination.component.ts +++ b/src/ui_ng/src/app/replication/create-edit-destination/create-edit-destination.component.ts @@ -209,7 +209,7 @@ export class CreateEditDestinationComponent implements AfterViewChecked { for(let i in data) { let current = data[i]; let origin = this.initVal[this.mappedName[i]]; - if(this.actionType === ActionType.EDIT && this.editable && !current || current && current !== origin) { + if((this.actionType === ActionType.EDIT && this.editable && !current) || (current && current !== origin)) { this.hasChanged = true; break; } else { diff --git a/src/ui_ng/src/app/shared/create-edit-policy/create-edit-policy.component.ts b/src/ui_ng/src/app/shared/create-edit-policy/create-edit-policy.component.ts index 041582a1b..26cee75b7 100644 --- a/src/ui_ng/src/app/shared/create-edit-policy/create-edit-policy.component.ts +++ b/src/ui_ng/src/app/shared/create-edit-policy/create-edit-policy.component.ts @@ -293,7 +293,7 @@ export class CreateEditPolicyComponent implements OnInit, AfterViewChecked { for(let i in data) { let origin = this.initVal[i]; let current = data[i]; - if(this.actionType === ActionType.EDIT && !this.readonly && !current || current && current !== origin) { + if((this.actionType === ActionType.EDIT && !this.readonly && !current) || (current && current !== origin)) { this.hasChanged = true; break; } else {