ui adjustment for tag-retention and webhook

Signed-off-by: AllForNothing <sshijun@vmware.com>
This commit is contained in:
AllForNothing 2019-08-21 15:18:32 +08:00
parent c1ad0518c9
commit e0b73f2729
5 changed files with 19 additions and 59 deletions

View File

@ -81,32 +81,6 @@
</div>
</div>
</div>
<div class="height-72">
<div class="clr-row">
<div class="clr-col-4">
<label>{{'TAG_RETENTION.LABELS' | translate}}</label>
</div>
<div class="clr-col-3">
<div class="clr-select-wrapper w-100">
<select [(ngModel)]="labelsSelect" class="clr-select w-100">
<option *ngFor="let d of metadata?.tag_selectors[0]?.decorations"
value="{{d}}">{{getI18nKey(d)|translate}}</option>
</select>
</div>
</div>
<div class="clr-col-5">
<div class="w-100">
<input [(ngModel)]="labelsInput" class="clr-input w-100">
</div>
</div>
</div>
<div class="clr-row">
<div class="clr-col-4"></div>
<div class="clr-col-8">
<span>{{'TAG_RETENTION.REP_LABELS' | translate}}</span>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-outline" (click)="cancel()">{{'BUTTON.CANCEL' | translate}}</button>

View File

@ -70,11 +70,6 @@ export class Rule {
kind: 'doublestar',
decoration: 'matches',
pattern: '**'
},
{
kind: 'label',
decoration: "withLabels",
pattern: null
}
];
}

View File

@ -11,27 +11,27 @@
<li class="rule" *ngFor="let rule of retention?.rules;let i = index;">
<div class="clr-row">
<div class="clr-col-1">
<clr-icon *ngIf="!rule?.disabled" class="color-green" shape="success-standard"></clr-icon>
<clr-icon *ngIf="rule?.disabled" class="color-red" shape="error-standard"></clr-icon>
<clr-icon (click)="openEditor(i)" shape="ellipsis-vertical"
class="dropdown-toggle hand"></clr-icon>
<div class="dropdown" [ngClass]="{open:ruleIndex===i}">
<div class="dropdown-menu">
<button *ngIf="!rule?.disabled" type="button" class="dropdown-item"
(click)="toggleDisable(i,true)">{{'TAG_RETENTION.DISABLE' | translate}}</button>
<button *ngIf="rule?.disabled" type="button" class="dropdown-item"
(click)="toggleDisable(i,false)">{{'TAG_RETENTION.ENABLE' | translate}}</button>
<button type="button" class="dropdown-item"
(click)="editRuleByIndex(i)">{{'TAG_RETENTION.EDIT' | translate}}</button>
<button type="button" class="dropdown-item"
(click)="deleteRule(i)">{{'TAG_RETENTION.DELETE' | translate}}</button>
</div>
</div>
</div>
<div class="clr-col">
<span>
<clr-icon (click)="openEditor(i)" shape="ellipsis-vertical"
class="dropdown-toggle hand"></clr-icon>
<div class="dropdown" [ngClass]="{open:ruleIndex===i}">
<div class="dropdown-menu">
<button *ngIf="!rule?.disabled" type="button" class="dropdown-item"
(click)="toggleDisable(i,true)">{{'TAG_RETENTION.DISABLE' | translate}}</button>
<button *ngIf="rule?.disabled" type="button" class="dropdown-item"
(click)="toggleDisable(i,false)">{{'TAG_RETENTION.ENABLE' | translate}}</button>
<button type="button" class="dropdown-item"
(click)="editRuleByIndex(i)">{{'TAG_RETENTION.EDIT' | translate}}</button>
<button type="button" class="dropdown-item"
(click)="deleteRule(i)">{{'TAG_RETENTION.DELETE' | translate}}</button>
</div>
</div>
<clr-icon *ngIf="!rule?.disabled" class="color-green" shape="success-standard"></clr-icon>
<clr-icon *ngIf="rule?.disabled" class="color-red" shape="error-standard"></clr-icon>
</span>
<span class="rule-name">
<span class="rule-name ml-5">
<span>{{'TAG_RETENTION.IN_REPOSITORIES' | translate}}</span>
<span>{{getI18nKey(rule?.scope_selectors?.repository[0]?.decoration)|translate}}</span>
<span>{{formatPattern(rule?.scope_selectors?.repository[0]?.pattern)}}</span>

View File

@ -1,12 +1,3 @@
.align-center {
text-align: center;
}
.webhook-section {
margin-left: calc(50% - 10rem);
text-align: left;
}
.icon-tooltip {
margin-top: 4px;
}

View File

@ -8,11 +8,11 @@
.webhook-form-wrap {
width: 19rem;
margin: 0 auto;
margin: 0 ;
}
.create-text {
margin: 0 auto;
margin: 0;
width: 19rem;
}