import-dialog-csv.tpl.html
9.31 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
<!--
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-dialog aria-label="{{ vm.importTitle | translate }}" class="tb-import-stepper" tb-help="'entitiesImport'"
help-container-id="help-container">
<md-toolbar>
<div class="md-toolbar-tools">
<h2 translate>{{ vm.importTitle }}</h2>
<span flex></span>
<div id="help-container"></div>
<md-button class="md-icon-button" ng-click="vm.cancel()" ng-disabled="vm.isImportData">
<ng-md-icon icon="close" aria-label="{{ 'dialog.close' | translate }}"></ng-md-icon>
</md-button>
</div>
</md-toolbar>
<span style="max-height: 5px; height: 5px;" flex></span>
<md-dialog-content>
<md-stepper id="import-stepper" md-mobile-step-text="vm.isMobileStepText" md-vertical="vm.isVertical"
md-linear="vm.isLinear" md-alternative="vm.isAlternative">
<md-step md-label="{{ 'import.stepper-text.select-file' | translate }}">
<md-step-body>
<form name="vm.theFormStep1">
<fieldset ng-disabled="$root.loading">
<div layout="column" layout-padding>
<div class="tb-container">
<label class="tb-label" translate>{{ vm.importFileLabel }}</label>
<div flow-init="{singleFile:true}"
flow-file-added="vm.fileAdded( $file )" class="tb-file-select-container">
<div class="tb-file-clear-container">
<md-button ng-click="vm.clearFile()"
class="tb-file-clear-btn md-icon-button md-primary"
aria-label="{{ 'action.remove' | translate }}">
<md-tooltip md-direction="top">
{{ 'action.remove' | translate }}
</md-tooltip>
<md-icon aria-label="{{ 'action.remove' | translate }}"
class="material-icons">
close
</md-icon>
</md-button>
</div>
<div class="alert tb-flow-drop" flow-drop>
<label for="select" translate>import.drop-file-csv</label>
<input class="file-input" flow-btn
flow-attrs="{accept:'.csv,application/csv,text/csv'}"
id="select">
</div>
</div>
</div>
<div>
<div ng-show="!vm.fileName" translate>import.no-file</div>
<div ng-show="vm.fileName">{{ vm.fileName }}</div>
</div>
</div>
</fieldset>
</form>
</md-step-body>
<md-step-actions layout="row">
<span flex></span>
<md-button ng-disabled="$root.loading" ng-click="vm.cancel()">
{{ 'action.cancel' | translate }}
</md-button>
<md-button class="md-primary md-raised"
ng-disabled="$root.loading || !vm.theFormStep1.$dirty || !vm.theFormStep1.$valid || !vm.importData"
ng-click="vm.nextStep(2);">
{{ 'action.continue' | translate }}
</md-button>
</md-step-actions>
</md-step>
<md-step md-label="{{ 'import.stepper-text.configuration' | translate }}">
<md-step-body>
<div layout="column">
<md-input-container>
<label translate>import.csv-delimiter</label>
<md-select ng-model="vm.importParameters.delim">
<md-option ng-repeat="delimiter in vm.delimiters" ng-value="delimiter.key">
{{delimiter.value}}
</md-option>
</md-select>
</md-input-container>
<md-checkbox ng-model="vm.importParameters.isHeader"
aria-label="First line contains column names">
{{ 'import.csv-first-line-header' | translate }}
</md-checkbox>
<md-checkbox ng-model="vm.importParameters.isUpdate" aria-label="Update attributes/telemetry">
{{ 'import.csv-update-data' | translate }}
</md-checkbox>
</div>
</md-step-body>
<md-step-actions layout="row">
<md-button ng-disabled="$root.loading" ng-click="vm.previousStep(1);">Back
</md-button>
<span flex></span>
<md-button ng-disabled="$root.loading" ng-click="vm.cancel()">
{{ 'action.cancel' | translate }}
</md-button>
<md-button class="md-primary md-raised" ng-disabled="$root.loading" ng-click="vm.nextStep(3);">
{{ 'action.continue' | translate }}
</md-button>
</md-step-actions>
</md-step>
<md-step md-label="{{ 'import.stepper-text.column-type' | translate }}">
<md-step-body>
<form name="vm.theFormStep3">
<tb-table-columns-assignment columns="vm.columnsParam" the-form="vm.theFormStep3"
entity-type="vm.entityType"></tb-table-columns-assignment>
</form>
</md-step-body>
<md-step-actions layout="row">
<md-button ng-disabled="$root.loading" ng-click="vm.previousStep();">Back
</md-button>
<span flex></span>
<md-button ng-disabled="$root.loading" ng-click="vm.cancel()">
{{ 'action.cancel' | translate }}
</md-button>
<md-button class="md-primary md-raised"
ng-disabled="$root.loading || !vm.theFormStep3.$dirty || !vm.theFormStep3.$valid"
ng-click="vm.nextStep(4);">
{{ 'action.continue' | translate }}
</md-button>
</md-step-actions>
</md-step>
<md-step md-label="{{ 'import.stepper-text.creat-entities' | translate }}">
<md-step-body>
<md-progress-linear class="md-warn tb-import-progress" md-mode="determinate"
value="{{vm.progressCreate}}"></md-progress-linear>
</md-step-body>
</md-step>
<md-step md-label="{{ 'import.stepper-text.done' | translate }}">
<md-step-body layout="column">
<div>
<p class="md-body-1" translate translate-values="{count: vm.statistical.create.entity}"
ng-if="vm.statistical.create && vm.statistical.create.entity">import.message.create-entities</p>
<p class="md-body-1" translate translate-values="{count: vm.statistical.update.entity}"
ng-if="vm.statistical.update && vm.statistical.update.entity">import.message.update-entities</p>
<p class="md-body-1" translate translate-values="{count: vm.statistical.error.entity}"
ng-if="vm.statistical.error && vm.statistical.error.entity">import.message.error-entities</p>
</div>
</md-step-body>
<md-step-actions layout="row">
<span flex></span>
<md-button class="md-primary md-raised" ng-disabled="$root.loading" ng-click="vm.nextStep(6);">
{{ 'action.ok' | translate }}
</md-button>
</md-step-actions>
</md-step>
</md-stepper>
</md-dialog-content>
</md-dialog>