|
|
|
|
<!doctype html>
|
|
|
|
|
<html>
|
|
|
|
|
<head>
|
|
|
|
|
<meta charset="UTF-8">
|
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
|
|
<meta name="description" content="应用设置" details="配置应用的基本信息">
|
|
|
|
|
<title>应用设置</title>
|
|
|
|
|
</head>
|
|
|
|
|
<style>
|
|
|
|
|
body {
|
|
|
|
|
padding: var(--spacing-lg);
|
|
|
|
|
background-color: var(--bg-color-secondary);
|
|
|
|
|
color: var(--text-color);
|
|
|
|
|
}
|
|
|
|
|
.section-title {
|
|
|
|
|
font-size: 1.25rem;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
margin-bottom: var(--spacing-lg);
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 0.5rem;
|
|
|
|
|
color: var(--text-color);
|
|
|
|
|
}
|
|
|
|
|
.settings-section {
|
|
|
|
|
background-color: var(--bg-color);
|
|
|
|
|
border-radius: var(--radius-lg);
|
|
|
|
|
padding: var(--spacing-xl);
|
|
|
|
|
box-shadow: var(--shadow-md);
|
|
|
|
|
margin-bottom: var(--spacing-xl);
|
|
|
|
|
}
|
|
|
|
|
.form-group {
|
|
|
|
|
margin-bottom: var(--spacing-lg);
|
|
|
|
|
}
|
|
|
|
|
.form-label {
|
|
|
|
|
display: block;
|
|
|
|
|
margin-bottom: 0.5rem;
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
color: var(--text-color-secondary);
|
|
|
|
|
}
|
|
|
|
|
.form-actions {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: flex-end;
|
|
|
|
|
gap: var(--spacing-md);
|
|
|
|
|
margin-top: var(--spacing-xl);
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
<body>
|
|
|
|
|
<div class="settings-section">
|
|
|
|
|
<div class="section-title">
|
|
|
|
|
<i class="fa-solid fa-gear"></i> 基本设置
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label class="form-label">应用名称</label>
|
|
|
|
|
<v-input v:value="form.name" placeholder="请输入应用名称"></v-input>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label class="form-label">应用图标 (URL)</label>
|
|
|
|
|
<v-input v:value="form.icon" placeholder="请输入图标链接"></v-input>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label class="form-label">应用描述</label>
|
|
|
|
|
<v-input type="textarea" v:value="form.des" placeholder="请输入应用描述"></v-input>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="form-actions">
|
|
|
|
|
<v-btn :click="saveSettings" :loading="loading" variant="primary">保存更改</v-btn>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</body>
|
|
|
|
|
<script setup>
|
|
|
|
|
form = {
|
|
|
|
|
name: $G.app?.name || '',
|
|
|
|
|
icon: $G.app?.icon || '',
|
|
|
|
|
des: $G.app?.des || ''
|
|
|
|
|
}
|
|
|
|
|
loading = false
|
|
|
|
|
|
|
|
|
|
saveSettings = () => {
|
|
|
|
|
loading = true
|
|
|
|
|
$axios.patch(`/api/app/${$G.app.id}`, form).then(res => {
|
|
|
|
|
$message.success('保存成功')
|
|
|
|
|
Object.assign($G.app, form)
|
|
|
|
|
}).catch(e => {
|
|
|
|
|
$message.error(e.message || '保存失败')
|
|
|
|
|
}).finally(() => {
|
|
|
|
|
loading = false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
<script>
|
|
|
|
|
$watch(() => $G.app, () => {
|
|
|
|
|
if ($G.app && $G.app.id && (!$data.form.name || $data.form.name !== $G.app.name)) {
|
|
|
|
|
// Only update if form is empty or mismatch, but usually we just want init
|
|
|
|
|
// For simplicity, just update if we have data now
|
|
|
|
|
$data.form.name = $G.app.name
|
|
|
|
|
$data.form.icon = $G.app.icon
|
|
|
|
|
$data.form.des = $G.app.des
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
</script>
|
|
|
|
|
</html>
|