Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Portal template remove template initialDelaySeconds required #382

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/backend/models/user.go
Expand Up @@ -43,7 +43,7 @@ type User struct {
Name string `orm:"index;unique;size(200)" json:"name,omitempty"`
Password string `orm:"size(255)" json:"-"`
Salt string `orm:"size(32)" json:"-"`
Email string `orm:"unique;size(200)" json:"email,omitempty"`
Email string `orm:"size(200)" json:"email,omitempty"`
Display string `orm:"size(200)" json:"display,omitempty"`
Comment string `orm:"type(text)" json:"comment,omitempty"`
Type UserType `orm:"type(integer)" json:"type"`
Expand Down
Expand Up @@ -277,7 +277,7 @@ <h3 class="header-title" id="创建模版">{{'DAEMONSET.CREATE_TMP' | translate}
<span class="tooltip-content">{{'TEMPLATE.CHECK_DELAY_MESSAGE' | translate}}</span>
</a>
</label>
<input type="number" required name="container.readinessProbe.initialDelaySeconds{{i}}"
<input type="number" name="container.readinessProbe.initialDelaySeconds{{i}}"
[(ngModel)]="container.readinessProbe.initialDelaySeconds"
[placeholder]="'PLACEHOLDER.SECOND' | translate">
</div>
Expand Down Expand Up @@ -365,7 +365,7 @@ <h3 class="header-title" id="创建模版">{{'DAEMONSET.CREATE_TMP' | translate}
<span class="tooltip-content">单位秒,启动多久之后开始存活检查,适用于启动时间较长的服务</span>
</a>
</label>
<input type="number" required name="container.livenessProbe.initialDelaySeconds{{i}}"
<input type="number" name="container.livenessProbe.initialDelaySeconds{{i}}"
[(ngModel)]="container.livenessProbe.initialDelaySeconds"
[placeholder]="'PLACEHOLDER.SECOND' | translate">
</div>
Expand Down
Expand Up @@ -311,7 +311,7 @@ <h3 class="header-title" id="创建模版">
<span class="tooltip-content">{{'TEMPLATE.CHECK_DELAY_MESSAGE' | translate}}</span>
</a>
</label>
<input type="number" required name="container.readinessProbe.initialDelaySeconds{{i}}"
<input type="number" name="container.readinessProbe.initialDelaySeconds{{i}}"
[(ngModel)]="container.readinessProbe.initialDelaySeconds"
[placeholder]="'PLACEHOLDER.SECOND' | translate">
</div>
Expand Down Expand Up @@ -399,7 +399,7 @@ <h3 class="header-title" id="创建模版">
<span class="tooltip-content">{{'TEMPLATE.CHECK_DELAY_MESSAGE' | translate}}</span>
</a>
</label>
<input type="number" required name="container.livenessProbe.initialDelaySeconds{{i}}"
<input type="number" name="container.livenessProbe.initialDelaySeconds{{i}}"
[(ngModel)]="container.livenessProbe.initialDelaySeconds"
[placeholder]="'PLACEHOLDER.SECOND' | translate">
</div>
Expand Down
Expand Up @@ -47,11 +47,16 @@ <h3 class="header-title">{{'PVC.CREATE_TMP' | translate}}</h3>
<label>ReadWriteMany</label>
</clr-checkbox-wrapper>
</div>
<label class="label-level2">关联标签
<button (click)="onAddSelector()" style="margin-left: 10px;" class="wayne-button primary">
<clr-icon shape="add-text"></clr-icon>
添加</button>
</label>
<div formArrayName="selectors">
<div *ngFor="let selector of selectors.controls; let i = index"
[formGroupName]="i"
class="form-group form-group-padding">
<label class="clr-col-md-3 form-group-label-override required">{{'PVC.ASSOCIATED_LABEL' | translate}}</label>
<label class="clr-col-md-3 form-group-label-override">{{'PVC.ASSOCIATED_LABEL' | translate}}</label>
<input type="text" style="width: 300px"
formControlName="key"
required
Expand All @@ -65,7 +70,7 @@ <h3 class="header-title">{{'PVC.CREATE_TMP' | translate}}</h3>
shape="trash" [title]="'PVC.DELETE_LABEL' | translate" class="is-solid clr-icon"></clr-icon>
</a>
<a href="javascript:void(0)">
<clr-icon (click)="onAddSelector(i)"
<clr-icon (click)="onAddSelector()"
shape="plus-circle" [title]="'PVC.ADD_LABEL' | translate" class="is-solid clr-icon"></clr-icon>
</a>
</div>
Expand Down
Expand Up @@ -101,22 +101,19 @@ export class CreateEditPersistentVolumeClaimTplComponent implements OnInit, Afte
return this.currentForm.get('selectors') as FormArray;
}

onAddSelector(index: number) {
onAddSelector() {
const selectors = this.currentForm.get(`selectors`) as FormArray;
selectors.push(this.initSelector());
}

onDeleteSelector(index: number) {
if (this.selectors.controls.length <= 1) {
return;
}
this.selectors.removeAt(index);
}

initSelector() {
return this.fb.group({
key: 'wayne.cloud/storage-type',
value: 'ceph',
key: '',
value: '',
});
}

Expand Down Expand Up @@ -294,11 +291,11 @@ export class CreateEditPersistentVolumeClaimTplComponent implements OnInit, Afte
accessModes.push('ReadWriteMany');
}
kubePvc.spec.accessModes = accessModes;
if (!kubePvc.spec.selector) {
kubePvc.spec.selector = new LabelSelector();
}
kubePvc.spec.selector.matchLabels = {};
if (formValue.selectors && formValue.selectors.length > 0) {
if (!kubePvc.spec.selector) {
kubePvc.spec.selector = new LabelSelector();
}
kubePvc.spec.selector.matchLabels = {};
for (const selector of formValue.selectors) {
kubePvc.spec.selector.matchLabels[selector.key] = selector.value;
}
Expand Down
Expand Up @@ -45,3 +45,8 @@ input:read-only, input:disabled {
border-bottom: 1px dashed #696161;
background-color: #dcdada;
}

.label-level2 {
font-size: 16px;
color: #007cbb;
}
Expand Up @@ -281,7 +281,7 @@ <h3 class="header-title" id="创建模版">
<span class="tooltip-content">{{'TEMPLATE.CHECK_DELAY_MESSAGE' | translate}}</span>
</a>
</label>
<input type="number" required name="container.readinessProbe.initialDelaySeconds{{i}}"
<input type="number" name="container.readinessProbe.initialDelaySeconds{{i}}"
[(ngModel)]="container.readinessProbe.initialDelaySeconds"
[placeholder]="'PLACEHOLDER.SECOND' | translate">

Expand Down Expand Up @@ -370,7 +370,7 @@ <h3 class="header-title" id="创建模版">
<span class="tooltip-content">{{'TEMPLATE.CHECK_DELAY_MESSAGE' | translate}}</span>
</a>
</label>
<input type="number" required name="container.livenessProbe.initialDelaySeconds{{i}}"
<input type="number" name="container.livenessProbe.initialDelaySeconds{{i}}"
[(ngModel)]="container.livenessProbe.initialDelaySeconds"
[placeholder]="'PLACEHOLDER.SECOND' | translate">
</div>
Expand Down