Remove last used from long lived access token list. (#1727)

This commit is contained in:
Paulus Schoutsen 2018-10-05 10:23:29 +02:00 committed by GitHub
parent 6720c03cbc
commit 2eb3a55f59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,10 +44,9 @@ class HaLongLivedTokens extends LocalizeMixin(EventsMixin(PolymerElement)) {
</template>
</div>
<template is='dom-repeat' items='[[_tokens]]'>
<ha-settings-row three-line>
<ha-settings-row two-line>
<span slot='heading'>[[item.client_name]]</span>
<div slot='description'>[[_formatCreatedAt(item.created_at)]]</div>
<div slot='description'>[[_formatLastUsed(item)]]</div>
<paper-icon-button icon="hass:delete" on-click='_handleDelete'></paper-icon-button>
</ha-settings-row>
</template>
@ -89,14 +88,6 @@ class HaLongLivedTokens extends LocalizeMixin(EventsMixin(PolymerElement)) {
);
}
_formatLastUsed(item) {
return item.last_used_at ? this.localize(
'ui.panel.profile.refresh_tokens.last_used',
'date', formatDateTime(new Date(item.last_used_at), this.language),
'location', item.last_used_ip
) : this.localize('ui.panel.profile.refresh_tokens.not_used');
}
async _handleCreate() {
const name = prompt(this.localize('ui.panel.profile.long_lived_access_tokens.prompt_name'));
if (!name) return;