better indicate status
Signed-off-by: Xe Iaso <me@christine.website>
This commit is contained in:
parent
88e02703d1
commit
2c2f545a9a
|
@ -5,43 +5,42 @@
|
||||||
<link rel="stylesheet" href="/steam_resource/css/library.css">
|
<link rel="stylesheet" href="/steam_resource/css/library.css">
|
||||||
<script src="/static/library.js"></script>
|
<script src="/static/library.js"></script>
|
||||||
<script>
|
<script>
|
||||||
async function log(message) {
|
function log(message) {
|
||||||
return call_plugin_method("log", {"message": message});
|
return call_plugin_method("log", {"message": message});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getUID() {
|
function getUID() {
|
||||||
return call_plugin_method("whoami", {});
|
return call_plugin_method("whoami", {});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getInstallState() {
|
function getInstallState() {
|
||||||
return call_plugin_method("install_state", {});
|
return call_plugin_method("install_state", {});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function onReady() {
|
function getStatus() {
|
||||||
await log("got here");
|
let status = document.getElementById("status");
|
||||||
|
let installStatus = getInstallState();
|
||||||
|
log(installStatus);
|
||||||
|
|
||||||
|
status.innerText = `${installStatus}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
function onReady() {
|
||||||
let heading = document.getElementById("heading");
|
let heading = document.getElementById("heading");
|
||||||
let id = getUID();
|
let id = getUID();
|
||||||
heading.innerText = `Hello ${id}`;
|
heading.innerText = `Hello ${id}`;
|
||||||
|
|
||||||
let status = document.getElementById("status");
|
|
||||||
let install_status = await getInstallState();
|
|
||||||
|
|
||||||
status.innerText = install_status;
|
|
||||||
await log(install_status);
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body onload="onReady()">
|
<body onload="onReady()">
|
||||||
<h2 id="heading">Hello World</h2>
|
<h2 id="heading">Hello World</h2>
|
||||||
<h3>Status: <span id="status">loading</span></h3>
|
|
||||||
<div class="gamepaddialog_Field_eKmEX gamepaddialog_WithFirstRow_2bDqk gamepaddialog_InlineWrapShiftsChildrenBelow_3LCXh gamepaddialog_WithBottomSeparator_3YKpU gamepaddialog_ExtraPaddingOnChildrenBelow_3nLNL gamepaddialog_StandardPadding_xIITX gamepaddialog_HighlightOnFocus_2HFrm Panel Focusable"
|
<div class="gamepaddialog_Field_eKmEX gamepaddialog_WithFirstRow_2bDqk gamepaddialog_InlineWrapShiftsChildrenBelow_3LCXh gamepaddialog_WithBottomSeparator_3YKpU gamepaddialog_ExtraPaddingOnChildrenBelow_3nLNL gamepaddialog_StandardPadding_xIITX gamepaddialog_HighlightOnFocus_2HFrm Panel Focusable"
|
||||||
style="--indent-level:0;">
|
style="--indent-level:0;">
|
||||||
<div class="gamepaddialog_FieldLabelRow_2VcTl">
|
<div class="gamepaddialog_FieldLabelRow_2VcTl">
|
||||||
<div class="gamepaddialog_FieldLabel_3jMlJ">Button field</div>
|
<div class="gamepaddialog_FieldLabel_3jMlJ" id="status"></div>
|
||||||
<div class="gamepaddialog_FieldChildren_2rhav"><button type="button"
|
<div class="gamepaddialog_FieldChildren_2rhav"><button type="button"
|
||||||
class="DialogButton _DialogLayout Secondary gamepaddialog_Button_cXzBZ Focusable" onclick="onReady()"
|
class="DialogButton _DialogLayout Secondary gamepaddialog_Button_cXzBZ Focusable" onclick="getStatus()"
|
||||||
tabindex="0">Click me </button></div>
|
tabindex="0">🔄</button></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
Loading…
Reference in New Issue