2019-05-15 17:04:39 +03:00
|
|
|
<!--
|
|
|
|
|
|
|
|
|
|
Copyright © 2016-2019 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 }}">
|
2019-05-24 15:58:13 +03:00
|
|
|
<md-toolbar>
|
|
|
|
|
<div class="md-toolbar-tools">
|
|
|
|
|
<h2 translate>{{ vm.importTitle }}</h2>
|
|
|
|
|
<span flex></span>
|
|
|
|
|
<md-button class="md-icon-button" ng-click="vm.cancel()">
|
|
|
|
|
<ng-md-icon icon="close" aria-label="{{ 'dialog.close' | translate }}"></ng-md-icon>
|
|
|
|
|
</md-button>
|
|
|
|
|
</div>
|
|
|
|
|
</md-toolbar>
|
|
|
|
|
<md-progress-linear class="md-warn" md-mode="indeterminate" ng-disabled="!$root.loading"
|
|
|
|
|
ng-show="$root.loading"></md-progress-linear>
|
|
|
|
|
<span style="min-height: 5px;" flex="" ng-show="!$root.loading"></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="Select a file">
|
|
|
|
|
<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>
|
2019-05-15 17:04:39 +03:00
|
|
|
</div>
|
2019-05-24 15:58:13 +03:00
|
|
|
<div>
|
|
|
|
|
<div ng-show="!vm.fileName" translate>import.no-file</div>
|
|
|
|
|
<div ng-show="vm.fileName">{{ vm.fileName }}</div>
|
2019-05-15 17:04:39 +03:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2019-05-24 15:58:13 +03:00
|
|
|
</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);">
|
|
|
|
|
Continue
|
|
|
|
|
</md-button>
|
|
|
|
|
</md-step-actions>
|
|
|
|
|
</md-step>
|
|
|
|
|
|
|
|
|
|
<md-step md-label="Select config import">
|
|
|
|
|
<md-step-body>
|
|
|
|
|
<div flex layout="row" layout-xs="column">
|
|
|
|
|
<md-input-container class="md-block" style="min-width: 120px">
|
|
|
|
|
<label translate>CSV delimiter</label>
|
|
|
|
|
<md-select ng-model="vm.importParams.delim">
|
|
|
|
|
<md-option ng-repeat="delimiter in vm.delimiters" ng-value="delimiter.key">
|
|
|
|
|
{{delimiter.value}}
|
|
|
|
|
</md-option>
|
|
|
|
|
</md-select>
|
|
|
|
|
</md-input-container>
|
|
|
|
|
<md-input-container class="md-block">
|
|
|
|
|
<md-checkbox ng-model="vm.importParams.isHeader" aria-label="Checkbox 1">
|
|
|
|
|
First line is header
|
|
|
|
|
</md-checkbox>
|
|
|
|
|
</md-input-container>
|
|
|
|
|
<md-input-container class="md-block">
|
|
|
|
|
<md-checkbox ng-model="vm.importParams.isUpdate" aria-label="Checkbox 1">
|
|
|
|
|
Update parameters
|
|
|
|
|
</md-checkbox>
|
|
|
|
|
</md-input-container>
|
2019-05-15 17:04:39 +03:00
|
|
|
</div>
|
2019-05-24 15:58:13 +03:00
|
|
|
</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" ng-click="vm.nextStep(3);">
|
|
|
|
|
Continue
|
|
|
|
|
</md-button>
|
|
|
|
|
</md-step-actions>
|
|
|
|
|
</md-step>
|
|
|
|
|
|
|
|
|
|
<md-step md-label="Select columns type">
|
|
|
|
|
<md-step-body>
|
|
|
|
|
<tb-table-columns-assignment columns="vm.columnsParam"
|
|
|
|
|
entity-type="vm.entityType"></tb-table-columns-assignment>
|
|
|
|
|
</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" ng-click="vm.nextStep(4);">
|
|
|
|
|
Continue
|
|
|
|
|
</md-button>
|
|
|
|
|
</md-step-actions>
|
|
|
|
|
</md-step>
|
|
|
|
|
|
|
|
|
|
<md-step md-label="Creat new device">
|
|
|
|
|
<md-step-body>
|
|
|
|
|
<md-progress-linear md-mode="determinate" value="{{vm.determinateValue}}"></md-progress-linear>
|
|
|
|
|
</md-step-body>
|
|
|
|
|
</md-step>
|
|
|
|
|
<md-step md-label="Creat new Entitys">
|
|
|
|
|
<md-step-body>
|
|
|
|
|
<div flex layout="row" ng-repeat="(key, value) in vm.statistical">
|
|
|
|
|
<md-list flex layout="column">
|
|
|
|
|
<md-subheader class="md-no-sticky">{{key}}</md-subheader>
|
|
|
|
|
<md-list-item class="md-2-line" ng-repeat="(info, infoValue) in vm.statistical[key]" ng-click="null">
|
|
|
|
|
<div class="md-list-item-text">
|
|
|
|
|
<p>{{ info }}: {{ infoValue }}</p>
|
|
|
|
|
</div>
|
|
|
|
|
</md-list-item>
|
|
|
|
|
</md-list>
|
|
|
|
|
</div>
|
|
|
|
|
</md-step-body>
|
|
|
|
|
<md-step-actions>
|
|
|
|
|
<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.finishExport();">
|
|
|
|
|
Ok
|
|
|
|
|
</md-button>
|
|
|
|
|
</md-step-actions>
|
|
|
|
|
</md-step>
|
|
|
|
|
|
|
|
|
|
</md-stepper>
|
|
|
|
|
</md-dialog-content>
|
|
|
|
|
<!--<md-dialog-actions layout="row">-->
|
|
|
|
|
<!--<span flex></span>-->
|
|
|
|
|
<!--<md-button ng-disabled="$root.loading || !theForm.$dirty || !theForm.$valid || !vm.importData" type="submit"-->
|
|
|
|
|
<!--class="md-raised md-primary">-->
|
|
|
|
|
<!--{{ 'action.import' | translate }}-->
|
|
|
|
|
<!--</md-button>-->
|
|
|
|
|
<!--<md-button ng-disabled="$root.loading" ng-click="vm.cancel()" style="margin-right:20px;">{{ 'action.cancel'-->
|
|
|
|
|
<!--| translate }}-->
|
|
|
|
|
<!--</md-button>-->
|
|
|
|
|
<!--</md-dialog-actions>-->
|
2019-05-15 17:04:39 +03:00
|
|
|
</md-dialog>
|