Add superuser config section for updating license
This commit is contained in:
parent
5fee4d6d19
commit
ee96693252
11 changed files with 370 additions and 34 deletions
40
static/directives/config/config-license-field.html
Normal file
40
static/directives/config/config-license-field.html
Normal file
|
@ -0,0 +1,40 @@
|
|||
<div class="config-license-field-element">
|
||||
<!-- Note: This hidden input will only have a value if there is a valid license, ensuring that the user cannot save
|
||||
config if the license is invalid (since this box will be empty and therefore "required") -->
|
||||
<input type="text" name="licenseRequiredBox" ng-model="requiredBox" style="visibility: hidden; height: 1px; position: absolute;" required>
|
||||
|
||||
<div class="cor-loader-inline" ng-show="state == 'loading-license'"></div>
|
||||
|
||||
<div class="license-valid license-status" ng-show="state == 'license-valid'">
|
||||
<h4><i class="fa fa-check-circle"></i>License Valid</h4>
|
||||
<table class="co-table">
|
||||
<tr><td>Product:</td><td>{{ licenseDecoded.publicProductName || licenseDecoded.productName }}</td></tr>
|
||||
<tr><td>Plan:</td><td>{{ licenseDecoded.publicPlanName || licenseDecoded.planName }}</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="license-invalid license-status" ng-show="state == 'license-error'">
|
||||
<h4><i class="fa fa-times-circle"></i> Validation Failed</h4>
|
||||
<h5>{{ licenseError }}</h5>
|
||||
</div>
|
||||
|
||||
<button class="btn btn-default" ng-show="!showingEditor" ng-click="showEditor($event)"><i class="fa fa-pencil"></i> Update License</button>
|
||||
|
||||
<div class="license-editor" ng-show="showingEditor">
|
||||
<p>
|
||||
Your license can be found under the "Raw Format" tab of your Quay Enterprise
|
||||
subscription in the <a href="https://account.tectonic.com" target="_blank">Tectonic Account</a>.
|
||||
</p>
|
||||
|
||||
<textarea id="enterLicenseBox" ng-model="licenseContents" class="form-control"
|
||||
placeholder="Paste your raw license here, which should already be in base64 format: GtqMjMwNDgyM3Vq..."
|
||||
ng-readonly="state == 'validating-license'"></textarea>
|
||||
|
||||
<button class="btn btn-primary" ng-show="state != 'validating-license'"
|
||||
ng-click="validateAndUpdate($event)" ng-disabled="!licenseContents">Update License</button>
|
||||
|
||||
<div class="license-validating" ng-show="state == 'validating-license'">
|
||||
<span class="cor-loader-inline"></span> Validating License
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -3,6 +3,16 @@
|
|||
<div ng-show="config && config['SUPER_USERS']">
|
||||
<form id="configform" name="configform">
|
||||
|
||||
<!-- License -->
|
||||
<div class="co-panel">
|
||||
<div class="co-panel-heading">
|
||||
<i class="fa fa-credit-card-alt"></i> License
|
||||
</div>
|
||||
<div class="co-panel-body">
|
||||
<div class="config-license-field"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Basic Configuration -->
|
||||
<div class="co-panel">
|
||||
<div class="co-panel-heading">
|
||||
|
|
Reference in a new issue