diff --git a/ui/src/accounts/AccountEntry.vue b/ui/src/accounts/AccountEntry.vue
index d9fd92b41..4c128c762 100644
--- a/ui/src/accounts/AccountEntry.vue
+++ b/ui/src/accounts/AccountEntry.vue
@@ -11,14 +11,14 @@ import { passkeysAvailable, useAccountsStore, usePasskey } from "./accounts";
const accounts=useAccountsStore();
const step=ref(1);const recovery=ref(false);const recoveryCode=ref("");
const organisation=ref("");const workspace=ref("Default");const publicURL=ref(window.location.origin);
-const name=ref("");const email=ref("");const password=ref("");const busy=ref(false);const error=ref("");
+const name=ref("");const email=ref("");const password=ref("");const busy=ref(false);const error=ref("");const notice=ref("");
const setup=computed(()=>accounts.status?.setup_required===true);
const passkey=computed(()=>passkeysAvailable(accounts.status?.public_url??""));
async function submit(){
if(setup.value&&step.value===1&&!recovery.value){step.value=2;return}
- busy.value=true;error.value="";
+ busy.value=true;error.value="";notice.value="";
try{
- if(recovery.value){await api.recoverAccount(email.value,recoveryCode.value,password.value);recovery.value=false;password.value="";error.value="Password changed. Sign in with your new password.";return}
+ if(recovery.value){await api.recoverAccount(email.value,recoveryCode.value,password.value);recovery.value=false;password.value="";notice.value="Password changed. Sign in with your new password.";return}
if(setup.value)await api.setupAccount({organisation_name:organisation.value,workspace_name:workspace.value,public_url:publicURL.value.replace(/\/$/,""),display_name:name.value,email:email.value,password:password.value});
else await api.signIn(email.value,password.value);
password.value="";
@@ -48,6 +48,7 @@ async function signInPasskey(){busy.value=true;error.value="";try{await usePassk
At least 15 characters.
{{error}}
+ {{notice}}
diff --git a/ui/src/accounts/AccountPage.vue b/ui/src/accounts/AccountPage.vue
index 2277fef15..abaab3d83 100644
--- a/ui/src/accounts/AccountPage.vue
+++ b/ui/src/accounts/AccountPage.vue
@@ -9,15 +9,15 @@ import { Card } from "@/components/ui/card";
import { Input } from "@/components/ui/input";
import { SettingRow } from "@/components/ui/setting-row";
import { Section } from "@/components/ui/section";
-import { api } from "@/lib/api";
+import { api, classifyActionError } from "@/lib/api";
import { passkeysAvailable,useAccountsStore,usePasskey } from "./accounts";
const recovery=ref("");
const makeRecovery=()=>run(async()=>{recovery.value=(await api.recoveryCode()).code});
-const accounts=useAccountsStore();const keys=ref<{id:string;name:string}[]>([]);const error=ref("");const busy=ref(false);const keyName=ref("");const current=ref("");const next=ref("");
+const accounts=useAccountsStore();const keys=ref<{id:string;name:string}[]>([]);const error=ref("");const sessionExpired=ref(false);const busy=ref(false);const keyName=ref("");const current=ref("");const next=ref("");
const eligible=computed(()=>passkeysAvailable(accounts.status?.public_url??""));
-async function load(){try{keys.value=(await api.passkeys()).passkeys}catch(cause){error.value=String((cause as Error).message||cause)}}
+async function load(){try{keys.value=(await api.passkeys()).passkeys}catch(cause){error.value=String((cause as Error).message||cause);sessionExpired.value=classifyActionError(cause).kind==="session-expired"}}
onMounted(load);
-async function run(action:()=>Promise
){busy.value=true;error.value="";try{await action()}catch(cause){error.value=String((cause as Error).message||cause)}finally{busy.value=false}}
+async function run(action:()=>Promise){busy.value=true;error.value="";try{await action()}catch(cause){error.value=String((cause as Error).message||cause);sessionExpired.value=classifyActionError(cause).kind==="session-expired"}finally{busy.value=false}}
const enroll=()=>run(async()=>{await usePasskey(true,keyName.value);keyName.value="";await load()});
const remove=(id:string)=>run(async()=>{await api.deletePasskey(id);await load()});
const change=()=>run(async()=>{await api.changePassword(current.value,next.value);current.value=next.value="";window.location.assign("/")});
@@ -26,7 +26,7 @@ const change=()=>run(async()=>{await api.changePassword(current.value,next.value
{{accounts.status?.user?.display_name}}
Your organisation and admin account are ready. Add a passkey below, add members, or configure OIDC.
-
{{error}} Sign in again
+
{{error}} Sign in again
- {{key.name}}
diff --git a/ui/src/accounts/AuthenticationPage.vue b/ui/src/accounts/AuthenticationPage.vue
index 092f7b6e3..d78fb00e4 100644
--- a/ui/src/accounts/AuthenticationPage.vue
+++ b/ui/src/accounts/AuthenticationPage.vue
@@ -6,18 +6,18 @@ import PageHeader from "@/base/PageHeader.vue";
import { Button } from "@/components/ui/button";
import CodeView from "@/base/CodeView.vue";
import { Input } from "@/components/ui/input";
-import { api } from "@/lib/api";
+import { api, classifyActionError } from "@/lib/api";
import { SettingRow } from "@/components/ui/setting-row";
import { Section } from "@/components/ui/section";
interface Settings {public_url:string;oidc_issuer:string;oidc_audience:string;oidc_client_id:string}
-const value=ref({public_url:"",oidc_issuer:"",oidc_audience:"",oidc_client_id:""});const loaded=ref(false);const error=ref("");const busy=ref(false);const saved=ref(false);
+const value=ref({public_url:"",oidc_issuer:"",oidc_audience:"",oidc_client_id:""});const loaded=ref(false);const error=ref("");const sessionExpired=ref(false);const busy=ref(false);const saved=ref(false);
onMounted(async()=>{try{value.value=await api.authentication();loaded.value=true}catch(cause){error.value=String((cause as Error).message||cause)}});
const redirectURI=computed(()=>`${value.value.public_url.replace(/\/$/,"")}/oauth2/callback`);
-async function save(){busy.value=true;error.value="";saved.value=false;try{await api.saveAuthentication(value.value);saved.value=true}catch(cause){error.value=String((cause as Error).message||cause)}finally{busy.value=false}}
+async function save(){busy.value=true;error.value="";saved.value=false;try{await api.saveAuthentication(value.value);saved.value=true}catch(cause){error.value=String((cause as Error).message||cause);sessionExpired.value=classifyActionError(cause).kind==="session-expired"}finally{busy.value=false}}
-
{{error}} Sign in again
+
{{error}} Sign in again
diff --git a/ui/src/accounts/accounts.ts b/ui/src/accounts/accounts.ts
index 4bf140597..4d76c1fa2 100644
--- a/ui/src/accounts/accounts.ts
+++ b/ui/src/accounts/accounts.ts
@@ -8,7 +8,7 @@ export const useAccountsStore=defineStore("accounts",()=>{
const status=ref
(null);
const error=ref("");
async function load():Promise{try{status.value=await api.authStatus();error.value=""}catch(cause){error.value=String((cause as Error).message||cause)}}
- async function signOut():Promise{await api.signOut();window.location.assign("/")}
+ async function signOut():Promise{try{await api.signOut()}catch(cause){error.value=String((cause as Error).message||cause);return}window.location.assign("/")}
// Empty for the default instance, which needs no label.
const instance=computed(()=>{const name=status.value?.instance||"";return name==="archie"?"":name});
return {status,error,instance,load,signOut};
diff --git a/ui/src/audit/AuditFilters.vue b/ui/src/audit/AuditFilters.vue
index dab727036..32acaa7ea 100644
--- a/ui/src/audit/AuditFilters.vue
+++ b/ui/src/audit/AuditFilters.vue
@@ -49,13 +49,13 @@ watch(search, (value) => {
onUnmounted(() => clearTimeout(searchTimer));
const actor = ref(props.query.actor ?? "");
-const action = ref(props.query.actions[0] ?? "");
+const action = ref((props.query.actions ?? []).join(", "));
const targetId = ref(props.query.target_id ?? "");
const from = ref(props.query.from ?? "");
const to = ref(props.query.to ?? "");
watch(() => props.query.actor, (value) => (actor.value = value ?? ""));
-watch(() => props.query.actions.join(","), () => (action.value = props.query.actions[0] ?? ""));
+watch(() => props.query.actions.join(","), () => (action.value = props.query.actions.join(", ")));
watch(() => props.query.target_id, (value) => (targetId.value = value ?? ""));
watch(() => props.query.from, (value) => (from.value = value ?? ""));
watch(() => props.query.to, (value) => (to.value = value ?? ""));
@@ -86,8 +86,8 @@ function commitActor() {
}
function commitAction() {
- const value = action.value.trim();
- emit("change", { actions: value ? [value] : [] });
+ const list = action.value.split(",").map((entry) => entry.trim()).filter(Boolean);
+ emit("change", { actions: list });
}
function commitTargetId() {
diff --git a/ui/src/audit/AuditPage.vue b/ui/src/audit/AuditPage.vue
index 1703736fd..aaacdc102 100644
--- a/ui/src/audit/AuditPage.vue
+++ b/ui/src/audit/AuditPage.vue
@@ -223,6 +223,7 @@ function openSaveView(): void {
function saveView(): void {
const name = viewName.value.trim();
if (!name || !identityId.value) return;
+ if (views.value.some((view) => view.name === name) && activeView.value?.name !== name && !window.confirm(`Replace the saved view "${name}"?`)) return;
views.value = [
...views.value.filter((view) => view.name !== name),
{ name, query: routeQueryFor(query.value) },
@@ -318,7 +319,7 @@ async function confirmRevert(): Promise {
// same versioned replace the settings pages use.
const RETENTION_KIND = "audit-retention";
const retentionOpen = ref(false);
-const retentionHours = ref("0");
+const retentionHours = ref("");
const retentionError = ref("");
const retentionSaving = ref(false);
const retentionState = settings.stateFor(RETENTION_KIND);
diff --git a/ui/src/settings/CardAccordion.vue b/ui/src/settings/CardAccordion.vue
index 7cce37df2..300cd7be7 100644
--- a/ui/src/settings/CardAccordion.vue
+++ b/ui/src/settings/CardAccordion.vue
@@ -9,7 +9,7 @@ import { Button } from "@/components/ui/button";
* opens a new card when it adds one and refuses to add another while unsaved
* changes exist.
*/
-defineProps<{
+const props = defineProps<{
items: T[];
title: (item: T, index: number) => string;
removeLabel: string;
@@ -17,13 +17,18 @@ defineProps<{
}>();
const open = defineModel("open", { default: "" });
defineEmits<{ remove: [index: number] }>();
+// Keyed by the item's own id when it has one, so removing a card does not
+// move another card's child state onto it.
+function keyOf(item: T, index: number): string {
+ return typeof item === "object" && item !== null && "id" in item ? String((item as { id: unknown }).id) : props.title(item, index);
+}
diff --git a/ui/src/settings/SystemTasksPage.vue b/ui/src/settings/SystemTasksPage.vue
index 6d0ac8d72..ed105f91a 100644
--- a/ui/src/settings/SystemTasksPage.vue
+++ b/ui/src/settings/SystemTasksPage.vue
@@ -54,6 +54,18 @@ function durationText(seconds: number | null | undefined): string {
return formatGoDuration((seconds ?? 0) * 1000);
}
// Undefined for text that is not a duration, so the draft keeps its last value.
+const durationErrors = ref>({});
+function commitDuration(field: { handleChange: (value: number) => void }, id: string, text: string): void {
+ const seconds = durationSeconds(text);
+ if (seconds === undefined) {
+ durationErrors.value = { ...durationErrors.value, [id]: "Enter a duration like 30m or 2h." };
+ return;
+ }
+ const next = { ...durationErrors.value };
+ delete next[id];
+ durationErrors.value = next;
+ field.handleChange(seconds);
+}
function durationSeconds(text: string): number | undefined {
const ms = parseGoDuration(text);
return ms === null ? undefined : Math.round(ms / 1000);
@@ -89,8 +101,9 @@ async function restoreWorkflows(): Promise {
id="te-task"
:model-value="durationText(field.state.value)"
:units="['m', 'h']"
- @update:model-value="(text: string) => { const s = durationSeconds(text); if (s !== undefined) field.handleChange(s); }"
+ @update:model-value="(text: string) => commitDuration(field, 'te-task', text)"
/>
+ {{ durationErrors['te-task'] }}
@@ -107,8 +120,9 @@ async function restoreWorkflows(): Promise {
id="te-call"
:model-value="durationText(field.state.value)"
:units="['s', 'm', 'h']"
- @update:model-value="(text: string) => { const s = durationSeconds(text); if (s !== undefined) field.handleChange(s); }"
+ @update:model-value="(text: string) => commitDuration(field, 'te-call', text)"
/>
+ {{ durationErrors['te-call'] }}
diff --git a/ui/src/settings/VersionsCard.vue b/ui/src/settings/VersionsCard.vue
index 9049312f1..6ebc614d1 100644
--- a/ui/src/settings/VersionsCard.vue
+++ b/ui/src/settings/VersionsCard.vue
@@ -196,7 +196,7 @@ useLiveResource("updates", () => void loadOutcome());
-
+
diff --git a/ui/src/workflows/WorkflowSettings.vue b/ui/src/workflows/WorkflowSettings.vue
index b3441a872..bc6570990 100644
--- a/ui/src/workflows/WorkflowSettings.vue
+++ b/ui/src/workflows/WorkflowSettings.vue
@@ -43,7 +43,6 @@ async function loadAgents(): Promise {
await identities.loadOrg();
const response = await api.orgAgents<{ agents: Identity[] }>(identities.homeOrg);
agents.value = response.agents.filter((agent) => agent.lifecycle === "active");
- if (!text("identity") && agents.value.some((agent) => agent.id === SEEDED_AGENT_ID)) set("identity", SEEDED_AGENT_ID);
} catch (cause) {
identitiesError.value = String((cause as Error).message || cause);
} finally { identitiesLoading.value = false; }
@@ -86,7 +85,7 @@ const needs = computed<{ captures?: boolean; gate_retries?: number }>(() => {
Runs as