yxcyc
This commit is contained in:
@@ -1173,6 +1173,31 @@
|
||||
}
|
||||
}
|
||||
|
||||
async function deleteMeasurement(id) {
|
||||
if (!id) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!window.confirm('Diesen Messpunkt wirklich loeschen?')) {
|
||||
return;
|
||||
}
|
||||
|
||||
setSaving(true);
|
||||
setError('');
|
||||
setMessage('');
|
||||
try {
|
||||
await request(`${apiBase}/projects/${encodeURIComponent(projectKey)}/measurements/${encodeURIComponent(id)}`, {
|
||||
method: 'DELETE',
|
||||
});
|
||||
setMessage('Messpunkt geloescht.');
|
||||
await loadBootstrap(projectKey);
|
||||
} catch (err) {
|
||||
setError(err.message);
|
||||
} finally {
|
||||
setSaving(false);
|
||||
}
|
||||
}
|
||||
|
||||
async function submitMeasurementImport(event) {
|
||||
event.preventDefault();
|
||||
setSaving(true);
|
||||
@@ -2272,7 +2297,7 @@
|
||||
panel('Messhistorie', 'Die letzten 10 Uploads inkl. Performance-Werten und OCR-Metadaten.', h('div', { className: 'mc-table-shell' }, [
|
||||
h('table', { key: 'table', className: 'mc-table' }, [
|
||||
h('thead', { key: 'thead' }, h('tr', null, [
|
||||
'Zeit', 'Coins', 'Kurs', 'Quelle', 'DOGE/Tag', 'Trend', 'Notiz'
|
||||
'Zeit', 'Coins', 'Kurs', 'Quelle', 'DOGE/Tag', 'Trend', 'Notiz', 'Aktion'
|
||||
].map((label) => h('th', { key: label }, label)))),
|
||||
h('tbody', { key: 'tbody' },
|
||||
measurements.slice(-10).reverse().map((row) => h('tr', { key: row.id }, [
|
||||
@@ -2283,6 +2308,12 @@
|
||||
h('td', { key: 'rate' }, fmtNumber(row.doge_per_day_interval, 4)),
|
||||
h('td', { key: 'trend' }, row.trend_label),
|
||||
h('td', { key: 'note' }, row.note || row.ocr_flags.join(', ') || '—'),
|
||||
h('td', { key: 'action' }, h('button', {
|
||||
type: 'button',
|
||||
className: 'mc-button mc-button--ghost',
|
||||
onClick: () => deleteMeasurement(row.id),
|
||||
disabled: saving,
|
||||
}, 'Loeschen')),
|
||||
]))
|
||||
),
|
||||
]),
|
||||
|
||||
Reference in New Issue
Block a user