Feature(custom): route to dashboard page before tutorial s… (#25)

*  Feature(custom): route to dashboard page before tutorial start

* 🐛 Fix(custom): fix mount config update and delete bugs
This commit is contained in:
Kuingsmile
2025-07-02 16:55:23 +08:00
committed by GitHub
parent 1905792f90
commit 4d6f6185fd
11 changed files with 339 additions and 68 deletions

View File

@@ -1,6 +1,6 @@
<script setup lang="ts">
import { ref, reactive, computed, onMounted, watch } from 'vue'
import { useRoute } from 'vue-router'
import { useRoute, useRouter } from 'vue-router'
import { useAppStore } from '../stores/app'
import { useTranslation } from '../composables/useI18n'
import { Settings, Server, HardDrive, Save, RotateCcw, AlertCircle, CheckCircle, Play } from 'lucide-vue-next'
@@ -8,6 +8,7 @@ import { enable, isEnabled, disable } from '@tauri-apps/plugin-autostart'
const store = useAppStore()
const route = useRoute()
const router = useRouter()
const { t } = useTranslation()
const isSaving = ref(false)
const message = ref('')
@@ -126,6 +127,11 @@ const handleSave = async () => {
}
}
async function startTutorial() {
router.push({ name: 'Dashboard' })
store.startTutorial()
}
const handleReset = async () => {
if (!confirm(t('settings.confirmReset'))) {
return
@@ -347,7 +353,7 @@ const handleReset = async () => {
<div class="form-grid">
<div class="form-group">
<button @click="store.startTutorial()" class="tutorial-btn" type="button">
<button @click="startTutorial" class="tutorial-btn" type="button">
<Play :size="16" />
{{ t('settings.app.tutorial.restart') }}
</button>