categories in toes list --all
This commit is contained in:
parent
a56af4ed47
commit
e4310bda6d
|
|
@ -79,11 +79,28 @@ interface ListAppsOptions {
|
|||
}
|
||||
|
||||
export async function listApps(options: ListAppsOptions) {
|
||||
const apps: App[] | undefined = await get('/api/apps')
|
||||
if (!apps) return
|
||||
const allApps: App[] | undefined = await get('/api/apps')
|
||||
if (!allApps) return
|
||||
|
||||
const filtered = apps.filter((app) => {
|
||||
if (options.all) return true
|
||||
if (options.all) {
|
||||
const apps = allApps.filter((app) => !app.tool)
|
||||
const tools = allApps.filter((app) => app.tool)
|
||||
|
||||
if (apps.length > 0) {
|
||||
console.log('apps:')
|
||||
for (const app of apps) {
|
||||
console.log(` ${STATE_ICONS[app.state] ?? '◯'} ${app.name}`)
|
||||
}
|
||||
}
|
||||
if (tools.length > 0) {
|
||||
if (apps.length > 0) console.log()
|
||||
console.log('tools:')
|
||||
for (const tool of tools) {
|
||||
console.log(` ${STATE_ICONS[tool.state] ?? '◯'} ${tool.name}`)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
const filtered = allApps.filter((app) => {
|
||||
if (options.tools) return app.tool
|
||||
return !app.tool
|
||||
})
|
||||
|
|
@ -92,6 +109,7 @@ export async function listApps(options: ListAppsOptions) {
|
|||
console.log(`${STATE_ICONS[app.state] ?? '◯'} ${app.name}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
interface NewAppOptions {
|
||||
ssr?: boolean
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user