Feat v0.7.3 extension shell migration (#57)
All checks were successful
CI/CD / detect-changes (push) Successful in 4s
CI/CD / test-runners (push) Has been skipped
CI/CD / test-frontend (push) Successful in 5s
CI/CD / test-go-pg (push) Successful in 2m51s
CI/CD / test-sqlite (push) Successful in 3m2s
CI/CD / build-and-deploy (push) Successful in 27s
All checks were successful
CI/CD / detect-changes (push) Successful in 4s
CI/CD / test-runners (push) Has been skipped
CI/CD / test-frontend (push) Successful in 5s
CI/CD / test-go-pg (push) Successful in 2m51s
CI/CD / test-sqlite (push) Successful in 3m2s
CI/CD / build-and-deploy (push) Successful in 27s
Co-authored-by: Jeffrey Smith <jasafpro@gmail.com> Co-committed-by: Jeffrey Smith <jasafpro@gmail.com>
This commit was merged in pull request #57.
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
* this surface talks directly to the core scheduled-tasks endpoints.
|
||||
*
|
||||
* SDK usage:
|
||||
* sw.shell.Topbar — standard navigation bar
|
||||
* sw.shell.topbar — shell topbar API
|
||||
* sw.ui.* — primitive components
|
||||
* sw.api.* — raw REST calls to /api/v1/schedules
|
||||
*/
|
||||
@@ -39,7 +39,6 @@
|
||||
var { useState, useEffect, useCallback } = hooks;
|
||||
var { render } = preact;
|
||||
var { Button, FormField, Dialog, Spinner, Banner } = sw.ui;
|
||||
var Topbar = sw.shell?.Topbar;
|
||||
|
||||
// ── API helpers (core kernel endpoints) ────
|
||||
var API = '/api/v1/schedules';
|
||||
@@ -365,6 +364,16 @@
|
||||
|
||||
useEffect(function () { loadItems(); }, []);
|
||||
|
||||
// ── Shell topbar ───────────────────────────
|
||||
useEffect(function () {
|
||||
if (!sw.shell?.topbar) return;
|
||||
sw.shell.topbar.setTitle('Schedules');
|
||||
sw.shell.topbar.setSlot(html`
|
||||
<span class="ext-schedules-count">${items.length} schedule${items.length !== 1 ? 's' : ''}</span>
|
||||
<${Button} variant="primary" size="sm" onClick=${() => setEditing({})}>+ New Schedule<//>
|
||||
`);
|
||||
}, [items.length]);
|
||||
|
||||
function handleSave() {
|
||||
setEditing(null);
|
||||
loadItems();
|
||||
@@ -372,17 +381,6 @@
|
||||
|
||||
return html`
|
||||
<div class="ext-schedules-app">
|
||||
${Topbar ? html`
|
||||
<${Topbar} title="Schedules">
|
||||
<span class="ext-schedules-count">${items.length} schedule${items.length !== 1 ? 's' : ''}</span>
|
||||
<${Button} variant="primary" size="sm" onClick=${() => setEditing({})}>+ New Schedule<//>
|
||||
<//>
|
||||
` : html`
|
||||
<div class="ext-schedules-header">
|
||||
<h1>Schedules</h1>
|
||||
<${Button} variant="primary" size="sm" onClick=${() => setEditing({})}>+ New Schedule<//>
|
||||
</div>
|
||||
`}
|
||||
|
||||
${error && html`<${Banner} variant="danger" text=${error} />`}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user