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