timewindow-panel.tpl.html
3.77 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
<!--
Copyright © 2016-2017 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.
-->
<form name="theForm" ng-submit="vm.update()">
<fieldset ng-disabled="loading">
<md-content layout="column">
<md-tabs ng-class="{'tb-headless': vm.historyOnly}" flex md-dynamic-height md-selected="vm.timewindow.selectedTab" md-border-bottom>
<md-tab label="{{ 'timewindow.realtime' | translate }}">
<md-content class="md-padding" layout="column">
<span translate>timewindow.last</span>
<tb-timeinterval
ng-required="vm.timewindow.selectedTab === 0"
ng-model="vm.timewindow.realtime.timewindowMs" style="padding-top: 8px;"></tb-timeinterval>
</md-content>
</md-tab>
<md-tab label="{{ 'timewindow.history' | translate }}">
<md-content class="md-padding" layout="column">
<md-radio-group ng-model="vm.timewindow.history.historyType" class="md-primary">
<md-radio-button ng-value=0 class="md-primary md-align-top-left md-radio-interactive">
<section layout="column">
<span translate>timewindow.last</span>
<tb-timeinterval
ng-required="vm.timewindow.selectedTab === 1 && vm.timewindow.history.historyType === 0"
ng-show="vm.timewindow.history.historyType === 0"
ng-model="vm.timewindow.history.timewindowMs" style="padding-top: 8px;"></tb-timeinterval>
</section>
</md-radio-button>
<md-radio-button ng-value=1 class="md-primary md-align-top-left md-radio-interactive">
<section layout="column">
<span translate>timewindow.time-period</span>
<tb-datetime-period
ng-required="vm.timewindow.selectedTab === 1 && vm.timewindow.history.historyType === 1"
ng-show="vm.timewindow.history.historyType === 1"
ng-model="vm.timewindow.history.fixedTimewindow" style="padding-top: 8px;"></tb-datetime-period>
</section>
</md-radio-button>
</md-radio-group>
</md-content>
</md-tab>
</md-tabs>
<md-content ng-if="vm.aggregation" class="md-padding" layout="column">
<md-input-container>
<label translate>aggregation.function</label>
<md-select ng-model="vm.timewindow.aggregation.type" style="min-width: 150px;">
<md-option ng-repeat="type in vm.aggregationTypes" ng-value="type.value">
{{type.name | translate}}
</md-option>
</md-select>
</md-input-container>
<md-slider-container>
<span translate>aggregation.limit</span>
<md-slider flex min="10" max="500" ng-model="vm.timewindow.aggregation.limit" aria-label="limit" id="limit-slider">
</md-slider>
<md-input-container>
<input flex type="number" ng-model="vm.timewindow.aggregation.limit" aria-label="limit" aria-controls="limit-slider">
</md-input-container>
</md-slider-container>
</md-content>
<section layout="row" layout-alignment="start center">
<span flex></span>
<md-button ng-disabled="loading || theForm.$invalid || !theForm.$dirty" type="submit" class="md-raised md-primary">
{{ 'action.update' | translate }}
</md-button>
<md-button ng-disabled="loading" ng-click="vm.cancel()" style="margin-right:20px;">
{{ 'action.cancel' | translate }}
</md-button>
</section>
</section>
</fieldset>
</form>