implement wtv-disk:/delete-group
- only sends DELETE-GROUP command - does not delete partitions or files - useful for clearing up broken groups that are failing due to conflicts or changes
This commit is contained in:
46
zefie_wtvp_minisrv/ServiceVault/wtv-disk/delete-group.js
Normal file
46
zefie_wtvp_minisrv/ServiceVault/wtv-disk/delete-group.js
Normal file
@@ -0,0 +1,46 @@
|
||||
if (request_headers.query.group) {
|
||||
const WTVDownloadList = require("./WTVDownloadList.js");
|
||||
var wtvdl = new WTVDownloadList(minisrv_config, service_name);
|
||||
if (request_headers['wtv-request-type']) {
|
||||
headers = "200 OK\nContent-Type: " + wtvdl.content_type;
|
||||
wtvdl.deleteGroup(request_headers.query.group);
|
||||
data = wtvdl.getDownloadList();
|
||||
}
|
||||
var title = "Deleting group"
|
||||
var message = title + " " + request_headers.query.group;
|
||||
headers = "200 OK\nContent-Type: text/html"
|
||||
data = wtvdl.getSyncPage(title, request_headers.query.group, "delete", message, message, null, "client:goback", "client:goback", "wtv-disk:/delete-group");
|
||||
} else {
|
||||
headers = "200 OK\nContent-Type: text/html"
|
||||
data = `
|
||||
<html>
|
||||
<head>
|
||||
<title>Delete a DiskMap Group</title>
|
||||
</head>
|
||||
<body bgcolor="black" text="gold" vlink"gold" alink="gold" link="gold">
|
||||
<form action="delete-group">
|
||||
<input type="text" usestyle name="group">
|
||||
<input type="submit" usestyle value="Delete">
|
||||
</form>
|
||||
<ul>
|
||||
`;
|
||||
var groups = [
|
||||
"HackTV",
|
||||
"HackTV-Base",
|
||||
"HackTV-Music",
|
||||
"FREEDOOM",
|
||||
"Doom",
|
||||
"DealerDemo",
|
||||
"Modem_Firmware",
|
||||
"MAME",
|
||||
"zefie"
|
||||
]
|
||||
groups.forEach(function (group) {
|
||||
data += "<li><a href=\"?group=" + group + "\">Delete Group \"" + group + "\"</a></li>\n";
|
||||
})
|
||||
data += `
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
||||
`
|
||||
}
|
||||
@@ -53,6 +53,9 @@
|
||||
<SubType>Code</SubType>
|
||||
</Content>
|
||||
<Content Include="ServiceVault\wtv-disk\content\diskmaps\ModemFirmware.json" />
|
||||
<Content Include="ServiceVault\wtv-disk\delete-group.js">
|
||||
<SubType>Code</SubType>
|
||||
</Content>
|
||||
<Content Include="ServiceVault\wtv-disk\userstore.js">
|
||||
<SubType>Code</SubType>
|
||||
</Content>
|
||||
|
||||
Reference in New Issue
Block a user