|
| 1 | +<div class={{if api_token.isNew "row create-token" "row"}}> |
| 2 | + <div class='name'> |
| 3 | + {{#if api_token.isNew}} |
| 4 | + {{input |
| 5 | + type="text" |
| 6 | + placeholder="New token name" |
| 7 | + disabled=api_token.isSaving |
| 8 | + value=api_token.name |
| 9 | + autofocus=true |
| 10 | + enter="saveToken"}} |
| 11 | + {{else}} |
| 12 | + {{ api_token.name }} |
| 13 | + {{/if}} |
| 14 | + </div> |
| 15 | + |
| 16 | + <div class='spacer'></div> |
| 17 | + |
| 18 | + {{#unless api_token.isNew}} |
| 19 | + <div class='dates'> |
| 20 | + <div class='created-at'> |
| 21 | + <span class='small' title={{api_token.created_at}}> |
| 22 | + Created {{moment-from-now api_token.created_at}} |
| 23 | + </span> |
| 24 | + </div> |
| 25 | + {{#if api_token.last_used_at}} |
| 26 | + <div class='last_used_at'> |
| 27 | + <span class='small' title={{api_token.last_used_at}}> |
| 28 | + Last used {{moment-from-now api_token.last_used_at}} |
| 29 | + </span> |
| 30 | + </div> |
| 31 | + {{else}} |
| 32 | + <div class='last_used_at'> |
| 33 | + <span class='small'>Never used</span> |
| 34 | + </div> |
| 35 | + {{/if}} |
| 36 | + </div> |
| 37 | + {{/unless}} |
| 38 | + |
| 39 | + <div class='actions'> |
| 40 | + {{#if api_token.isNew}} |
| 41 | + <button class='small yellow-button' |
| 42 | + disabled={{disableCreate}} |
| 43 | + title={{if emptyName "You must specify a name" ""}} |
| 44 | + {{action "saveToken"}}>Create</button> |
| 45 | + {{else}} |
| 46 | + <button class='small tan-button' |
| 47 | + disabled={{api_token.isSaving}} |
| 48 | + {{action "revokeToken"}}>Revoke</button> |
| 49 | + {{/if}} |
| 50 | + {{#if api_token.isSaving}} |
| 51 | + <img class='overlay' src="/assets/ajax-loader.gif" /> |
| 52 | + {{/if}} |
| 53 | + </div> |
| 54 | +</div> |
| 55 | + |
| 56 | +{{#if serverError}} |
| 57 | + <div class='row error'> |
| 58 | + <div> |
| 59 | + {{ serverError }} |
| 60 | + </div> |
| 61 | + </div> |
| 62 | +{{/if}} |
| 63 | + |
| 64 | +{{#if api_token.token}} |
| 65 | + <div class='row new-token'> |
| 66 | + <div> |
| 67 | + Please record this token somewhere, you cannot retrieve |
| 68 | + its value again. For use on the command line you can save it to <code>~/.cargo/config</code> |
| 69 | + with: |
| 70 | + |
| 71 | + <pre>cargo login {{ api_token.token }}</pre> |
| 72 | + </div> |
| 73 | + </div> |
| 74 | +{{/if}} |
0 commit comments