forked from cory/tildefriends
Compare commits
No commits in common. "5474c5a1010914e5951d773e0b23697c65186774" and "4b7261fa2033f3205888c8a913d63a744e98a751" have entirely different histories.
5474c5a101
...
4b7261fa20
@ -3,9 +3,6 @@ import * as tfrpc from '/tfrpc.js';
|
||||
tfrpc.register(async function getIdentities() {
|
||||
return ssb.getIdentities();
|
||||
});
|
||||
tfrpc.register(async function createID(id) {
|
||||
return await ssb.createIdentity();
|
||||
});
|
||||
tfrpc.register(async function getPrivateKey(id) {
|
||||
return bip39Words(await ssb.getPrivateKey(id));
|
||||
});
|
||||
@ -18,9 +15,6 @@ tfrpc.register(async function setTheme() {
|
||||
console.warn("setTheme called - not implemented")
|
||||
return null;
|
||||
});
|
||||
tfrpc.register(async function reload() {
|
||||
await main();
|
||||
});
|
||||
|
||||
async function main() {
|
||||
// Get body.html
|
||||
@ -31,7 +25,9 @@ async function main() {
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="/static/tildefriends-v1.css"/>
|
||||
<link rel="stylesheet" href="/static/tildefriends-latest.css"/>
|
||||
<link rel="stylesheet" href="style.css"/>
|
||||
<script src="script.js" type="module"></script>
|
||||
<script src="tf-theme-picker.js" type="module"></script>
|
||||
<script src="tf-password-form.js" type="module"></script>
|
||||
<script src="tf-delete-account-btn.js" type="module"></script>
|
||||
|
@ -9,12 +9,12 @@
|
||||
<div class="box flex-column">
|
||||
<h2>Danger Zone</h2>
|
||||
|
||||
<h3>Manage your identities</h3>
|
||||
<tf-identity-manager></tf-identity-manager>
|
||||
|
||||
<h3>Change my password</h3>
|
||||
<tf-password-form></tf-password-form>
|
||||
|
||||
<h3>Manage your identities</h3>
|
||||
<tf-identity-manager></tf-identity-manager>
|
||||
|
||||
<h3>Delete your account</h3>
|
||||
<tf-delete-account-btn></tf-delete-account-btn>
|
||||
</div>
|
||||
|
@ -22,7 +22,7 @@ class TfDeleteAccountButtonElement extends LitElement {
|
||||
|
||||
render() {
|
||||
return html`
|
||||
<link rel="stylesheet" href="/static/tildefriends-v1.css"/>
|
||||
<link rel="stylesheet" href="/static/tildefriends-latest.css"/>
|
||||
|
||||
<span>This action is irreversible !</span>
|
||||
|
||||
|
@ -18,23 +18,13 @@ class TfIdentityManagerElement extends LitElement {
|
||||
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`
|
||||
<link rel="stylesheet" href="/static/tildefriends-v1.css"/>
|
||||
<link rel="stylesheet" href="/static/tildefriends-latest.css"/>
|
||||
<style>
|
||||
.id-span {
|
||||
font-family: monospace;
|
||||
@ -43,7 +33,7 @@ class TfIdentityManagerElement extends LitElement {
|
||||
</style>
|
||||
|
||||
<h4>Create a new identity</h4>
|
||||
<button id="create-id" class="green" @click=${this.createIdentity}>Create Identity</button>
|
||||
<button id="create-id" class="btn-green">[Not implemented] Create Identity</button>
|
||||
|
||||
<h4>Import an SSB Identity from 12 BIP39 English Words</h4>
|
||||
<textarea id="add-id" style="width: 100%" rows="4"></textarea>
|
||||
|
@ -37,7 +37,7 @@ class TfPasswordFormElement extends LitElement {
|
||||
|
||||
render() {
|
||||
return html`
|
||||
<link rel="stylesheet" href="/static/tildefriends-v1.css"/>
|
||||
<link rel="stylesheet" href="/static/tildefriends-latest.css"/>
|
||||
|
||||
<style>
|
||||
.grid {
|
||||
|
@ -26,7 +26,7 @@ class TfThemePickerElement extends LitElement {
|
||||
|
||||
render() {
|
||||
return html`
|
||||
<link rel="stylesheet" href="/static/tildefriends-v1.css"/>
|
||||
<link rel="stylesheet" href="/static/tildefriends-latest.css"/>
|
||||
|
||||
<label for="theme">[Not implemented] Choose your theme:</label>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user