Add attachments, usage limits and automation editing
Attachments upload like the web composer's (signed URL, then bytes) and ride on the next message or a draft's first message; pending names show above the composer and removal deletes the unsent upload. Settings shows provider limit windows, banked reset credits and the last 30 days' usage summary, with a status-line note near a limit and a confirmed reset-credit command. Automations can be created and edited in $EDITOR from a template parsed back against the web form's rules, and deleted behind a confirm. Asks for the diagnostics:read and providers:manage scopes the new RPCs need.
This commit is contained in:
1 parent
43347d1d58
commit
2b31804f8e
15 files changed
+1049
-23
No files matched your search
+11
-1
@@ -6,11 +6,14 @@ export function SettingsView(props: {
|
||||
readonly rows: readonly SettingRow[];
|
||||
readonly server: readonly { label: string; value: string }[];
|
||||
readonly serverStatus: "loading" | "live" | "error";
|
||||
/** Usage limits and the last 30 days' totals, read-only; left out until known. */
|
||||
readonly usage?: readonly { label: string; value: string }[];
|
||||
readonly selected: number;
|
||||
readonly path: string;
|
||||
readonly onCycle: (index: number) => void;
|
||||
}) {
|
||||
const labelWidth = Math.max(...props.rows.map((row) => row.label.length), ...props.server.map((line) => line.label.length)) + 2;
|
||||
const usage = props.usage ?? [];
|
||||
const labelWidth = Math.max(...props.rows.map((row) => row.label.length), ...props.server.map((line) => line.label.length), ...usage.map((line) => line.label.length)) + 2;
|
||||
return (
|
||||
<box flexGrow={1} minHeight={0} flexDirection="column" paddingLeft={2} paddingRight={1}>
|
||||
<box flexDirection="row" flexShrink={0} height={1}>
|
||||
@@ -40,6 +43,13 @@ export function SettingsView(props: {
|
||||
<text fg={colors.text}>{line.value}</text>
|
||||
</box>
|
||||
))}
|
||||
{usage.length > 0 ? <text fg={colors.faint} marginTop={1}>Usage</text> : null}
|
||||
{usage.map((line) => (
|
||||
<box key={`${line.label}:${line.value}`} flexDirection="row" height={1}>
|
||||
<text fg={colors.muted} flexShrink={0}>{` ${line.label.padEnd(labelWidth)}`}</text>
|
||||
<text fg={colors.text}>{line.value}</text>
|
||||
</box>
|
||||
))}
|
||||
</box>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user