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 | 28ecc5f | 2018-06-25 12:50:16 +0100 | [diff] [blame] | 17 | <div class="tabular-header"> |
Sean Condon | 2aa8609 | 2018-07-16 09:04:05 +0100 | [diff] [blame] | 18 | <onos-flash id="appMsgFlash" message="{{ alertMsg }}" dwell="5000" warning="true" (closed)="alertMsg = ''"></onos-flash> |
| 19 | <onos-confirm message="{{ confirmMsg }}" warning="{{ strongWarning }}" (chosen)="dOk($event)"></onos-confirm> |
Sean Condon | 28ecc5f | 2018-06-25 12:50:16 +0100 | [diff] [blame] | 20 | <h2> |
| 21 | {{lionFn('title_apps')}} |
| 22 | ({{ tableData.length }} |
| 23 | {{ lionFn('total') }}) |
| 24 | </h2> |
| 25 | <div class="ctrl-btns"> |
Sean Condon | 2aa8609 | 2018-07-16 09:04:05 +0100 | [diff] [blame] | 26 | <form #inputFileForm="ngForm"> |
| 27 | <input id="uploadFile" hidden |
| 28 | type="file" size="50" accept=".oar,.jar" |
| 29 | name="appFile" (change)="fileEvent($event)"> |
| 30 | </form> |
| 31 | |
Sean Condon | 28ecc5f | 2018-06-25 12:50:16 +0100 | [diff] [blame] | 32 | <div class="refresh" (click)="toggleRefresh()"> |
| 33 | <onos-icon classes="{{ autoRefresh?'active refresh':'refresh' }}" |
| 34 | iconId="refresh" iconSize="42" toolTip="{{ autoRefreshTip }}"></onos-icon> |
| 35 | </div> |
| 36 | <div class="separator"></div> |
| 37 | |
Sean Condon | 2aa8609 | 2018-07-16 09:04:05 +0100 | [diff] [blame] | 38 | <div class="active" (click)="triggerForm()"> |
Sean Condon | 28ecc5f | 2018-06-25 12:50:16 +0100 | [diff] [blame] | 39 | <onos-icon classes="{{ 'active upload' }}" |
Sean Condon | 2aa8609 | 2018-07-16 09:04:05 +0100 | [diff] [blame] | 40 | iconId="upload" iconSize="42" toolTip="{{ uploadTip }}"></onos-icon> |
Sean Condon | 28ecc5f | 2018-06-25 12:50:16 +0100 | [diff] [blame] | 41 | </div> |
Sean Condon | 2aa8609 | 2018-07-16 09:04:05 +0100 | [diff] [blame] | 42 | |
| 43 | <div (click)="confirmAction(AppActionEnum.ACTIVATE)"> |
Sean Condon | 28ecc5f | 2018-06-25 12:50:16 +0100 | [diff] [blame] | 44 | <onos-icon classes="{{ ctrlBtnState.installed?'active play':'play' }}" |
| 45 | iconId="play" iconSize="42" toolTip="{{ activateTip }}"></onos-icon> |
| 46 | </div> |
Sean Condon | 2aa8609 | 2018-07-16 09:04:05 +0100 | [diff] [blame] | 47 | <div (click)="confirmAction(AppActionEnum.DEACTIVATE)"> |
Sean Condon | 28ecc5f | 2018-06-25 12:50:16 +0100 | [diff] [blame] | 48 | <onos-icon classes="{{ ctrlBtnState.active?'active stop':'stop' }}" |
| 49 | iconId="stop" iconSize="42" toolTip="{{ deactivateTip }}"></onos-icon> |
| 50 | </div> |
Sean Condon | 2aa8609 | 2018-07-16 09:04:05 +0100 | [diff] [blame] | 51 | <div (click)="confirmAction(AppActionEnum.UNINSTALL)"> |
Sean Condon | 28ecc5f | 2018-06-25 12:50:16 +0100 | [diff] [blame] | 52 | <onos-icon classes="{{ ctrlBtnState.selection?'active garbage':'garbage' }}" |
| 53 | iconId="garbage" iconSize="42" toolTip="{{ uninstallTip }}"></onos-icon> |
| 54 | </div> |
| 55 | <div (click)="downloadApp()"> |
| 56 | <onos-icon classes="{{ ctrlBtnState.selection?'active download':'download' }}" |
| 57 | iconId="download" iconSize="42" toolTip="{{ downloadTip }}"></onos-icon> |
| 58 | </div> |
| 59 | </div> |
| 60 | <div class="search"> |
| 61 | <input id="searchinput" [(ngModel)]="tableDataFilter.queryStr" type="search" #search placeholder="Search"/> |
| 62 | <!--(keyup)="onSearch(search.value)" (search)="onSearch(search.value)"/>--> |
| 63 | <select [(ngModel)]="tableDataFilter.queryBy"> |
| 64 | <!--(change)="onSearchBy($event)" (change)="search.value = ''">--> |
| 65 | <option value="" disabled>Search By</option> |
| 66 | <option value="$">All Fields</option> |
| 67 | <option value="title">{{lionFn('title')}}</option> |
| 68 | <option value="id">{{lionFn('app_id')}}</option> |
| 69 | <option value="version">{{lionFn('version')}}</option> |
| 70 | <option value="category">{{lionFn('category')}}</option> |
| 71 | <option value="origin">{{lionFn('origin')}}</option> |
| 72 | </select> |
| 73 | </div> |
| 74 | |
| 75 | </div> |
| 76 | |
Sean Condon | 2aa8609 | 2018-07-16 09:04:05 +0100 | [diff] [blame] | 77 | <div id="summary-list" class="summary-list"> |
| 78 | <div class="table-header"> |
| 79 | <table onosTableResize> |
| 80 | <tr> |
| 81 | <th colId="state" [ngStyle]="{width: '32px'}" class="table-icon" (click)="onSort('state')"> |
| 82 | <onos-icon classes="active" [iconId]="sortIcon('state')"></onos-icon> |
| 83 | </th> |
| 84 | <th colId="icon" [ngStyle]="{width: '32px'}" class="table-icon"></th> |
| 85 | <th colId="title" (click)="onSort('title')">{{lionFn('title')}} |
| 86 | <onos-icon classes="active" [iconId]="sortIcon('title')"></onos-icon> |
| 87 | </th> |
| 88 | <th colId="id" (click)="onSort('id')">{{lionFn('app_id')}} |
| 89 | <onos-icon classes="active" [iconId]="sortIcon('id')"></onos-icon> |
| 90 | </th> |
| 91 | <th colId="version" (click)="onSort('version')"> {{lionFn('version')}} |
| 92 | <onos-icon classes="active" [iconId]="sortIcon('version')"></onos-icon> |
| 93 | </th> |
| 94 | <th colId="category" (click)="onSort('category')"> {{lionFn('category')}} |
| 95 | <onos-icon classes="active" [iconId]="sortIcon('category')"></onos-icon> |
| 96 | </th> |
| 97 | <th colId="origin" (click)="onSort('origin')"> {{lionFn('origin')}} |
| 98 | <onos-icon classes="active" [iconId]="sortIcon('origin')"></onos-icon> |
| 99 | </th> |
| 100 | </tr> |
| 101 | </table> |
| 102 | </div> |
| 103 | <div class="table-body"> |
| 104 | <table onosTableResize> |
| 105 | <tr *ngIf="tableData.length === 0" class="no-data"> |
| 106 | <td colspan="5"> |
| 107 | {{annots.no_rows_msg}} |
| 108 | </td> |
| 109 | </tr> |
| 110 | <!-- See https://angular.io/guide/pipes#appendix-no-filterpipe-or-orderbypipe |
| 111 | Angular has dropped the filter and order by pipe that were present in |
| 112 | AngularJS - filter and sort the data at source instead --> |
| 113 | <tr *ngFor="let app of tableData | filter: tableDataFilter" |
| 114 | (click)="selectCallback($event, app)" |
| 115 | [ngClass]="{selected: app.id === selId, 'data-change': isChanged(app.id)}"> |
| 116 | <td class="table-icon"> |
| 117 | <onos-icon iconId="{{app._iconid_state}}"></onos-icon> |
| 118 | </td> |
| 119 | <td class="table-icon"> |
| 120 | <!-- The path below gets the app icon from the old GUI path --> |
| 121 | <img src="../../ui/rs/applications/{{app.icon}}/icon" |
| 122 | height="24px" width="24px" /> |
| 123 | </td> |
| 124 | <td>{{ app.title }}</td> |
| 125 | <td>{{ app.id }}</td> |
| 126 | <td>{{ app.version }}</td> |
| 127 | <td>{{ app.category }}</td> |
| 128 | <td>{{ app.origin }}</td> |
| 129 | </tr> |
| 130 | </table> |
| 131 | </div> |
Sean Condon | 28ecc5f | 2018-06-25 12:50:16 +0100 | [diff] [blame] | 132 | </div> |
| 133 | <!-- There are 2 ways this component can be included |
| 134 | 1) Insert it in to the ngFor above and have it created as the row is rendered |
| 135 | for the row that has a selId != '' OR |
| 136 | 2) Include it here and let selId dictate its state |
| 137 | The advantage in 2) is that panel can be animated in and out, as it is not |
| 138 | killed every time the selection changes. |
| 139 | --> |
| 140 | <onos-appsdetails class="floatpanels" id="{{ selId }}"></onos-appsdetails> |
| 141 | |
| 142 | </div> |