This commit is contained in:
2026-04-18 12:20:44 +03:00
parent af757ff224
commit 2068154656
13 changed files with 423 additions and 92 deletions

View File

@@ -0,0 +1,37 @@
<template>
<AppLayout>
<div class="card">
<h1 class="text-2xl font-bold mb-6">Application Settings</h1>
<form @submit.prevent="saveSettings" class="space-y-4 max-w-lg">
<div v-for="(value, key) in settings" :key="key">
<label class="block text-sm font-medium text-gray-700">{{ key }}</label>
<input v-model="settings[key]" type="text" class="input-field mt-1" />
</div>
<button type="submit" class="btn-primary">Save Changes</button>
</form>
</div>
</AppLayout>
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue'
import AppLayout from '../components/Layout/AppLayout.vue'
const settings = ref<Record<string, string>>({})
async function loadSettings() {
const res = await fetch('/api/settings')
settings.value = await res.json()
}
async function saveSettings() {
await fetch('/api/admin/settings', {
method: 'PUT',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(settings.value)
})
alert('Settings saved')
}
onMounted(loadSettings)
</script>