UI: shared toast notifications in the bottom-right corner

- useToast composable and ToastContainer (mounted once in App.vue):
  stacked toasts with icon, close button and progress bar, hover pause,
  slide-in animation, aria roles, full width on phones.
- Light and dark theme colour tokens; old .toast-message styles removed.
- PKIConfig, VPNConfig, ServerManagement and Certificates use the shared
  toast through thin showMessage/showToast wrappers.
- Docs: plan and summary in DOCS/Changes, README, Index.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
ayurishchevandClaude Sonnet 5.5 committed 2026-10-04 21:05:41 +03:00
1 parent d251ec73d0
commit dcc3d7f2d5
12 files changed
+316 -93

No files matched your search

+3 -15
View File
@@ -5,10 +5,6 @@
<h1>Server Infrastructure Configuration</h1>
</div>
<div v-if="message.text" :class="['toast-message', 'toast-' + message.type, 'show']">
<i :class="['fas', message.icon]"></i> {{ message.text }}
</div>
<form @submit.prevent="handleSave">
<!-- Basic Network -->
<div class="config-row">
@@ -257,8 +253,10 @@
<script setup>
import { ref, onMounted, reactive, watch } from 'vue';
import { useApi } from '../composables/useApi';
import { useToast } from '../composables/useToast';
const { profilesApiClient } = useApi();
const toast = useToast();
// State
const form = reactive({
@@ -285,11 +283,6 @@ const form = reactive({
const isSplitTunnel = ref(false);
const message = reactive({
text: '',
type: 'success',
icon: 'fa-check-circle'
});
const isLoading = ref(false);
const action = ref('');
@@ -309,12 +302,7 @@ function maskToCidr(mask) {
}
// Methods
const showMessage = (text, type = 'success') => {
message.text = text;
message.type = type;
message.icon = type === 'success' ? 'fa-check-circle' : 'fa-exclamation-circle';
setTimeout(() => message.text = '', 5000);
};
const showMessage = (text, type = 'success') => toast.show(text, type);
const addRoute = () => form.split_routes.push('');
const removeRoute = (idx) => form.split_routes.splice(idx, 1);