diff --git a/src/ui_ng/src/app/log/audit-log.component.html b/src/ui_ng/src/app/log/audit-log.component.html index d787c1cf5..69791755f 100644 --- a/src/ui_ng/src/app/log/audit-log.component.html +++ b/src/ui_ng/src/app/log/audit-log.component.html @@ -22,8 +22,20 @@
- - + + + +
diff --git a/src/ui_ng/src/app/log/audit-log.component.ts b/src/ui_ng/src/app/log/audit-log.component.ts index 7c4a24aff..aa5e84831 100644 --- a/src/ui_ng/src/app/log/audit-log.component.ts +++ b/src/ui_ng/src/app/log/audit-log.component.ts @@ -105,15 +105,29 @@ export class AuditLogComponent implements OnInit { this.retrieve(); } - doSearchByTimeRange(strDate: string, target: string): void { - let oneDayOffset = 3600 * 24; - switch(target) { - case 'begin': + convertDate(strDate: string): string { + if(/^(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)\d\d$/.test(strDate)) { + let parts = strDate.split(/[-\/]/); + strDate = parts[2] /*Year*/ + '-' +parts[1] /*Month*/ + '-' + parts[0] /*Date*/; + } + return strDate; + } + + doSearchByStartTime(valid: boolean, strDate: string): void { + this.queryParam.begin_timestamp = 0; + if(valid && strDate){ + strDate = this.convertDate(strDate); this.queryParam.begin_timestamp = new Date(strDate).getTime() / 1000; - break; - case 'end': + } + this.retrieve(); + } + + doSearchByEndTime(valid: boolean, strDate: string): void { + this.queryParam.end_timestamp = 0; + if(valid && strDate) { + strDate = this.convertDate(strDate); + let oneDayOffset = 3600 * 24; this.queryParam.end_timestamp = new Date(strDate).getTime() / 1000 + oneDayOffset; - break; } this.retrieve(); } diff --git a/src/ui_ng/src/app/log/log.module.ts b/src/ui_ng/src/app/log/log.module.ts index 533e20d7d..6200eb09f 100644 --- a/src/ui_ng/src/app/log/log.module.ts +++ b/src/ui_ng/src/app/log/log.module.ts @@ -21,7 +21,8 @@ import { RecentLogComponent } from './recent-log.component'; imports: [SharedModule], declarations: [ AuditLogComponent, - RecentLogComponent], + RecentLogComponent + ], providers: [AuditLogService], exports: [ AuditLogComponent, diff --git a/src/ui_ng/src/app/project/create-project/create-project.component.html b/src/ui_ng/src/app/project/create-project/create-project.component.html index 48117cbc4..2fa899a64 100644 --- a/src/ui_ng/src/app/project/create-project/create-project.component.html +++ b/src/ui_ng/src/app/project/create-project/create-project.component.html @@ -20,7 +20,7 @@
- +
diff --git a/src/ui_ng/src/app/project/list-project/list-project.component.html b/src/ui_ng/src/app/project/list-project/list-project.component.html index da18a7f7d..4529d2876 100644 --- a/src/ui_ng/src/app/project/list-project/list-project.component.html +++ b/src/ui_ng/src/app/project/list-project/list-project.component.html @@ -1,6 +1,6 @@ {{'PROJECT.NAME' | translate}} - {{'PROJECT.PUBLIC_OR_PRIVATE' | translate}} + {{'PROJECT.ACCESS_LEVEL' | translate}} {{'PROJECT.ROLE' | translate}} {{'PROJECT.REPO_COUNT'| translate}} {{'PROJECT.CREATION_TIME' | translate}} diff --git a/src/ui_ng/src/app/project/member/member.component.ts b/src/ui_ng/src/app/project/member/member.component.ts index 494dfcb4d..2521fe519 100644 --- a/src/ui_ng/src/app/project/member/member.component.ts +++ b/src/ui_ng/src/app/project/member/member.component.ts @@ -22,7 +22,7 @@ import { MemberService } from './member.service'; import { AddMemberComponent } from './add-member/add-member.component'; import { MessageHandlerService } from '../../shared/message-handler/message-handler.service'; -import { ConfirmationTargets, ConfirmationState } from '../../shared/shared.const'; +import { ConfirmationTargets, ConfirmationState, ConfirmationButtons } from '../../shared/shared.const'; import { ConfirmationDialogService } from '../../shared/confirmation-dialog/confirmation-dialog.service'; import { ConfirmationMessage } from '../../shared/confirmation-dialog/confirmation-message'; @@ -149,7 +149,8 @@ export class MemberComponent implements OnInit, OnDestroy { 'MEMBER.DELETION_SUMMARY', m.username, m.user_id, - ConfirmationTargets.PROJECT_MEMBER + ConfirmationTargets.PROJECT_MEMBER, + ConfirmationButtons.DELETE_CANCEL ); this.deletionDialogService.openComfirmDialog(deletionMessage); } diff --git a/src/ui_ng/src/app/project/project.component.ts b/src/ui_ng/src/app/project/project.component.ts index 4c8489f41..fcb4b668d 100644 --- a/src/ui_ng/src/app/project/project.component.ts +++ b/src/ui_ng/src/app/project/project.component.ts @@ -29,7 +29,7 @@ import { Response } from '@angular/http'; import { ConfirmationDialogService } from '../shared/confirmation-dialog/confirmation-dialog.service'; import { ConfirmationMessage } from '../shared/confirmation-dialog/confirmation-message'; -import { ConfirmationTargets, ConfirmationState } from '../shared/shared.const'; +import { ConfirmationTargets, ConfirmationState, ConfirmationButtons } from '../shared/shared.const'; import { Subscription } from 'rxjs/Subscription'; @@ -178,7 +178,8 @@ export class ProjectComponent implements OnInit, OnDestroy { 'PROJECT.DELETION_SUMMARY', p.name, p.project_id, - ConfirmationTargets.PROJECT + ConfirmationTargets.PROJECT, + ConfirmationButtons.DELETE_CANCEL ); this.deletionDialogService.openComfirmDialog(deletionMessage); } diff --git a/src/ui_ng/src/app/replication/destination/destination.component.ts b/src/ui_ng/src/app/replication/destination/destination.component.ts index 384395041..37f049471 100644 --- a/src/ui_ng/src/app/replication/destination/destination.component.ts +++ b/src/ui_ng/src/app/replication/destination/destination.component.ts @@ -19,7 +19,7 @@ import { MessageHandlerService } from '../../shared/message-handler/message-hand import { ConfirmationDialogService } from '../../shared/confirmation-dialog/confirmation-dialog.service'; import { ConfirmationMessage } from '../../shared/confirmation-dialog/confirmation-message'; -import { ConfirmationTargets, ConfirmationState } from '../../shared/shared.const'; +import { ConfirmationTargets, ConfirmationState, ConfirmationButtons } from '../../shared/shared.const'; import { Subscription } from 'rxjs/Subscription'; @@ -149,7 +149,8 @@ export class DestinationComponent implements OnInit { 'REPLICATION.DELETION_SUMMARY_TARGET', target.name, target.id, - ConfirmationTargets.TARGET); + ConfirmationTargets.TARGET, + ConfirmationButtons.DELETE_CANCEL); this.deletionDialogService.openComfirmDialog(deletionMessage); } } diff --git a/src/ui_ng/src/app/replication/replication.component.html b/src/ui_ng/src/app/replication/replication.component.html index 6bb7c5708..d35493611 100644 --- a/src/ui_ng/src/app/replication/replication.component.html +++ b/src/ui_ng/src/app/replication/replication.component.html @@ -39,8 +39,20 @@
- - + + + +
diff --git a/src/ui_ng/src/app/replication/replication.component.ts b/src/ui_ng/src/app/replication/replication.component.ts index 903408c59..0c9e0ff80 100644 --- a/src/ui_ng/src/app/replication/replication.component.ts +++ b/src/ui_ng/src/app/replication/replication.component.ts @@ -232,20 +232,31 @@ export class ReplicationComponent implements OnInit { (option === 1) ? this.currentJobSearchOption = 0 : this.currentJobSearchOption = 1; } - doJobSearchByStartTime(strDate: string) { - if(!strDate || strDate.trim() === '') { - strDate = 0 + ''; - } - (strDate === '0') ? this.search.startTime = '' : this.search.startTime = (new Date(strDate).getTime() / 1000) + ''; + convertDate(strDate: string): string { + if(/^(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)\d\d$/.test(strDate)) { + let parts = strDate.split(/[-\/]/); + strDate = parts[2] /*Year*/ + '-' +parts[1] /*Month*/ + '-' + parts[0] /*Date*/; + } + return strDate; + } + + doJobSearchByStartTime(valid: boolean, strDate: string) { + this.search.startTime = ''; + if(valid && strDate) { + strDate = this.convertDate(strDate); + console.log(strDate); + this.search.startTime = (new Date(strDate).getTime() / 1000) + ''; + } this.fetchPolicyJobs(); } - doJobSearchByEndTime(strDate: string) { - if(!strDate || strDate.trim() === '') { - strDate = 0 + ''; + doJobSearchByEndTime(valid: boolean, strDate: string) { + this.search.endTime = ''; + if(valid && strDate) { + strDate = this.convertDate(strDate); + let oneDayOffset = 3600 * 24; + this.search.endTime = (new Date(strDate).getTime() / 1000 + oneDayOffset) + ''; } - let oneDayOffset = 3600 * 24; - (strDate === '0') ? this.search.endTime = '' : this.search.endTime = (new Date(strDate).getTime() / 1000 + oneDayOffset) + ''; this.fetchPolicyJobs(); } } \ No newline at end of file diff --git a/src/ui_ng/src/app/repository/repository.component.ts b/src/ui_ng/src/app/repository/repository.component.ts index a3f24565c..265cb2ae1 100644 --- a/src/ui_ng/src/app/repository/repository.component.ts +++ b/src/ui_ng/src/app/repository/repository.component.ts @@ -18,7 +18,7 @@ import { RepositoryService } from './repository.service'; import { Repository } from './repository'; import { MessageHandlerService } from '../shared/message-handler/message-handler.service'; -import { ConfirmationState, ConfirmationTargets } from '../shared/shared.const'; +import { ConfirmationState, ConfirmationTargets, ConfirmationButtons } from '../shared/shared.const'; import { ConfirmationDialogService } from '../shared/confirmation-dialog/confirmation-dialog.service'; @@ -115,7 +115,8 @@ export class RepositoryComponent implements OnInit { 'REPOSITORY.DELETION_SUMMARY_REPO', repoName, repoName, - ConfirmationTargets.REPOSITORY); + ConfirmationTargets.REPOSITORY, + ConfirmationButtons.DELETE_CANCEL); this.deletionDialogService.openComfirmDialog(message); } 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 37f32ea5a..5c5db27df 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 @@ -16,7 +16,7 @@ import { ActivatedRoute } from '@angular/router'; import { RepositoryService } from '../repository.service'; import { MessageHandlerService } from '../../shared/message-handler/message-handler.service'; -import { ConfirmationTargets, ConfirmationState } from '../../shared/shared.const'; +import { ConfirmationTargets, ConfirmationState, ConfirmationButtons } from '../../shared/shared.const'; import { ConfirmationDialogService } from '../../shared/confirmation-dialog/confirmation-dialog.service'; import { ConfirmationMessage } from '../../shared/confirmation-dialog/confirmation-message'; @@ -155,25 +155,25 @@ export class TagRepositoryComponent implements OnInit, OnDestroy { deleteTag(tag: TagView) { if (tag) { - let titleKey: string, summaryKey: string, content: string, confirmOnly: boolean; + let titleKey: string, summaryKey: string, content: string, buttons: ConfirmationButtons; if (tag.signed) { titleKey = 'REPOSITORY.DELETION_TITLE_TAG_DENIED'; summaryKey = 'REPOSITORY.DELETION_SUMMARY_TAG_DENIED'; - confirmOnly = true; + buttons = ConfirmationButtons.CLOSE; 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'; + buttons = ConfirmationButtons.DELETE_CANCEL; content = tag.tag; - confirmOnly = false; } let message = new ConfirmationMessage( titleKey, summaryKey, content, tag, - ConfirmationTargets.TAG); - message.confirmOnly = confirmOnly; + ConfirmationTargets.TAG, + buttons); this.deletionDialogService.openComfirmDialog(message); } } 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 fe56db9b8..0154a11dd 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 @@ -6,8 +6,21 @@
{{dialogContent}}
-