Sean Condon | 28ecc5f | 2018-06-25 12:50:16 +0100 | [diff] [blame] | 1 | <!-- |
Sean Condon | 2aa8609 | 2018-07-16 09:04:05 +0100 | [diff] [blame] | 2 | ~ Copyright 2018-present Open Networking Foundation |
Sean Condon | 28ecc5f | 2018-06-25 12:50:16 +0100 | [diff] [blame] | 3 | ~ |
| 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 Condon | 2aa8609 | 2018-07-16 09:04:05 +0100 | [diff] [blame] | 16 | <div id="ov-app" (dragover)="onDragOver($event)" (dragleave)="onDragLeave($event)" (drop)="onDrop($event)"> |
Sean Condon | 95fb574 | 2019-04-02 12:16:55 +0100 | [diff] [blame] | 17 | <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 Condon | 28ecc5f | 2018-06-25 12:50:16 +0100 | [diff] [blame] | 20 | <div class="tabular-header"> |
| 21 | <h2> |
| 22 | {{lionFn('title_apps')}} |
| 23 | ({{ tableData.length }} |
| 24 | {{ lionFn('total') }}) |
| 25 | </h2> |
| 26 | <div class="ctrl-btns"> |
Sean Condon | 2aa8609 | 2018-07-16 09:04:05 +0100 | [diff] [blame] | 27 | <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 Condon | 28ecc5f | 2018-06-25 12:50:16 +0100 | [diff] [blame] | 33 | <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 Condon | 2aa8609 | 2018-07-16 09:04:05 +0100 | [diff] [blame] | 39 | <div class="active" (click)="triggerForm()"> |
Bhavesh | 72ead49 | 2018-07-19 16:29:18 +0530 | [diff] [blame] | 40 | <onos-icon classes="{{ 'active-rect upload' }}" |
Sean Condon | 2aa8609 | 2018-07-16 09:04:05 +0100 | [diff] [blame] | 41 | iconId="upload" iconSize="42" toolTip="{{ uploadTip }}"></onos-icon> |
Sean Condon | 28ecc5f | 2018-06-25 12:50:16 +0100 | [diff] [blame] | 42 | </div> |
Sean Condon | 2aa8609 | 2018-07-16 09:04:05 +0100 | [diff] [blame] | 43 | |
Bhavesh | 72ead49 | 2018-07-19 16:29:18 +0530 | [diff] [blame] | 44 | <div (click)="(!!selId) ? confirmAction(AppActionEnum.ACTIVATE) : ''"> |
| 45 | <onos-icon classes="{{ ctrlBtnState.installed?'active-rect play':'play' }}" |
Sean Condon | 28ecc5f | 2018-06-25 12:50:16 +0100 | [diff] [blame] | 46 | iconId="play" iconSize="42" toolTip="{{ activateTip }}"></onos-icon> |
| 47 | </div> |
Bhavesh | 72ead49 | 2018-07-19 16:29:18 +0530 | [diff] [blame] | 48 | <div (click)="(!!selId) ? confirmAction(AppActionEnum.DEACTIVATE) : ''"> |
| 49 | <onos-icon classes="{{ ctrlBtnState.active?'active-rect stop':'stop' }}" |
Sean Condon | 28ecc5f | 2018-06-25 12:50:16 +0100 | [diff] [blame] | 50 | iconId="stop" iconSize="42" toolTip="{{ deactivateTip }}"></onos-icon> |
| 51 | </div> |
Bhavesh | 72ead49 | 2018-07-19 16:29:18 +0530 | [diff] [blame] | 52 | <div (click)="(!!selId) ? confirmAction(AppActionEnum.UNINSTALL) : ''"> |
| 53 | <onos-icon classes="{{ ctrlBtnState.selection?'active-rect garbage':'garbage' }}" |
Sean Condon | 28ecc5f | 2018-06-25 12:50:16 +0100 | [diff] [blame] | 54 | iconId="garbage" iconSize="42" toolTip="{{ uninstallTip }}"></onos-icon> |
| 55 | </div> |
Bhavesh | 72ead49 | 2018-07-19 16:29:18 +0530 | [diff] [blame] | 56 | <div (click)="(!!selId) ? downloadApp() : ''"> |
| 57 | <onos-icon classes="{{ ctrlBtnState.selection?'active-rect download':'download' }}" |
Sean Condon | 28ecc5f | 2018-06-25 12:50:16 +0100 | [diff] [blame] | 58 | 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 | |
Bhavesh | 72ead49 | 2018-07-19 16:29:18 +0530 | [diff] [blame] | 78 | <div id="summary-list" class="summary-list" onosTableResize> |
Sean Condon | 2aa8609 | 2018-07-16 09:04:05 +0100 | [diff] [blame] | 79 | <div class="table-header"> |
Bhavesh | 72ead49 | 2018-07-19 16:29:18 +0530 | [diff] [blame] | 80 | <table> |
Sean Condon | 2aa8609 | 2018-07-16 09:04:05 +0100 | [diff] [blame] | 81 | <tr> |
| 82 | <th colId="state" [ngStyle]="{width: '32px'}" class="table-icon" (click)="onSort('state')"> |
Bhavesh | 72ead49 | 2018-07-19 16:29:18 +0530 | [diff] [blame] | 83 | <onos-icon classes="active-sort" [iconSize]="10" [iconId]="sortIcon('state')"></onos-icon> |
Sean Condon | 2aa8609 | 2018-07-16 09:04:05 +0100 | [diff] [blame] | 84 | </th> |
| 85 | <th colId="icon" [ngStyle]="{width: '32px'}" class="table-icon"></th> |
| 86 | <th colId="title" (click)="onSort('title')">{{lionFn('title')}} |
Bhavesh | 72ead49 | 2018-07-19 16:29:18 +0530 | [diff] [blame] | 87 | <onos-icon classes="active-sort" [iconSize]="10" [iconId]="sortIcon('title')"></onos-icon> |
Sean Condon | 2aa8609 | 2018-07-16 09:04:05 +0100 | [diff] [blame] | 88 | </th> |
| 89 | <th colId="id" (click)="onSort('id')">{{lionFn('app_id')}} |
Bhavesh | 72ead49 | 2018-07-19 16:29:18 +0530 | [diff] [blame] | 90 | <onos-icon classes="active-sort" [iconSize]="10" [iconId]="sortIcon('id')"></onos-icon> |
Sean Condon | 2aa8609 | 2018-07-16 09:04:05 +0100 | [diff] [blame] | 91 | </th> |
| 92 | <th colId="version" (click)="onSort('version')"> {{lionFn('version')}} |
Bhavesh | 72ead49 | 2018-07-19 16:29:18 +0530 | [diff] [blame] | 93 | <onos-icon classes="active-sort" [iconSize]="10" [iconId]="sortIcon('version')"></onos-icon> |
Sean Condon | 2aa8609 | 2018-07-16 09:04:05 +0100 | [diff] [blame] | 94 | </th> |
| 95 | <th colId="category" (click)="onSort('category')"> {{lionFn('category')}} |
Bhavesh | 72ead49 | 2018-07-19 16:29:18 +0530 | [diff] [blame] | 96 | <onos-icon classes="active-sort" [iconSize]="10" [iconId]="sortIcon('category')"></onos-icon> |
Sean Condon | 2aa8609 | 2018-07-16 09:04:05 +0100 | [diff] [blame] | 97 | </th> |
| 98 | <th colId="origin" (click)="onSort('origin')"> {{lionFn('origin')}} |
Bhavesh | 72ead49 | 2018-07-19 16:29:18 +0530 | [diff] [blame] | 99 | <onos-icon classes="active-sort" [iconSize]="10" [iconId]="sortIcon('origin')"></onos-icon> |
Sean Condon | 2aa8609 | 2018-07-16 09:04:05 +0100 | [diff] [blame] | 100 | </th> |
| 101 | </tr> |
| 102 | </table> |
| 103 | </div> |
| 104 | <div class="table-body"> |
Bhavesh | 72ead49 | 2018-07-19 16:29:18 +0530 | [diff] [blame] | 105 | <table> |
Sean Condon | 2aa8609 | 2018-07-16 09:04:05 +0100 | [diff] [blame] | 106 | <tr *ngIf="tableData.length === 0" class="no-data"> |
| 107 | <td colspan="5"> |
Priyanka H M | fa5b77a | 2018-07-27 12:43:44 +0530 | [diff] [blame] | 108 | {{annots.noRowsMsg}} |
Sean Condon | 2aa8609 | 2018-07-16 09:04:05 +0100 | [diff] [blame] | 109 | </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"> |
| 118 | <onos-icon iconId="{{app._iconid_state}}"></onos-icon> |
| 119 | </td> |
| 120 | <td class="table-icon"> |
| 121 | <!-- The path below gets the app icon from the old GUI path --> |
Sean Condon | 3c8e558 | 2018-08-28 23:22:43 +0100 | [diff] [blame] | 122 | <img src="rs/applications/{{app.icon}}/icon" |
Sean Condon | 2aa8609 | 2018-07-16 09:04:05 +0100 | [diff] [blame] | 123 | 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 Condon | 28ecc5f | 2018-06-25 12:50:16 +0100 | [diff] [blame] | 133 | </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 | --> |
Bhavesh | 72ead49 | 2018-07-19 16:29:18 +0530 | [diff] [blame] | 141 | <onos-appsdetails class="floatpanels" id="{{ selId }}" (closeEvent)="deselectRow($event)"></onos-appsdetails> |
Sean Condon | 28ecc5f | 2018-06-25 12:50:16 +0100 | [diff] [blame] | 142 | |
| 143 | </div> |