Get token name as input

This commit is contained in:
Girish Ramakrishnan
2018-08-27 16:04:16 -07:00
parent 764e7e7d1f
commit 9c90a20b4d
4 changed files with 60 additions and 20 deletions

View File

@@ -198,11 +198,35 @@
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">New token created</h4>
<h4 class="modal-title">Create API token</h4>
</div>
<div class="modal-body">
<div ng-hide="tokenAdd.token.accessToken">
<form name="tokenAddForm" role="form" novalidate ng-submit="tokenAdd.submit(apiClient)" autocomplete="off">
<div class="form-group" ng-class="{ 'has-error': (tokenAddForm.tokenName.$dirty && tokenAddForm.tokenName.$invalid) || (!tokenAddForm.tokenName.$dirty && tokenAdd.error.tokenName)}">
<label class="control-label">Token name</label>
<div class="control-label" ng-show="(!tokenAddForm.tokenName.$dirty && tokenAdd.error.tokenName) || (tokenAddForm.tokenName.$dirty && tokenAddForm.tokenName.$invalid)">
<small ng-show="tokenAddForm.tokenName.$error.required">A token name is required</small>
<small ng-show="(tokenAddForm.tokenName.$dirty && tokenAddForm.tokenName.$invalid) && !tokenAddForm.tokenName.$error.required">This token name is not valid</small>
<small ng-show="!tokenAddForm.email.$dirty && tokenAdd.error.tokenName">{{ tokenAdd.error.tokenName }}</small>
</div>
<input type="text" class="form-control" ng-model="tokenAdd.tokenName" id="inputTokenAddName" name="tokenName" required autofocus>
</div>
<input class="ng-hide" type="submit" ng-disabled="tokenAddForm.$invalid"/>
</form>
</div>
<div ng-show="tokenAdd.token.accessToken">
Use the following token to authenticate against the Cloudron API:
<br/>
<b ng-click-select>{{ tokenAdd.token.accessToken }}</b>
</div>
</div>
<div class="modal-body"><b ng-click-select>{{ tokenAdd.token.accessToken }}</b></div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Done</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-success" ng-click="tokenAdd.submit(apiClient)" ng-hide="tokenAdd.token.accessToken" ng-disabled="tokenAddForm.$invalid || tokenAdd.busy">
<i class="fa fa-circle-o-notch fa-spin" ng-show="tokenAdd.busy"></i> Generate Token
</button>
</div>
</div>
</div>