hotfix-feat(dataset): implement file upload with validation and error handling
- Implemented file upload functionality for datasets using multipart requests. - Added file size and type validation using VineJS. - Added file name length validation. - Added file scan to remove infected files. - Implemented aggregated upload limit to prevent exceeding the server's capacity. - Added error handling for file upload failures, including temporary file cleanup. - Updated the `DatasetController` to handle file uploads, validation, and database transactions. - Updated the `bodyparser.ts` config to process the file upload manually. - Updated the `api.ts` routes to fetch the statistic data. - Updated the `main.ts` store to fetch the statistic data. - Updated the `Dashboard.vue` to display the submitters only for administrator role. - Updated the `CardBoxWidget.vue` to display the submitters. - Updated the `ServerError.vue` to use the LayoutGuest.vue. - Updated the `AuthController.ts` and `start/routes.ts` to handle the database connection errors. - Updated the `app/exceptions/handler.ts` to handle the database connection errors. - Updated the `package.json` to use the correct version of the `@adonisjs/bodyparser`.
This commit is contained in:
parent
a25f8bf6f7
commit
b93e46207f
15 changed files with 637 additions and 200 deletions
|
@ -20,11 +20,13 @@ import SectionTitleLineWithButton from '@/Components/SectionTitleLineWithButton.
|
|||
import BaseButton from '@/Components/BaseButton.vue';
|
||||
import { mdiLightbulbAlert, mdiArrowLeftBoldOutline } from '@mdi/js';
|
||||
import { stardust } from '@eidellev/adonis-stardust/client';
|
||||
|
||||
@Component({
|
||||
// options: {
|
||||
// layout: DefaultLayout,
|
||||
// },
|
||||
import LayoutGuest from '@/Layouts/LayoutGuest.vue';
|
||||
|
||||
|
||||
@Component({
|
||||
options: {
|
||||
layout: LayoutGuest,
|
||||
},
|
||||
name: 'AppComponent',
|
||||
|
||||
components: {
|
||||
|
|
71
resources/js/Pages/Errors/postgres_error.vue
Normal file
71
resources/js/Pages/Errors/postgres_error.vue
Normal file
|
@ -0,0 +1,71 @@
|
|||
<template>
|
||||
<div class="min-h-screen flex items-center justify-center bg-gray-100">
|
||||
<div class="max-w-md w-full p-6 bg-white rounded-md shadow-md">
|
||||
<h1 class="text-2xl font-bold text-red-500 mb-4">{{ status }}</h1>
|
||||
<p class="text-gray-700 mb-4">{{ message }}</p>
|
||||
<div class="text-sm text-gray-500 mb-4">
|
||||
<p>Error Code: {{ details.code }}</p>
|
||||
<p>Type: {{ details.type }}</p>
|
||||
<div v-for="(port, index) in details.ports" :key="index">
|
||||
<p>Connection attempt {{ index + 1 }}: {{ port.address }}:{{ port.port }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<SectionTitleLineWithButton :icon="mdiLightbulbAlert" :title="'Database Error'" :main="true">
|
||||
<BaseButton @click.prevent="handleAction" :icon="mdiArrowLeftBoldOutline" label="Dashboard"
|
||||
color="white" rounded-full small />
|
||||
</SectionTitleLineWithButton>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Vue, Prop } from 'vue-facing-decorator';
|
||||
import { Link, router } from '@inertiajs/vue3';
|
||||
import SectionTitleLineWithButton from '@/Components/SectionTitleLineWithButton.vue';
|
||||
import BaseButton from '@/Components/BaseButton.vue';
|
||||
import { mdiLightbulbAlert, mdiArrowLeftBoldOutline } from '@mdi/js';
|
||||
import { stardust } from '@eidellev/adonis-stardust/client';
|
||||
import LayoutGuest from '@/Layouts/LayoutGuest.vue';
|
||||
|
||||
@Component({
|
||||
options: {
|
||||
layout: LayoutGuest,
|
||||
},
|
||||
name: 'PostgresError',
|
||||
components: {
|
||||
Link,
|
||||
BaseButton,
|
||||
SectionTitleLineWithButton,
|
||||
},
|
||||
})
|
||||
export default class AppComponent extends Vue {
|
||||
@Prop({
|
||||
type: String,
|
||||
default: '',
|
||||
})
|
||||
status: string;
|
||||
|
||||
@Prop({
|
||||
type: String,
|
||||
default: '',
|
||||
})
|
||||
message: string;
|
||||
|
||||
@Prop({
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
})
|
||||
details: {
|
||||
code: string;
|
||||
type: string;
|
||||
ports: Array<{ port: number; address: string }>;
|
||||
};
|
||||
|
||||
mdiLightbulbAlert = mdiLightbulbAlert;
|
||||
mdiArrowLeftBoldOutline = mdiArrowLeftBoldOutline;
|
||||
|
||||
public async handleAction() {
|
||||
await router.get(stardust.route('dashboard'));
|
||||
}
|
||||
}
|
||||
</script>
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue