blob: c7fc3808c7b051019229d9dd904bcc9f6c47311c [file] [log] [blame]
Sean Condon28ecc5f2018-06-25 12:50:16 +01001<!--
Sean Condon2aa86092018-07-16 09:04:05 +01002~ Copyright 2018-present Open Networking Foundation
Sean Condon28ecc5f2018-06-25 12:50:16 +01003~
4~ Licensed under the Apache License, Version 2.0 (the "License");
5~ you may not use this file except in compliance with the License.
6~ You may obtain a copy of the License at
7~
8~ http://www.apache.org/licenses/LICENSE-2.0
9~
10~ Unless required by applicable law or agreed to in writing, software
11~ distributed under the License is distributed on an "AS IS" BASIS,
12~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13~ See the License for the specific language governing permissions and
14~ limitations under the License.
15-->
Sean Condon2aa86092018-07-16 09:04:05 +010016<div id="ov-app" (dragover)="onDragOver($event)" (dragleave)="onDragLeave($event)" (drop)="onDrop($event)">
Sean Condon95fb5742019-04-02 12:16:55 +010017 <onos-flash id="appMsgFlash" message="{{ alertMsg }}" dwell="5000" warning="true" (closed)="alertMsg = ''"></onos-flash>
18 <onos-loading [theme]="'light'" [running]="loadingIconShown"></onos-loading>
19 <onos-confirm title="{{ lionFn('dlg_confirm_action') }}" message="{{ confirmMsg }}" warning="{{ strongWarning }}" (chosen)="dOk($event)"></onos-confirm>
Sean Condon28ecc5f2018-06-25 12:50:16 +010020 <div class="tabular-header">
21 <h2>
22 {{lionFn('title_apps')}}
23 ({{ tableData.length }}
24 {{ lionFn('total') }})
25 </h2>
26 <div class="ctrl-btns">
Sean Condon2aa86092018-07-16 09:04:05 +010027 <form #inputFileForm="ngForm">
28 <input id="uploadFile" hidden
29 type="file" size="50" accept=".oar,.jar"
30 name="appFile" (change)="fileEvent($event)">
31 </form>
32
Sean Condon28ecc5f2018-06-25 12:50:16 +010033 <div class="refresh" (click)="toggleRefresh()">
34 <onos-icon classes="{{ autoRefresh?'active refresh':'refresh' }}"
35 iconId="refresh" iconSize="42" toolTip="{{ autoRefreshTip }}"></onos-icon>
36 </div>
37 <div class="separator"></div>
38
Sean Condon2aa86092018-07-16 09:04:05 +010039 <div class="active" (click)="triggerForm()">
Bhavesh72ead492018-07-19 16:29:18 +053040 <onos-icon classes="{{ 'active-rect upload' }}"
Sean Condon2aa86092018-07-16 09:04:05 +010041 iconId="upload" iconSize="42" toolTip="{{ uploadTip }}"></onos-icon>
Sean Condon28ecc5f2018-06-25 12:50:16 +010042 </div>
Sean Condon2aa86092018-07-16 09:04:05 +010043
Bhavesh72ead492018-07-19 16:29:18 +053044 <div (click)="(!!selId) ? confirmAction(AppActionEnum.ACTIVATE) : ''">
45 <onos-icon classes="{{ ctrlBtnState.installed?'active-rect play':'play' }}"
Sean Condon28ecc5f2018-06-25 12:50:16 +010046 iconId="play" iconSize="42" toolTip="{{ activateTip }}"></onos-icon>
47 </div>
Bhavesh72ead492018-07-19 16:29:18 +053048 <div (click)="(!!selId) ? confirmAction(AppActionEnum.DEACTIVATE) : ''">
49 <onos-icon classes="{{ ctrlBtnState.active?'active-rect stop':'stop' }}"
Sean Condon28ecc5f2018-06-25 12:50:16 +010050 iconId="stop" iconSize="42" toolTip="{{ deactivateTip }}"></onos-icon>
51 </div>
Bhavesh72ead492018-07-19 16:29:18 +053052 <div (click)="(!!selId) ? confirmAction(AppActionEnum.UNINSTALL) : ''">
53 <onos-icon classes="{{ ctrlBtnState.selection?'active-rect garbage':'garbage' }}"
Sean Condon28ecc5f2018-06-25 12:50:16 +010054 iconId="garbage" iconSize="42" toolTip="{{ uninstallTip }}"></onos-icon>
55 </div>
Bhavesh72ead492018-07-19 16:29:18 +053056 <div (click)="(!!selId) ? downloadApp() : ''">
57 <onos-icon classes="{{ ctrlBtnState.selection?'active-rect download':'download' }}"
Sean Condon28ecc5f2018-06-25 12:50:16 +010058 iconId="download" iconSize="42" toolTip="{{ downloadTip }}"></onos-icon>
59 </div>
60 </div>
61 <div class="search">
62 <input id="searchinput" [(ngModel)]="tableDataFilter.queryStr" type="search" #search placeholder="Search"/>
63 <!--(keyup)="onSearch(search.value)" (search)="onSearch(search.value)"/>-->
64 <select [(ngModel)]="tableDataFilter.queryBy">
65 <!--(change)="onSearchBy($event)" (change)="search.value = ''">-->
66 <option value="" disabled>Search By</option>
67 <option value="$">All Fields</option>
68 <option value="title">{{lionFn('title')}}</option>
69 <option value="id">{{lionFn('app_id')}}</option>
70 <option value="version">{{lionFn('version')}}</option>
71 <option value="category">{{lionFn('category')}}</option>
72 <option value="origin">{{lionFn('origin')}}</option>
73 </select>
74 </div>
75
76 </div>
77
Bhavesh72ead492018-07-19 16:29:18 +053078 <div id="summary-list" class="summary-list" onosTableResize>
Sean Condon2aa86092018-07-16 09:04:05 +010079 <div class="table-header">
Bhavesh72ead492018-07-19 16:29:18 +053080 <table>
Sean Condon2aa86092018-07-16 09:04:05 +010081 <tr>
82 <th colId="state" [ngStyle]="{width: '32px'}" class="table-icon" (click)="onSort('state')">
Bhavesh72ead492018-07-19 16:29:18 +053083 <onos-icon classes="active-sort" [iconSize]="10" [iconId]="sortIcon('state')"></onos-icon>
Sean Condon2aa86092018-07-16 09:04:05 +010084 </th>
85 <th colId="icon" [ngStyle]="{width: '32px'}" class="table-icon"></th>
86 <th colId="title" (click)="onSort('title')">{{lionFn('title')}}
Bhavesh72ead492018-07-19 16:29:18 +053087 <onos-icon classes="active-sort" [iconSize]="10" [iconId]="sortIcon('title')"></onos-icon>
Sean Condon2aa86092018-07-16 09:04:05 +010088 </th>
89 <th colId="id" (click)="onSort('id')">{{lionFn('app_id')}}
Bhavesh72ead492018-07-19 16:29:18 +053090 <onos-icon classes="active-sort" [iconSize]="10" [iconId]="sortIcon('id')"></onos-icon>
Sean Condon2aa86092018-07-16 09:04:05 +010091 </th>
92 <th colId="version" (click)="onSort('version')"> {{lionFn('version')}}
Bhavesh72ead492018-07-19 16:29:18 +053093 <onos-icon classes="active-sort" [iconSize]="10" [iconId]="sortIcon('version')"></onos-icon>
Sean Condon2aa86092018-07-16 09:04:05 +010094 </th>
95 <th colId="category" (click)="onSort('category')"> {{lionFn('category')}}
Bhavesh72ead492018-07-19 16:29:18 +053096 <onos-icon classes="active-sort" [iconSize]="10" [iconId]="sortIcon('category')"></onos-icon>
Sean Condon2aa86092018-07-16 09:04:05 +010097 </th>
98 <th colId="origin" (click)="onSort('origin')"> {{lionFn('origin')}}
Bhavesh72ead492018-07-19 16:29:18 +053099 <onos-icon classes="active-sort" [iconSize]="10" [iconId]="sortIcon('origin')"></onos-icon>
Sean Condon2aa86092018-07-16 09:04:05 +0100100 </th>
101 </tr>
102 </table>
103 </div>
104 <div class="table-body">
Bhavesh72ead492018-07-19 16:29:18 +0530105 <table>
Sean Condon2aa86092018-07-16 09:04:05 +0100106 <tr *ngIf="tableData.length === 0" class="no-data">
107 <td colspan="5">
Priyanka H Mfa5b77a2018-07-27 12:43:44 +0530108 {{annots.noRowsMsg}}
Sean Condon2aa86092018-07-16 09:04:05 +0100109 </td>
110 </tr>
111 <!-- See https://angular.io/guide/pipes#appendix-no-filterpipe-or-orderbypipe
112 Angular has dropped the filter and order by pipe that were present in
113 AngularJS - filter and sort the data at source instead -->
114 <tr *ngFor="let app of tableData | filter: tableDataFilter"
115 (click)="selectCallback($event, app)"
116 [ngClass]="{selected: app.id === selId, 'data-change': isChanged(app.id)}">
117 <td class="table-icon">
Sean Condonc687ccb2019-10-25 12:27:54 +0100118 <onos-icon [classes]="getStateAsClass(app.state)" [iconId]="app._iconid_state"></onos-icon>
Sean Condon2aa86092018-07-16 09:04:05 +0100119 </td>
120 <td class="table-icon">
121 <!-- The path below gets the app icon from the old GUI path -->
Sean Condon3c8e5582018-08-28 23:22:43 +0100122 <img src="rs/applications/{{app.icon}}/icon"
Sean Condon2aa86092018-07-16 09:04:05 +0100123 height="24px" width="24px" />
124 </td>
125 <td>{{ app.title }}</td>
126 <td>{{ app.id }}</td>
127 <td>{{ app.version }}</td>
128 <td>{{ app.category }}</td>
129 <td>{{ app.origin }}</td>
130 </tr>
131 </table>
132 </div>
Sean Condon28ecc5f2018-06-25 12:50:16 +0100133 </div>
134 <!-- There are 2 ways this component can be included
135 1) Insert it in to the ngFor above and have it created as the row is rendered
136 for the row that has a selId != '' OR
137 2) Include it here and let selId dictate its state
138 The advantage in 2) is that panel can be animated in and out, as it is not
139 killed every time the selection changes.
140 -->
Bhavesh72ead492018-07-19 16:29:18 +0530141 <onos-appsdetails class="floatpanels" id="{{ selId }}" (closeEvent)="deselectRow($event)"></onos-appsdetails>
Sean Condon28ecc5f2018-06-25 12:50:16 +0100142
143</div>