Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public static ShowLogPanel() {
jsPanel.jsPanel.create({
id: () => "buttplug-logger-panel",
theme: "primary",
headerTitle: "Buttplug Log",
position: "center-top 0 80",
contentSize: "650 250",
callback() {
this.content.innerHTML = logPanelHTML;
LogPanel._panel = new LogPanel();
},
});
}
public static ShowLogPanel() {
jsPanel.jsPanel.create({
id: () => "buttplug-logger-panel",
theme: "primary",
headerTitle: "Buttplug Log",
position: "center-top 0 80",
contentSize: "650 250",
callback() {
this.content.innerHTML = logPanelHTML;
LogPanel._panel = new LogPanel();
},
});
}
public static ShowTestDeviceManagerPanel(buttplugServer: ButtplugServer) {
let tdm: TestDeviceManager | null = null;
for (const mgr of buttplugServer.DeviceManagers) {
if (mgr.constructor.name === "TestDeviceManager") {
tdm = (mgr as TestDeviceManager);
break;
}
}
if (tdm === null) {
ButtplugLogger.Logger.Error("TestDeviceManagerPanel: Cannot get test device manager from server.");
throw new Error("Cannot get test device manager from server.");
}
jsPanel.jsPanel.create({
id: () => "buttplug-test-device-manager-panel",
theme: "primary",
headerTitle: "Test Device Manager",
position: "center-top 0 80",
contentSize: "400 250",
callback() {
this.content.innerHTML = testPanelHTML;
TestDeviceManagerPanel._panel = new TestDeviceManagerPanel(tdm!);
},
});
}
public static ShowTestDeviceManagerPanel(buttplugServer: ButtplugServer) {
let tdm: TestDeviceSubtypeManager | null = null;
for (const mgr of buttplugServer.DeviceManagers) {
if (mgr instanceof TestDeviceSubtypeManager) {
tdm = (mgr as TestDeviceSubtypeManager);
break;
}
}
if (tdm === null) {
ButtplugLogger.Logger.Error("TestDeviceSubtypeManagerPanel: Cannot get test device manager from server.");
throw new Error("Cannot get test device manager from server.");
}
jsPanel.jsPanel.create({
id: () => "buttplug-test-device-manager-panel",
theme: "primary",
headerTitle: "Test Device Manager",
position: "center-top 0 80",
contentSize: "400 250",
callback() {
this.content.innerHTML = testPanelHTML;
TestDeviceManagerPanel._panel = new TestDeviceManagerPanel(tdm!);
},
});
}