summaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2022-11-21 07:19:35 +0300
committerMaxim Devaev <[email protected]>2022-11-21 07:19:35 +0300
commitbe25f5a0268910616c8089cc200b8be69a9ed9d6 (patch)
tree0e840d5916e0baa1786fc8fb7f1d01494c2ef07c /web
parent703cc2b9814793a974a50de222dbdaa0cf6ef3f3 (diff)
removed relay msd
Diffstat (limited to 'web')
-rw-r--r--web/kvm/index.html24
-rw-r--r--web/kvm/navbar-msd.pug21
-rw-r--r--web/share/js/kvm/msd.js29
3 files changed, 19 insertions, 55 deletions
diff --git a/web/kvm/index.html b/web/kvm/index.html
index b3b7aa65..cabe166e 100644
--- a/web/kvm/index.html
+++ b/web/kvm/index.html
@@ -453,21 +453,7 @@
</div>
<hr>
</div>
- <table class="kv msd-single-storage feature-disabled">
- <tr>
- <td>Current image:</td>
- <td class="value" id="msd-image-name"></td>
- </tr>
- <tr>
- <td>Image size:</td>
- <td class="value" id="msd-image-size"></td>
- </tr>
- <tr>
- <td>Storage size:</td>
- <td class="value" id="msd-storage-size"></td>
- </tr>
- </table>
- <table class="kv msd-multi-storage feature-disabled">
+ <table class="kv">
<tr>
<td>Image:</td>
<td width="100%">
@@ -502,11 +488,9 @@
</td>
</tr>
</table>
- <div class="msd-multi-storage feature-disabled">
- <hr>
- <div class="text">
- <div class="progress" id="msd-storage-progress"><span class="progress-value" id="msd-storage-progress-value"></span></div>
- </div>
+ <hr>
+ <div class="text">
+ <div class="progress" id="msd-storage-progress"><span class="progress-value" id="msd-storage-progress-value"></span></div>
</div>
<hr>
<div class="buttons buttons-row">
diff --git a/web/kvm/navbar-msd.pug b/web/kvm/navbar-msd.pug
index b7ba1a75..1ffd763e 100644
--- a/web/kvm/navbar-msd.pug
+++ b/web/kvm/navbar-msd.pug
@@ -33,17 +33,7 @@ li(id="msd-dropdown" class="right feature-disabled")
+menu_message("info", "The image is being downloaded from PiKVM")
| Please wait
hr
- table(class="kv msd-single-storage feature-disabled")
- tr
- td Current image:
- td(id="msd-image-name" class="value")
- tr
- td Image size:
- td(id="msd-image-size" class="value")
- tr
- td Storage size:
- td(id="msd-storage-size" class="value")
- table(class="kv msd-multi-storage feature-disabled")
+ table(class="kv")
tr
td Image:
td(width="100%") #[select(disabled id="msd-image-selector")]
@@ -60,11 +50,10 @@ li(id="msd-dropdown" class="right feature-disabled")
label(for="msd-mode-radio-flash") Flash
td &nbsp;
+menu_switch_notable("msd-rw-switch", "Writable", false, false, "msd-rw feature-disabled")
- div(class="msd-multi-storage feature-disabled")
- hr
- div(class="text")
- div(id="msd-storage-progress" class="progress")
- span(id="msd-storage-progress-value" class="progress-value")
+ hr
+ div(class="text")
+ div(id="msd-storage-progress" class="progress")
+ span(id="msd-storage-progress-value" class="progress-value")
hr
div(class="buttons buttons-row")
button(disabled id="msd-select-new-button" class="row50") Select image to upload
diff --git a/web/share/js/kvm/msd.js b/web/share/js/kvm/msd.js
index 9d454d97..8ef89dcb 100644
--- a/web/share/js/kvm/msd.js
+++ b/web/share/js/kvm/msd.js
@@ -236,23 +236,20 @@ export function Msd() {
let s = __state;
let online = (s && s.online);
- $("msd-image-name").innerHTML = ((online && s.drive.image) ? s.drive.image.name : "None");
- $("msd-image-size").innerHTML = ((online && s.drive.image) ? tools.formatSize(s.drive.image.size) : "None");
if (online) {
let size_str = tools.formatSize(s.storage.size);
let used = s.storage.size - s.storage.free;
let used_str = tools.formatSize(used);
- $("msd-storage-size").innerHTML = size_str;
- tools.progress.setValue($("msd-storage-progress"), `Storage: ${used_str} of ${size_str}`, used / s.storage.size * 100);
+ let percent = used / s.storage.size * 100;
+ tools.progress.setValue($("msd-storage-progress"), `Storage: ${used_str} of ${size_str}`, percent);
} else {
- $("msd-storage-size").innerHTML = "Unavailable";
tools.progress.setValue($("msd-storage-progress"), "Storage: unavailable", 0);
}
- tools.el.setEnabled($("msd-image-selector"), (online && s.features.multi && !s.drive.connected && !s.busy));
+ tools.el.setEnabled($("msd-image-selector"), (online && !s.drive.connected && !s.busy));
__applyStateImageSelector();
- tools.el.setEnabled($("msd-download-button"), (online && s.features.multi && s.drive.image && !s.drive.connected && !s.busy));
- tools.el.setEnabled($("msd-remove-button"), (online && s.features.multi && s.drive.image && !s.drive.connected && !s.busy));
+ tools.el.setEnabled($("msd-download-button"), (online && s.drive.image && !s.drive.connected && !s.busy));
+ tools.el.setEnabled($("msd-remove-button"), (online && s.drive.image && !s.drive.connected && !s.busy));
tools.radio.setEnabled("msd-mode-radio", (online && s.features.cdrom && !s.drive.connected && !s.busy));
tools.radio.setValue("msd-mode-radio", `${Number(online && s.features.cdrom && s.drive.cdrom)}`);
@@ -260,7 +257,7 @@ export function Msd() {
tools.el.setEnabled($("msd-rw-switch"), (online && s.features.rw && !s.drive.connected && !s.busy));
$("msd-rw-switch").checked = (online && s.features.rw && s.drive.rw);
- tools.el.setEnabled($("msd-connect-button"), (online && (!s.features.multi || s.drive.image) && !s.drive.connected && !s.busy));
+ tools.el.setEnabled($("msd-connect-button"), (online && s.drive.image && !s.drive.connected && !s.busy));
tools.el.setEnabled($("msd-disconnect-button"), (online && s.drive.connected && !s.busy));
tools.el.setEnabled($("msd-select-new-button"), (online && !s.drive.connected && !__http && !s.busy));
@@ -297,12 +294,6 @@ export function Msd() {
if (s) {
tools.feature.setEnabled($("msd-dropdown"), s.enabled);
tools.feature.setEnabled($("msd-reset-button"), s.enabled);
- for (let el of $$$(".msd-single-storage")) {
- tools.feature.setEnabled(el, !s.features.multi);
- }
- for (let el of $$$(".msd-multi-storage")) {
- tools.feature.setEnabled(el, s.features.multi);
- }
for (let el of $$$(".msd-cdrom-emulation")) {
tools.feature.setEnabled(el, s.features.cdrom);
}
@@ -317,13 +308,13 @@ export function Msd() {
tools.hidden.setVisible($("msd-message-too-big-for-cdrom"),
(online && s.features.cdrom && s.drive.cdrom && s.drive.image && s.drive.image.size >= 2359296000));
tools.hidden.setVisible($("msd-message-out-of-storage"),
- (online && s.features.multi && s.drive.image && !s.drive.image.in_storage));
+ (online && s.drive.image && !s.drive.image.in_storage));
tools.hidden.setVisible($("msd-message-rw-enabled"),
(online && s.features.rw && s.drive.rw));
tools.hidden.setVisible($("msd-message-another-user-uploads"),
(online && s.storage.uploading && !__http));
tools.hidden.setVisible($("msd-message-downloads"),
- (online && s.features.multi && s.storage.downloading));
+ (online && s.storage.downloading));
};
var __applyStateStatus = function() {
@@ -339,7 +330,7 @@ export function Msd() {
} else if (online && s.storage.uploading) {
led_cls = "led-yellow-rotating-fast";
msg = "Uploading new image";
- } else if (online && s.features.multi && s.storage.downloading) {
+ } else if (online && s.storage.downloading) {
led_cls = "led-yellow-rotating-fast";
msg = "Serving the image to download";
} else if (online) { // Sic!
@@ -359,7 +350,7 @@ export function Msd() {
el.options.length = 1; // Cleanup
return;
}
- if (!s.features.multi || s.storage.uploading || s.storage.downloading) {
+ if (s.storage.uploading || s.storage.downloading) {
return;
}