MonitorProgress/templates/modals/manage_files_modal.html
2025-04-10 07:26:30 +00:00

70 lines
3.8 KiB
HTML

<!-- NEW: Manage Project Files Modal -->
<div class="modal fade" id="manageFilesModal" tabindex="-1" aria-labelledby="manageFilesModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="manageFilesModalLabel">Manage Files for Project: <span class="project-name-display"></span></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<!-- Existing Files List -->
<h6>Existing Drawing PDFs:</h6>
<div id="existingPdfList" class="list-group mb-3" style="max-height: 200px; overflow-y: auto;">
<!-- Files will be listed here by JS -->
<span class="text-muted">Loading files...</span>
</div>
<hr>
<!-- Upload New Files Form -->
<h6>Upload New PDF Files:</h6>
<form id="uploadPdfsForm" enctype="multipart/form-data">
<div class="mb-3">
<input class="form-control" type="file" id="newPdfFiles" name="pdfFiles" accept=".pdf" multiple required>
<div class="form-text">Select one or more PDF files to add to the project.</div>
</div>
<button type="submit" class="btn btn-success">Upload Selected PDFs</button>
<div id="uploadStatus" class="mt-2" style="display: none;"></div>
</form>
<hr>
<!-- NEW: Upload/Replace Manifest -->
<h6>Update Manifest File:</h6>
<form id="uploadManifestForm" enctype="multipart/form-data">
<div class="mb-3">
<label for="newManifestFile" class="form-label">Select new manifest.csv</label>
<input class="form-control" type="file" id="newManifestFile" name="manifestFile" accept=".csv" required>
<div class="form-text">This will replace the existing manifest for the project.</div>
</div>
<button type="submit" class="btn btn-primary">Update Manifest</button>
<div id="uploadManifestStatus" class="mt-2" style="display: none;"></div>
</form>
<hr>
<!-- Trigger Analysis -->
<h6>Manual Analysis:</h6>
<p class="form-text">After deleting or uploading files, or updating the manifest, you should manually trigger an analysis to update the progress metrics.</p>
<button type="button" id="triggerAnalysisBtn" class="btn btn-warning">Trigger Project Analysis</button>
<div id="analysisTriggerStatus" class="mt-2" style="display: none;"></div>
<hr>
<!-- NEW: Delete Project Section -->
<h6>Delete Project (Warning: Irreversible)</h6>
<p class="form-text text-danger">Deleting the project will remove all associated files (Manifest, PDFs, Extracted Text, Cloned Repo) from the server permanently.</p>
<button type="button" id="deleteProjectBtn" class="btn btn-danger">Delete This Project</button>
<div id="deleteProjectStatus" class="mt-2" style="display: none;"></div>
<hr>
<div id="manageFilesStatus" class="mt-3 alert" style="display: none;"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- End Manage Project Files Modal -->