mirror of https://github.com/veypi/OneAuth.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
962 B
TypeScript
44 lines
962 B
TypeScript
/*
|
|
* app.ts
|
|
* Copyright (C) 2024 veypi <i@veypi.com>
|
|
* 2024-10-23 15:35
|
|
* Distributed under terms of the GPL license.
|
|
*/
|
|
|
|
import { v, proxy, vfor } from "../v2dom";
|
|
import logic from '../logic'
|
|
import api from "../api";
|
|
import * as typs from "../typs"
|
|
|
|
|
|
export default () => {
|
|
let apps: typs.App[] = proxy.Watch([])
|
|
api.app.List({}).then(e => {
|
|
apps.push(...e.filter((i) => i.user_status === 'ok'))
|
|
})
|
|
return v({
|
|
class: 'voa-apps',
|
|
children: [
|
|
v('voa-apps-header',
|
|
[v({
|
|
class: 'voa-item-title',
|
|
children: ['我的应用'],
|
|
onclick: () => {
|
|
logic.goto('/')
|
|
}
|
|
})]
|
|
),
|
|
v('voa-apps-body', [
|
|
vfor(apps,
|
|
(data) => v({
|
|
class: 'voa-apps-box',
|
|
children: [v('img', '', { src: () => data.icon })],
|
|
onclick: () => {
|
|
logic.goto(`/app/${data.id}`)
|
|
}
|
|
}))
|
|
])
|
|
]
|
|
})
|
|
}
|