outgoing-mail-settings.tpl.html
5.58 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
<!--
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.
-->
<div tb-help="'outgoingMailSettings'" help-container-id="help-container">
<md-card class="settings-card">
<md-card-title>
<md-card-title-text layout="row">
<span translate class="md-headline">admin.outgoing-mail-settings</span>
<span flex></span>
<div id="help-container"></div>
</md-card-title-text>
</md-card-title>
<md-progress-linear 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-card-content>
<form name="vm.settingsForm" ng-submit="vm.save()" tb-confirm-on-exit confirm-form="vm.settingsForm">
<fieldset ng-disabled="$root.loading">
<md-input-container class="md-block">
<label translate>admin.mail-from</label>
<input required name="mailFrom" ng-model="vm.settings.jsonValue.mailFrom">
<div ng-messages="vm.settingsForm.mailFrom.$error">
<div translate ng-message="required">admin.mail-from-required</div>
</div>
</md-input-container>
<md-input-container class="md-block">
<label translate>admin.smtp-protocol</label>
<md-select ng-disabled="$root.loading" ng-model="vm.settings.jsonValue.smtpProtocol">
<md-option ng-repeat="smtpProtocol in vm.smtpProtocols" value="{{smtpProtocol}}">
{{smtpProtocol.toUpperCase()}}
</md-option>
</md-select>
</md-input-container>
<div layout-gt-sm="row">
<md-input-container class="md-block" flex="100" flex-gt-sm="60">
<label translate>admin.smtp-host</label>
<input required name="smtpHost" ng-model="vm.settings.jsonValue.smtpHost"
placeholder="localhost">
<div ng-messages="vm.settingsForm.smtpHost.$error">
<div translate ng-message="required">admin.smtp-host-required</div>
</div>
</md-input-container>
<md-input-container class="md-block" flex="100" flex-gt-sm="40">
<label translate>admin.smtp-port</label>
<input required name="smtpPort" ng-model="vm.settings.jsonValue.smtpPort"
placeholder="25"
ng-pattern="/^([0-9]{1,4}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$/"
md-maxlength="5">
<div ng-messages="vm.settingsForm.smtpPort.$error" role="alert" multiple>
<div translate ng-message="required">admin.smtp-port-required</div>
<div translate ng-message="pattern">admin.smtp-port-invalid</div>
<div translate ng-message="md-maxlength">admin.smtp-port-invalid</div>
</div>
</md-input-container>
</div>
<md-input-container class="md-block">
<label translate>admin.timeout-msec</label>
<input required name="timeout" ng-model="vm.settings.jsonValue.timeout"
placeholder="10000"
ng-pattern="/^[0-9]{1,6}$/"
md-maxlength="6">
<div ng-messages="vm.settingsForm.timeout.$error" role="alert" multiple>
<div translate ng-message="required">admin.timeout-required</div>
<div translate ng-message="pattern">admin.timeout-invalid</div>
<div translate ng-message="md-maxlength">admin.timeout-invalid</div>
</div>
</md-input-container>
<md-checkbox ng-disabled="$root.loading"
aria-label="{{ 'admin.enable-tls' | translate }}" ng-model="vm.settings.jsonValue.enableTls">{{ 'admin.enable-tls' | translate }}</md-checkbox>
<md-input-container class="md-block" ng-if="vm.settings.jsonValue.enableTls">
<label translate>admin.tls-version</label>
<md-select ng-disabled="$root.loading" ng-model="vm.settings.jsonValue.tlsVersion">
<md-option ng-repeat="tlsVersion in vm.tlsVersions" value="{{tlsVersion}}">
{{tlsVersion}}
</md-option>
</md-select>
</md-input-container>
<md-input-container class="md-block">
<label translate>common.username</label>
<input name="username" placeholder="{{ 'common.enter-username' | translate }}" ng-model="vm.settings.jsonValue.username">
</md-input-container>
<md-input-container class="md-block">
<label translate>common.password</label>
<input name="password" placeholder="{{ 'common.enter-password' | translate }}" type="password" ng-model="vm.settings.jsonValue.password">
</md-input-container>
<div layout="row" layout-align="end center" width="100%" layout-wrap>
<md-button ng-disabled="$root.loading || vm.settingsForm.$invalid" ng-click="vm.sendTestMail()" class="md-raised">{{'admin.send-test-mail' | translate}}</md-button>
<md-button ng-disabled="$root.loading || vm.settingsForm.$invalid || !vm.settingsForm.$dirty" type="submit" class="md-raised md-primary">{{'action.save' | translate}}</md-button>
</div>
</fieldset>
</form>
</md-card-content>
</md-card>
</div>