|
@@ -15,6 +15,7 @@ import { useLayout } from "@/context/layout"
|
|
|
import { useFile } from "@/context/file"
|
|
import { useFile } from "@/context/file"
|
|
|
import { useLanguage } from "@/context/language"
|
|
import { useLanguage } from "@/context/language"
|
|
|
import { decode64 } from "@/utils/base64"
|
|
import { decode64 } from "@/utils/base64"
|
|
|
|
|
+import { getRelativeTime } from "@/utils/time"
|
|
|
|
|
|
|
|
type EntryType = "command" | "file" | "session"
|
|
type EntryType = "command" | "file" | "session"
|
|
|
|
|
|
|
@@ -30,6 +31,7 @@ type Entry = {
|
|
|
directory?: string
|
|
directory?: string
|
|
|
sessionID?: string
|
|
sessionID?: string
|
|
|
archived?: number
|
|
archived?: number
|
|
|
|
|
+ updated?: number
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
type DialogSelectFileMode = "all" | "files"
|
|
type DialogSelectFileMode = "all" | "files"
|
|
@@ -120,6 +122,7 @@ export function DialogSelectFile(props: { mode?: DialogSelectFileMode; onOpenFil
|
|
|
title: string
|
|
title: string
|
|
|
description: string
|
|
description: string
|
|
|
archived?: number
|
|
archived?: number
|
|
|
|
|
+ updated?: number
|
|
|
}): Entry => ({
|
|
}): Entry => ({
|
|
|
id: `session:${input.directory}:${input.id}`,
|
|
id: `session:${input.directory}:${input.id}`,
|
|
|
type: "session",
|
|
type: "session",
|
|
@@ -129,6 +132,7 @@ export function DialogSelectFile(props: { mode?: DialogSelectFileMode; onOpenFil
|
|
|
directory: input.directory,
|
|
directory: input.directory,
|
|
|
sessionID: input.id,
|
|
sessionID: input.id,
|
|
|
archived: input.archived,
|
|
archived: input.archived,
|
|
|
|
|
+ updated: input.updated,
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
const list = createMemo(() => allowed().map(commandItem))
|
|
const list = createMemo(() => allowed().map(commandItem))
|
|
@@ -214,6 +218,7 @@ export function DialogSelectFile(props: { mode?: DialogSelectFileMode; onOpenFil
|
|
|
description,
|
|
description,
|
|
|
directory,
|
|
directory,
|
|
|
archived: s.time?.archived,
|
|
archived: s.time?.archived,
|
|
|
|
|
+ updated: s.time?.updated,
|
|
|
})),
|
|
})),
|
|
|
)
|
|
)
|
|
|
.catch(() => [] as { id: string; title: string; description: string; directory: string; archived?: number }[])
|
|
.catch(() => [] as { id: string; title: string; description: string; directory: string; archived?: number }[])
|
|
@@ -384,6 +389,11 @@ export function DialogSelectFile(props: { mode?: DialogSelectFileMode; onOpenFil
|
|
|
</Show>
|
|
</Show>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <Show when={item.updated}>
|
|
|
|
|
+ <span class="text-12-regular text-text-weak whitespace-nowrap ml-2">
|
|
|
|
|
+ {getRelativeTime(new Date(item.updated!).toISOString())}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </Show>
|
|
|
</div>
|
|
</div>
|
|
|
</Match>
|
|
</Match>
|
|
|
</Switch>
|
|
</Switch>
|