import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
import { TranslateLoader, TranslateModule } from "@ngx-translate/core";
import { TranslateHttpLoader } from "@ngx-translate/http-loader";
+import { EventQueueService } from "@src/app/core/services/eventQueue.service";
import { en_US, NgZorroAntdModule, NZ_I18N } from "ng-zorro-antd";
import { NgxEchartsModule } from "ngx-echarts";
import { AppRoutingModule } from "./app-routing.module";
import { PerformanceComponent } from "./views/performance/performance.component";
import { CloudLeasedLineModalComponent } from './views/services/intent-based-services/cloud-leased-line-modal/cloud-leased-line-modal.component';
import { CloudLeasedLineComponent } from './views/services/intent-based-services/cloud-leased-line/cloud-leased-line.component';
+import { IntentBasedPredictComponent } from './views/services/intent-based-services/intent-based-predict/intent-based-predict.component';
import { IntentBasedServicesComponent } from './views/services/intent-based-services/intent-based-services.component';
import { SmartCloudLeasedModalComponent } from './views/services/intent-based-services/smart-cloud-leased-modal/smart-cloud-leased-modal.component';
import { CcvpnCreationComponent } from "./views/services/services-list/ccvpn-creation/ccvpn-creation.component";
import { MonitorServiceComponent } from "./views/services/sotn-management/monitor-service/monitor-service.component";
import { OrderServiceComponent } from "./views/services/sotn-management/order-service/order-service.component";
import { SotnManagementComponent } from "./views/services/sotn-management/sotn-management.component";
-import { EventQueueService } from "@src/app/core/services/eventQueue.service";
export function HttpLoaderFactory(httpClient: HttpClient) {
return new TranslateHttpLoader(httpClient, "./assets/i18n/", ".json");
Monitor5gComponent,
MonitorManagementService,
MonitorFacpsServiceComponent,
+ IntentBasedPredictComponent,
IntentBasedServicesComponent,
CloudLeasedLineComponent,
CloudLeasedLineModalComponent,
activeIntentInstance: this.baseUrl + "/intent/activeIntentInstance",
invalidIntentInstance: this.baseUrl + "/intent/invalidIntentInstance",
queryAccessNodeInfo: this.baseUrl + "/intent/queryAccessNodeInfo",
- intentInstancePredict: this.baseUrl + "/intent/predict"
+ intentInstancePredict: this.baseUrl + "/intent/predict",
+ intentBasedUnifyPredict: this.baseUrl + "/intent/unifyPredict"
};
//The following APIs function are optimizable------------------------
intentInstancePredict(requestBody) {
return this.http.post<any>(this.url["intentInstancePredict"], requestBody);
}
+
+ intentBasedUnifyPredict(requestBody) {
+ return this.http.post<any>(this.url["intentBasedUnifyPredict"], requestBody);
+ }
}
<input
nz-input
nz-tooltip
- [id]="item.key"
- [name]="item.key"
+ [id]="item.rateName"
+ [name]="item.rateName"
[(ngModel)]="cloud_leased_line_info[item.key].bandwidth"
[placeholder]="item.placeholder ? item.placeholder : ''"
/>
<div>
<span>{{item.nodeName}}:</span>
<nz-select
- [name]="item.key"
+ [name]="item.nodeName"
[(ngModel)]="cloud_leased_line_info[item.key].name"
>
<nz-option
--- /dev/null
+<div class="subnet_params_container">
+ <div class="form_class">
+ <form nz-form class='text-form-class'>
+ <nz-form-item>
+ <nz-form-control [nzSpan]="24">
+ <textarea
+ [id]="communicationMessage"
+ nz-tooltip
+ nz-input
+ placeholder="Please input communicationMessage"
+ [nzAutosize]="{ minRows: 6, maxRows: 6 }"
+ [(ngModel)]="communicationMessage"
+ name="communicationMessage">
+ </textarea>
+ </nz-form-control>
+ </nz-form-item>
+ </form>
+ </div>
+ <div class="submit">
+ <button
+ nz-button
+ nzType="primary"
+ nzSize="middle"
+ (click)="submitFormMessage()"
+ [nzLoading]="isConfirmCreating"
+ form="createForm">
+ <span>
+ Submit
+ </span>
+ </button>
+ </div>
+ <app-cloud-leased-line-modal
+ [modelParams]="modalParam"
+ [cloudLeasedLineShowFlag]="cloudModalShowFlag"
+ (cancelEmitter)="modalClose()"
+ ></app-cloud-leased-line-modal>
+ <app-business-order
+ [modelParams]="modalParam"
+ [showModel]="businessModalShowFlag"
+ (cancel)="modalClose()"
+ ></app-business-order>
+</div>
--- /dev/null
+.subnet_params_container {
+ // padding-left: 3%;
+ // padding-right: 3%;
+ .form_class {
+ padding: 0 100px;
+ }
+ .submit {
+ text-align: center;
+ margin-top: 30px;
+ }
+}
+.ant-form-item {
+ margin-top: 20px;
+ margin-bottom: -5px;
+}
+
+.validateRules{
+ color: red;
+}
+.error-input-border{
+ border-color: red!important;
+}
\ No newline at end of file
--- /dev/null
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { InputBusinessOrderComponent } from './input-business-order.component';
+
+describe('InputBusinessOrderComponent', () => {
+ let component: InputBusinessOrderComponent;
+ let fixture: ComponentFixture<InputBusinessOrderComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ InputBusinessOrderComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(InputBusinessOrderComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
--- /dev/null
+import { Component, OnInit } from '@angular/core';
+import { NzMessageService } from 'ng-zorro-antd';
+import { intentBaseService } from '../../../../core/services/intentBase.service';
+
+@Component({
+ selector: 'app-intent-based-predict',
+ templateUrl: './intent-based-predict.component.html',
+ styleUrls: ['./intent-based-predict.component.less']
+})
+export class IntentBasedPredictComponent implements OnInit {
+
+ constructor(
+ private myhttp: intentBaseService,
+ private msg: NzMessageService
+ ) {}
+
+ // textarea input predict param
+ communicationMessage: String = "";
+ // button loading
+ isConfirmCreating: boolean = false;
+ // modal param
+ modalParam: Object = {};
+ // cloud modal show flag
+ cloudModalShowFlag: boolean = false;
+ // business modal show flag
+ businessModalShowFlag: boolean = false;
+
+ ngOnInit() {
+ this.communicationMessage = '';
+ }
+
+ ngOnChange() {}
+
+ submitFormMessage(): void {
+ this.isConfirmCreating = true;
+ this.myhttp.intentBasedUnifyPredict({
+ "text": this.communicationMessage
+ }).subscribe(
+ (response) => {
+ this.isConfirmCreating = false;
+ const { code, message, data: { type, formData } } = response;
+ if (code !== 200) {
+ this.msg.error(message);
+ return;
+ }
+
+ this.modalParam = {
+ ...formData,
+ intentContent: this.communicationMessage
+ };
+
+ if (type === 'ccvpn') {
+ this.cloudModalShowFlag = true;
+ }
+
+ if (type === '5gs') {
+ this.businessModalShowFlag = true;
+ }
+ },
+ (err) => {
+ this.isConfirmCreating = false;
+ console.log(err);
+ }
+ )
+ }
+
+ modalClose() {
+ this.cloudModalShowFlag = false;
+ this.businessModalShowFlag = false;
+ this.modalParam = {};
+ this.communicationMessage = '';
+ }
+}
<nz-tabset [nzSelectedIndex]="selectedIndex" (nzSelectChange)="handleTabChange($event)" class="slicing">
+ <nz-tab [nzTitle]="'i18nTextDefine_intentBaseService' | translate">
+ <app-intent-based-predict
+ *ngIf="selectedIndex === 0"
+ ></app-intent-based-predict>
+ </nz-tab>
<nz-tab [nzTitle]="'i18nTextDefine_cloudLeasedLine' | translate">
<app-cloud-leased-line
- *ngIf="selectedIndex === 0"
+ *ngIf="selectedIndex === 1"
></app-cloud-leased-line>
</nz-tab>
</nz-tabset>
\ No newline at end of file
};
this.myhttp.intentInstancePredict(params).subscribe(
(response) => {
- this.handleCancel(false, response);
+ const { code, message, data } = response;
+ if (code !== 200) {
+ this.msg.error(message);
+ return;
+ }
+ let orderForm = {
+ ...data,
+ intentContent: this.communicationMessage
+ };
+ this.handleCancel(false, orderForm);
},
(err) => {
console.log(err);
import { Component, EventEmitter, Input, OnInit, Output } from "@angular/core";
-import { COMMUNICATION_FORM_ITEMS, MASKTEXT } from "./constants";
-import { Util } from "../../../../../shared/utils/utils";
-import { SlicingTaskServices } from "../../../../../core/services/slicingTaskServices";
import { NzMessageService } from "ng-zorro-antd";
+import { SlicingTaskServices } from "../../../../../core/services/slicingTaskServices";
+import { Util } from "../../../../../shared/utils/utils";
+import { COMMUNICATION_FORM_ITEMS, MASKTEXT } from "./constants";
@Component({
selector: "app-business-order",
this.slicing_order_info = { ...this.modelParams };
if (this.slicing_order_info.coverageArea) {
areaList = [];
- areaList.push(
- this.slicing_order_info.coverageArea.split(" ").join(";")
- );
+ areaList.push(this.slicing_order_info.coverageArea);
}
}
this.AreaFormatting(areaList);
"text": this.communicationMessage
};
this.myhttp["analysisInputText"](params)
- .subscribe((data) => {
+ .subscribe((response) => {
this.clickRepeat = false;
- if (data === 0) {
+ const { code, message, data } = response;
+ if (code !== 200) {
+ this.msg.error(message);
return;
}
- let orderForm = { ...data };
+
+ let orderForm = {
+ ...data,
+ intentContent: this.communicationMessage
+ };
this.communicationMessage = "";
this.showModel = false;
this.modalOpreation.emit({ "cancel": false, "param": orderForm });
"i18nTextDefine_monitorService":"监控服务",
"i18nTextDefine_manageService":"管理服务",
"i18nTextDefine_cloudLeasedLine":"Cloud Leased Line",
+ "i18nTextDefine_intentBaseService":"Intent Based Services",
"mdons-network-component":"--:",
"i18nTextDefine_monitorService":"Monitor Service",
"i18nTextDefine_manageService":"Manage Service",
"i18nTextDefine_cloudLeasedLine":"Cloud Leased Line",
+ "i18nTextDefine_intentBaseService":"Intent Based Services",
"mdons-network-component":"--:",