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
977 B
TypeScript

/*
* app.ts
* Copyright (C) 2024 veypi <i@veypi.com>
* 2024-10-23 15:35
* Distributed under terms of the GPL license.
*/
4 weeks ago
import { v, proxy, vfor } from "../v2dom";
import logic from '../logic'
4 weeks ago
import api from "../api";
import * as typs from "../typs"
4 weeks ago
export default () => {
let apps: typs.App[] = proxy.Watch([])
api.app.List({}).then(e => {
4 weeks ago
apps.push(...e.filter((i) => i.user_status === 'ok'))
4 weeks ago
})
return v({
class: 'voa-apps',
children: [
4 weeks ago
v('voa-apps-header',
[v({
class: 'voa-item-title',
children: ['我的应用'],
4 weeks ago
onclick: () => {
4 weeks ago
logic.goto('/')
4 weeks ago
}
4 weeks ago
})]
),
v('voa-apps-body', [
vfor(apps,
(data) => v({
class: 'voa-apps-box',
3 weeks ago
children: [v('img', '', { src: () => logic.urlwarp(data.icon) })],
4 weeks ago
onclick: () => {
logic.goto(`/app/${data.id}`)
}
}))
4 weeks ago
])
]
})
}