2026-05-20 18:25:15 +02:00
|
|
|
{{-- File Server uploader import --}}
|
|
|
|
|
<div class="form-group level" x-data="FSUploader()" x-init="init(@js($oldFilesArray))">
|
|
|
|
|
|
|
|
|
|
<x-form-group-title label="Download Files" icon="upload-cloud" />
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<x-form-field-title name="Files" helper="test" required="true" />
|
|
|
|
|
<div class="form-upload" x-ref="uploadTarget" :class="{ 'disabled': isUploading }">
|
|
|
|
|
<input type="file" multiple :disabled="isUploading" @change="handleSubmitFile($event)">
|
|
|
|
|
<div class="form-upload-placeholder level">
|
|
|
|
|
<i data-lucide="file-archive" size="36" style="margin-bottom:15px;color:var(--text2)"></i>
|
|
|
|
|
<div style="font-size: 1.1rem;color:var(--text);margin-bottom:5px;">
|
|
|
|
|
Click or drag'n drop files here.
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<x-form-error-text message="Don't submit ROMs" />
|
|
|
|
|
|
|
|
|
|
{{-- Client-side Errors --}}
|
|
|
|
|
<div class="form-error-text" x-show="errorKey === 'noFiles' || errorKey === 'uploadError' || errorKey === 'notAllFilesDone'" x-text="errorMessage"></div>
|
|
|
|
|
|
|
|
|
|
{{-- Server-side Errors --}}
|
|
|
|
|
@error('file_ids')
|
|
|
|
|
<x-form-error-text message="{{ $message }}" />
|
|
|
|
|
@enderror
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{{--
|
|
|
|
|
File listing. Used for editions or server-side errors.
|
|
|
|
|
--}}
|
|
|
|
|
<div class="upload-list" x-show="numberOfFiles > 0" x-cloak>
|
|
|
|
|
<template x-for="(file,i) in files" :key="i">
|
|
|
|
|
<div class="upload-item" :class="
|
|
|
|
|
{
|
|
|
|
|
'upload-item-uploading': !file.done && !file.error,
|
|
|
|
|
'upload-item-done': file.done,
|
|
|
|
|
'upload-item-error': file.error
|
|
|
|
|
}">
|
|
|
|
|
<template x-if="!file.done && !file.error">
|
|
|
|
|
<i data-lucide="loader-2" class="spin"></i>
|
|
|
|
|
</template>
|
|
|
|
|
<template x-if="file.error">
|
|
|
|
|
<i data-lucide="alert-circle"></i>
|
|
|
|
|
</template>
|
2026-06-02 20:54:10 +02:00
|
|
|
<template x-if="file.done && file.state === 'public'">
|
|
|
|
|
<i data-lucide="eye" class="file-state-icon file-state-icon--public"></i>
|
|
|
|
|
</template>
|
|
|
|
|
<template x-if="file.done && file.state === 'private'">
|
|
|
|
|
<i data-lucide="eye-off" class="file-state-icon file-state-icon--private"></i>
|
|
|
|
|
</template>
|
|
|
|
|
<template x-if="file.done && file.state === 'archived'">
|
|
|
|
|
<i data-lucide="archive" class="file-state-icon file-state-icon--archived"></i>
|
|
|
|
|
</template>
|
2026-05-20 18:25:15 +02:00
|
|
|
|
|
|
|
|
<div class="upload-item-info">
|
|
|
|
|
<span class="upload-item-name" x-text="file.name"></span>
|
|
|
|
|
<div class="progress" x-show="!file.done && !file.error">
|
|
|
|
|
<div class="progress-bar" :style="{width: file.progressValue + '%' }">
|
|
|
|
|
<span class="progress-bar-label" x-text="file.progressValue + '% - chunk' + file.currentChunk + ' / ' + file.totalChunks"></span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<span class="upload-item-error" x-show="file.error" x-text="file.error"></span>
|
|
|
|
|
</div>
|
2026-06-02 20:54:10 +02:00
|
|
|
@if($isEdit)
|
|
|
|
|
<div class="upload-item-state" x-show="file.done" x-data="{ confirmArchive: false }">
|
|
|
|
|
<select class="form-select" :disabled="file.state === 'archived'" @change="
|
|
|
|
|
if( $event.target.value === 'archived'){
|
|
|
|
|
confirmArchive = true;
|
|
|
|
|
$event.target.value = file.state;
|
|
|
|
|
} else {
|
|
|
|
|
$wire ? $wire.dispatch('fileStateChanged') : null;
|
|
|
|
|
changeFileState(i, $event.target.value);
|
|
|
|
|
}
|
|
|
|
|
" :value="file.state">
|
|
|
|
|
<option value="public" :selected="file.state === 'public'">Public</option>
|
|
|
|
|
<option value="private" :selected="file.state === 'private'">Private</option>
|
|
|
|
|
<option value="archived" :selected="file.state === 'archived'">Archived</option>
|
|
|
|
|
</select>
|
|
|
|
|
<div class="modal-overlay" x-cloak x-show="confirmArchive" x-transition.opacity.duration.300ms @click.self="confirmArchive = false" @keydown.escape.window="confirmArchive = false">
|
|
|
|
|
<div class="modal-window" x-show="confirmArchive" x-transition>
|
|
|
|
|
<div class="modal-header">
|
|
|
|
|
<span class="modal-title">
|
|
|
|
|
<i data-lucide="archive" size="16"></i>
|
|
|
|
|
Archive file
|
|
|
|
|
</span>
|
|
|
|
|
<button type="button" class="modal-close" @click="confirmArchive = false">
|
|
|
|
|
<i data-lucide="x" size="20"></i>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="modal-body">
|
|
|
|
|
<p>Archiving a file is <b>irreversible</b>.</p>
|
|
|
|
|
<div class="queue-mod-actions" style="margin-top: 15px">
|
|
|
|
|
<button type="button" class="btn" @click="confirmArchive = false">
|
|
|
|
|
Cancel
|
|
|
|
|
</button>
|
|
|
|
|
<button type="button" class="btn danger" @click="changeFileState(i,'archived'); confirmArchive = false;">
|
|
|
|
|
<i data-lucide="archive" size="14"></i>
|
|
|
|
|
Confirm archive
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
@endif
|
2026-05-20 18:25:15 +02:00
|
|
|
<div class="upload-item-actions">
|
|
|
|
|
<button type="button" class="btn" x-show="file.error" @click="handleRetryFile(i)">
|
|
|
|
|
<i data-lucide="refresh-cw"></i>
|
|
|
|
|
</button>
|
|
|
|
|
<button type="button" class="btn" x-show="file.done || file.error" @click="handleRemoveFile(i)">
|
|
|
|
|
<i data-lucide="x"></i>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
<input type="hidden" name="files_uuid[]" :value="file.uuid" x-show="file.done">
|
2026-06-02 20:54:10 +02:00
|
|
|
@if($isEdit)
|
|
|
|
|
<input type="hidden" name="files_state[]" :value="file.state" x-show="file.done">
|
|
|
|
|
@endif
|
2026-05-20 18:25:15 +02:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</div>
|