Close the UI-review follow-ups: names typeahead, fleet form, overflow flip.
Some checks are pending
offline / test (push) Waiting to run
Some checks are pending
offline / test (push) Waiting to run
Staff pages typeahead customers by name (Ada, not cust_1). Add-machine is two rows with a wide identity path and filename picker. Overflow menus flip up near the viewport edge. Customer list no longer leaks password hashes. UI-REVIEW.pdf remaining list is the three leftover items.
This commit is contained in:
parent
9cc0018708
commit
b68fefdea8
41 changed files with 569 additions and 454 deletions
|
|
@ -58,8 +58,9 @@
|
|||
<div class="card">
|
||||
<div class="row">
|
||||
<div>
|
||||
<label for="id">Customer id or name</label>
|
||||
<input id="id" value="cust_1" autocomplete="off" />
|
||||
<label for="id">Customer</label>
|
||||
<input id="id" list="cust-list" placeholder="Type a name or id" autocomplete="off" />
|
||||
<datalist id="cust-list"></datalist>
|
||||
</div>
|
||||
<button type="button" onclick="review()">Review account</button>
|
||||
</div>
|
||||
|
|
@ -112,6 +113,18 @@
|
|||
<div class="card"><h3>Usage</h3>${moneyTable(st.usage, [{key:'endpointId',label:'Endpoint'},{key:'cents',label:'Amount'},{key:'at',label:'When'}], 'No usage yet')}</div>
|
||||
<div class="card"><h3>Payments</h3>${moneyTable(st.payments, [{key:'cents',label:'Amount'},{key:'kind',label:'Kind'},{key:'reason',label:'Reason'},{key:'at',label:'When'}], 'No payments yet')}</div>`;
|
||||
}
|
||||
async function loadCustomers() {
|
||||
try {
|
||||
const { customers } = await (await fetch('/customers')).json();
|
||||
document.getElementById('cust-list').innerHTML = (customers || [])
|
||||
.map((c) => `<option value="${c.name}">${c.id}</option>`)
|
||||
.join('');
|
||||
if (customers && customers[0] && !document.getElementById('id').value) {
|
||||
document.getElementById('id').value = customers[0].name;
|
||||
}
|
||||
} catch { /* edge optional */ }
|
||||
}
|
||||
loadCustomers();
|
||||
async function review() {
|
||||
const id = document.getElementById('id').value.trim();
|
||||
try {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue