Versie 0.3.2
This commit is contained in:
1 parent
e77d8fd373
commit
1cf6eeed29
16 files changed
+551
-44
No files matched your search
@@ -1,4 +1,4 @@
|
||||
// Generated, do not edit. sha256:51ab737fb6604c8493f238a8893184408226a1a90ddd465fcd92bf0040b5a50e
|
||||
// Generated, do not edit. sha256:9b4688b90b1d72ebe6c49262c3d23557d132d9066d8379a911157bbf3dae8ae8
|
||||
import { mergeCheck, mergeAccounts } from '../data/accounts-merge.js';
|
||||
import { listAccounts, listSelectableAccounts, createAccount, updateAccount, deleteAccount } from '../data/accounts.js';
|
||||
import { listConnections } from '../data/connections.js';
|
||||
@@ -102,7 +102,7 @@ async function buildTable(el) {
|
||||
tableApi = renderTable(el.querySelector('#tbl'), {
|
||||
columns, rows: rijen,
|
||||
...(limitFor('fiatAccounts') !== null
|
||||
? { toolbarNote: () => `${t('license.name_fiatAccounts')}: ${counterText('fiatAccounts', bankCount)}` } : {}),
|
||||
? { toolbarNote: () => counterText('fiatAccounts', bankCount) } : {}),
|
||||
...(await tableViewCfg('accounts', { key: 'name', dir: 'asc' })),
|
||||
emptyText: t('accounts.none'),
|
||||
noneLabel: t('table.none'),
|
||||
@@ -317,6 +317,8 @@ async function mountSources(host, accountId, allowed) {
|
||||
};
|
||||
let api = null;
|
||||
const reloadSrc = async () => api.refresh(await listWalletSources(accountId));
|
||||
const rows = await listWalletSources(accountId);
|
||||
const nodeColumn = !locked('lightning') || rows.some(r => r.connectionId != null);
|
||||
|
||||
api = renderTable(host.querySelector('[data-src-table]'), {
|
||||
title: t('accounts.sources'),
|
||||
@@ -348,8 +350,8 @@ async function mountSources(host, accountId, allowed) {
|
||||
{ key: 'scriptType', label: t('accounts.colScriptType'),
|
||||
render: s => s.kind === 'xpub' ? t('accounts.script_' + s.scriptType) : '<span class="t-muted-cell">-</span>',
|
||||
edit: { type: 'select', options: scriptTypeOpts, visible: v => v.kind === 'xpub' } },
|
||||
],
|
||||
rows: await listWalletSources(accountId),
|
||||
].filter(c => nodeColumn || c.key !== 'connectionId'),
|
||||
rows,
|
||||
...(await tableViewCfg('accounts.sources', { key: 'name', dir: 'asc' })),
|
||||
emptyText: t('accounts.noSources'),
|
||||
newLabel: t('table.new'),
|
||||
|
||||
+12
-5
@@ -1,4 +1,4 @@
|
||||
// Generated, do not edit. sha256:7de3dc53eab20f070a6ac8c7162fee1bd0695f724c6a13e314a994181782906e
|
||||
// Generated, do not edit. sha256:26e9a2b26a7c0fa9e0b6979080609ba55baa351ce8440240a006def072475893
|
||||
import { listAssets, listBookableAssets, createAsset, updateAsset, deleteAsset } from '../data/assets.js';
|
||||
import { hasMetalAssets } from '../data/metals.js';
|
||||
import { tableViewCfg } from '../data/preferences.js';
|
||||
@@ -132,7 +132,14 @@ async function buildTable(el) {
|
||||
};
|
||||
}
|
||||
|
||||
const rijen = await listAssets();
|
||||
const nieuw = new Set();
|
||||
const zichtbaar = async () => {
|
||||
const b = await listBookableAssets();
|
||||
if (!nieuw.size) return b;
|
||||
const ids = new Set(b.map(a => a.id));
|
||||
return [...b, ...(await listAssets()).filter(a => nieuw.has(a.id) && !ids.has(a.id))];
|
||||
};
|
||||
const rijen = await zichtbaar();
|
||||
const bookable = async () => (await listBookableAssets()).filter(r => r.symbol !== baseCurrency()).length;
|
||||
let used = await bookable();
|
||||
tableApi = renderTable(el.querySelector('#tbl'), {
|
||||
@@ -145,11 +152,11 @@ async function buildTable(el) {
|
||||
newLabel: t('table.new'),
|
||||
newDefaults: { kind: 'crypto', decimals: '', displayUnit: 'unit', taxCategory: '', taxScope: '', balanceCapture: '' },
|
||||
saveLabel: t('assets.save'), cancelLabel: t('assets.cancel'),
|
||||
onCreate: async v => { const id = await createAsset(toPayload(v)); used = await bookable(); tableApi.refresh(await listAssets(), { locate: id }); },
|
||||
onSave: async (id, v) => { await updateAsset(id, toPayload(v)); tableApi.refresh(await listAssets()); },
|
||||
onCreate: async v => { const id = await createAsset(toPayload(v)); nieuw.add(id); used = await bookable(); tableApi.refresh(await zichtbaar(), { locate: id }); },
|
||||
onSave: async (id, v) => { await updateAsset(id, toPayload(v)); tableApi.refresh(await zichtbaar()); },
|
||||
onDelete: async id => {
|
||||
if (!(await dialog.confirm({ message: t('assets.confirmDelete'), danger: true }))) return;
|
||||
try { await deleteAsset(id); used = await bookable(); tableApi.refresh(await listAssets()); } catch (e) { dialog.alert({ title: t('dialog.error'), message: e.message }); }
|
||||
try { await deleteAsset(id); used = await bookable(); tableApi.refresh(await zichtbaar()); } catch (e) { dialog.alert({ title: t('dialog.error'), message: e.message }); }
|
||||
},
|
||||
});
|
||||
tableApi.focusRow(takeRowFocus('assets'));
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Generated, do not edit. sha256:fcc1131e05f7794fbe4f303c8c1237f96201e5ee9ed17491fd18d55b64828d40
|
||||
// Generated, do not edit. sha256:bcb22b0408193ecc7c34d5e55a86c15a89be89fdd2d96b8d21f03771f4179be1
|
||||
import { localDate } from '../../shared/time.js';
|
||||
import { listAccounts } from '../data/accounts.js';
|
||||
import { listLabels, createLabel } from '../data/labels.js';
|
||||
@@ -553,18 +553,18 @@ async function scanAll(el) {
|
||||
const r = await scanLightningSource(s);
|
||||
ln += r.count;
|
||||
if (r.channelTxids.length) kanalen.push([s.accountId, r.channelTxids]);
|
||||
} catch (err) { console.error('[lightning-scan]', err); error = true; }
|
||||
} catch (err) { console.error('[lightning-scan]', err); error = err.message || true; }
|
||||
continue;
|
||||
}
|
||||
if (!isOnchainSource(s)) { geslagen++; continue; }
|
||||
try {
|
||||
const r = await scanOne(el, s, g.id);
|
||||
count += r.count; failed += r.failed; voorstellen.set(s.accountId, r.proposals || 0);
|
||||
} catch (err) { console.error('[onchain-scan-all]', err); error = true; }
|
||||
} catch (err) { console.error('[onchain-scan-all]', err); error = err.message || true; }
|
||||
}
|
||||
const skipped = geslagen && !lnBronnen && !count && !failed;
|
||||
if (error) nMislukt++; else if (!skipped) nWallets++;
|
||||
results[g.id] = error ? { error: true } : (skipped ? { skipped: true } : { count, failed, ln, lnBronnen });
|
||||
results[g.id] = error ? { error } : (skipped ? { skipped: true } : { count, failed, ln, lnBronnen });
|
||||
}
|
||||
if (Object.values(results).some(r => r.lnBronnen)) await syncAddressLinks().catch(err => console.error('[lightning-links]', err));
|
||||
for (const [accountId, txids] of kanalen) {
|
||||
@@ -582,7 +582,8 @@ async function scanAll(el) {
|
||||
zetStatus(scanSummary(nWallets, nVoorstellen, nMislukt));
|
||||
for (const id in results) {
|
||||
const r = results[id];
|
||||
if (r.error) setLogRow(el, id, 't-neg', t('tracking.scanError'));
|
||||
if (r.error) setLogRow(el, id, 't-neg', typeof r.error === 'string'
|
||||
? t('tracking.scanErrorWhy', { reden: r.error }) : t('tracking.scanError'));
|
||||
else if (r.skipped) setLogRow(el, id, 't-muted', t('tracking.scanNotOnchain'));
|
||||
else setLogRow(el, id, r.failed ? 't-neg' : 't-pos', scanDoneText(r));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user