mirror of
https://github.com/goharbor/harbor.git
synced 2025-01-22 23:51:27 +01:00
Merge pull request #13804 from AllForNothing/scan-all
Fix robot account UI issues
This commit is contained in:
commit
4392a626f3
@ -1,6 +1,6 @@
|
||||
ARG harbor_base_image_version
|
||||
ARG harbor_base_namespace
|
||||
FROM node:10.15.0 as nodeportal
|
||||
FROM node:15.4.0 as nodeportal
|
||||
|
||||
WORKDIR /build_dir
|
||||
|
||||
|
@ -59,7 +59,7 @@
|
||||
<clr-dg-column>{{'ROBOT_ACCOUNT.ENABLED_STATE' | translate}}</clr-dg-column>
|
||||
<clr-dg-column>{{"SYSTEM_ROBOT.PERMISSION_COLUMN" | translate}}</clr-dg-column>
|
||||
<clr-dg-column>{{'ROBOT_ACCOUNT.CREATETION' | translate}}</clr-dg-column>
|
||||
<clr-dg-column>{{'SYSTEM_ROBOT.EXPIRED_AT' | translate}}</clr-dg-column>
|
||||
<clr-dg-column>{{'SYSTEM_ROBOT.EXPIRES_AT' | translate}}</clr-dg-column>
|
||||
<clr-dg-column>{{'ROBOT_ACCOUNT.DESCRIPTION' | translate}}</clr-dg-column>
|
||||
<clr-dg-placeholder>{{
|
||||
'SYSTEM_ROBOT.NOT_FOUND' | translate
|
||||
|
@ -102,6 +102,8 @@ export class RobotAccountComponent implements OnInit, OnDestroy {
|
||||
this.searchKey = robotSearchName;
|
||||
if (this.searchKey) {
|
||||
queryParam.q = encodeURIComponent(`Level=${PermissionsKinds.PROJECT},ProjectID=${this.projectId},name=~${this.searchKey}`);
|
||||
} else {
|
||||
queryParam.q = encodeURIComponent(`Level=${PermissionsKinds.PROJECT},ProjectID=${this.projectId}`);
|
||||
}
|
||||
this.loading = true;
|
||||
return this.robotService.ListRobotResponse(queryParam)
|
||||
|
@ -69,11 +69,23 @@ export class StatisticsPanelComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
public get totalStorage(): number {
|
||||
return this.getGBFromBytes(this.volumesInfo.storage.total);
|
||||
let count: number = 0;
|
||||
if (this.volumesInfo && this.volumesInfo.storage && this.volumesInfo.storage.length) {
|
||||
this.volumesInfo.storage.forEach(item => {
|
||||
count += item.total;
|
||||
});
|
||||
}
|
||||
return this.getGBFromBytes(count);
|
||||
}
|
||||
|
||||
public get freeStorage(): number {
|
||||
return this.getGBFromBytes(this.volumesInfo.storage.free);
|
||||
let count: number = 0;
|
||||
if (this.volumesInfo && this.volumesInfo.storage && this.volumesInfo.storage.length) {
|
||||
this.volumesInfo.storage.forEach(item => {
|
||||
count += item.free;
|
||||
});
|
||||
}
|
||||
return this.getGBFromBytes(count);
|
||||
}
|
||||
|
||||
public getStatistics(): void {
|
||||
@ -98,7 +110,13 @@ export class StatisticsPanelComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
public get isValidStorage(): boolean {
|
||||
return this.volumesInfo.storage.total !== 0 &&
|
||||
let count: number = 0;
|
||||
if (this.volumesInfo && this.volumesInfo.storage && this.volumesInfo.storage.length) {
|
||||
this.volumesInfo.storage.forEach(item => {
|
||||
count += item.total;
|
||||
});
|
||||
}
|
||||
return count !== 0 &&
|
||||
this.appConfigService.getConfig().registry_storage_provider_name === "filesystem";
|
||||
}
|
||||
|
||||
|
@ -13,10 +13,10 @@
|
||||
// limitations under the License.
|
||||
export class Volumes {
|
||||
constructor() {
|
||||
this.storage = new Storage();
|
||||
this.storage = [new Storage()];
|
||||
}
|
||||
|
||||
storage: Storage;
|
||||
storage: Storage[];
|
||||
}
|
||||
|
||||
export class Storage {
|
||||
|
@ -189,6 +189,9 @@ export class NewRobotComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
});
|
||||
}
|
||||
if (!this.coverAll) {
|
||||
this.defaultAccesses.forEach( item => item.checked = true);
|
||||
}
|
||||
this.robotForm.reset({
|
||||
name: this.systemRobot.name,
|
||||
expiration: this.systemRobot.duration,
|
||||
@ -281,18 +284,31 @@ export class NewRobotComponent implements OnInit, OnDestroy {
|
||||
return true;
|
||||
}
|
||||
if (this.coverAll !== this.coverAllForEdit) {
|
||||
return true;
|
||||
}
|
||||
if (this.coverAll) {
|
||||
let flag = true;
|
||||
this.defaultAccessesForEdit.forEach(item => {
|
||||
this.defaultAccesses.forEach(item2 => {
|
||||
if (item.resource === item2.resource && item.action === item2.action && item.checked !== item2.checked) {
|
||||
flag = false;
|
||||
if (this.coverAll) {
|
||||
let flag = false;
|
||||
this.defaultAccesses.forEach(item => {
|
||||
if (item.checked) {
|
||||
flag = true;
|
||||
}
|
||||
});
|
||||
});
|
||||
return !flag;
|
||||
if (!flag) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
if (this.coverAll === this.coverAllForEdit) {
|
||||
if (this.coverAll) {
|
||||
let flag = true;
|
||||
this.defaultAccessesForEdit.forEach(item => {
|
||||
this.defaultAccesses.forEach(item2 => {
|
||||
if (item.resource === item2.resource && item.action === item2.action && item.checked !== item2.checked) {
|
||||
flag = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
return !flag;
|
||||
}
|
||||
}
|
||||
if (this.systemRobot.permissions.length !== this.listAllProjectsComponent.selectedRow.length) {
|
||||
return true;
|
||||
|
@ -107,7 +107,8 @@ export const ACTION_RESOURCE_I18N_MAP = {
|
||||
'helm-chart-version': 'SYSTEM_ROBOT.HELM_VERSION',
|
||||
'tag': 'REPLICATION.TAG',
|
||||
'artifact-label': 'SYSTEM_ROBOT.ARTIFACT_LABEL',
|
||||
'scan': 'SYSTEM_ROBOT.SCAN'
|
||||
'scan': 'SYSTEM_ROBOT.SCAN',
|
||||
'scanner-pull': 'SYSTEM_ROBOT.SCANNER_PULL'
|
||||
};
|
||||
|
||||
export enum ExpirationType {
|
||||
|
@ -1659,6 +1659,7 @@
|
||||
"ENABLE_NEW_SECRET": "Enable this option to manually specify a new secret",
|
||||
"DELETE": "Delete",
|
||||
"ARTIFACT_LABEL": "Artifact label",
|
||||
"SCAN": "Scan"
|
||||
"SCAN": "Scan",
|
||||
"SCANNER_PULL": "Scanner Pull"
|
||||
}
|
||||
}
|
||||
|
@ -1659,6 +1659,7 @@
|
||||
"ENABLE_NEW_SECRET": "Enable this option to manually specify a new secret",
|
||||
"DELETE": "Delete",
|
||||
"ARTIFACT_LABEL": "Artifact label",
|
||||
"SCAN": "Scan"
|
||||
"SCAN": "Scan",
|
||||
"SCANNER_PULL": "Scanner Pull"
|
||||
}
|
||||
}
|
||||
|
@ -1657,6 +1657,7 @@
|
||||
"ENABLE_NEW_SECRET": "Enable this option to manually specify a new secret",
|
||||
"DELETE": "Delete",
|
||||
"ARTIFACT_LABEL": "Artifact label",
|
||||
"SCAN": "Scan"
|
||||
"SCAN": "Scan",
|
||||
"SCANNER_PULL": "Scanner Pull"
|
||||
}
|
||||
}
|
||||
|
@ -1627,6 +1627,7 @@
|
||||
"ENABLE_NEW_SECRET": "Enable this option to manually specify a new secret",
|
||||
"DELETE": "Delete",
|
||||
"ARTIFACT_LABEL": "Artifact label",
|
||||
"SCAN": "Scan"
|
||||
"SCAN": "Scan",
|
||||
"SCANNER_PULL": "Scanner Pull"
|
||||
}
|
||||
}
|
||||
|
@ -1655,7 +1655,8 @@
|
||||
"ENABLE_NEW_SECRET": "Enable this option to manually specify a new secret",
|
||||
"DELETE": "Delete",
|
||||
"ARTIFACT_LABEL": "Artifact label",
|
||||
"SCAN": "Scan"
|
||||
"SCAN": "Scan",
|
||||
"SCANNER_PULL": "Scanner Pull"
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1659,6 +1659,7 @@
|
||||
"ENABLE_NEW_SECRET": "Enable this option to manually specify a new secret",
|
||||
"DELETE": "Delete",
|
||||
"ARTIFACT_LABEL": "Artifact label",
|
||||
"SCAN": "Scan"
|
||||
"SCAN": "Scan",
|
||||
"SCANNER_PULL": "Scanner Pull"
|
||||
}
|
||||
}
|
||||
|
@ -1656,6 +1656,7 @@
|
||||
"ENABLE_NEW_SECRET": "开启此项以便手动指定新令牌",
|
||||
"DELETE": "删除",
|
||||
"ARTIFACT_LABEL": "Artifact 标签",
|
||||
"SCAN": "扫描"
|
||||
"SCAN": "扫描",
|
||||
"SCANNER_PULL": "扫描器拉取"
|
||||
}
|
||||
}
|
||||
|
@ -1643,6 +1643,7 @@
|
||||
"ENABLE_NEW_SECRET": "Enable this option to manually specify a new secret",
|
||||
"DELETE": "Delete",
|
||||
"ARTIFACT_LABEL": "Artifact label",
|
||||
"SCAN": "Scan"
|
||||
"SCAN": "Scan",
|
||||
"SCANNER_PULL": "Scanner Pull"
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,7 @@
|
||||
<clr-icon shape="info-circle" class="info-tips-icon" size="24"></clr-icon>
|
||||
<span class="tooltip-content">{{'CONFIG.TOOLTIP.DAILY_CRON' | translate}}</span>
|
||||
</a>
|
||||
<span [hidden]="originScheduleType!==SCHEDULE_TYPE.CUSTOM">{{ "SCHEDULE.CRON" | translate }} :</span>
|
||||
<span [hidden]="originScheduleType!==SCHEDULE_TYPE.CUSTOM"> {{ "SCHEDULE.CRON" | translate }} :</span>
|
||||
<span [hidden]="originScheduleType!==SCHEDULE_TYPE.CUSTOM">{{ oriCron }}</span>
|
||||
<button [disabled]="disabled" class="btn btn-link" (click)="editSchedule()"
|
||||
id="editSchedule">
|
||||
@ -35,7 +35,7 @@
|
||||
<option [value]="SCHEDULE_TYPE.CUSTOM">{{'SCHEDULE.CUSTOM' | translate}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<span class="required" [hidden]="scheduleType!==SCHEDULE_TYPE.CUSTOM">{{ "SCHEDULE.CRON" | translate }}</span>
|
||||
<span class="required" [hidden]="scheduleType!==SCHEDULE_TYPE.CUSTOM"> {{ "SCHEDULE.CRON" | translate }}</span>
|
||||
<div [hidden]="scheduleType!==SCHEDULE_TYPE.CUSTOM" class="cron-input">
|
||||
<div class="height-1rem clr-input-wrapper">
|
||||
<label for="targetCron" aria-haspopup="true" role="tooltip" [class.clr-error]="dateInvalid"
|
||||
@ -78,7 +78,7 @@
|
||||
<clr-icon shape="info-circle" class="info-tips-icon" size="24"></clr-icon>
|
||||
<span class="tooltip-content">{{'CONFIG.TOOLTIP.DAILY_CRON' | translate}}</span>
|
||||
</a>
|
||||
<span *ngIf="originScheduleType===SCHEDULE_TYPE.CUSTOM">{{ "SCHEDULE.CRON" | translate }} :</span>
|
||||
<span *ngIf="originScheduleType===SCHEDULE_TYPE.CUSTOM"> {{ "SCHEDULE.CRON" | translate }} :</span>
|
||||
<span *ngIf="originScheduleType===SCHEDULE_TYPE.CUSTOM">{{ oriCron }}</span>
|
||||
<button [disabled]="disabled" class="btn btn-link" (click)="editSchedule()"
|
||||
id="inline-edit">
|
||||
|
Loading…
Reference in New Issue
Block a user