export const getLogDates = (name: string): Promise => fetch(`/api/apps/${name}/logs/dates`).then(r => r.json()) export const getLogsForDate = (name: string, date: string): Promise => fetch(`/api/apps/${name}/logs?date=${date}`).then(r => r.json()) export const getWifiConfig = (): Promise<{ network: string, password: string }> => fetch('/api/system/wifi').then(r => r.json()) export const saveWifiConfig = (config: { network: string, password: string }) => fetch('/api/system/wifi', { method: 'PUT', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(config), }).then(r => r.json()) export const shareApp = (name: string) => fetch(`/api/apps/${name}/tunnel`, { method: 'POST' }) export const unshareApp = (name: string) => fetch(`/api/apps/${name}/tunnel`, { method: 'DELETE' }) export const restartApp = (name: string) => fetch(`/api/apps/${name}/restart`, { method: 'POST' }) export const startApp = (name: string) => fetch(`/api/apps/${name}/start`, { method: 'POST' }) export const stopApp = (name: string) => fetch(`/api/apps/${name}/stop`, { method: 'POST' })