first commit

This commit is contained in:
2025-08-25 12:19:58 +03:30
parent f798e8e35c
commit 2f6a7242c4
20 changed files with 885 additions and 1302 deletions

BIN
resources/.DS_Store vendored

Binary file not shown.

View File

@@ -184,7 +184,7 @@ const isQuickRepliesVisible = computed(() => {
if (activeForm.value !== null) return false;
if (isConfirmationActive.value) return false;
if (isWebSearchEnabled.value) return false;
if (pendingConfirmationFormId.value !== null) return false;
if (pendingConfirmationFormId.value !== null) return false;
return true;
});
@@ -405,14 +405,14 @@ const handleMultiFormResponse = (userResponse) => {
const form = forms[activeMultiForm.value];
const currentStep = form.steps[currentFormStep.value];
multiFormData.value[currentStep.id] = userResponse;
if (pendingConfirmationFormId.value) {
confirmationData.value = { ...confirmationData.value, ...multiFormData.value };
return {
completed: true,
return {
completed: true,
data: confirmationData.value,
showConfirmationAgain: true
};
@@ -686,7 +686,7 @@ const handleConfirmation = (confirmed, message) => {
} else {
showConfirmation.value = false;
showStepSelection.value = true;
messageQueue.value.push({
sender: "bot",
type: "step-selection",
@@ -733,7 +733,7 @@ const handleMultiFormOptionClick = (stepId, option) => {
if (formResponse.completed) {
const form = forms[activeMultiForm.value];
if (formResponse.showConfirmationAgain) {
messageQueue.value.push({
sender: "bot",

File diff suppressed because it is too large Load Diff

View File

@@ -41,7 +41,90 @@ const credentials = ref({
const rememberMe = ref(false)
const loginDirect = async () => {
try {
const fakeUserData = {
id: 1,
fullName: 'Admin User',
username: 'admin',
email: 'admin@demo.com',
role: 'admin'
}
const fakeAbilityRules = [
{
action: 'manage',
subject: 'all'
}
]
const fakeAccessToken = 'fake-access-token-for-development'
useCookie('userAbilityRules').value = fakeAbilityRules
ability.update(fakeAbilityRules)
useCookie('userData').value = fakeUserData
useCookie('accessToken').value = fakeAccessToken
await nextTick(() => {
router.replace(route.query.to ? String(route.query.to) : '/')
})
} catch (err) {
console.error(err)
}
}
const loginAlwaysSuccess = async () => {
try {
/*
const res = await $api('/auth/login', {
method: 'POST',
body: {
email: credentials.value.email,
password: credentials.value.password,
},
onResponseError({ response }) {
// errors رو ignore می‌کنیم
console.log('Auth error ignored:', response._data.errors)
},
})
*/
const userData = {
id: 1,
fullName: 'Demo User',
username: 'demo',
email: credentials.value.email,
role: 'admin'
}
const userAbilityRules = [
{
action: 'manage',
subject: 'all'
}
]
const accessToken = 'demo-access-token'
useCookie('userAbilityRules').value = userAbilityRules
ability.update(userAbilityRules)
useCookie('userData').value = userData
useCookie('accessToken').value = accessToken
await nextTick(() => {
router.replace(route.query.to ? String(route.query.to) : '/')
})
} catch (err) {
console.error(err)
loginDirect()
}
}
const login = async () => {
if (process.env.NODE_ENV === 'development' || import.meta.env.DEV) {
return loginDirect()
}
try {
const res = await $api('/auth/login', {
method: 'POST',
@@ -69,10 +152,9 @@ const login = async () => {
}
const onSubmit = () => {
refVForm.value?.validate().then(({ valid: isValid }) => {
if (isValid)
login()
})
login()
}
</script>
@@ -86,18 +168,12 @@ const onSubmit = () => {
</div>
</RouterLink>
<VRow
no-gutters
class="auth-wrapper bg-surface"
>
<VCol
md="8"
class="d-none d-md-flex"
>
<VRow no-gutters class="auth-wrapper bg-surface">
<VCol md="8" class="d-none d-md-flex">
<div class="position-relative bg-background w-100 me-0">
<div
class="d-flex align-center justify-center w-100 h-100"
style="padding-inline: 6.25rem;"
style="padding-inline: 6.25rem"
>
<VImg
max-width="613"
@@ -112,7 +188,7 @@ const onSubmit = () => {
alt="auth-footer-mask"
height="280"
width="100"
>
/>
</div>
</VCol>
@@ -121,37 +197,19 @@ const onSubmit = () => {
md="4"
class="auth-card-v2 d-flex align-center justify-center"
>
<VCard
flat
:max-width="500"
class="mt-12 mt-sm-0 pa-4"
>
<VCard flat :max-width="500" class="mt-12 mt-sm-0 pa-4">
<VCardText>
<h4 class="text-h4 mb-1">
Welcome to <span class="text-capitalize"> {{ themeConfig.app.title }} </span>! 👋🏻
Welcome to
<span class="text-capitalize"> {{ themeConfig.app.title }} </span>!
</h4>
<p class="mb-0">
Please sign-in to your account and start the adventure
</p>
</VCardText>
<VCardText>
<VAlert
color="primary"
variant="tonal"
>
<p class="text-sm mb-2">
Admin Email: <strong>admin@demo.com</strong> / Pass: <strong>admin</strong>
</p>
<p class="text-sm mb-0">
Client Email: <strong>client@demo.com</strong> / Pass: <strong>client</strong>
</p>
</VAlert>
</VCardText>
<VCardText>
<VForm
ref="refVForm"
@submit.prevent="onSubmit"
>
<VForm ref="refVForm" @submit.prevent="onSubmit">
<VRow>
<!-- email -->
<VCol cols="12">
@@ -176,15 +234,16 @@ const onSubmit = () => {
:type="isPasswordVisible ? 'text' : 'password'"
autocomplete="password"
:error-messages="errors.password"
:append-inner-icon="isPasswordVisible ? 'tabler-eye-off' : 'tabler-eye'"
:append-inner-icon="
isPasswordVisible ? 'tabler-eye-off' : 'tabler-eye'
"
@click:append-inner="isPasswordVisible = !isPasswordVisible"
/>
<div class="d-flex align-center flex-wrap justify-space-between my-6">
<VCheckbox
v-model="rememberMe"
label="Remember me"
/>
<div
class="d-flex align-center flex-wrap justify-space-between my-6"
>
<VCheckbox v-model="rememberMe" label="Remember me" />
<RouterLink
class="text-primary ms-2 mb-1"
:to="{ name: 'forgot-password' }"
@@ -193,19 +252,11 @@ const onSubmit = () => {
</RouterLink>
</div>
<VBtn
block
type="submit"
>
Login
</VBtn>
<VBtn block type="submit"> Login </VBtn>
</VCol>
<!-- create account -->
<VCol
cols="12"
class="text-center"
>
<VCol cols="12" class="text-center">
<span>New on our platform?</span>
<RouterLink
class="text-primary ms-1"
@@ -214,20 +265,14 @@ const onSubmit = () => {
Create an account
</RouterLink>
</VCol>
<VCol
cols="12"
class="d-flex align-center"
>
<VCol cols="12" class="d-flex align-center">
<VDivider />
<span class="mx-4">or</span>
<VDivider />
</VCol>
<!-- auth providers -->
<VCol
cols="12"
class="text-center"
>
<VCol cols="12" class="text-center">
<AuthProvider />
</VCol>
</VRow>

View File

@@ -33,7 +33,7 @@ import * as demoCode from '@/views/demos/forms/tables/data-table/demoCodeDataTab
:code="demoCode.cellSlot"
no-padding
>
<DemoDataTableCellSlot />
<AgGridTable />
</AppCardCode>
</VCol>

View File

@@ -13,5 +13,13 @@ export async function loadFonts() {
})
}
export default function () {
loadFonts()
const idle = window.requestIdleCallback || (cb => setTimeout(cb, 1500))
idle(() => {
try {
loadFonts()
} catch (e) {
// If idle loading fails for any reason, fallback after a short delay
setTimeout(() => loadFonts(), 1000)
}
})
}

View File

@@ -189,7 +189,7 @@ const exportToPDF = () => {
:defaultColDef="defaultColDef"
:gridOptions="gridOptions"
@grid-ready="onGridReady"
@cell-value-changed="onCellValueChanged"
/>
</v-card-text>

View File

@@ -6,6 +6,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vuexy - Vuejs Admin Dashboard Template</title>
<link rel="stylesheet" type="text/css" href="{{ asset('loader.css') }}" />
<link rel="preconnect" href="https://fonts.googleapis.com" crossorigin>
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
@vite(['resources/js/main.js'])
</head>