Skip to content

Commit

Permalink
Merge pull request #145 from gh-ca/fe-ui-730
Browse files Browse the repository at this point in the history
Fe UI 730
  • Loading branch information
lianqiang-git authored Dec 14, 2021
2 parents 8f9c9ce + 3648de4 commit c33da86
Show file tree
Hide file tree
Showing 11 changed files with 743 additions and 665 deletions.
289 changes: 150 additions & 139 deletions dmestore-ui/src/main/angular/src/app/routes/nfs/nfs.component.html

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -738,9 +738,9 @@ export class NfsComponent extends NfsComponentCommon implements OnInit ,AfterVie
this.checkNfsNameExist(this.addForm.nfsName);
}
} else {
this.matchErr = true;
//不满足的时候置空,触发错误提示
this.addForm.nfsName = null;
this.matchErr = true;
console.log('验证不通过');
}
}
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -596,8 +596,8 @@ export class NfsAddComponent extends NfsComponentCommon implements OnInit {
}
} else {
//不满足的时候置空,触发错误提示
this.addForm.nfsName = null;
this.matchErr = true;
this.addForm.nfsName = null;
console.log('验证不通过');
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class NfsReduceComponent implements OnInit{
storeObjectId:string;
viewPage: string;
unit='GB';
newCapacity = 0;
newCapacity =1;
pluginFlag: string;//来至插件的标记
rowSelected = []; // 当前选中数据
errorMsg: string;
Expand Down Expand Up @@ -142,27 +142,26 @@ export class NfsReduceComponent implements OnInit{
this.closeModel();
}
}
/* checkCapacity(){
let capacity;
switch (this.unit) {
case 'TB':
capacity = this.newCapacity * 1024;
break;
default: // 默认GB 不变
capacity = this.newCapacity;
break;
}
const lastCapacity = this.updateNfs.capacity - capacity;
if (lastCapacity<parseFloat(this.maxOpCapacity)){
this.newCapacity=0;
this.capacityErr=false;
return false;
}else {
this.capacityErr=true;
return true;
}
}*/
/* checkCapacity(){
let capacity;
switch (this.unit) {
case 'TB':
capacity = this.newCapacity * 1024;
break;
default: // 默认GB 不变
capacity = this.newCapacity;
break;
}
const lastCapacity = this.updateNfs.capacity - capacity;
if (lastCapacity<parseFloat(this.maxOpCapacity)){
this.newCapacity=0;
this.capacityErr=false;
return false;
}else {
this.capacityErr=true;
return true;
}
}*/
checkNewCapacity(){
console.log('reduce',this.newCapacity)
console.log(typeof this.newCapacity)
Expand All @@ -176,7 +175,7 @@ export class NfsReduceComponent implements OnInit{
break;
}
if (capacity>parseFloat(this.maxOpCapacity)||capacity<0.001){
this.newCapacity=null
this.newCapacity=1
this.newCapacityError=true
return false
}else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,24 @@
<input clrInput style="width: 19%;text-align: center;" readonly value="{{'vmfs.multiply' | translate}}">
<input clrInput min="0" (blur)="countBlur();" style="width: 27%;" type="number" [(ngModel)]="form.count"
name="count" formControlName="count" required />
<clr-control-helper *ngIf="!capacityErr">
<clr-icon shape="exclamation-circle"></clr-icon>{{'vmfs.capacityTips' | translate}}
<clr-control-helper *ngIf="!capacityErr&&form.capacityUnit==='GB'">
<clr-icon shape="exclamation-circle" class="is-solid"></clr-icon>
{{'vmfs.capacityTipsGB' | translate}}
</clr-control-helper>
<clr-control-helper *ngIf="capacityErr">
<clr-control-helper *ngIf="capacityErr&&form.capacityUnit==='GB'">
<div class="errorTips" readonly>
<clr-icon shape="exclamation-circle" class="is-solid"></clr-icon>{{'vmfs.capacityTips' | translate}}
<clr-icon shape="exclamation-circle" class="is-solid"></clr-icon>
{{'vmfs.capacityTipsGB' | translate}}
</div>
</clr-control-helper>
<clr-control-helper *ngIf="!capacityErr&&form.capacityUnit==='TB'">
<clr-icon shape="exclamation-circle" class="is-solid"></clr-icon>
{{'vmfs.capacityTipsTB' | translate}}
</clr-control-helper>
<clr-control-helper *ngIf="capacityErr&&form.capacityUnit==='TB'">
<div class="errorTips" readonly>
<clr-icon shape="exclamation-circle" class="is-solid"></clr-icon>
{{'vmfs.capacityTipsTB' | translate}}
</div>
</clr-control-helper>
<!-- <clr-control-error>{{'validations.required' | translate}}</clr-control-error> -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -820,13 +820,19 @@ export class AddComponent extends VmfsCommon implements OnInit {
if (capacity < 1 / 1024) {
capacity = '';
this.capacityErr = true;
} else if (capacity > 256) {
capacity = '';
this.capacityErr = true;
} else {
this.capacityErr = false;
}
} else {
if (capacity < 2 / 1024) {
capacity = '';
this.capacityErr = true;
} else if (capacity > 256) {
capacity = '';
this.capacityErr = true;
} else {
this.capacityErr = false;
}
Expand Down Expand Up @@ -870,13 +876,19 @@ export class AddComponent extends VmfsCommon implements OnInit {
if (capacity < 1) {
capacity = '';
this.capacityErr = true;
} else if (capacity > 262144) {
capacity = '';
this.capacityErr = true;
} else {
this.capacityErr = false;
}
} else {
if (capacity < 2) {
capacity = '';
this.capacityErr = true;
} else if (capacity > 262144) {
capacity = '';
this.capacityErr = true;
} else {
this.capacityErr = false;
}
Expand Down
Loading

0 comments on commit c33da86

Please sign in to comment.