Remove all configure bits from the app grid page

This commit is contained in:
Johannes Zellner
2019-09-13 11:29:19 +02:00
parent 7a2a5d3846
commit 3d5cdd659b
4 changed files with 62 additions and 587 deletions

View File

@@ -1,270 +1,3 @@
<!-- Modal configure/repair app -->
<div class="modal fade" id="appConfigureModal" tabindex="-1" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" ng-show="(appConfigure.app | installError)">Repair {{ appConfigure.app.fqdn }}</h4>
<h4 class="modal-title" ng-hide="(appConfigure.app | installError)">Configure {{ appConfigure.app.fqdn }}</h4>
</div>
<div class="modal-body" style="padding: 0 15px">
<fieldset>
<form role="form" name="appConfigureForm" ng-submit="appConfigure.submit()" autocomplete="off">
<uib-tabset active="appConfigure.action">
<uib-tab index="'location'" heading="Location">
<br/>
<div class="has-error text-center" ng-show="appConfigure.error.other">{{ appConfigure.error.other }}</div>
<div class="form-group" ng-class="{ 'has-error': (appConfigureForm.location.$dirty && appConfigureForm.location.$invalid) || (!appConfigureForm.location.$dirty && appConfigure.error.location) }">
<label class="control-label" for="appConfigureLocationInput">Location {{ appConfigure.error.location }} </label>
<div class="input-group form-inline">
<input type="text" class="form-control" ng-model="appConfigure.location" id="appConfigureLocationInput" 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>{{ (!appConfigure.location ? '' : (appConfigure.domain.config.hyphenatedSubdomains ? '-' : '.')) + appConfigure.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="appConfigure.domain = domain">{{ domain.domain }}</a>
</li>
</ul>
</div>
</div>
</div>
<p class="text-center" ng-show="appConfigure.location && appConfigure.domain.provider === 'manual'">
<b>Add an A record manually for {{ appConfigure.location }} to this Cloudron's public IP</b>
<br>
</p>
<div class="has-error text-center" ng-show="appConfigure.error.port">{{ appConfigure.error.port }}</div>
<div ng-repeat="(env, info) in appConfigure.portBindingsInfo">
<ng-form name="portInfo_form">
<div class="form-group" ng-class="{ 'has-error': (!appConfigureForm.itemName{{$index}}.$dirty && appConfigure.error.port) || (portInfo_form.itemName{{$index}}.$dirty && portInfo_form.itemName{{$index}}.$invalid) }">
<label class="control-label" for="appConfigurePortInput{{env}}"><input type="checkbox" ng-model="appConfigure.portBindingsEnabled[env]">
{{ info.title }}
<sup>
<a popover-placement="top-right" popover-trigger="outsideClick" uib-popover="{{info.description}} ({{ HOST_PORT_MIN }} - {{ HOST_PORT_MAX }})"><i class="fa fa-question-circle"></i></a>
</sup>
</label>
<input type="number" class="form-control" ng-model="appConfigure.portBindings[env]" ng-disabled="!appConfigure.portBindingsEnabled[env]" id="appConfigurePortInput{{env}}" later-name="itemName{{$index}}" min="{{HOST_PORT_MIN}}" max="{{HOST_PORT_MAX}}" required>
</div>
</ng-form>
</div>
<div class="form-group alternate-domains">
<label class="control-label">Redirections <sup><a ng-href="{{ config.webServerOrigin }}/documentation/apps/#redirections" class="help" target="_blank"><i class="fa fa-question-circle"></i></a></sup></label>
<div class="has-error" ng-show="appConfigure.error.alternateDomains">{{ appConfigure.error.alternateDomains }}</div>
<div class="row" ng-repeat="alternateDomain in appConfigure.alternateDomains">
<div class="col col-lg-11">
<div class="input-group">
<input type="text" class="form-control" ng-model="alternateDomain.subdomain" placeholder="Leave empty to use bare domain">
<div class="input-group-btn">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<span>{{ (!alternateDomain.subdomain ? '' : (alternateDomain.domain.config.hyphenatedSubdomains ? '-' : '.')) + alternateDomain.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="alternateDomain.domain = domain">{{ domain.domain }}</a>
</li>
</ul>
</div>
</div>
</div>
<div class="col col-lg-1">
<button class="btn btn-danger btn-sm" ng-click="appConfigure.delAlternateDomain($event, $index)"><i class="far fa-trash-alt"></i></button>
</div>
</div>
<div ng-show="appConfigure.alternateDomains.length === 0">
No alternate domains are configured. <a href="" ng-click="appConfigure.addAlternateDomain($event)">Add a domain</a>
</div>
<div ng-show="appConfigure.alternateDomains.length > 0" style="margin-top: 5px;">
<a href="" ng-click="appConfigure.addAlternateDomain($event)">Add another domain</a>
</div>
</div>
</uib-tab>
<uib-tab index="'access'" heading="Access">
<br/>
<div class="form-group">
<div ng-show="appConfigure.ssoAuth">
<label class="control-label">User management</label>
<p class="text-small" ng-show="appConfigure.ftp">This setting also controls SFTP access.</p>
</div>
<div ng-show="!appConfigure.ssoAuth">
<label class="control-label">Dashboard visibility</label>
<p ng-show="!appConfigure.app.manifest.addons.email" class="text-small">
This app has it's own user management.
<span ng-show="appConfigure.ftp">This setting also controls SFTP access.</span>
</p>
<p ng-show="appConfigure.app.manifest.addons.email" class="text-small">
This app is pre-configured for use with <a href="https://cloudron.io/documentation/email/" target="_blank">Cloudron Email</a>.
</p>
</div>
<div class="radio">
<label>
<input type="radio" ng-model="appConfigure.accessRestrictionOption" value="any">
<span ng-show="appConfigure.ssoAuth">Allow all users on this Cloudron</span>
<span ng-show="!appConfigure.ssoAuth">Visible to all users on this Cloudron</span>
</label>
</div>
<div class="radio">
<label>
<input type="radio" ng-model="appConfigure.accessRestrictionOption" value="groups">
<span ng-show="appConfigure.ssoAuth">Only allow the following users and groups</span>
<span ng-show="!appConfigure.ssoAuth">Only visible to the following users and groups</span>
<span class="label label-danger" ng-show="appConfigure.accessRestrictionOption === 'groups' && !appConfigure.isAccessRestrictionValid()">Select at least one user or group</span>
</label>
</div>
<div>
<div style="margin-left: 20px;">
<div class="col-md-5">
Users:
<multiselect class="input-sm stretch" ng-model="appConfigure.accessRestriction.users" ng-disabled="appConfigure.accessRestrictionOption !== 'groups'" options="user.display for user in users" data-multiple="true"></multiselect>
</div>
<div class="col-md-5">
Groups:
<multiselect class="input-sm stretch" ng-model="appConfigure.accessRestriction.groups" ng-disabled="appConfigure.accessRestrictionOption !== 'groups'" options="group.name for group in groups" data-multiple="true"></multiselect>
</div>
</div>
</div>
<br/>
<br/>
</div>
</uib-tab>
<uib-tab index="'display'" heading="Display">
<br/>
<div class="form-group" ng-class="{ 'has-error': !appConfigureForm.label.$dirty && appConfigure.error.label }">
<label class="control-label">Label</label>
<div class="control-label" ng-show="appConfigure.error.label">{{appConfigure.error.label}}</div>
<input type="text" class="form-control" id="appConfigureLabelInput" name="label" ng-model="appConfigure.label">
</div>
<div class="form-group">
<label class="control-label">Tags</label>
<tag-input class="form-control" placeholder="Use comma to separate tags" taglist="appConfigure.tags" name="tags" uib-tooltip="For grouping in the dashboard"></tag-input>
</div>
<div class="form-group">
<div>
<label class="control-label">Icon</label>
<a href="" class="pull-right" style="font-weight: normal;" ng-click="appConfigure.resetCustomIcon()">Reset Icon</a>
</div>
<div id="previewIcon" class="app-custom-icon" ng-click="appConfigure.showCustomIconSelector()" style="background-image: url('{{appConfigure.iconUrl()}}');">
<div class="overlay"></div>
</div>
<input type="file" id="iconFileInput" style="display: none" accept="image/png"/>
</div>
<br/>
</uib-tab>
<uib-tab index="'resources'" heading="Resources">
<br/>
<div class="form-group">
<label class="control-label" for="memoryLimit">Memory Limit <sup><a ng-href="{{ config.webServerOrigin }}/documentation/apps/#increasing-the-memory-limit-of-an-app" class="help" target="_blank"><i class="fa fa-question-circle"></i></a></sup> : <b>{{ appConfigure.memoryLimit ? appConfigure.memoryLimit / 1024 / 1024 + 'MB' : 'Default (256 MB)' }}</b></label>
<br/>
<div style="padding: 0 10px;">
<slider id="memoryLimit" ng-model="appConfigure.memoryLimit" step="134217728" tooltip="hide" ticks="appConfigure.memoryTicks" ticks-snap-bounds="67108864"></slider>
</div>
</div>
<div ng-hide="true" class="form-group" ng-class="{ 'has-error': !appConfigureForm.dataDir.$dirty && appConfigure.error.dataDir }">
<input type="checkbox" id="appConfigureEnableDataDir" ng-model="appConfigure.dataDirEnabled">
<label class="control-label" for="appConfigureEnableDataDir">Custom Data Directory</label>
<div class="control-label" ng-show="appConfigure.error.dataDir">{{appConfigure.error.dataDir}}</div>
<input type="text" class="form-control" id="appConfigureDataDirInput" name="dataDir" ng-disabled="!appConfigure.dataDirEnabled" placeholder="/mnt/appdata" ng-model="appConfigure.dataDir">
</div>
</uib-tab>
<uib-tab index="'email'" heading="Email" ng-if="appConfigure.app.manifest.addons.sendmail || appConfigure.app.manifest.addons.recvmail">
<br/>
<!-- recvmail currently only works with cloudron email -->
<div class="form-group" ng-class="{ 'has-error': !appConfigureForm.mailboxName.$dirty && appConfigure.error.mailboxName }">
<input type="checkbox" id="appConfigureMailboxNameEnabled" ng-model="appConfigure.mailboxNameEnabled">
<label class="control-label" for="appConfigureMailboxNameEnabled">Custom Mail FROM</label>
<div class="has-error" ng-show="appConfigure.error.mailboxName">{{ appConfigure.error.mailboxName }}</div>
<div class="input-group form-inline">
<input type="text" class="form-control" id="appConfigureMailboxNameInput" ng-required="appConfigure.mailboxNameEnabled" name="mailboxName" ng-model="appConfigure.mailboxName" uib-tooltip="App FROM email address. Addresses ending with '.app' are reserved." tooltip-class="long" ng-disabled="!appConfigure.mailboxNameEnabled">
<div class="input-group-btn">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" ng-disabled="!appConfigure.mailboxNameEnabled">
@{{ appConfigure.domain.domain }}
</button>
</div>
</div>
<p class="text-small">
<br/>
This app is configured to send mail using <a ng-href="/#/email/{{ appConfigure.app.domain }}">{{appConfigure.app.domain}}'s Outbound Email</a> settings.
</p>
</div>
</uib-tab>
<uib-tab index="'advanced'" heading="Advanced">
<br/>
<div class="form-group">
<label class="control-label" style="width: 100%">Specify robots.txt file content <sup><a ng-href="{{ config.webServerOrigin }}/documentation/apps/#indexing-by-search-engines-robotstxt" class="help" target="_blank"><i class="fa fa-question-circle"></i></a></sup> <a href="" class="pull-right" style="font-weight: normal;" ng-click="appConfigure.robotsTxt = disableIndexingTemplate">Disable indexing</a></label>
<textarea ng-model="appConfigure.robotsTxt" placeholder="Leave empty to allow all bots to index this app." class="form-control" rows="4"></textarea>
</div>
<div class="form-group">
<input type="checkbox" id="appConfigureEnableBackup" ng-model="appConfigure.enableBackup">
<label class="control-label" for="appConfigureEnableBackup">Enable automatic daily backups</label>
</div>
<div class="form-group">
<input type="checkbox" id="appConfigureEnableAutomaticUpdate" ng-model="appConfigure.enableAutomaticUpdate">
<label class="control-label" for="appConfigureEnableAutomaticUpdate">Enable automatic updates</label>
</div>
<div class="hide">
<label class="control-label" for="appConfigureCertificateInput" ng-show="appConfigure.domain.provider !== 'caas'">Certificate (optional)</label>
<div class="has-error text-center" ng-show="appConfigure.error.cert && appConfigure.domain.provider !== 'caas'">{{ appConfigure.error.cert }}</div>
<div class="form-group" ng-class="{ 'has-error': !appConfigureForm.certificate.$dirty && appConfigure.error.cert }" ng-show="appConfigure.domain.provider !== 'caas'">
<div class="input-group">
<input type="file" id="appConfigureCertificateFileInput" onchange="readCertificate()" style="display:none"/>
<input type="text" class="form-control" placeholder="Certificate" ng-model="appConfigure.certificateFileName" id="appConfigureCertificateInput" name="certificate" onclick="getElementById('appConfigureCertificateFileInput').click();" style="cursor: pointer;" ng-required="appConfigure.keyFileName">
<span class="input-group-addon">
<i class="fa fa-upload" onclick="getElementById('appConfigureCertificateFileInput').click();"></i>
</span>
</div>
</div>
<div class="form-group" ng-class="{ 'has-error': !appConfigureForm.key.$dirty && appConfigure.error.cert }" ng-show="appConfigure.domain.provider !== 'caas'">
<div class="input-group">
<input type="file" id="appConfigureKeyFileInput" onchange="readKey()" style="display:none"/>
<input type="text" class="form-control" placeholder="Key" ng-model="appConfigure.keyFileName" id="appConfigureKeyInput" name="key" onclick="getElementById('appConfigureKeyFileInput').click();" style="cursor: pointer;" ng-required="appConfigure.certificateFileName">
<span class="input-group-addon">
<i class="fa fa-upload" onclick="getElementById('appConfigureKeyFileInput').click();"></i>
</span>
</div>
</div>
</div>
</uib-tab>
</uib-tabset>
<input class="ng-hide" type="submit" ng-disabled="appConfigureForm.$invalid || appConfigure.busy || (appConfigure.accessRestrictionOption === 'groups' && !appConfigure.isAccessRestrictionValid())"/>
</form>
</fieldset>
</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="appConfigure.submit()" ng-disabled="appConfigureForm.$invalid || appConfigure.busy || (appConfigure.accessRestrictionOption === 'groups' && !appConfigure.isAccessRestrictionValid())"><i class="fa fa-circle-notch fa-spin" ng-show="appConfigure.busy"></i>
{{ (appConfigure.app | installError) ? 'Repair' : 'Configure' }}
</button>
</div>
</div>
</div>
</div>
<!-- Modal restore app -->
<div class="modal fade" id="appRestoreModal" tabindex="-1" role="dialog">
@@ -468,7 +201,7 @@
<p>{{ appError.app | prettyAppErrorMessage }}</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary pull-left" ng-click="appConfigure.show(appError.app)" autofocus>Repair</button>
<a type="button" class="btn btn-primary pull-left" ng-href="{{ '/#/app/' + appError.app.id }}" autofocus>Repair</a>
<a type="button" class="btn btn-default pull-left" ng-href="{{ '/logs.html?appId=' + appError.app.id }}" target="_blank">Logs</a>
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>