mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-20 15:48:26 +01:00
Merge pull request #8716 from AllForNothing/cve-bug
fix cve-whitelist bugs
This commit is contained in:
commit
786fb429d6
@ -27,8 +27,6 @@
|
|||||||
width: 222px;
|
width: 222px;
|
||||||
color: #0079bb;
|
color: #0079bb;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
white-space: nowrap;
|
|
||||||
|
|
||||||
li {
|
li {
|
||||||
height: 24px;
|
height: 24px;
|
||||||
line-height: 24px;
|
line-height: 24px;
|
||||||
|
@ -89,12 +89,12 @@
|
|||||||
</div>
|
</div>
|
||||||
<clr-radio-container clrInline>
|
<clr-radio-container clrInline>
|
||||||
<clr-radio-wrapper>
|
<clr-radio-wrapper>
|
||||||
<input type="radio" clrRadio name="systemWhitelistOrProjectWhitelist" required value="true"
|
<input [disabled]="!hasChangeConfigRole" type="radio" clrRadio name="systemWhitelistOrProjectWhitelist" required value="true"
|
||||||
[(ngModel)]="systemWhitelistOrProjectWhitelist"/>
|
[(ngModel)]="systemWhitelistOrProjectWhitelist"/>
|
||||||
<label>{{'CVE_WHITELIST.SYS_WHITELIST'|translate}}</label>
|
<label>{{'CVE_WHITELIST.SYS_WHITELIST'|translate}}</label>
|
||||||
</clr-radio-wrapper>
|
</clr-radio-wrapper>
|
||||||
<clr-radio-wrapper>
|
<clr-radio-wrapper>
|
||||||
<input type="radio" clrRadio name="systemWhitelistOrProjectWhitelist" required value="false"
|
<input [disabled]="!hasChangeConfigRole" type="radio" clrRadio name="systemWhitelistOrProjectWhitelist" required value="false"
|
||||||
[(ngModel)]="systemWhitelistOrProjectWhitelist"/>
|
[(ngModel)]="systemWhitelistOrProjectWhitelist"/>
|
||||||
<label>{{'CVE_WHITELIST.PRO_WHITELIST'|translate}}</label>
|
<label>{{'CVE_WHITELIST.PRO_WHITELIST'|translate}}</label>
|
||||||
</clr-radio-wrapper>
|
</clr-radio-wrapper>
|
||||||
@ -102,10 +102,10 @@
|
|||||||
<div class="clr-row width-70per">
|
<div class="clr-row width-70per">
|
||||||
<div class="clr-col position-relative">
|
<div class="clr-col position-relative">
|
||||||
<div>
|
<div>
|
||||||
<button [disabled]="isUseSystemWhitelist()"
|
<button [disabled]="isUseSystemWhitelist() || !hasChangeConfigRole"
|
||||||
(click)="showAddModal=!showAddModal"
|
(click)="showAddModal=!showAddModal"
|
||||||
class="btn btn-link">{{'CVE_WHITELIST.ADD'|translate}}</button>
|
class="btn btn-link">{{'CVE_WHITELIST.ADD'|translate}}</button>
|
||||||
<button [disabled]="isUseSystemWhitelist()" (click)="addSystem()"
|
<button [disabled]="isUseSystemWhitelist() || !hasChangeConfigRole" (click)="addSystem()"
|
||||||
class="btn btn-link ml-1">{{'CVE_WHITELIST.ADD_SYSTEM'|translate}}</button>
|
class="btn btn-link ml-1">{{'CVE_WHITELIST.ADD_SYSTEM'|translate}}</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="add-modal" *ngIf="showAddModal && !isUseSystemWhitelist()">
|
<div class="add-modal" *ngIf="showAddModal && !isUseSystemWhitelist()">
|
||||||
@ -144,17 +144,17 @@
|
|||||||
<label for="expires">{{'CVE_WHITELIST.EXPIRES_AT'|translate}}</label>
|
<label for="expires">{{'CVE_WHITELIST.EXPIRES_AT'|translate}}</label>
|
||||||
<div class="underline">
|
<div class="underline">
|
||||||
<input #dateSystemInput readonly type="date" [(clrDate)]="systemExpiresDate">
|
<input #dateSystemInput readonly type="date" [(clrDate)]="systemExpiresDate">
|
||||||
<input *ngIf="!isUseSystemWhitelist()" #dateInput
|
<input [disabled]="!hasChangeConfigRole" *ngIf="!isUseSystemWhitelist()" #dateInput
|
||||||
placeholder="{{'CVE_WHITELIST.NEVER_EXPIRES'|translate}}" readonly type="date"
|
placeholder="{{'CVE_WHITELIST.NEVER_EXPIRES'|translate}}" readonly type="date"
|
||||||
[(clrDate)]="expiresDate" newFormLayout="true">
|
[(clrDate)]="expiresDate" newFormLayout="true">
|
||||||
<input *ngIf="isUseSystemWhitelist()"
|
<input [disabled]="!hasChangeConfigRole" *ngIf="isUseSystemWhitelist()"
|
||||||
placeholder="{{'CVE_WHITELIST.NEVER_EXPIRES'|translate}}" readonly type="text"
|
placeholder="{{'CVE_WHITELIST.NEVER_EXPIRES'|translate}}" readonly type="text"
|
||||||
value="{{systemExpiresDateString}}">
|
value="{{systemExpiresDateString}}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group padding-left-80">
|
<div class="form-group padding-left-80">
|
||||||
<clr-checkbox-wrapper>
|
<clr-checkbox-wrapper>
|
||||||
<input [disabled]="isUseSystemWhitelist()" [checked]="neverExpires"
|
<input [disabled]="isUseSystemWhitelist() || !hasChangeConfigRole" [checked]="neverExpires"
|
||||||
[(ngModel)]="neverExpires" type="checkbox" clrCheckbox name="neverExpires"
|
[(ngModel)]="neverExpires" type="checkbox" clrCheckbox name="neverExpires"
|
||||||
id="neverExpires"/>
|
id="neverExpires"/>
|
||||||
<label>
|
<label>
|
||||||
@ -168,10 +168,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button type="button" class="btn btn-primary" (click)="save()"
|
<button type="button" class="btn btn-primary" (click)="save()"
|
||||||
[disabled]="(!isValid() || !hasChanges() || !hasChangeConfigRole) && !hasWhitelistChanged">{{'BUTTON.SAVE'
|
[disabled]="((!isValid() || !hasChanges()) && !hasWhitelistChanged) || !hasChangeConfigRole">{{'BUTTON.SAVE'
|
||||||
| translate}}</button>
|
| translate}}</button>
|
||||||
<button type="button" class="btn btn-outline" (click)="cancel()"
|
<button type="button" class="btn btn-outline" (click)="cancel()"
|
||||||
[disabled]="(!isValid() || !hasChanges() || !hasChangeConfigRole) && !hasWhitelistChanged">{{'BUTTON.CANCEL'
|
[disabled]="((!isValid() || !hasChanges()) && !hasWhitelistChanged) || !hasChangeConfigRole">{{'BUTTON.CANCEL'
|
||||||
| translate}}</button>
|
| translate}}</button>
|
||||||
<confirmation-dialog #cfgConfirmationDialog (confirmAction)="confirmCancel($event)"></confirmation-dialog>
|
<confirmation-dialog #cfgConfirmationDialog (confirmAction)="confirmCancel($event)"></confirmation-dialog>
|
||||||
</section>
|
</section>
|
||||||
|
@ -17,8 +17,6 @@
|
|||||||
width: 222px;
|
width: 222px;
|
||||||
color: #0079bb;
|
color: #0079bb;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
white-space: nowrap;
|
|
||||||
|
|
||||||
li {
|
li {
|
||||||
height: 24px;
|
height: 24px;
|
||||||
line-height: 24px;
|
line-height: 24px;
|
||||||
|
@ -170,6 +170,9 @@ export class ProjectPolicyConfigComponent implements OnInit {
|
|||||||
if (!response.cve_whitelist['expires_at']) {
|
if (!response.cve_whitelist['expires_at']) {
|
||||||
response.cve_whitelist['expires_at'] = null;
|
response.cve_whitelist['expires_at'] = null;
|
||||||
}
|
}
|
||||||
|
if (!response.metadata.reuse_sys_cve_whitelist) {
|
||||||
|
response.metadata.reuse_sys_cve_whitelist = "true";
|
||||||
|
}
|
||||||
if (response && response.cve_whitelist) {
|
if (response && response.cve_whitelist) {
|
||||||
this.projectWhitelist = clone(response.cve_whitelist);
|
this.projectWhitelist = clone(response.cve_whitelist);
|
||||||
this.projectWhitelistOrigin = clone(response.cve_whitelist);
|
this.projectWhitelistOrigin = clone(response.cve_whitelist);
|
||||||
|
Loading…
Reference in New Issue
Block a user