mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-07 21:44:51 +00:00
- Vite 6 → 8 (Rolldown bundler), laravel-vite-plugin 1 → 3, @vitejs/plugin-vue 5 → 6 - Tailwind CSS 3 → 4 with CSS-based config (@theme, @plugin, @utility) - Add @tailwindcss/vite plugin, remove postcss/autoprefixer/sass - Convert SCSS files to plain CSS (resources/sass → resources/css) - Migrate tailwind.config.js to CSS @theme directives - Rename deprecated utility classes (shadow-sm→shadow-xs, outline-none→outline-hidden, rounded-sm→rounded-xs, bg-gradient-to→bg-linear-to, ring→ring-3) - Migrate opacity utilities to color modifiers (bg-opacity, text-opacity, border-opacity, ring-opacity → color/N syntax) - Update primary color CSS vars to full rgb() values for TW4 color-mix() - Fix border-l color specificity for sidebar navigation (TW4 default border color changed from gray-200 to currentColor) - Fix invalid border color classes (border-grey-light, border-modal-bg, border--200) - Add @reference directive for @apply in Vue component style blocks - Convert Vue component <style lang="scss"> blocks to plain CSS
107 lines
2.9 KiB
Vue
107 lines
2.9 KiB
Vue
<template>
|
|
<BaseWizardStep
|
|
:title="$t('wizard.verify_domain.title')"
|
|
:description="$t('wizard.verify_domain.desc')"
|
|
>
|
|
<div class="w-full">
|
|
<BaseInputGroup
|
|
:label="$t('wizard.verify_domain.app_domain')"
|
|
:error="v$.app_domain.$error && v$.app_domain.$errors[0].$message"
|
|
required
|
|
>
|
|
<BaseInput
|
|
v-model="formData.app_domain"
|
|
:invalid="v$.app_domain.$error"
|
|
type="text"
|
|
@input="v$.app_domain.$touch()"
|
|
/>
|
|
</BaseInputGroup>
|
|
</div>
|
|
|
|
<p class="mt-4 mb-0 text-sm text-gray-600">{{ $t('wizard.verify_domain.notes.notes') }}</p>
|
|
<ul class="w-full text-gray-600 list-disc list-inside">
|
|
<li class="text-sm leading-8">
|
|
{{ $t('wizard.verify_domain.notes.not_contain') }}
|
|
<b class="inline-block px-1 bg-gray-100 rounded-xs">https://</b> {{ $t('wizard.verify_domain.notes.or') }}
|
|
<b class="inline-block px-1 bg-gray-100 rounded-xs">http</b> {{ $t('wizard.verify_domain.notes.in_front') }}
|
|
</li>
|
|
<li class="text-sm leading-8">
|
|
{{ $t('wizard.verify_domain.notes.if_you') }}
|
|
<b class="inline-block px-1 bg-gray-100">localhost:8080</b>
|
|
</li>
|
|
</ul>
|
|
|
|
<BaseButton
|
|
:loading="isSaving"
|
|
:disabled="isSaving"
|
|
class="mt-8"
|
|
@click="verifyDomain"
|
|
>
|
|
{{ $t('wizard.verify_domain.verify_now') }}
|
|
</BaseButton>
|
|
</BaseWizardStep>
|
|
</template>
|
|
|
|
<script setup>
|
|
import { required, helpers } from '@vuelidate/validators'
|
|
import useVuelidate from '@vuelidate/core'
|
|
import { ref, inject, computed, reactive } from 'vue'
|
|
import { useInstallationStore } from '@/scripts/admin/stores/installation'
|
|
import { useNotificationStore } from '@/scripts/stores/notification'
|
|
import { useI18n } from 'vue-i18n'
|
|
|
|
const emit = defineEmits(['next'])
|
|
|
|
const formData = reactive({
|
|
app_domain: window.location.origin.replace(/(^\w+:|^)\/\//, ''),
|
|
})
|
|
const isSaving = ref(false)
|
|
const { t } = useI18n()
|
|
const utils = inject('utils')
|
|
const isUrl = (value) => utils.checkValidDomainUrl(value)
|
|
|
|
const installationStore = useInstallationStore()
|
|
const notificationStore = useNotificationStore()
|
|
|
|
const rules = {
|
|
app_domain: {
|
|
required: helpers.withMessage(t('validation.required'), required),
|
|
isUrl: helpers.withMessage(t('validation.invalid_domain_url'), isUrl),
|
|
},
|
|
}
|
|
|
|
const v$ = useVuelidate(
|
|
rules,
|
|
computed(() => formData)
|
|
)
|
|
|
|
async function verifyDomain() {
|
|
v$.value.$touch()
|
|
|
|
if (v$.value.$invalid) {
|
|
return true
|
|
}
|
|
|
|
isSaving.value = true
|
|
|
|
try {
|
|
await installationStore.setInstallationDomain(formData)
|
|
await installationStore.installationLogin()
|
|
let driverRes = await installationStore.checkAuthenticated()
|
|
|
|
if (driverRes.data) {
|
|
emit('next', 4)
|
|
}
|
|
|
|
isSaving.value = false
|
|
} catch (e) {
|
|
notificationStore.showNotification({
|
|
type: 'error',
|
|
message: t('wizard.verify_domain.failed'),
|
|
})
|
|
|
|
isSaving.value = false
|
|
}
|
|
}
|
|
</script>
|