module.html 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <style type="text/css">
  2. .panel {
  3. width: 90%;
  4. float:right;
  5. margin-right: 5%;
  6. }
  7. .table {
  8. table-layout:fixed;
  9. }
  10. .table td {
  11. white-space: nowrap;
  12. overflow: scroll;
  13. text-overflow: ellipsis
  14. }
  15. </style>
  16. <div class="row" ng-controller="APITokenController">
  17. <div class="panel panel-default">
  18. <div class="panel-heading">
  19. <h3 class="panel-title">
  20. Manage API Tokens
  21. <span class="pull-right"><button class="btn btn-primary" style="padding: 0px 5px;" ng-click="getApiTokens();">Refresh</button></span>
  22. </h3>
  23. </div>
  24. <table class="table table-hover table-responsive table-condensed" ng-show="apiTokens.length">
  25. <thead>
  26. <th>ID</th>
  27. <th>Name</th>
  28. <th>Token</th>
  29. </thead>
  30. <tbody>
  31. <tr ng-repeat="apiToken in apiTokens">
  32. <td class="col-md-1">{{ apiToken.rowid }}</td>
  33. <td class="col-md-3">{{ apiToken.name }}</td>
  34. <td class="col-md-5 token" ng-click="selectOnClick($event);">{{ apiToken.token }}</td>
  35. <td class="col-md-3"><span class="pull-right"><button tokenid="{{ apiToken.rowid }}" class="btn btn-danger btn-sm" ng-click="revokeApiToken($event);">Revoke</button></span></td>
  36. </tr>
  37. </tbody>
  38. </table>
  39. <div class="panel-body" ng-hide="apiTokens.length">
  40. <center><i>No API Tokens</i></center>
  41. </div>
  42. </div>
  43. <div class="panel panel-default">
  44. <div class="panel-heading">
  45. <h3 class="panel-title">
  46. Generate New Token
  47. </h3>
  48. </div>
  49. <div class="panel-body">
  50. <form class="form-inline" role="form" ng-submit="genApiToken()" novalidate>
  51. <div class="form-group">
  52. <label for="tokenName">Token Name:</label>
  53. <input name="tokenName" type="text" class="form-control" id="tokenName" ng-model="newToken.name" autofocus>
  54. </div>
  55. <button type="submit" class="btn btn-success">Generate</button>
  56. </form>
  57. </div>
  58. </div>
  59. </div>