aboutsummaryrefslogtreecommitdiffstats
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
parent125fb9b3811f9f580997545f92c93e0a01271abe (diff)
feat:add protect param
Signed-off-by: liuwh7 <liuwh7@asiainfo.com> Change-Id: I46af7e2a48ebf571341a9b58514785413157fb17 Issue-ID: REQ-1075
-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
-rw-r--r--usecaseui-portal/src/app/views/services/intent-based-services/cloud-leased-line/cloud-leased-line.component.html2
-rw-r--r--usecaseui-portal/src/app/views/services/intent-based-services/cloud-leased-line/cloud-leased-line.component.less4
-rw-r--r--usecaseui-portal/src/app/views/services/intent-based-services/constants.ts16
5 files changed, 51 insertions, 3 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
diff --git a/usecaseui-portal/src/app/views/services/intent-based-services/cloud-leased-line/cloud-leased-line.component.html b/usecaseui-portal/src/app/views/services/intent-based-services/cloud-leased-line/cloud-leased-line.component.html
index 331eb7b0..f4dd029f 100644
--- a/usecaseui-portal/src/app/views/services/intent-based-services/cloud-leased-line/cloud-leased-line.component.html
+++ b/usecaseui-portal/src/app/views/services/intent-based-services/cloud-leased-line/cloud-leased-line.component.html
@@ -1,4 +1,4 @@
-<div>
+<div class="cloud_leased_class">
<div nz-row>
<button
nz-button
diff --git a/usecaseui-portal/src/app/views/services/intent-based-services/cloud-leased-line/cloud-leased-line.component.less b/usecaseui-portal/src/app/views/services/intent-based-services/cloud-leased-line/cloud-leased-line.component.less
index df2a899e..f315dd8b 100644
--- a/usecaseui-portal/src/app/views/services/intent-based-services/cloud-leased-line/cloud-leased-line.component.less
+++ b/usecaseui-portal/src/app/views/services/intent-based-services/cloud-leased-line/cloud-leased-line.component.less
@@ -1,3 +1,7 @@
+.cloud_leased_class {
+ margin-left: 50px !important;
+}
+
nz-select {
width: 200px;
}
diff --git a/usecaseui-portal/src/app/views/services/intent-based-services/constants.ts b/usecaseui-portal/src/app/views/services/intent-based-services/constants.ts
index 9a54a49a..6c3941c1 100644
--- a/usecaseui-portal/src/app/views/services/intent-based-services/constants.ts
+++ b/usecaseui-portal/src/app/views/services/intent-based-services/constants.ts
@@ -26,6 +26,22 @@ export const COMMUNICATION_FORM_ITEMS = [
type: "text",
required: true,
},
+ {
+ title: "Resource Protect Level",
+ key: "protect",
+ type: "radio",
+ required: true,
+ options: [
+ {
+ title: "Protect",
+ key: true,
+ },
+ {
+ title: "Non-Protect",
+ key: false,
+ },
+ ],
+ },
{
title: "Access Point 1",
nodeName: 'Name',