mirror of
https://github.com/DeNNiiInc/UltyScan.git
synced 2026-04-17 20:35:59 +00:00
Fix delete function with sudo and remove export feature
This commit is contained in:
@@ -155,7 +155,6 @@ async function loadWorkspaces() {
|
||||
</div>
|
||||
<div class="workspace-actions">
|
||||
<button class="btn btn-secondary" onclick="viewWorkspace('${escapeHtml(name)}')">View</button>
|
||||
<button class="btn btn-secondary" onclick="exportWorkspace('${escapeHtml(name)}')">Export</button>
|
||||
<button class="btn btn-danger" onclick="deleteWorkspace('${escapeHtml(name)}')">Delete</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -193,28 +192,6 @@ async function viewWorkspace(name) {
|
||||
}
|
||||
}
|
||||
|
||||
async function exportWorkspace(name) {
|
||||
showNotification("Creating export for: " + name + "...", "info");
|
||||
try {
|
||||
const response = await fetch("workspaces.php", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ action: "export", name: name }),
|
||||
});
|
||||
const result = await response.json();
|
||||
|
||||
if (result.success && result.downloadUrl) {
|
||||
showNotification(`Export ready: ${result.filename} (${result.size})`, "success");
|
||||
// Trigger download
|
||||
window.open(result.downloadUrl, "_blank");
|
||||
} else {
|
||||
showNotification("Export failed: " + (result.error || "Unknown error"), "error");
|
||||
}
|
||||
} catch (error) {
|
||||
showNotification("Export failed.", "error");
|
||||
}
|
||||
}
|
||||
|
||||
async function deleteWorkspace(name) {
|
||||
if (!confirm(`Are you sure you want to delete workspace "${name}"?`)) return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user