Skip to content

Commit c51425b

Browse files
author
Lasim
committed
feat: add setup success message to Setup view and update translations, remove unused imports in Users view
1 parent 1d4b043 commit c51425b

File tree

4 files changed

+29
-9
lines changed

4 files changed

+29
-9
lines changed

services/frontend/src/components/AppSidebar.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import { ref, onMounted, defineProps, computed } from 'vue' // Added defineProps
33
import { useRouter } from 'vue-router'
44
import { useI18n } from 'vue-i18n'
5-
import { getEnv } from '@/utils/env' // Import getEnv
65
// import { cn } from '@/lib/utils' // cn might not be needed for root if $attrs.class is used directly
76
// import { ScrollArea } from '@/components/ui/scroll-area' // SidebarContent should handle scrolling
87

services/frontend/src/i18n/locales/en/setup.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ export default {
2626
description: 'Your DeployStack instance appears to be already configured. If you need to change settings, please consult the documentation or environment variables.',
2727
button: 'Go to Dashboard',
2828
},
29+
success: {
30+
title: 'Setup Successful',
31+
description: 'Setup was successful. Please restart the backend service to apply changes.',
32+
buttonAcknowledge: 'Go to Login',
33+
},
2934
buttons: {
3035
submit: 'Save Configuration',
3136
loading: 'Saving Configuration...',

services/frontend/src/views/Setup.vue

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,23 @@
1010
</CardHeader>
1111

1212
<CardContent>
13+
<!-- Setup success message -->
14+
<div v-if="setupSuccessMessageVisible" class="text-center">
15+
<Alert class="mb-4" variant="default">
16+
<CheckCircle class="h-4 w-4" />
17+
<AlertTitle>{{ $t('setup.success.title') }}</AlertTitle>
18+
<AlertDescription>
19+
{{ $t('setup.success.description') }}
20+
</AlertDescription>
21+
</Alert>
22+
<!-- Optionally, add a button to go to login or elsewhere -->
23+
<Button @click="goToLogin" class="w-full mt-4">
24+
{{ $t('setup.success.buttonAcknowledge') }}
25+
</Button>
26+
</div>
27+
1328
<!-- Already configured message -->
14-
<div v-if="databaseStore.canProceedToApp" class="text-center">
29+
<div v-else-if="databaseStore.canProceedToApp" class="text-center">
1530
<Alert class="mb-4">
1631
<CheckCircle class="h-4 w-4" />
1732
<AlertTitle>{{ $t('setup.alreadyConfigured.title') }}</AlertTitle>
@@ -76,7 +91,7 @@
7691
</template>
7792

7893
<script setup lang="ts">
79-
import { onMounted } from 'vue';
94+
import { onMounted, ref } from 'vue';
8095
import { useRouter } from 'vue-router';
8196
import { useForm } from 'vee-validate';
8297
import { toTypedSchema } from '@vee-validate/zod';
@@ -119,6 +134,8 @@ const formSchema = toTypedSchema(
119134
})
120135
);
121136
137+
const setupSuccessMessageVisible = ref(false);
138+
122139
const form = useForm({
123140
validationSchema: formSchema,
124141
initialValues: {
@@ -128,14 +145,17 @@ const form = useForm({
128145
129146
const onSubmit = form.handleSubmit(async (values) => {
130147
databaseStore.clearError();
148+
setupSuccessMessageVisible.value = false; // Reset on new submission
131149
132150
const success = await databaseStore.setupDatabase({
133151
type: values.type,
134152
});
135153
136154
if (success) {
137-
// Redirect to login after successful setup
138-
router.push('/login');
155+
// Display success message instead of immediate redirect
156+
setupSuccessMessageVisible.value = true;
157+
// Optionally, still check status to update canProceedToApp if needed
158+
await databaseStore.checkDatabaseStatus(true);
139159
}
140160
});
141161

services/frontend/src/views/admin/Users.vue

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@
77
</template>
88

99
<script setup lang="ts">
10-
import { useI18n } from 'vue-i18n'
11-
12-
const { t } = useI18n()
13-
1410
// Define page title for use in DashboardLayout or similar
1511
// This is a common pattern but might need adjustment based on your layout component
1612
// definePageMeta({

0 commit comments

Comments
 (0)