gateway-config.tpl.html
4.8 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
<!--
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.
-->
<form name="gatewayConfig" flex layout="column" class="gateway-config">
<div layout="row" id="section-row" ng-repeat="keyVal in vm.kvList track by $index">
<div layout="column" layout-align="center center" class="gateway-config-row">
<md-input-container class="md-block">
<md-checkbox ng-model="keyVal.enabled"
aria-label="{{ 'gateway.enabled' | translate }}"
ng-change="vm.checkboxValid(keyVal)"
ng-click="vm.checkboxValidClick($event, keyVal)"
ng-mouseover="vm.checkboxValidMouseover($event, keyVal)">
</md-checkbox>
<md-tooltip md-direction="top">
{{ 'gateway.enabled' | translate }}
</md-tooltip>
</md-input-container>
</div>
<div layout="row" flex class="gateway-config-row"
ng-class="{'gateway-config-row-vertical': vm.changeAlignment}">
<md-input-container class="md-block" flex>
<label>{{'gateway.connector-type' | translate }}</label>
<md-select name="configType" ng-change="vm.configTypeChange(keyVal)" ng-model="keyVal.value" required>
<md-option ng-repeat="configType in vm.types.gatewayConfigType" ng-value="configType.value">
{{configType.value}}
</md-option>
</md-select>
<md-tooltip md-direction="top">
{{ 'gateway.connector-type' | translate }}
</md-tooltip>
</md-input-container>
<md-input-container class="md-block" flex>
<input placeholder="{{ (vm.keyPlaceholderText ? vm.keyPlaceholderText : 'gateway.name') | translate }}"
ng-model-options="{ updateOn: 'blur' }"
ng-change="vm.keyValChange(keyVal, $index)" name="key" ng-model="keyVal.key" required/>
<div ng-messages="gatewayConfig.key.$error">
<div ng-message="required" translate>extension.field-required</div>
</div>
<md-tooltip md-direction="top">
{{ 'gateway.name' | translate }}
</md-tooltip>
</md-input-container>
</div>
<div layout="row" layout-align="end center" class="action-buttons"
ng-class="{'gateway-config-row-vertical': vm.changeAlignment}">
<md-button class="md-icon-button md-fab md-mini"
name="updateconf"
ng-click="vm.openConfigDialog($event, $index, keyVal.config, keyVal.key)"
aria-label="{{ 'gateway.update-config' | translate }}"
ng-class="vm.buttonValid(keyVal.config)" required>
<md-icon class="material-icons">settings_ethernet</md-icon>
<md-tooltip md-direction="top">
{{ 'gateway.update-config' | translate }}
</md-tooltip>
</md-button>
<md-button ng-show="!vm.disabled" ng-disabled="$root.loading"
class="md-icon-button md-fab md-mini md-primary"
ng-click="vm.removeKeyVal($index)"
aria-label="{{ 'gateway.delete' | translate }}">
<md-icon class="material-icons">close</md-icon>
<md-tooltip md-direction="top">
{{ 'gateway.delete' | translate }}
</md-tooltip>
</md-button>
</div>
</div>
<span ng-show="!vm.kvList.length"
layout-align="center center" ng-class="{'disabled': vm.disabled}"
class="no-data-found" translate>{{vm.noDataText ? vm.noDataText : 'gateway.no-connectors'}}</span>
<div>
<md-button ng-show="!vm.disabled" ng-disabled="$root.loading" class="md-raised"
ng-click="vm.addKeyVal()"
aria-label="{{ 'gateway.add-connectors' | translate }}">
<md-tooltip md-direction="top">
{{ 'gateway.add-connectors' | translate }}
</md-tooltip>
<span translate>action.add</span>
</md-button>
</div>
</form >