summaryrefslogtreecommitdiffstats
path: root/usecaseui-portal/src/app/views/services/intent-based-services/cloud-leased-line-modal
diff options
context:
space:
mode:
authorliuwh7 <liuwh7@asiainfo.com>2022-03-10 17:18:47 +0800
committerliuwh7 <liuwh7@asiainfo.com>2022-03-10 17:18:58 +0800
commitb44075625fe5d092e0f7048b254edc986dd26c0a (patch)
treed43b137e92c3f20571b3edd22086b5d83caa16e0 /usecaseui-portal/src/app/views/services/intent-based-services/cloud-leased-line-modal
parent125fb9b3811f9f580997545f92c93e0a01271abe (diff)
feat:add protect param
Signed-off-by: liuwh7 <liuwh7@asiainfo.com> Change-Id: I46af7e2a48ebf571341a9b58514785413157fb17 Issue-ID: REQ-1075
Diffstat (limited to 'usecaseui-portal/src/app/views/services/intent-based-services/cloud-leased-line-modal')
-rw-r--r--usecaseui-portal/src/app/views/services/intent-based-services/cloud-leased-line-modal/cloud-leased-line-modal.component.html13
-rw-r--r--usecaseui-portal/src/app/views/services/intent-based-services/cloud-leased-line-modal/cloud-leased-line-modal.component.ts19
2 files changed, 30 insertions, 2 deletions
diff --git a/usecaseui-portal/src/app/views/services/intent-based-services/cloud-leased-line-modal/cloud-leased-line-modal.component.html b/usecaseui-portal/src/app/views/services/intent-based-services/cloud-leased-line-modal/cloud-leased-line-modal.component.html
index b436bf32..c746e30f 100644
--- a/usecaseui-portal/src/app/views/services/intent-based-services/cloud-leased-line-modal/cloud-leased-line-modal.component.html
+++ b/usecaseui-portal/src/app/views/services/intent-based-services/cloud-leased-line-modal/cloud-leased-line-modal.component.html
@@ -71,6 +71,19 @@
</nz-select>
</div>
</div>
+ <nz-radio-group
+ [name]="item.key"
+ [(ngModel)]="cloud_leased_line_info[item.key]"
+ *ngIf="item.type === 'radio'"
+ >
+ <label
+ nz-radio
+ [nzValue]="option.key"
+ *ngFor="let option of item.options"
+ >
+ {{ option.title }}
+ </label>
+ </nz-radio-group>
</nz-form-control>
</nz-form-item>
</form>
diff --git a/usecaseui-portal/src/app/views/services/intent-based-services/cloud-leased-line-modal/cloud-leased-line-modal.component.ts b/usecaseui-portal/src/app/views/services/intent-based-services/cloud-leased-line-modal/cloud-leased-line-modal.component.ts
index a8c617ae..77c9f0dd 100644
--- a/usecaseui-portal/src/app/views/services/intent-based-services/cloud-leased-line-modal/cloud-leased-line-modal.component.ts
+++ b/usecaseui-portal/src/app/views/services/intent-based-services/cloud-leased-line-modal/cloud-leased-line-modal.component.ts
@@ -27,6 +27,7 @@ export class CloudLeasedLineModalComponent implements OnInit {
cloud_leased_line_info = {
name: '',
instanceId: '',
+ protect: false,
accessPointOne: {
name: '',
bandwidth: ''
@@ -82,6 +83,9 @@ export class CloudLeasedLineModalComponent implements OnInit {
submit(): void {
const paramOnj = { ...this.cloud_leased_line_info };
for (const iterator in paramOnj) {
+ if (this.isBoolean(paramOnj[iterator])) {
+ continue;
+ }
if (this.isString(paramOnj[iterator]) && !paramOnj[iterator]) {
this.nzMessage.error(`Please enter ${iterator}`);
return;
@@ -103,7 +107,12 @@ export class CloudLeasedLineModalComponent implements OnInit {
this.myHttp.createIntentInstance({
...this.cloud_leased_line_info
}).subscribe(
- (data) => {
+ (response) => {
+ const { code, message } = response;
+ if (code !== 200) {
+ this.nzMessage.error(message);
+ return;
+ }
this.nzMessage.success('Create IntentInstance Success!');
this.cancel();
},
@@ -118,6 +127,7 @@ export class CloudLeasedLineModalComponent implements OnInit {
this.cloud_leased_line_info = {
name: '',
instanceId: '',
+ protect: false,
accessPointOne: {
name: '',
bandwidth: ''
@@ -128,6 +138,11 @@ export class CloudLeasedLineModalComponent implements OnInit {
}
isString(val) {
- return Object.prototype.toString.call(val) === '[object String]';
+ return typeof val === 'string' || typeof val === 'number';
+ //return Object.prototype.toString.call(val) === '[object String]';
+ }
+
+ isBoolean(val) {
+ return typeof val === 'boolean';
}
} \ No newline at end of file