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
.DS_Store vendored

Binary file not shown.

0
README.md Normal file
View File

BIN
app/.DS_Store vendored

Binary file not shown.

View File

@@ -0,0 +1,215 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Http\JsonResponse;
use Illuminate\Support\Facades\Validator;
class TaskController extends Controller
{
/**
* Display a listing of tasks
*/
public function index(): JsonResponse
{
// Sample data - in real app, this would come from database
$tasks = [
[
'id' => 1,
'text' => 'Project Planning',
'start_date' => '2024-01-01',
'duration' => 5,
'progress' => 100,
'priority' => 'high',
'notes' => 'Initial project planning and requirements gathering',
'parent' => null
],
[
'id' => 2,
'text' => 'Design Phase',
'start_date' => '2024-01-06',
'duration' => 10,
'progress' => 60,
'priority' => 'medium',
'notes' => 'UI/UX design and wireframing',
'parent' => null
],
[
'id' => 3,
'text' => 'Development',
'start_date' => '2024-01-16',
'duration' => 15,
'progress' => 30,
'priority' => 'high',
'notes' => 'Core development work',
'parent' => null
],
[
'id' => 4,
'text' => 'Testing',
'start_date' => '2024-01-31',
'duration' => 7,
'progress' => 0,
'priority' => 'medium',
'notes' => 'Quality assurance and testing',
'parent' => null
],
[
'id' => 5,
'text' => 'Deployment',
'start_date' => '2024-02-07',
'duration' => 3,
'progress' => 0,
'priority' => 'critical',
'notes' => 'Production deployment and launch',
'parent' => null
],
[
'id' => 6,
'text' => 'Frontend Development',
'start_date' => '2024-01-16',
'duration' => 8,
'progress' => 40,
'priority' => 'high',
'notes' => 'Vue.js frontend development',
'parent' => 3
],
[
'id' => 7,
'text' => 'Backend Development',
'start_date' => '2024-01-24',
'duration' => 7,
'progress' => 20,
'priority' => 'high',
'notes' => 'Laravel backend development',
'parent' => 3
]
];
return response()->json([
'success' => true,
'data' => $tasks,
'message' => 'Tasks retrieved successfully'
]);
}
/**
* Store a newly created task
*/
public function store(Request $request): JsonResponse
{
$validator = Validator::make($request->all(), [
'text' => 'required|string|max:255',
'start_date' => 'required|date',
'duration' => 'required|integer|min:1',
'priority' => 'required|in:low,medium,high,critical',
'notes' => 'nullable|string',
'parent' => 'nullable|integer'
]);
if ($validator->fails()) {
return response()->json([
'success' => false,
'message' => 'Validation failed',
'errors' => $validator->errors()
], 422);
}
// In real app, save to database
$task = [
'id' => rand(1000, 9999), // Generate random ID for demo
'text' => $request->text,
'start_date' => $request->start_date,
'duration' => $request->duration,
'progress' => 0,
'priority' => $request->priority,
'notes' => $request->notes,
'parent' => $request->parent
];
return response()->json([
'success' => true,
'data' => $task,
'message' => 'Task created successfully'
], 201);
}
/**
* Display the specified task
*/
public function show(int $id): JsonResponse
{
// Sample task data - in real app, fetch from database
$task = [
'id' => $id,
'text' => 'Sample Task',
'start_date' => '2024-01-01',
'duration' => 5,
'progress' => 50,
'priority' => 'medium',
'notes' => 'This is a sample task',
'parent' => null
];
return response()->json([
'success' => true,
'data' => $task,
'message' => 'Task retrieved successfully'
]);
}
/**
* Update the specified task
*/
public function update(Request $request, int $id): JsonResponse
{
$validator = Validator::make($request->all(), [
'text' => 'required|string|max:255',
'start_date' => 'required|date',
'duration' => 'required|integer|min:1',
'priority' => 'required|in:low,medium,high,critical',
'notes' => 'nullable|string',
'parent' => 'nullable|integer'
]);
if ($validator->fails()) {
return response()->json([
'success' => false,
'message' => 'Validation failed',
'errors' => $validator->errors()
], 422);
}
// In real app, update in database
$task = [
'id' => $id,
'text' => $request->text,
'start_date' => $request->start_date,
'duration' => $request->duration,
'progress' => $request->progress ?? 0,
'priority' => $request->priority,
'notes' => $request->notes,
'parent' => $request->parent
];
return response()->json([
'success' => true,
'data' => $task,
'message' => 'Task updated successfully'
]);
}
/**
* Remove the specified task
*/
public function destroy(int $id): JsonResponse
{
// In real app, delete from database
return response()->json([
'success' => true,
'message' => 'Task deleted successfully'
]);
}
}

