import {LitElement, html} from './lit-all.min.js'; import * as tfrpc from '/static/tfrpc.js'; class TfIdentityManagerElement extends LitElement { static get properties() { return { ids: {type: Array}, }; } constructor() { super(); this.ids = []; this.load(); } async load() { this.ids = await tfrpc.rpc.getIdentities(); } async createIdentity() { try { let id = await tfrpc.rpc.createID(); alert('Successfully created: ' + id); await tfrpc.rpc.reload(); } catch (err) { alert('Error creating identity: ' + err); } } async exportIdentity(id) { alert('Your private key is:\n' + (await tfrpc.rpc.getPrivateKey(id))); } render() { return html`