Review comment incorporated
Gui2 Intent and Processor View
Change-Id: Ieb3b2c818f31ee7bff73b26cd5b7150c8f6fb92c
diff --git a/web/gui2/src/main/webapp/app/fw/layer/confirm/confirm.component.css b/web/gui2/src/main/webapp/app/fw/layer/confirm/confirm.component.css
index 80243b0..b097534 100644
--- a/web/gui2/src/main/webapp/app/fw/layer/confirm/confirm.component.css
+++ b/web/gui2/src/main/webapp/app/fw/layer/confirm/confirm.component.css
@@ -22,6 +22,12 @@
padding: 12px;
}
+#app-dialog h3 {
+ display: inline-block;
+ font-weight: bold;
+ font-size: 18pt;
+}
+
#app-dialog p {
font-size: 12pt;
}
diff --git a/web/gui2/src/main/webapp/app/fw/layer/confirm/confirm.component.html b/web/gui2/src/main/webapp/app/fw/layer/confirm/confirm.component.html
index a3b76f4..a8e2489 100644
--- a/web/gui2/src/main/webapp/app/fw/layer/confirm/confirm.component.html
+++ b/web/gui2/src/main/webapp/app/fw/layer/confirm/confirm.component.html
@@ -14,8 +14,9 @@
~ limitations under the License.
-->
<div id="app-dialog" class="floatpanel dialog" [@confirmDlgState]="message!==''">
+ <h3> {{ lionFn('dlg_confirm_action') }} </h3>
<p>{{ message }}</p>
<p *ngIf="warning" class="warning strong">{{ warning }}</p>
<div tabindex="10" class="dialog-button" (click)="choice(true)">OK</div>
<div tabindex="11" class="dialog-button" (click)="choice(false)">Cancel</div>
-</div>
+</div>
\ No newline at end of file
diff --git a/web/gui2/src/main/webapp/app/fw/layer/confirm/confirm.component.spec.ts b/web/gui2/src/main/webapp/app/fw/layer/confirm/confirm.component.spec.ts
index 9a88dc9..bf13589 100644
--- a/web/gui2/src/main/webapp/app/fw/layer/confirm/confirm.component.spec.ts
+++ b/web/gui2/src/main/webapp/app/fw/layer/confirm/confirm.component.spec.ts
@@ -17,6 +17,7 @@
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { DebugElement } from '@angular/core';
import { By } from '@angular/platform-browser';
+import { LionService } from '../../../fw/util/lion.service';
import { ConsoleLoggerService } from '../../../consolelogger.service';
import { LogService } from '../../../log.service';
@@ -29,6 +30,14 @@
let log: LogService;
let component: ConfirmComponent;
let fixture: ComponentFixture<ConfirmComponent>;
+ const bundleObj = {
+ 'core.view.App': {
+ test: 'test1'
+ }
+ };
+ const mockLion = (key) => {
+ return bundleObj[key] || '%' + key + '%';
+ };
beforeEach(async(() => {
log = new ConsoleLoggerService();
@@ -37,6 +46,15 @@
declarations: [ ConfirmComponent ],
providers: [
{ provide: LogService, useValue: log },
+ {
+ provide: LionService, useFactory: (() => {
+ return {
+ bundle: ((bundleId) => mockLion),
+ ubercache: new Array(),
+ loadCbs: new Map<string, () => void>([])
+ };
+ })
+ },
]
});
}));
@@ -51,6 +69,13 @@
expect(component).toBeTruthy();
});
+ it('should have a h3 inside a div#app-dialog', () => {
+ const appDe: DebugElement = fixture.debugElement;
+ const divDe = appDe.query(By.css('div#app-dialog h3'));
+ const div: HTMLElement = divDe.nativeElement;
+ expect(div.textContent).toEqual(' %dlg_confirm_action% ');
+ });
+
it('should have a div.dialog-button inside a div#app-dialog', () => {
const appDe: DebugElement = fixture.debugElement;
const divDe = appDe.query(By.css('div#app-dialog div.dialog-button'));
diff --git a/web/gui2/src/main/webapp/app/fw/layer/confirm/confirm.component.ts b/web/gui2/src/main/webapp/app/fw/layer/confirm/confirm.component.ts
index cd6aa7a..5c5bad2 100644
--- a/web/gui2/src/main/webapp/app/fw/layer/confirm/confirm.component.ts
+++ b/web/gui2/src/main/webapp/app/fw/layer/confirm/confirm.component.ts
@@ -16,6 +16,7 @@
import { Component, Input, Output, EventEmitter } from '@angular/core';
import { trigger, state, style, animate, transition } from '@angular/animations';
import { LogService } from '../../../log.service';
+import { LionService } from '../../../fw/util/lion.service';
/**
* ONOS GUI -- Layer -- Confirm Component
@@ -55,14 +56,19 @@
]
})
export class ConfirmComponent {
+
+ lionFn; // Function
+
@Input() message: string;
@Input() warning: string;
@Output() chosen: EventEmitter<boolean> = new EventEmitter();
constructor(
private log: LogService,
+ private lion: LionService,
) {
this.log.debug('ConfirmComponent constructed');
+ this.doLion();
}
/**
@@ -71,4 +77,11 @@
choice(chosen: boolean): void {
this.chosen.emit(chosen);
}
+
+ /**
+ * Read the LION bundle for App to get confirm dialouge header
+ */
+ doLion() {
+ this.lionFn = this.lion.bundle('core.view.App');
+ }
}
diff --git a/web/gui2/src/main/webapp/app/fw/nav/nav/nav.component.html b/web/gui2/src/main/webapp/app/fw/nav/nav/nav.component.html
index f807c9a..27d4a60 100644
--- a/web/gui2/src/main/webapp/app/fw/nav/nav/nav.component.html
+++ b/web/gui2/src/main/webapp/app/fw/nav/nav/nav.component.html
@@ -19,6 +19,9 @@
<a (click)="ns.hideNav()" routerLink="/app" routerLinkActive="active">
<onos-icon iconId="nav_apps"></onos-icon> Apps</a>
+ <a (click)="ns.hideNav()" routerLink="/processor" routerLinkActive="active">
+ <onos-icon iconId="nav_processors"></onos-icon> Packet Processors</a>
+
<div class="nav-hdr">{{ lionFn('cat_network') }}</div>
<a (click)="ns.hideNav()" routerLink="/device" routerLinkActive="active">
@@ -30,6 +33,9 @@
<a (click)="ns.hideNav()" routerLink="/host" routerLinkActive="active">
<onos-icon iconId="nav_hosts"></onos-icon> Hosts</a>
+ <a (click)="ns.hideNav()" routerLink="/intent" routerLinkActive="active">
+ <onos-icon iconId="nav_intents"></onos-icon> Intents</a>
+
<a (click)="ns.hideNav()" routerLink="/tunnel" routerLinkActive="active">
<onos-icon iconId="nav_tunnels"></onos-icon> Tunnels</a>
diff --git a/web/gui2/src/main/webapp/app/onos-routing.module.ts b/web/gui2/src/main/webapp/app/onos-routing.module.ts
index 040139b..48192b5 100644
--- a/web/gui2/src/main/webapp/app/onos-routing.module.ts
+++ b/web/gui2/src/main/webapp/app/onos-routing.module.ts
@@ -26,6 +26,10 @@
loadChildren: 'app/view/apps/apps.module#AppsModule'
},
{
+ path: 'processor',
+ loadChildren: 'app/view/processor/processor.module#ProcessorModule'
+ },
+ {
path: 'device',
loadChildren: 'app/view/device/device.module#DeviceModule'
},
@@ -38,6 +42,10 @@
loadChildren: 'app/view/host/host.module#HostModule'
},
{
+ path: 'intent',
+ loadChildren: 'app/view/intent/intent.module#IntentModule'
+ },
+ {
path: 'tunnel',
loadChildren: 'app/view/tunnel/tunnel.module#TunnelModule'
},
diff --git a/web/gui2/src/main/webapp/app/view/intent/intent-routing.module.ts b/web/gui2/src/main/webapp/app/view/intent/intent-routing.module.ts
new file mode 100644
index 0000000..22407ff
--- /dev/null
+++ b/web/gui2/src/main/webapp/app/view/intent/intent-routing.module.ts
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2018-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+import { IntentComponent } from './intent/intent.component';
+
+const intentRoutes: Routes = [
+ {
+ path: '',
+ component: IntentComponent
+ }
+];
+
+/**
+ * ONOS GUI -- Intents Tabular View Feature Routing Module - allows it to be lazy loaded
+ *
+ * See https://angular.io/guide/lazy-loading-ngmodules
+ */
+@NgModule({
+ imports: [RouterModule.forChild(intentRoutes)],
+ exports: [RouterModule]
+})
+export class IntentRoutingModule { }
diff --git a/web/gui2/src/main/webapp/app/view/intent/intent.module.ts b/web/gui2/src/main/webapp/app/view/intent/intent.module.ts
new file mode 100644
index 0000000..b5d6e64
--- /dev/null
+++ b/web/gui2/src/main/webapp/app/view/intent/intent.module.ts
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2018-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+
+import { IntentRoutingModule } from './intent-routing.module';
+import { IntentComponent } from './intent/intent.component';
+import { SvgModule } from '../../fw/svg/svg.module';
+import { WidgetModule } from '../../fw/widget/widget.module';
+import { RouterModule } from '@angular/router';
+import { LayerModule } from '../../fw/layer/layer.module';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ SvgModule,
+ WidgetModule,
+ RouterModule,
+ IntentRoutingModule,
+ LayerModule
+ ],
+ declarations: [IntentComponent],
+ exports: [IntentComponent]
+})
+export class IntentModule { }
diff --git a/web/gui2/src/main/webapp/app/view/intent/intent/intent-theme.css b/web/gui2/src/main/webapp/app/view/intent/intent/intent-theme.css
new file mode 100644
index 0000000..f9ba730
--- /dev/null
+++ b/web/gui2/src/main/webapp/app/view/intent/intent/intent-theme.css
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2018-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ ONOS GUI -- Intent View (theme) -- CSS file
+ */
+
+
+/* a "logical" row is made up of 3 "physical" rows -- color as such */
+#ov-intent tr:nth-child(6n + 1),
+#ov-intent tr:nth-child(6n + 2),
+#ov-intent tr:nth-child(6n + 3) {
+ background-color: #fbfbfb;
+}
+#ov-intent tr:nth-child(6n + 4),
+#ov-intent tr:nth-child(6n + 5),
+#ov-intent tr:nth-child(6n) {
+ background-color: #f4f4f4;
+}
+
+/* highlighted color */
+#ov-intent tr:nth-child(6n + 1).data-change,
+#ov-intent tr:nth-child(6n + 2).data-change,
+#ov-intent tr:nth-child(6n + 3).data-change,
+#ov-intent tr:nth-child(6n + 4).data-change,
+#ov-intent tr:nth-child(6n + 5).data-change,
+#ov-intent tr:nth-child(6n).data-change {
+ background-color: #FDFFDC;
+}
+
+#ov-intent td.selector,
+#ov-intent td.treatment {
+ opacity: 0.65;
+}
+
+/* ========== DARK Theme ========== */
+
+.dark #ov-intent tr:nth-child(6n + 1),
+.dark #ov-intent tr:nth-child(6n + 2),
+.dark #ov-intent tr:nth-child(6n + 3) {
+ background-color: #333333;
+}
+.dark #ov-intent tr:nth-child(6n + 4),
+.dark #ov-intent tr:nth-child(6n + 5),
+.dark #ov-intent tr:nth-child(6n) {
+ background-color: #3a3a3a;
+}
+
+.dark #ov-intent tr:nth-child(6n + 1).data-change,
+.dark #ov-intent tr:nth-child(6n + 2).data-change,
+.dark #ov-intent tr:nth-child(6n + 3).data-change,
+.dark #ov-intent tr:nth-child(6n + 4).data-change,
+.dark #ov-intent tr:nth-child(6n + 5).data-change,
+.dark #ov-intent tr:nth-child(6n).data-change {
+ background-color: #423708;
+}
\ No newline at end of file
diff --git a/web/gui2/src/main/webapp/app/view/intent/intent/intent.component.css b/web/gui2/src/main/webapp/app/view/intent/intent/intent.component.css
new file mode 100644
index 0000000..3b94c9b
--- /dev/null
+++ b/web/gui2/src/main/webapp/app/view/intent/intent/intent.component.css
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2018-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/*
+ ONOS GUI -- Intent View (layout) -- CSS file
+ */
+
+#ov-intent .tabular-header {
+ text-align: left;
+}
+#ov-intent div.summary-list .table-header td {
+ font-weight: bold;
+ font-variant: small-caps;
+ text-transform: uppercase;
+ font-size: 10pt;
+ padding-top: 8px;
+ padding-bottom: 8px;
+ letter-spacing: 0.02em;
+ cursor: pointer;
+ background-color: #e5e5e6;
+}
+
+#ov-intent h2 {
+ display: inline-block;
+}
+
+#ov-intent th, td {
+ text-align: left;
+ padding: 8px;
+}
+
+#ov-intent .overlay-choice {
+ padding: 2px;
+ white-space: nowrap;
+ font-size: 10pt;
+ color: black;
+}
+
+#ov-intent .overlay-choice:hover {
+ color: white;
+}
+
+#ov-intent td.resources,
+#ov-intent td.details {
+ padding-left: 36px;
+}
diff --git a/web/gui2/src/main/webapp/app/view/intent/intent/intent.component.html b/web/gui2/src/main/webapp/app/view/intent/intent/intent.component.html
new file mode 100644
index 0000000..98b2084
--- /dev/null
+++ b/web/gui2/src/main/webapp/app/view/intent/intent/intent.component.html
@@ -0,0 +1,109 @@
+<!--
+~ Copyright 2018-present Open Networking Foundation
+~
+~ Licensed under the Apache License, Version 2.0 (the "License");
+~ you may not use this file except in compliance with the License.
+~ You may obtain a copy of the License at
+~
+~ http://www.apache.org/licenses/LICENSE-2.0
+~
+~ Unless required by applicable law or agreed to in writing, software
+~ distributed under the License is distributed on an "AS IS" BASIS,
+~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+~ See the License for the specific language governing permissions and
+~ limitations under the License.
+-->
+<div id="ov-intent" xmlns="http://www.w3.org/1999/html">
+ <div class="tabular-header">
+ <onos-flash id="intentActionFlash" message="{{ intentActionMsg }}"></onos-flash>
+ <onos-confirm message="{{ warnMsg }}" (chosen)="dOk($event)"></onos-confirm>
+ <h2>
+ Intents ({{tableData.length}} total)
+ </h2>
+ <div class="ctrl-btns">
+ <div class="refresh" (click)="toggleRefresh()">
+ <!-- See icon.theme.css for the defintions of the classes active and refresh-->
+ <onos-icon classes="{{ autoRefresh?'active refresh':'refresh' }}" iconId="refresh" iconSize="42" toolTip="{{ autoRefreshTip }}"></onos-icon>
+ </div>
+ <div class="separator"></div>
+ <span *ngIf="brief" (click)="briefToggle()">
+ <div>
+ <onos-icon classes="{{'active-rect'}}" iconId="plus" iconSize="42" toolTip="{{detailTip}}">
+ </onos-icon>
+ </div>
+ </span>
+ <span *ngIf="!brief" (click)="briefToggle()">
+ <div>
+ <onos-icon classes="{{'active-rect'}}" iconId="minus" iconSize="42" toolTip="{{briefTip}}">
+ </onos-icon>
+ </div>
+ </span>
+ <div class="separator"></div>
+ <!-- TO-DO showIntent() need to correct once topology page is available-->
+ <div (click)="showIntent()">
+ <onos-icon classes="{active: canShowIntent()}" iconId="topo" iconSize="42" toolTip="{{ topoTip }}"></onos-icon>
+ </div>
+ <div (click)="!!selId && intentState() === 'Withdrawn' ? confirmAction(IntentActionEnum.RESUBMIT):''">
+ <onos-icon classes="{{!!selId && intentState() === 'Withdrawn' ? 'active-rect' :undefined}}" iconId="play" iconSize="42"
+ toolTip="{{ resubmitTip }}"></onos-icon>
+ </div>
+ <div (click)="!!selId && intentState() === 'Installed' ? confirmAction(IntentActionEnum.WITHDRAWN):''">
+ <onos-icon classes="{{!!selId && intentState() === 'Installed' ? 'active-rect' :undefined}}" iconId="stop" iconSize="42"
+ toolTip="{{ deactivateTip }}"></onos-icon>
+ </div>
+ <div (click)="!!selId && intentState() === 'Withdrawn' ? confirmAction(IntentActionEnum.PURGE):''">
+ <onos-icon classes="{{!!selId && intentState() === 'Withdrawn' ? 'active-rect' :undefined}}" iconId="garbage" iconSize="42"
+ toolTip="{{ purgeTip }}"></onos-icon>
+ </div>
+ <div (click)="isHavingWithdrawn() ? confirmAction(IntentActionEnum.PURGEWITHDRAWN):''">
+ <onos-icon classes="{{isHavingWithdrawn() ? 'active-rect' :undefined}}" iconId="garbage" iconSize="47" toolTip="{{ purgeAllTip }}"></onos-icon>
+ </div>
+ </div>
+ </div>
+
+ <div class="summary-list">
+ <div class="table-header">
+ <table onosTableResize>
+ <tr>
+ <td colId="appId" (click)="onSort('appId')">Application ID
+ <onos-icon classes="active-sort" [iconSize]="10" [iconId]="sortIcon('appId')"></onos-icon>
+ </td>
+ <td colId="key" (click)="onSort('key')">Key
+ <onos-icon classes="active-sort" [iconSize]="10" [iconId]="sortIcon('key')"></onos-icon>
+ </td>
+ <td colId="type" (click)="onSort('type')">Type
+ <onos-icon classes="active-sort" [iconSize]="10" [iconId]="sortIcon('type')"></onos-icon>
+ </td>
+ <td colId="priority" (click)="onSort('priority')">Priority
+ <onos-icon classes="active-sort" [iconSize]="10" [iconId]="sortIcon('priority')"></onos-icon>
+ </td>
+ <td colId="state" (click)="onSort('state')">State
+ <onos-icon classes="active-sort" [iconSize]="10" [iconId]="sortIcon('state')"></onos-icon>
+ </td>
+ </tr>
+ </table>
+ </div>
+ <div class="table-body">
+ <table onosTableResize id-prop="key">
+ <tr class="table-body" *ngIf="tableData.length === 0" class="no-data">
+ <td colspan="5">{{ annots.noRowsMsg }}</td>
+ </tr>
+ <ng-template ngFor let-intent [ngForOf]="tableData">
+ <tr (click)="selectCallback($event, intent)" [ngClass]="{selected: intent.key === selId, 'data-change': isChanged(intent.key)}">
+ <td>{{intent.appId}}</td>
+ <td>{{intent.key}}</td>
+ <td>{{intent.type}}</td>
+ <td>{{intent.priority}}</td>
+ <td>{{intent.state}}</td>
+ </tr>
+ <tr (click)="selectCallback($event, intent)" [hidden]="brief" [ngClass]="{selected: intent.key === selId, 'data-change': isChanged(intent.key)}">
+ <td class="resources" colspan="5">{{ intent.resources }}</td>
+ </tr>
+ <tr (click)="selectCallback($event, intent)" [hidden]="brief" [ngClass]="{selected: intent.key === selId, 'data-change': isChanged(intent.key)}">
+ <td class="details" colspan="5">{{ intent.details }}</td>
+ </tr>
+ </ng-template>
+ </table>
+ </div>
+ </div>
+</div>
\ No newline at end of file
diff --git a/web/gui2/src/main/webapp/app/view/intent/intent/intent.component.spec.ts b/web/gui2/src/main/webapp/app/view/intent/intent/intent.component.spec.ts
new file mode 100644
index 0000000..b32538b
--- /dev/null
+++ b/web/gui2/src/main/webapp/app/view/intent/intent/intent.component.spec.ts
@@ -0,0 +1,153 @@
+/*
+* Copyright 2018-present Open Networking Foundation
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+import { ActivatedRoute, Params } from '@angular/router';
+import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
+import { FormsModule } from '@angular/forms';
+import { DebugElement } from '@angular/core';
+import { By } from '@angular/platform-browser';
+import { ConfirmComponent } from '../../../fw/layer/confirm/confirm.component';
+import { FlashComponent } from '../../../fw/layer/flash/flash.component';
+
+import { LogService } from '../../../log.service';
+import { FnService } from '../../../fw/util/fn.service';
+import { IconComponent } from '../../../fw/svg/icon/icon.component';
+import { IconService } from '../../../fw/svg/icon.service';
+import { LoadingService } from '../../../fw/layer/loading.service';
+import { TableFilterPipe } from '../../../fw/widget/tablefilter.pipe';
+import { WebSocketService } from '../../../fw/remote/websocket.service';
+import { of } from 'rxjs';
+import { } from 'jasmine';
+
+import { IntentComponent } from './intent.component';
+
+class MockActivatedRoute extends ActivatedRoute {
+ constructor(params: Params) {
+ super();
+ this.queryParams = of(params);
+ }
+}
+
+class MockIconService {
+ loadIconDef() { }
+}
+
+class MockLoadingService {
+ startAnim() { }
+ stop() { }
+ waiting() { }
+}
+
+class MockWebSocketService {
+ createWebSocket() { }
+ isConnected() { return false; }
+ unbindHandlers() { }
+ bindHandlers() { }
+}
+
+describe('IntentComponent', () => {
+ let fs: FnService;
+ let ar: MockActivatedRoute;
+ let windowMock: Window;
+ let logServiceSpy: jasmine.SpyObj<LogService>;
+ let component: IntentComponent;
+ let fixture: ComponentFixture<IntentComponent>;
+
+ const bundleObj = {
+ 'core.view.Intent': {
+ test: 'test1'
+ }
+ };
+
+ beforeEach(async(() => {
+ const logSpy = jasmine.createSpyObj('LogService', ['info', 'debug', 'warn', 'error']);
+ ar = new MockActivatedRoute({ 'debug': 'txrx' });
+
+ windowMock = <any>{
+ location: <any>{
+ hostname: 'foo',
+ host: 'foo',
+ port: '80',
+ protocol: 'http',
+ search: { debug: 'true' },
+ href: 'ws://foo:123/onos/ui/websock/path',
+ absUrl: 'ws://foo:123/onos/ui/websock/path'
+ }
+ };
+ fs = new FnService(ar, logSpy, windowMock);
+ TestBed.configureTestingModule({
+ imports: [BrowserAnimationsModule, FormsModule],
+ declarations: [IntentComponent, IconComponent, TableFilterPipe, ConfirmComponent, FlashComponent],
+ providers: [
+ { provide: FnService, useValue: fs },
+ { provide: IconService, useClass: MockIconService },
+ { provide: LoadingService, useClass: MockLoadingService },
+ { provide: LogService, useValue: logSpy },
+ { provide: WebSocketService, useClass: MockWebSocketService },
+ { provide: 'Window', useValue: windowMock },
+ ]
+ })
+ .compileComponents();
+ logServiceSpy = TestBed.get(LogService);
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(IntentComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+
+ it('should have a div.tabular-header inside a div#ov-intent', () => {
+ const hostDe: DebugElement = fixture.debugElement;
+ const divDe = hostDe.query(By.css('div#ov-intent div.tabular-header'));
+ expect(divDe).toBeTruthy();
+ });
+
+ it('should have a h2 inside the div.tabular-header', () => {
+ const hostDe: DebugElement = fixture.debugElement;
+ const divDe = hostDe.query(By.css('div#ov-intent div.tabular-header h2'));
+ const div: HTMLElement = divDe.nativeElement;
+ expect(div.textContent).toEqual(' Intents (0 total) ');
+ });
+
+ it('should have a refresh button inside the div.tabular-header', () => {
+ const hostDe: DebugElement = fixture.debugElement;
+ const divDe = hostDe.query(By.css('div#ov-intent div.tabular-header div.ctrl-btns div.refresh'));
+ expect(divDe).toBeTruthy();
+ });
+
+ it('should have a div.summary-list inside a div#ov-intent', () => {
+ const hostDe: DebugElement = fixture.debugElement;
+ const divDe = hostDe.query(By.css('div#ov-intent div.summary-list'));
+ expect(divDe).toBeTruthy();
+ });
+
+ it('should have a div.table-header inside a div.summary-list inside a div#ov-intent', () => {
+ const hostDe: DebugElement = fixture.debugElement;
+ const divDe = hostDe.query(By.css('div#ov-intent div.summary-list div.table-header'));
+ expect(divDe).toBeTruthy();
+ });
+
+ it('should have a div.table-body inside a div.summary-list inside a div#ov-intent', () => {
+ const hostDe: DebugElement = fixture.debugElement;
+ const divDe = hostDe.query(By.css('div#ov-intent div.summary-list div.table-body'));
+ expect(divDe).toBeTruthy();
+ });
+});
diff --git a/web/gui2/src/main/webapp/app/view/intent/intent/intent.component.ts b/web/gui2/src/main/webapp/app/view/intent/intent/intent.component.ts
new file mode 100644
index 0000000..df94ed1
--- /dev/null
+++ b/web/gui2/src/main/webapp/app/view/intent/intent/intent.component.ts
@@ -0,0 +1,235 @@
+/*
+ * Copyright 2018-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import { Component, OnInit, OnDestroy } from '@angular/core';
+import { LogService } from '../../../log.service';
+import { FnService } from '../../../fw/util/fn.service';
+import { LoadingService } from '../../../fw/layer/loading.service';
+import { DialogService } from '../../../fw/layer/dialog.service';
+import { WebSocketService } from '../../../fw/remote/websocket.service';
+import { TableResponse, TableBaseImpl, SortDir } from '../../../fw/widget/table.base';
+
+const RESUBMITINTENT = 'resubmitIntent';
+const REMOVEINTENT = 'removeIntent';
+const REMOVEINTENTS = 'removeIntents';
+const INTENTRESUBMITTED = 'Intent resubmitted';
+const INTENTWITHDRAWN = 'Intent withdrawn';
+const INTENTPURGE = 'Intents purged';
+
+/**
+ * Model of the response from WebSocket
+ */
+interface IntentTableResponse extends TableResponse {
+ intents: Intent[];
+}
+
+/**
+ * Model of the Intents returned from the WebSocket
+ */
+interface Intent {
+ appId: string;
+ appName: string;
+ key: string;
+ type: string;
+ priority: string;
+ state: string;
+ purge: boolean;
+}
+
+export enum IntentAction {
+ NONE = 0,
+ RESUBMIT = 1,
+ WITHDRAWN = 2,
+ PURGE = 3,
+ PURGEWITHDRAWN = 4,
+}
+
+/**
+* ONOS GUI -- Intents View Component extends TableBaseImpl
+*/
+@Component({
+ selector: 'onos-intent',
+ templateUrl: './intent.component.html',
+ styleUrls: ['./intent.component.css', './intent-theme.css', '../../../fw/widget/table.css', '../../../fw/widget/table.theme.css']
+})
+export class IntentComponent extends TableBaseImpl implements OnInit, OnDestroy {
+
+ brief: boolean;
+ withdrwanIntent: boolean;
+ intentData: Intent;
+ warnMsg: string = '';
+ intentActionMsg: string;
+ intentTableData: IntentTableResponse;
+ IntentActionEnum: any = IntentAction;
+ intentAction: IntentAction = IntentAction.NONE;
+
+ topoTip = 'Show selected intent on topology view';
+ resubmitTip = 'Resubmit selected intent';
+ deactivateTip = 'Remove selected intent';
+ purgeTip = 'Purge selected intent';
+ purgeAllTip = 'Purge withdrawn intents';
+
+ briefTip = 'Switch to brief view';
+ detailTip = 'Switch to detailed view';
+
+ constructor(
+ protected log: LogService,
+ protected fs: FnService,
+ private ds: DialogService,
+ protected ls: LoadingService,
+ protected wss: WebSocketService,
+ ) {
+ super(fs, ls, log, wss, 'intent', 'key');
+ this.responseCallback = this.intentResponseCb;
+ this.parentSelCb = this.rowSelection;
+ this.brief = true;
+ this.sortParams = {
+ firstCol: 'appId',
+ firstDir: SortDir.desc,
+ secondCol: 'key',
+ secondDir: SortDir.asc,
+ };
+ this.intentData = <Intent>{};
+ }
+
+ ngOnInit() {
+ this.init();
+ this.log.info('IntentComponent initialized');
+ }
+
+ ngOnDestroy() {
+ this.destroy();
+ this.log.info('IntentComponent distroyed');
+ }
+
+ intentResponseCb(data: IntentTableResponse) {
+ this.withdrwanIntent = false;
+ this.log.debug('Intent response received for ', data.intents.length, 'intent');
+ this.intentTableData = data;
+ this.isHavingWithdrawn();
+ }
+
+ /**
+ * called when a row is selected - sets the state of control icons
+ */
+ rowSelection(event: any, selRow: any) {
+ this.intentData.state = selRow.state;
+ const selRowAppId = selRow.appId;
+ const splittedRowAppId = selRowAppId.split(':');
+ this.intentData.appId = splittedRowAppId[0].trim();
+ this.intentData.appName = splittedRowAppId[1].trim();
+ this.intentData.key = this.selId;
+ }
+
+ briefToggle() {
+ this.brief = !this.brief;
+ }
+
+ intentState() {
+ return this.intentData.state;
+ }
+
+ isHavingWithdrawn() {
+ if (this.intentTableData !== undefined) {
+ for (let i = 0; i < this.intentTableData.intents.length; i++) {
+ if (this.intentTableData.intents[i].state === 'Withdrawn') {
+ this.withdrwanIntent = true;
+ return this.withdrwanIntent;
+ }
+ }
+
+ }
+ return this.withdrwanIntent;
+ }
+
+ /**
+ * TO-DO intent view related function need to implement once
+ * topology page will be available
+ */
+ showIntent() {
+ }
+
+ /**
+ * TO-DO intent view related function need to implement once
+ * topology page will be available
+ */
+ canShowIntent() {
+ }
+
+ /**
+ * Perform one of the intent actions - resubmit, remove, purge or purge withdrawn
+ * Raises a dialog which calls back the dOk() below
+ */
+ confirmAction(action: IntentAction): void {
+ this.intentActionMsg = '';
+ this.intentAction = action;
+ const intentActionLc = (<string>IntentAction[this.intentAction]).toLowerCase();
+
+ if (this.intentAction === IntentAction.PURGE) {
+ this.intentData.purge = true;
+ } else {
+ this.intentData.purge = false;
+ }
+
+ if (this.intentAction === IntentAction.PURGEWITHDRAWN) {
+ this.warnMsg = 'Are you sure you want to purge all the withdrawn intents?';
+ } else {
+ this.warnMsg = 'Are you sure you want to ' + intentActionLc + ' the selected intent?';
+ }
+ this.log.debug('Initiating', this.intentAction, 'of', this.selId);
+ }
+
+ /**
+ * Callback when the Confirm dialog is shown and a choice is made
+ */
+ dOk(choice: boolean) {
+ const intentActionLc = (<string>IntentAction[this.intentAction]).toLowerCase();
+ if (choice) {
+
+ if (this.intentAction === IntentAction.RESUBMIT) {
+ this.wss.sendEvent(RESUBMITINTENT, {
+ appId: this.intentData.appId,
+ appName: this.intentData.appName,
+ key: this.intentData.key,
+ purge: this.intentData.purge,
+ });
+ this.selId = '';
+ this.intentActionMsg = INTENTRESUBMITTED;
+ } else if ((this.intentAction === IntentAction.PURGE) || (this.intentAction === IntentAction.WITHDRAWN)) {
+ this.wss.sendEvent(REMOVEINTENT, {
+ appId: this.intentData.appId,
+ appName: this.intentData.appName,
+ key: this.intentData.key,
+ purge: this.intentData.purge,
+ });
+ this.selId = '';
+ if (this.intentData.purge) {
+ this.intentActionMsg = INTENTPURGE;
+ } else {
+ this.intentActionMsg = INTENTWITHDRAWN;
+ }
+ } else if (this.intentAction === IntentAction.PURGEWITHDRAWN) {
+ this.wss.sendEvent(REMOVEINTENTS, {});
+ this.intentActionMsg = INTENTPURGE;
+ } else {
+ this.log.debug('Some worng input provided');
+ }
+
+ } else {
+ this.log.debug('Cancelled', intentActionLc, 'on', this.selId);
+ }
+ this.warnMsg = '';
+ }
+}
diff --git a/web/gui2/src/main/webapp/app/view/processor/processor-routing.module.ts b/web/gui2/src/main/webapp/app/view/processor/processor-routing.module.ts
new file mode 100644
index 0000000..598e451
--- /dev/null
+++ b/web/gui2/src/main/webapp/app/view/processor/processor-routing.module.ts
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2018-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+import { ProcessorComponent } from './processor/processor.component';
+
+const processorRoutes: Routes = [
+ {
+ path: '',
+ component: ProcessorComponent
+ }
+];
+
+@NgModule({
+ imports: [RouterModule.forChild(processorRoutes)],
+ exports: [RouterModule]
+})
+export class ProcessorRoutingModule { }
diff --git a/web/gui2/src/main/webapp/app/view/processor/processor.module.ts b/web/gui2/src/main/webapp/app/view/processor/processor.module.ts
new file mode 100644
index 0000000..961925a
--- /dev/null
+++ b/web/gui2/src/main/webapp/app/view/processor/processor.module.ts
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2018-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { SvgModule } from '../../fw/svg/svg.module';
+import { WidgetModule } from '../../fw/widget/widget.module';
+import { ProcessorRoutingModule } from './processor-routing.module';
+import { ProcessorComponent } from './processor/processor.component';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ ProcessorRoutingModule,
+ SvgModule,
+ WidgetModule
+ ],
+ declarations: [ProcessorComponent]
+})
+export class ProcessorModule { }
diff --git a/web/gui2/src/main/webapp/app/view/processor/processor/processor.component.css b/web/gui2/src/main/webapp/app/view/processor/processor/processor.component.css
new file mode 100644
index 0000000..ff9163e
--- /dev/null
+++ b/web/gui2/src/main/webapp/app/view/processor/processor/processor.component.css
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2018-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ ONOS GUI -- Processor View (layout) -- CSS file
+ */
+ #ov-processor .tabular-header {
+ text-align: left;
+}
+
+#ov-processor h2 {
+ display: inline-block;
+}
+
+#ov-processor div.summary-list .table-header td {
+ font-weight: bold;
+ font-variant: small-caps;
+ text-transform: uppercase;
+ font-size: 10pt;
+ padding-top: 8px;
+ padding-bottom: 8px;
+ letter-spacing: 0.02em;
+ cursor: pointer;
+ background-color: #e5e5e6;
+ color: #3c3a3a;
+}
+
+#ov-processor td {
+ text-align: left;
+}
+
+#ov-processor tr.no-data td {
+ text-align: center;
+}
+
+#ov-processor td.priority {
+ text-align: center;
+}
+
+#ov-processor td.number {
+ text-align: right;
+}
+
diff --git a/web/gui2/src/main/webapp/app/view/processor/processor/processor.component.html b/web/gui2/src/main/webapp/app/view/processor/processor/processor.component.html
new file mode 100644
index 0000000..7073556
--- /dev/null
+++ b/web/gui2/src/main/webapp/app/view/processor/processor/processor.component.html
@@ -0,0 +1,56 @@
+<!--
+~ Copyright 2018-present Open Networking Foundation
+~
+~ Licensed under the Apache License, Version 2.0 (the "License");
+~ you may not use this file except in compliance with the License.
+~ You may obtain a copy of the License at
+~
+~ http://www.apache.org/licenses/LICENSE-2.0
+~
+~ Unless required by applicable law or agreed to in writing, software
+~ distributed under the License is distributed on an "AS IS" BASIS,
+~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+~ See the License for the specific language governing permissions and
+~ limitations under the License.
+-->
+<div id="ov-processor">
+ <div class="tabular-header">
+ <h2>
+ Packet Processors ({{tableData.length}} Processors total)
+ </h2>
+ <div class="ctrl-btns">
+ <div class="refresh" (click)="toggleRefresh()">
+ <onos-icon classes="{{ autoRefresh?'active refresh':'refresh' }}" iconId="refresh" iconSize="42" toolTip="{{ autoRefreshTip }}"></onos-icon>
+ </div>
+ </div>
+ </div>
+ <div class="summary-list">
+ <div class="table-header">
+ <table onosTableResize>
+ <tr>
+ <td class="priority" colId="priority" [ngStyle]="{width: '80px'}">Priority </td>
+ <td colId="type" [ngStyle]="{width: '80px'}">Type </td>
+ <td colId="processor" [ngStyle]="{width: '500px'}">Class </td>
+ <td class="number" colId="packets" [ngStyle]="{width: '100px'}">Packets </td>
+ <td class="number" colId="avgMillis" [ngStyle]="{width: '100px'}">Average (ms) </td>
+
+ </tr>
+ </table>
+ </div>
+ <div class="table-body">
+ <table onosTableResize id-prop="id">
+ <tr class="table-body" *ngIf="tableData.length === 0" class="no-data">
+ <td colspan="5">{{annots.noRowsMsg}}</td>
+ </tr>
+
+ <tr *ngFor="let processor of tableData" [ngClass]="{'data-change': isChanged(processor.id)}">
+ <td class="priority" [ngStyle]="{width: '80px'}">{{processor.priority}}</td>
+ <td [ngStyle]="{width: '80px'}">{{processor.type}}</td>
+ <td [ngStyle]="{width: '500px'}">{{processor.processor}}</td>
+ <td class="number" [ngStyle]="{width: '100px'}">{{processor.packets}}</td>
+ <td class="number" [ngStyle]="{width: '100px'}">{{processor.avgMillis}}</td>
+ </tr>
+ </table>
+ </div>
+ </div>
+</div>
\ No newline at end of file
diff --git a/web/gui2/src/main/webapp/app/view/processor/processor/processor.component.spec.ts b/web/gui2/src/main/webapp/app/view/processor/processor/processor.component.spec.ts
new file mode 100644
index 0000000..6abded1
--- /dev/null
+++ b/web/gui2/src/main/webapp/app/view/processor/processor/processor.component.spec.ts
@@ -0,0 +1,151 @@
+/*
+ * Copyright 2018-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+import { ActivatedRoute, Params } from '@angular/router';
+import { DebugElement } from '@angular/core';
+import { By } from '@angular/platform-browser';
+import { LogService } from '../../../log.service';
+import { FnService } from '../../../fw/util/fn.service';
+import { IconComponent } from '../../../fw/svg/icon/icon.component';
+import { IconService } from '../../../fw/svg/icon.service';
+import { LoadingService } from '../../../fw/layer/loading.service';
+import { WebSocketService } from '../../../fw/remote/websocket.service';
+import { of } from 'rxjs';
+import { } from 'jasmine';
+import { RouterTestingModule } from '@angular/router/testing';
+
+import { ProcessorComponent } from './processor.component';
+
+class MockActivatedRoute extends ActivatedRoute {
+ constructor(params: Params) {
+ super();
+ this.queryParams = of(params);
+ }
+}
+
+
+class MockIconService {
+ loadIconDef() { }
+}
+
+class MockLoadingService {
+ startAnim() { }
+ stop() { }
+ waiting() { }
+}
+
+class MockWebSocketService {
+ createWebSocket() { }
+ isConnected() { return false; }
+ unbindHandlers() { }
+ bindHandlers() { }
+}
+
+describe('ProcessorComponent', () => {
+ let fs: FnService;
+ let ar: MockActivatedRoute;
+ let windowMock: Window;
+ let logServiceSpy: jasmine.SpyObj<LogService>;
+ let component: ProcessorComponent;
+ let fixture: ComponentFixture<ProcessorComponent>;
+
+ const bundleObj = {
+ 'core.view.Processor': {
+ test: 'test1'
+ }
+ };
+
+ beforeEach(async(() => {
+ const logSpy = jasmine.createSpyObj('LogService', ['info', 'debug', 'warn', 'error']);
+ ar = new MockActivatedRoute({ 'debug': 'txrx' });
+
+ windowMock = <any>{
+ location: <any>{
+ hostname: 'foo',
+ host: 'foo',
+ port: '80',
+ protocol: 'http',
+ search: { debug: 'true' },
+ href: 'ws://foo:123/onos/ui/websock/path',
+ absUrl: 'ws://foo:123/onos/ui/websock/path'
+ }
+ };
+ fs = new FnService(ar, logSpy, windowMock);
+
+ TestBed.configureTestingModule({
+ imports: [RouterTestingModule],
+ declarations: [ProcessorComponent, IconComponent],
+ providers: [
+ { provide: FnService, useValue: fs },
+ { provide: LoadingService, useClass: MockLoadingService },
+ { provide: IconService, useClass: MockIconService },
+ { provide: LogService, useValue: logSpy },
+ { provide: WebSocketService, useClass: MockWebSocketService },
+ ]
+ })
+ .compileComponents();
+ logServiceSpy = TestBed.get(LogService);
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(ProcessorComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+
+
+ it('should have a div.tabular-header inside a div#ov-processor', () => {
+ const metDe: DebugElement = fixture.debugElement;
+ const divDe = metDe.query(By.css('div#ov-processor div.tabular-header'));
+ expect(divDe).toBeTruthy();
+ });
+
+ it('should have a h2 inside the div.tabular-header', () => {
+ const metDe: DebugElement = fixture.debugElement;
+ const divDe = metDe.query(By.css('div#ov-processor div.tabular-header h2'));
+ const div: HTMLElement = divDe.nativeElement;
+ expect(div.textContent).toEqual(' Packet Processors (0 Processors total) ');
+ });
+
+ it('should have a refresh button inside the div.tabular-header', () => {
+ const metDe: DebugElement = fixture.debugElement;
+ const divDe = metDe.query(By.css('div#ov-processor div.tabular-header div.ctrl-btns div.refresh'));
+ expect(divDe).toBeTruthy();
+ });
+
+
+ it('should have a div.summary-list inside a div#ov-processor', () => {
+ const hostDe: DebugElement = fixture.debugElement;
+ const divDe = hostDe.query(By.css('div#ov-processor div.summary-list'));
+ expect(divDe).toBeTruthy();
+ });
+
+ it('should have a div.table-header inside a div.summary-list inside a div#ov-processor', () => {
+ const hostDe: DebugElement = fixture.debugElement;
+ const divDe = hostDe.query(By.css('div#ov-processor div.summary-list div.table-header'));
+ expect(divDe).toBeTruthy();
+ });
+
+ it('should have a div.table-body inside a div.summary-list inside a div#ov-processor', () => {
+ const hostDe: DebugElement = fixture.debugElement;
+ const divDe = hostDe.query(By.css('div#ov-processor div.summary-list div.table-body'));
+ expect(divDe).toBeTruthy();
+ });
+});
diff --git a/web/gui2/src/main/webapp/app/view/processor/processor/processor.component.ts b/web/gui2/src/main/webapp/app/view/processor/processor/processor.component.ts
new file mode 100644
index 0000000..a7840ec
--- /dev/null
+++ b/web/gui2/src/main/webapp/app/view/processor/processor/processor.component.ts
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2018-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import { Component, OnDestroy, OnInit } from '@angular/core';
+import { SortDir, TableBaseImpl, TableResponse } from '../../../fw/widget/table.base';
+import { WebSocketService } from '../../../fw/remote/websocket.service';
+import { LogService } from '../../../log.service';
+import { LoadingService } from '../../../fw/layer/loading.service';
+import { FnService } from '../../../fw/util/fn.service';
+import { ActivatedRoute } from '@angular/router';
+
+/**
+* ONOS GUI -- Processor View Component extends TableBaseImpl
+*/
+@Component({
+ selector: 'onos-processor',
+ templateUrl: './processor.component.html',
+ styleUrls: ['./processor.component.css', '../../../fw/widget/table.css', '../../../fw/widget/table.theme.css']
+})
+export class ProcessorComponent extends TableBaseImpl implements OnInit, OnDestroy {
+
+ constructor(
+ protected fs: FnService,
+ protected log: LogService,
+ protected ls: LoadingService,
+ protected as: ActivatedRoute,
+ protected wss: WebSocketService,
+ ) {
+ super(fs, ls, log, wss, 'processor');
+ }
+
+ ngOnInit() {
+ this.init();
+ this.log.debug('ProcessorComponent initialized');
+ }
+
+ ngOnDestroy() {
+ this.destroy();
+ this.log.debug('ProcessorComponent destroyed');
+ }
+}