Preparing for production #8

Merged
niat8586 merged 12 commits from develop into main 2025-02-03 11:29:15 +01:00
4 changed files with 67 additions and 50 deletions
Showing only changes of commit f9b60b8fd0 - Show all commits

15
pom.xml
View File

@ -82,6 +82,21 @@
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>webjars-locator</artifactId>
<version>0.52</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
<version>5.3.3</version>
</dependency>
<dependency>
<groupId>org.webjars.npm</groupId>
<artifactId>bootstrap-icons</artifactId>
<version>1.11.3</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>

View File

@ -8,6 +8,10 @@ app.upload-root=@project.basedir@/files/uploads
app.output-root=@project.basedir@/files/outputs
app.onSuccess-homepage=/files/manage
# Webjars properties
spring.web.resources.chain.strategy.content.enabled=true
spring.web.resources.chain.strategy.content.paths=/**
# Whisper properties
whisper.activate-virtual-env-command=bash, -c, source activate
whisper.model-path=@project.basedir@/whisper-models

View File

@ -0,0 +1,42 @@
// Select/Deselect all checkboxes
document.querySelectorAll('[id^=select-all]').forEach(function (element) {
element.addEventListener('change', function () {
const checkboxes = element.closest('table').querySelectorAll('input[name="selectedFiles"]');
checkboxes.forEach(checkbox => checkbox.checked = this.checked);
});
});
// Handle bulk download
function downloadSelected() {
const selectedFiles = Array.from(document.querySelectorAll('input[name="selectedFiles"]:checked'))
.map(checkbox => checkbox.value);
if (selectedFiles.length === 0) {
alert('No files selected.');
return;
}
const form = document.getElementById('bulk-actions-form');
form.action = '/files/download-zip'; // Backend endpoint for bulk download
form.method = 'post';
form.submit();
clearCheckboxes();
}
function clearCheckboxes() {
const checkboxes = document.querySelectorAll('input[name="selectedFiles"], #select-all');
checkboxes.forEach(checkbox => (checkbox.checked = false));
}
// Handle bulk delete
function deleteSelected() {
const selectedFiles = Array.from(document.querySelectorAll('input[name="selectedFiles"]:checked'))
.map(checkbox => checkbox.value);
if (selectedFiles.length === 0) {
alert('No files selected.');
return;
}
if (confirm('Are you sure you want to delete the selected files?')) {
const form = document.getElementById('bulk-actions-form');
form.action = '/files/bulk-delete'; // Backend endpoint for bulk delete
form.submit();
}
}

View File

@ -1,13 +1,13 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<html xmlns:th="http://www.thymeleaf.org" lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Seshat Auido Transcriber</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css">
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-icons/1.9.1/font/bootstrap-icons.min.css">
<link rel="stylesheet" th:href="@{/css/styles.css}">
<link th:rel="stylesheet" th:href="@{/webjars/bootstrap/css/bootstrap.min.css}" />
<link th:rel="stylesheet" th:href="@{/webjars/bootstrap-icons/font/bootstrap-icons.min.css}" />
<script type="text/javascript" th:src="@{/webjars/bootstrap/js/bootstrap.bundle.min.js}"></script>
<link th:rel="stylesheet" th:href="@{/css/styles.css}" />
</head>
<body>
<header class="header bg-primary text-white py-3">
@ -133,50 +133,6 @@
<footer class="bg-primary text-white text-center py-3">
<p>&copy; 2024 Seshat App</p>
</footer>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>
<script>
// Select/Deselect all checkboxes
document.querySelectorAll('[id^=select-all]').forEach(function (element) {
element.addEventListener('change', function () {
const checkboxes = element.closest('table').querySelectorAll('input[name="selectedFiles"]');
checkboxes.forEach(checkbox => checkbox.checked = this.checked);
});
});
// Handle bulk download
function downloadSelected() {
const selectedFiles = Array.from(document.querySelectorAll('input[name="selectedFiles"]:checked'))
.map(checkbox => checkbox.value);
if (selectedFiles.length === 0) {
alert('No files selected.');
return;
}
const form = document.getElementById('bulk-actions-form');
form.action = '/files/download-zip'; // Backend endpoint for bulk download
form.method = 'post';
form.submit();
clearCheckboxes();
}
function clearCheckboxes() {
const checkboxes = document.querySelectorAll('input[name="selectedFiles"], #select-all');
checkboxes.forEach(checkbox => (checkbox.checked = false));
}
// Handle bulk delete
function deleteSelected() {
const selectedFiles = Array.from(document.querySelectorAll('input[name="selectedFiles"]:checked'))
.map(checkbox => checkbox.value);
if (selectedFiles.length === 0) {
alert('No files selected.');
return;
}
if (confirm('Are you sure you want to delete the selected files?')) {
const form = document.getElementById('bulk-actions-form');
form.action = '/files/bulk-delete'; // Backend endpoint for bulk delete
form.submit();
}
}
</script>
<script type="text/javascript" th:src="@{/js/script.js}"></script>
</body>
</html>