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:
1 parent
d251ec73d0
commit
dcc3d7f2d5
12 files changed
+316
-93
No files matched your search
@@ -5,10 +5,6 @@
|
||||
<h1>PKI 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">
|
||||
<div class="config-row">
|
||||
<div class="config-col">
|
||||
@@ -176,8 +172,10 @@
|
||||
import { ref, computed, onMounted, onUnmounted, reactive } from 'vue';
|
||||
|
||||
import { useApi } from '../composables/useApi';
|
||||
import { useToast } from '../composables/useToast';
|
||||
|
||||
const { profilesApiClient } = useApi();
|
||||
const toast = useToast();
|
||||
|
||||
// State
|
||||
const form = reactive({
|
||||
@@ -198,12 +196,6 @@ const form = reactive({
|
||||
easyrsa_batch: true
|
||||
});
|
||||
|
||||
const message = reactive({
|
||||
text: '',
|
||||
type: 'success', // success, warning, error (mapped to css classes)
|
||||
icon: 'fa-check-circle'
|
||||
});
|
||||
|
||||
const isLoading = ref(false);
|
||||
const action = ref(''); // 'save', 'init', 'clear'
|
||||
|
||||
@@ -225,16 +217,7 @@ const stepText = computed(() => STEP_TEXTS[initStatus.step] || 'Initializing PKI
|
||||
let pollTimer = null;
|
||||
|
||||
// Methods
|
||||
const showMessage = (text, type = 'success') => {
|
||||
message.text = text;
|
||||
message.type = type;
|
||||
message.icon = type === 'success' ? 'fa-check-circle' : type === 'warning' ? 'fa-exclamation-triangle' : 'fa-exclamation-circle';
|
||||
|
||||
// Auto hide
|
||||
setTimeout(() => {
|
||||
message.text = '';
|
||||
}, 4000);
|
||||
};
|
||||
const showMessage = (text, type = 'success') => toast.show(text, type);
|
||||
|
||||
// API Fetch Wrapper
|
||||
// API Wrapper removed, using profilesApiClient directly
|
||||
|
||||
Reference in new issue
Block a user