This repository has been archived by the owner on Jul 3, 2022. It is now read-only.
generated from SteamDeckHomebrew/Plugin-Template
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmain_view.html
112 lines (98 loc) · 5.76 KB
/
main_view.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<html>
<head>
<link rel="stylesheet" href="/static/styles.css">
<script src="/static/library.js"></script>
<script>
function setToggleState(id, state) {
const ENABLED_CLASS = "gamepaddialog_On_3ld7T";
let toggle = document.getElementById(id);
if (state && !toggle.classList.contains(ENABLED_CLASS)) {
toggle.classList.add(ENABLED_CLASS);
}
if (!state && toggle.classList.contains(ENABLED_CLASS)) {
toggle.classList.remove(ENABLED_CLASS);
}
}
function handleSSHToggle() {
let toggle = document.getElementById("sshToggle");
let isActive = toggle.classList.contains("gamepaddialog_On_3ld7T");
if (isActive) {
call_plugin_method("set_ssh_state", { "state": false }).then((value) => {
setToggleState("sshToggle", value);
})
}
else {
call_plugin_method("set_ssh_state", { "state": true }).then((value) => {
setToggleState("sshToggle", value);
})
}
}
function handleTHPToggle() {
let toggle = document.getElementById("thpToggle");
let isActive = toggle.classList.contains("gamepaddialog_On_3ld7T");
if (isActive) {
call_plugin_method("set_thp_state", { "state": false }).then((value) => {
setToggleState("thpToggle", value);
})
}
else {
call_plugin_method("set_thp_state", { "state": true }).then((value) => {
setToggleState("thpToggle", value);
})
}
}
async function handleInitialValue() {
console.log("InitialValue")
let state = await call_plugin_method("get_ssh_state", {});
console.log(state)
setToggleState("sshToggle", state)
state = await call_plugin_method("get_thp_state", {});
console.log("THP: " + state.toString())
setToggleState("thpToggle", state)
}
</script>
</head>
<body onload="handleInitialValue()">
<div class="quickaccessmenu_TabGroupPanel_1QO7b Panel Focusable">
<div class="quickaccesscontrols_PanelSection_2C0g0">
<div class="quickaccesscontrols_PanelSectionRow_2VQ88">
<div class="gamepaddialog_Field_S-_La gamepaddialog_WithFirstRow_qFXi6 gamepaddialog_WithBottomSeparator_1lUZx gamepaddialog_ExtraPaddingOnChildrenBelow_5UO-_ gamepaddialog_StandardPadding_XRBFu gamepaddialog_HighlightOnFocus_wE4V6 Panel Focusable" style="--indent-level:0;">
<div class="gamepaddialog_FieldLabelRow_H9WOq">
<div class="gamepaddialog_FieldLabel_3b0U-">
<div class="gamepaddialog_FieldLeadIcon_OKYIj">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-server" viewBox="0 0 16 16">
<path d="M1.333 2.667C1.333 1.194 4.318 0 8 0s6.667 1.194 6.667 2.667V4c0 1.473-2.985 2.667-6.667 2.667S1.333 5.473 1.333 4V2.667z"/>
<path d="M1.333 6.334v3C1.333 10.805 4.318 12 8 12s6.667-1.194 6.667-2.667V6.334a6.51 6.51 0 0 1-1.458.79C11.81 7.684 9.967 8 8 8c-1.966 0-3.809-.317-5.208-.876a6.508 6.508 0 0 1-1.458-.79z"/>
<path d="M14.667 11.668a6.51 6.51 0 0 1-1.458.789c-1.4.56-3.242.876-5.21.876-1.966 0-3.809-.316-5.208-.876a6.51 6.51 0 0 1-1.458-.79v1.666C1.333 14.806 4.318 16 8 16s6.667-1.194 6.667-2.667v-1.665z"/>
</svg>
</div>
SSH Server
</div>
<div class="gamepaddialog_FieldChildren_14_HB">
<div id="sshToggle" tabindex="0" class="gamepaddialog_Toggle_24G4g Focusable" onclick="handleSSHToggle()">
<div class="gamepaddialog_ToggleRail_2JtC3"></div>
<div class="gamepaddialog_ToggleSwitch_3__OD"></div>
</div>
</div>
</div>
</div>
</div>
<div class="quickaccesscontrols_PanelSectionRow_2VQ88">
<div class="gamepaddialog_Field_S-_La gamepaddialog_WithFirstRow_qFXi6 gamepaddialog_WithBottomSeparator_1lUZx gamepaddialog_ExtraPaddingOnChildrenBelow_5UO-_ gamepaddialog_StandardPadding_XRBFu gamepaddialog_HighlightOnFocus_wE4V6 Panel Focusable" style="--indent-level:0;">
<div class="gamepaddialog_FieldLabelRow_H9WOq">
<div class="gamepaddialog_FieldLabel_3b0U-">
Transparent Huge Pages
</div>
<div class="gamepaddialog_FieldChildren_14_HB">
<div id="thpToggle" tabindex="0" class="gamepaddialog_Toggle_24G4g Focusable" onclick="handleTHPToggle()">
<div class="gamepaddialog_ToggleRail_2JtC3"></div>
<div class="gamepaddialog_ToggleSwitch_3__OD"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>