fix frontend
This commit is contained in:
@@ -70,7 +70,9 @@
|
||||
import { ref, onMounted } from 'vue';
|
||||
import AppLayout from '../components/Layout/AppLayout.vue';
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { useNotification } from '../composables/useNotification'
|
||||
|
||||
const { showNotification } = useNotification()
|
||||
const { t, locale } = useI18n()
|
||||
interface FieldMeta {
|
||||
key: string;
|
||||
@@ -92,7 +94,7 @@ async function loadMeta() {
|
||||
if (res.ok) {
|
||||
meta.value = await res.json();
|
||||
} else {
|
||||
showMessage('Failed to load settings metadata', 'bg-red-50 text-red-800');
|
||||
showNotification('settings.loadMetaError', 'error');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,7 +103,7 @@ async function loadValues() {
|
||||
if (res.ok) {
|
||||
values.value = await res.json();
|
||||
} else {
|
||||
showMessage('Failed to load settings values', 'bg-red-50 text-red-800');
|
||||
showNotification('settings.loadMetaError', 'error');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,12 +119,12 @@ async function saveSettings() {
|
||||
body: JSON.stringify(values.value),
|
||||
});
|
||||
if (res.ok) {
|
||||
showMessage('Settings saved successfully', 'bg-green-50 text-green-800');
|
||||
showNotification('settings.saveSuccess', 'success');
|
||||
} else {
|
||||
showMessage('Failed to save settings', 'bg-red-50 text-red-800');
|
||||
showNotification('settings.saveError', 'error');
|
||||
}
|
||||
} catch (e) {
|
||||
showMessage('Network error', 'bg-red-50 text-red-800');
|
||||
showNotification('common.networkError', 'error');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user