���Root Mod By V1rus_Alfa
User / IP
:
216.73.217.78
Host / Server
:
195.214.235.115 / npln.ir
System
:
Linux damavand.pws-dns.net 5.14.0-503.35.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Apr 4 05:23:43 EDT 2025 x86_64
Command
|
Upload
|
Mass Deface
|
Create
:
/
home2
/
cutunixc
/
.trash
/
pages
/
project
/
Viewing: index.vue
<script setup lang="ts"> // import modules const { t } = useI18n() definePageMeta({ title: 'Projects', middleware: ['auth'], }) useHead ({ title: t('Projects') }) // set const global const localePath = useLocalePath() const toast = useToast() const isOpenProject = ref(false); const loadingEdit = ref(false); const loadingPageNext = ref(false); const loadingPagepre = ref(false); const state = reactive({ project_id: undefined, name: undefined, name_employer: undefined, page: 1, }) const requestParams = computed(() => { return { page: state.page, }; }); // Fetch List const { data, pending, error, refresh } = await useAPI( '/analyze/project/get', { query: requestParams, immediate: true, server: true, transform: (mountains:any) => { return JSON.parse(mountains).data; }, onResponse({ request, response, options }) { loadingPageNext.value=false; loadingPagepre.value=false; } }) // Methods const handelPage = (type:any) => { if(type == 'increment'){ loadingPageNext.value=true; state.page = state.page + 1 refresh(); }else if( state.page != 1 ){ loadingPagepre.value=true; state.page = state.page - 1 refresh(); } } //methods const ToggleModal = (obj:any) => { state.project_id =obj['id']; state.name =obj['name']; state.name_employer =obj['name_employer']; isOpenProject.value = true; } // Project request async function ProjectReq () { if(!state.name){ return toast.add({ title: t('project_name') ,color:"orange"})} if(!state.name_employer ){ return toast.add({ title: t('Employer name') ,color:"orange"})} if(!state.project_id ){ return toast.add({ title: t('refresh page') ,color:"orange"})} loadingEdit.value=true; await useAPI( '/analyze/project/edit', { method: 'POST', body: { project_id:state.project_id, name:state.name, name_employer:state.name_employer, } , immediate: true, server: true, }) loadingEdit.value=false; isOpenProject.value=false; refresh(); } // Delete request async function Delete (id:any) { loadingEdit.value=true; await useAPI( '/analyze/project/delete', { method: 'POST', body: { project_id:id, } , immediate: true, server: true, }) loadingEdit.value=false; refresh(); } </script> <template> <div> <UModal v-model="isOpenProject" class=" !top-0"> <div :dir="$i18n.locale == 'en' ? 'ltr' : 'rtl'" class=" flex justify-between items-center p-2"> <span class=" block bold text-xs truncate !top-0 !bottom-auto !justify-start "> {{ t('Project Information') }} </span> <UButton color="gray" variant="ghost" icon="i-heroicons-x-mark-20-solid" class="-my-1" @click="isOpenProject = false" /> </div> <div :dir="$i18n.locale == 'en' ? 'ltr' : 'rtl'" class=" h-96 w-full mb-6 mt-3 px-4 pt-3 max-h-full overflow-y-auto " > <div class=" flex justify-start items-center w-full mb-3"> <label :class="$i18n.locale == 'en' ? ' text-left' : ' text-right'" class="block w-4/12 text-gray-500 bg-white text-xs "> {{ t('Project Name') }} </label> <UInput variant="outline" class="w-9/12" :inputClass="' w-full !shadow-none focus:ring-1 rounded-sm focus:ring-orange-600 h-7 pl-2 py-0 text-xs' " v-model="state.name" /> </div> <div class=" flex justify-start items-center w-full mb-3"> <label :class="$i18n.locale == 'en' ? ' text-left' : ' text-right'" class="block w-4/12 text-gray-500 bg-white text-xs "> {{ t('Name Of Employer') }} </label> <UInput :loading="false" variant="outline" class="w-9/12" :inputClass="' w-full !shadow-none focus:ring-1 rounded-sm focus:ring-orange-600 h-7 pl-2 py-0 text-xs' " v-model="state.name_employer" /> </div> </div> <div class=" flex justify-around mb-2 items-center "> <UButton @click="isOpenProject = false" square class="w-5/12 flex px-2 text-white rounded bg-blue-700 items-center justify-center"> <span class=" block px-2 text-xs truncate "> {{ t('Cancel') }} </span> </UButton> <UButton :loading="loadingEdit" @click="ProjectReq()" square class="w-5/12 flex px-2 h-8 text-white rounded bg-main-700 items-center justify-center"> <span class=" block px-2 text-xs truncate "> {{ t('Edit') }} </span> </UButton> </div> </UModal> <section :dir="$i18n.locale == 'en' ? 'ltr' : 'rtl'" class=" mt-1 mb-10"> <ul> <li class=" w-full border-b-2 mb-2 " v-for="row in data.projects.data" :key="row.id"> <div class="pb-2 px-2 cursor-pointer flex justify-between items-center"> <label class=" block w-full text-main-700 cursor-pointer text-xs "> {{ row.name }} </label> <div class="flex justify-end items-center"> <UIcon @click="ToggleModal(row)" name="i-heroicons-pencil-square" :class="$i18n.locale == 'en' ? 'mr-4' : 'ml-4'" class="text-green-600 cursor-pointer ml-4 text-base" /> <UButton square :loading="loadingEdit" @click="Delete(row.id)" class=" flex items-center !bg-white !text-red-600 !shadow-none hover:!bg-white justify-center"> <UIcon name="i-heroicons-trash" :class="$i18n.locale == 'en' ? 'mr-4' : 'ml-4'" class="text-red-600 cursor-pointer text-base" /> </UButton> <ULink :to="localePath('/project/'+row.id)" square class=" flex text-white rounded bg-red-700 items-center justify-center"> <span class=" block p-1 text-xs truncate "> {{ t('View_Details') }} </span> </ULink> </div> </div> </li> <li class=" mt-4"> <ClientOnly> <div class="flex w-full flex-col items-center"> <div :class="(data.projects.prev_page_url && data.projects.next_page_url)? 'justify-between' : data.projects.prev_page_url ? 'justify-start' : data.projects.next_page_url ? 'justify-end' : 'justify-between' " class=" flex w-[95%] items-center mt-2 xs:mt-0"> <!-- Buttons --> <UButton :loading="loadingPagepre" v-if="data.projects.prev_page_url " @click="handelPage('decrement')" class="flex items-center justify-center px-3 h-8 text-sm text-white bg-main-700 rounded "> <svg class="w-3.5 h-3.5 me-2 rtl:rotate-180" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 10"> <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 5H1m0 0 4 4M1 5l4-4"/> </svg> {{ t('Prev') }} </UButton> <UButton square :loading="loadingPageNext" v-if="data.projects.next_page_url" @click="handelPage('increment')" class="flex items-center justify-center px-3 h-8 text-sm text-white bg-main-700 border-0 rounded "> {{ t('Next') }} <svg class="w-3.5 h-3.5 ms-2 rtl:rotate-180" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 10"> <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M1 5h12m0 0L9 1m4 4L9 9"/> </svg> </UButton> </div> <!-- Help text --> <span class="text-sm text-gray-700 mt-2 " :dir="$i18n.locale == 'en' ? 'ltr' : 'rtl'" > {{ t('Showing') }} <span class=" bold text-gray-900 ">{{data.projects.from}}</span> {{ t('to') }} <span class=" bold text-gray-900 ">{{data.projects.to}}</span> {{ t('of') }} <span class=" bold text-gray-900 ">{{data.projects.total}}</span> {{ t('Entries') }} </span> </div> </ClientOnly> </li> </ul> </section> <footer class=" bg-white flex justify-between items-center pb-2 pt-1 sm:border-r sm:border-l w-full sm:w-9/12 md:w-7/12 lg:w-6/12 2xl:w-5/12 mx-auto fixed bottom-0 right-0 left-0 border-t"> <div class="px-1 w-6/12"> <ULink external :to="localePath('/analyze/start')" class="w-full flex bg-green-700 hover:bg-green-600 rounded border h-7 text-white items-center justify-center"> <span class=" block px-2 text-sm truncate "> {{ t('New Project') }} </span> </ULink> </div> <div class="px-1 w-6/12"> <ULink :to="localePath('/')" class="w-full flex bg-red-700 rounded border h-7 text-white items-center justify-center" color="red" > <span class=" block px-2 text-sm truncate "> {{ t('Main Page') }} </span> </ULink> </div> </footer> </div> </template>
Coded With 💗 by
0x6ick Mod By V1rus_Alfa