2
components.d.ts vendored
View File

@@ -12,6 +12,7 @@ declare module 'vue' {
AddEditPermissionDialog: typeof import('./resources/js/components/dialogs/AddEditPermissionDialog.vue')['default']
AddEditRoleDialog: typeof import('./resources/js/components/dialogs/AddEditRoleDialog.vue')['default']
AddPaymentMethodDialog: typeof import('./resources/js/components/dialogs/AddPaymentMethodDialog.vue')['default']
AgGridTable: typeof import('./resources/js/views/demos/forms/tables/data-table/AgGridTable.vue')['default']
AnalysisCard: typeof import('./resources/js/components/AnalysisCard.vue')['default']
AppAutocomplete: typeof import('./resources/js/@core/components/app-form-elements/AppAutocomplete.vue')['default']
AppBarSearch: typeof import('./resources/js/@core/components/AppBarSearch.vue')['default']
@@ -133,7 +134,6 @@ declare module 'vue' {
DemoCustomInputCustomRadiosWithIcon: typeof import('./resources/js/views/demos/forms/form-elements/custom-input/DemoCustomInputCustomRadiosWithIcon.vue')['default']
DemoCustomInputCustomRadiosWithImage: typeof import('./resources/js/views/demos/forms/form-elements/custom-input/DemoCustomInputCustomRadiosWithImage.vue')['default']
DemoDataTableBasic: typeof import('./resources/js/views/demos/forms/tables/data-table/DemoDataTableBasic.vue')['default']
DemoDataTableCellSlot: typeof import('./resources/js/views/demos/forms/tables/data-table/DemoDataTableCellSlot.vue')['default']
DemoDataTableDense: typeof import('./resources/js/views/demos/forms/tables/data-table/DemoDataTableDense.vue')['default']
DemoDataTableExpandableRows: typeof import('./resources/js/views/demos/forms/tables/data-table/DemoDataTableExpandableRows.vue')['default']
DemoDataTableExternalPagination: typeof import('./resources/js/views/demos/forms/tables/data-table/DemoDataTableExternalPagination.vue')['default']

BIN
database/.DS_Store vendored

Binary file not shown.

BIN
public/.DS_Store vendored

Binary file not shown.

1
public/hot Normal file
View File

@@ -0,0 +1 @@
http://localhost:5173

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;
});

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>

View File

@@ -4,6 +4,7 @@ use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\OpenRouterController;
use App\Http\Controllers\AuthController;
use App\Http\Controllers\TaskController;
/*
|--------------------------------------------------------------------------
@@ -28,3 +29,6 @@ Route::prefix('openrouter')->group(function () {
Route::post('/send-message', [OpenRouterController::class, 'sendMessage']);
Route::get('/models', [OpenRouterController::class, 'getModels']);
});
// مسیرهای Tasks
Route::apiResource('tasks', TaskController::class);

BIN
storage/.DS_Store vendored

Binary file not shown.

BIN
tests/.DS_Store vendored

Binary file not shown.

BIN
vendor/.DS_Store vendored

Binary file not shown.