Fix mail server location UI

This commit is contained in:
Girish Ramakrishnan
2020-08-20 23:06:22 -07:00
parent f6fef21bf7
commit eb69c365fc
3 changed files with 94 additions and 22 deletions

View File

@@ -1,26 +1,51 @@
<!-- Modal change mail server domain -->
<div class="modal fade" id="mailDomainChangeModal" tabindex="-1" role="dialog">
<div class="modal fade" id="mailLocationModal" tabindex="-1" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Change Email Server Domain</h4>
</div>
<div class="modal-body">
<form name="mailDomainChangeForm" role="form" novalidate ng-submit="mailDomainChange.submit()" autocomplete="off">
<div class="form-group" ng-class="{ 'has-error': (mailDomainChangeForm.mailDomain.$dirty && mailDomainChangeForm.mailDomain.$invalid) || (!mailDomainChangeForm.mailDomain.$dirty && mailDomainChange.error)}">
<form name="mailLocationForm" role="form" novalidate ng-submit="mailLocation.submit()" autocomplete="off">
<div class="form-group" ng-class="{ 'has-error': (mailLocationForm.subdomain.$dirty && mailLocationForm.subdomain.$invalid) || (!mailLocationForm.subdomain.$dirty && mailLocation.error)}">
<label class="control-label">Domain</label>
<input type="text" class="form-control" ng-model="mailDomainChange.mailDomain" name="mailDomain" required autofocus>
<div class="control-label" ng-show="(!mailDomainChangeForm.mailDomain.$dirty && mailDomainChange.error) || (mailDomainChangeForm.mailDomain.$dirty && mailDomainChangeForm.mailDomain.$invalid)">
<small ng-show="mailDomainChangeForm.mailDomain.$error.required">A valid domain is required</small>
<small ng-show="!mailDomainChangeForm.email.$dirty && mailDomainChange.error">{{ mailDomainChange.error }}</small>
<div class="has-error" ng-show="mailLocation.error">{{ mailLocation.error.message }}</div>
<div class="input-group form-inline">
<input type="text" class="form-control" ng-model="mailLocation.subdomain" id="mailLocationLocationInput" name="location" placeholder="{{ 'Leave empty to use bare domain' }}" autofocus>
<div class="input-group-btn">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<span>{{ (!mailLocation.subdomain ? '' : '.') + mailLocation.domain.domain }}</span>
<span class="caret"></span>
</button>
<ul class="dropdown-menu dropdown-menu-right" role="menu">
<li ng-repeat="domain in domains">
<a href="" ng-click="mailLocation.domain = domain">{{ domain.domain }}</a>
</li>
</ul>
</div>
</div>
</div>
<input class="ng-hide" type="submit" ng-disabled="mailDomainChangeForm.$invalid"/>
<p class="small text-center text-warning" ng-show="mailLocation.domain.provider === 'linode'">
<b>Linode DNS average <a target="_blank" ng-href="{{ config.webServerOrigin }}/documentation/domains/#linode-dns">propagation time</a> is 30 minutes.
Changing the location will take a while.</b>
<br>
</p>
<p class="text-center" ng-show="mailLocation.domain.provider === 'manual'">
<b>Add an A record manually for {{ (!mailLocation.subdomain ? '' : '.') + mailLocation.domain.domain }} to this Cloudron's public IP</b>
<br>
</p>
<input class="ng-hide" type="submit" ng-disabled="mailLocationForm.$invalid"/>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-success" ng-click="mailDomainChange.submit()" ng-disabled="mailDomainChangeForm.$invalid || mailDomainChange.busy"><i class="fa fa-circle-notch fa-spin" ng-show="mailDomainChange.busy"></i> Change</button>
<button type="button" class="btn btn-success" ng-click="mailLocation.submit()" ng-disabled="mailLocationForm.$invalid || mailLocation.busy"><i class="fa fa-circle-notch fa-spin" ng-show="mailLocation.busy"></i> Change</button>
</div>
</div>
</div>
@@ -175,14 +200,16 @@
</div>
<div class="card card-large" style="margin-bottom: 15px;">
<p>These settings apply to all domains.</p>
<p>These settings apply to all domains</p>
<div class="row">
<div class="col-xs-6">
<span class="text-muted">Email domain</span>
</div>
<div class="col-xs-6 text-right">
<span>{{ config.mailFqdn }} <a href="" ng-click="mailDomainChange.show()"><i class="fa fa-edit text-small"></i></a></span>
<span>{{ mailLocation.currentLocation.subdomain + (!mailLocation.currentLocation.subdomain ? '' : '.') + mailLocation.currentLocation.domain.domain }}
<a href="" ng-click="mailLocation.show()"><i class="fa fa-edit text-small"></i></a>
</span>
</div>
<div class="col-xs-6">
<span class="text-muted">Maximum email size</span>