/* * app.ts * Copyright (C) 2024 veypi * 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 voa-item', children: [ v('voa-apps-header voa-item-header', [v({ class: 'voa-item-title', children: ['ζˆ‘ηš„εΊ”η”¨'], onclick: () => { logic.goto('/') } })] ), v('voa-apps-body voa-item-body vflex', [ vfor(apps, (data) => v({ class: 'voa-apps-box', children: [v('img', '', { src: () => logic.urlwarp(data.icon) })], onclick: () => { logic.goto(`/app/${data.id}`) } })) ]) ] }) }