Skip to content

Commit ac97020

Browse files
committed
Status query button in Manager
1 parent c3c432b commit ac97020

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

frontend/index.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import { callable, findModule, Millennium, sleep, IconsModule, definePlugin, Field, TextField, Toggle } from "@steambrew/client";
1+
import { callable, findModule, Millennium, sleep, DialogButton, IconsModule, definePlugin, Field, TextField, Toggle } from "@steambrew/client";
22
import React, { useState, useEffect } from "react";
33

44
// Backend functions
55
const set_progress_percent = callable<[{ percent: number }], boolean>('set_progress_percent');
6+
const get_plugin_status = callable<[{}], string>('get_plugin_status');
67

78
const WaitForElement = async (sel: string, parent: Document | Element = document) =>
89
[...(await Millennium.findElement(parent as Document, sel))][0];
@@ -101,6 +102,11 @@ const SettingsContent = () => {
101102
return (
102103
<div>
103104
<SingleSetting name="use_old_detection" type="bool" label="Use old detection method" description="Use the old, observer-based detection" />
105+
<DialogButton onClick={async (e) => {
106+
const statusTag = (e.target as HTMLElement).ownerDocument.createElement("div");
107+
statusTag.innerText = await get_plugin_status({});
108+
(e.target as HTMLElement).parentElement!.appendChild(statusTag);
109+
}}>Query Plugin Status</DialogButton>
104110
</div>
105111
);
106112
};

0 commit comments

Comments
 (0)