attribute-table.tpl.html
11.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
<!--
Copyright © 2016-2020 The Thingsboard Authors
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.
-->
<md-content flex class="md-padding tb-absolute-fill" layout="column">
<section ng-show="!disableAttributeScopeSelection">
<md-input-container class="md-block" style="width: 200px;">
<label translate>attribute.attributes-scope</label>
<md-select ng-model="attributeScope" ng-disabled="$root.loading || attributeScopeSelectionReadonly">
<md-option ng-repeat="scope in attributeScopes" ng-value="scope">
{{scope.name | translate}}
</md-option>
</md-select>
</md-input-container>
</section>
<div class="md-whiteframe-z1 toolbarsContainer" ng-class="{flex: mode==='widget'}">
<md-toolbar class="md-table-toolbar md-default" ng-show="mode==='default'
&& !selectedAttributes.length
&& query.search === null">
<div class="md-toolbar-tools">
<span translate>{{ attributeScope.name }}</span>
<span flex></span>
<md-button ng-show="!attributeScope.clientSide" class="md-icon-button" ng-click="addAttribute($event)">
<md-icon>add</md-icon>
<md-tooltip md-direction="top">
{{ 'action.add' | translate }}
</md-tooltip>
</md-button>
<md-button class="md-icon-button" ng-click="enterFilterMode($event)">
<md-icon>search</md-icon>
<md-tooltip md-direction="top">
{{ 'action.search' | translate }}
</md-tooltip>
</md-button>
<md-button ng-show="!attributeScope.clientSide" class="md-icon-button" ng-click="getEntityAttributes()">
<md-icon>refresh</md-icon>
<md-tooltip md-direction="top">
{{ 'action.refresh' | translate }}
</md-tooltip>
</md-button>
</div>
</md-toolbar>
<md-toolbar class="md-table-toolbar md-default" ng-show="mode==='default'
&& !selectedAttributes.length
&& query.search != null">
<div class="md-toolbar-tools">
<md-button class="md-icon-button" aria-label="{{ 'action.search' | translate }}">
<md-icon aria-label="{{ 'action.search' | translate }}" class="material-icons">search</md-icon>
<md-tooltip md-direction="top">
{{ 'action.search' | translate }}
</md-tooltip>
</md-button>
<md-input-container flex>
<label> </label>
<input ng-model="query.search" class="searchInput" placeholder="{{ 'common.enter-search' | translate }}"/>
</md-input-container>
<md-button class="md-icon-button" aria-label="{{ 'action.back' | translate }}" ng-click="exitFilterMode()">
<md-icon aria-label="{{ 'action.close' | translate }}" class="material-icons">close</md-icon>
<md-tooltip md-direction="top">
{{ 'action.close' | translate }}
</md-tooltip>
</md-button>
</div>
</md-toolbar>
<md-toolbar class="md-table-toolbar alternate" ng-show="mode==='default' && selectedAttributes.length">
<div class="md-toolbar-tools">
<span translate="{{(attributeScope === types.latestTelemetry) ? 'attribute.selected-telemetry' : 'attribute.selected-attributes'}}"
translate-values="{count: selectedAttributes.length}"
translate-interpolation="messageformat"></span>
<span flex></span>
<md-button ng-show="!attributeScope.clientSide" class="md-icon-button" ng-click="deleteAttributes($event)">
<md-icon>delete</md-icon>
<md-tooltip md-direction="top">
{{ 'action.delete' | translate }}
</md-tooltip>
</md-button>
<md-button class="md-accent md-hue-2 md-raised" ng-click="enterWidgetMode()">
<md-tooltip md-direction="top">
{{ 'attribute.show-on-widget' | translate }}
</md-tooltip>
<md-icon>now_widgets</md-icon>
<span translate>attribute.show-on-widget</span>
</md-button>
</div>
</md-toolbar>
<md-toolbar class="md-table-toolbar alternate" ng-show="mode==='widget'">
<div class="md-toolbar-tools">
<div flex layout="row" layout-align="start">
<span class="tb-details-subtitle">{{ 'widgets-bundle.current' | translate }}</span>
<tb-widgets-bundle-select flex-offset="5"
flex
ng-model="widgetsBundle"
select-first-bundle="false"
select-bundle-alias="selectedWidgetsBundleAlias">
</tb-widgets-bundle-select>
</div>
<md-button ng-show="widgetsList.length > 0" class="md-accent md-hue-2 md-raised" ng-click="addWidgetToDashboard($event)">
<md-tooltip md-direction="top">
{{ 'attribute.add-to-dashboard' | translate }}
</md-tooltip>
<md-icon>dashboard</md-icon>
<span translate>attribute.add-to-dashboard</span>
</md-button>
<md-button class="md-icon-button" aria-label="{{ 'action.back' | translate }}" ng-click="exitWidgetMode()">
<md-icon aria-label="{{ 'action.close' | translate }}" class="material-icons">close</md-icon>
<md-tooltip md-direction="top">
{{ 'action.close' | translate }}
</md-tooltip>
</md-button>
</div>
</md-toolbar>
<md-table-container ng-show="mode!='widget'">
<table class="tb-attribute-table" md-table md-row-select multiple="" ng-model="selectedAttributes" md-progress="attributesDeferred.promise">
<thead ng-show="mode!='widget'" fix-head md-head md-order="query.order" md-on-reorder="onReorder">
<tr md-row>
<th md-column md-order-by="lastUpdateTs"><span translate>attribute.last-update-time</span></th>
<th md-column md-order-by="key"><span translate>attribute.key</span></th>
<th md-column><span translate>attribute.value</span></th>
</tr>
</thead>
<tbody md-body>
<tr md-row md-select="attribute" md-select-id="key" md-auto-select ng-repeat="attribute in attributes.data">
<td md-cell>{{attribute.lastUpdateTs | date : 'yyyy-MM-dd HH:mm:ss'}}</td>
<td md-cell>{{attribute.key}}</td>
<td md-cell class="tb-value-cell" ng-click="editAttribute($event, attribute)">
<span>{{attribute.value}}</span>
<span ng-show="!attributeScope.clientSide"><ng-md-icon size="24" icon="edit"></ng-md-icon></span>
</td>
</tr>
</tbody>
</table>
</md-table-container>
<md-table-pagination ng-show="mode!='widget'" md-limit="query.limit" md-limit-options="[5, 10, 15]"
md-page="query.page" md-total="{{attributes.count}}"
md-on-paginate="onPaginate" md-page-select>
</md-table-pagination>
<ul flex rn-carousel ng-if="mode==='widget'" class="widgets-carousel"
rn-carousel-index="widgetsCarousel.index"
rn-carousel-buffered
rn-carousel-transition="fadeAndSlide"
rn-swipe-disabled="true">
<li ng-repeat="widgets in widgetsList">
<tb-dashboard
alias-controller="aliasController"
widgets="widgets"
columns="20"
is-edit="false"
is-mobile-disabled="true"
is-edit-action-enabled="false"
is-remove-action-enabled="false">
</tb-dashboard>
</li>
<span translate ng-if="widgetsLoaded &&
widgetsList.length === 0 &&
widgetsBundle"
layout-align="center center"
style="text-transform: uppercase; display: flex;"
class="md-headline tb-absolute-fill">widgets-bundle.empty</span>
<span translate ng-if="!widgetsBundle"
layout-align="center center"
style="text-transform: uppercase; display: flex;"
class="md-headline tb-absolute-fill">widget.select-widgets-bundle</span>
<div ng-show="widgetsList.length > 1"
style="position: absolute; left: 0; height: 100%;" layout="column" layout-align="center">
<md-button ng-show="widgetsCarousel.index > 0"
class="md-icon-button"
ng-click="prevWidget()">
<md-icon>navigate_before</md-icon>
<md-tooltip md-direction="top">
{{ 'attribute.prev-widget' | translate }}
</md-tooltip>
</md-button>
</div>
<div ng-show="widgetsList.length > 1"
style="position: absolute; right: 0; height: 100%;" layout="column" layout-align="center">
<md-button ng-show="widgetsCarousel.index < widgetsList.length-1"
class="md-icon-button"
ng-click="nextWidget()">
<md-icon>navigate_next</md-icon>
<md-tooltip md-direction="top">
{{ 'attribute.next-widget' | translate }}
</md-tooltip>
</md-button>
</div>
<div style="position: absolute; bottom: 0; width: 100%; font-size: 24px;" layout="row" layout-align="center">
<div rn-carousel-indicators
ng-if="widgetsList.length > 1"
slides="widgetsList"
rn-carousel-index="widgetsCarousel.index">
</div>
</div>
</ul>
</div>
</md-content>