From 9b3f1975061fa6b4c7ac1b15125b71f2e93d90c4 Mon Sep 17 00:00:00 2001 From: Devaev Maxim Date: Fri, 11 Sep 2020 07:00:56 +0300 Subject: pikvm/pikvm#63: added loop mode for macro --- web/kvm/index.html | 12 ++++++++++++ web/kvm/navbar-macro.pug | 11 +++++++++++ web/share/js/kvm/recorder.js | 8 +++++++- 3 files changed, 30 insertions(+), 1 deletion(-) (limited to 'web') diff --git a/web/kvm/index.html b/web/kvm/index.html index 54d4f220..6cbcdee5 100644 --- a/web/kvm/index.html +++ b/web/kvm/index.html @@ -354,6 +354,18 @@
+ + + + + +
Infinite loop playback: +
+ + +
+
+
diff --git a/web/kvm/navbar-macro.pug b/web/kvm/navbar-macro.pug index 2a0e00d1..9df95e4f 100644 --- a/web/kvm/navbar-macro.pug +++ b/web/kvm/navbar-macro.pug @@ -22,6 +22,17 @@ li(class="right") td(id="hid-recorder-events-count" class="value") 0 td #[sup #[i include delays]] hr + table(class="kv") + tr + td Infinite loop playback: + td(colspan="2") + div(class="switch-box") + input(disabled type="checkbox" id="hid-recorder-loop-checkbox") + label(for="hid-recorder-loop-checkbox") + span(class="switch-inner") + span(class="switch") + + hr input(type="file" id="hid-recorder-new-script-file") div(class="buttons buttons-row") button(disabled id="hid-recorder-upload" class="row50") Upload script diff --git a/web/share/js/kvm/recorder.js b/web/share/js/kvm/recorder.js index 02f927d7..45be88d3 100644 --- a/web/share/js/kvm/recorder.js +++ b/web/share/js/kvm/recorder.js @@ -222,7 +222,11 @@ export function Recorder() { } index += 1; } - __stopProcess(); + if ($("hid-recorder-loop-checkbox").checked) { + setTimeout(() => __runEvents(0)); + } else { + __stopProcess(); + } }; var __refresh = function() { @@ -241,6 +245,8 @@ export function Recorder() { wm.switchEnabled($("hid-recorder-stop"), (__ws && (__play_timer || __recording))); wm.switchEnabled($("hid-recorder-play"), (__ws && !__recording && __events.length)); wm.switchEnabled($("hid-recorder-clear"), (!__play_timer && !__recording && __events.length)); + wm.switchEnabled($("hid-recorder-loop-checkbox"), (__ws && !__recording)); + wm.switchEnabled($("hid-recorder-upload"), (!__play_timer && !__recording)); wm.switchEnabled($("hid-recorder-download"), (!__play_timer && !__recording && __events.length)); -- cgit v1.2.3