mirror of https://github.com/jetkvm/kvm.git
cleanup
This commit is contained in:
parent
8108597740
commit
afebc2dd1e
|
@ -253,7 +253,7 @@ export default function SettingsSidebar() {
|
||||||
send("setSSHKeyState", { sshKey }, resp => {
|
send("setSSHKeyState", { sshKey }, resp => {
|
||||||
if ("error" in resp) {
|
if ("error" in resp) {
|
||||||
notifications.error(
|
notifications.error(
|
||||||
`Failed to update SSH key: ${resp.error.data || "Unknown error"}`,
|
`Failed to update SSH key: ${resp.error.data || "Unknown error"}`,
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -329,7 +329,7 @@ export default function SettingsSidebar() {
|
||||||
const receivedEdid = resp.result as string;
|
const receivedEdid = resp.result as string;
|
||||||
|
|
||||||
const matchingEdid = edids.find(
|
const matchingEdid = edids.find(
|
||||||
x => x.value.toLowerCase() === receivedEdid.toLowerCase(),
|
x => x.value.toLowerCase() === receivedEdid.toLowerCase(),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (matchingEdid) {
|
if (matchingEdid) {
|
||||||
|
@ -372,8 +372,8 @@ export default function SettingsSidebar() {
|
||||||
const getDevice = useCallback(async () => {
|
const getDevice = useCallback(async () => {
|
||||||
try {
|
try {
|
||||||
const status = await api
|
const status = await api
|
||||||
.GET(`${import.meta.env.VITE_SIGNAL_API}/device`)
|
.GET(`${import.meta.env.VITE_SIGNAL_API}/device`)
|
||||||
.then(res => res.json() as Promise<LocalDevice>);
|
.then(res => res.json() as Promise<LocalDevice>);
|
||||||
setLocalDevice(status);
|
setLocalDevice(status);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
notifications.error("Failed to get authentication status");
|
notifications.error("Failed to get authentication status");
|
||||||
|
@ -408,8 +408,8 @@ export default function SettingsSidebar() {
|
||||||
localStorage.removeItem("theme");
|
localStorage.removeItem("theme");
|
||||||
// Check system preference
|
// Check system preference
|
||||||
const systemTheme = window.matchMedia("(prefers-color-scheme: dark)").matches
|
const systemTheme = window.matchMedia("(prefers-color-scheme: dark)").matches
|
||||||
? "dark"
|
? "dark"
|
||||||
: "light";
|
: "light";
|
||||||
root.classList.remove("light", "dark");
|
root.classList.remove("light", "dark");
|
||||||
root.classList.add(systemTheme);
|
root.classList.add(systemTheme);
|
||||||
} else {
|
} else {
|
||||||
|
@ -423,7 +423,7 @@ export default function SettingsSidebar() {
|
||||||
send("resetConfig", {}, resp => {
|
send("resetConfig", {}, resp => {
|
||||||
if ("error" in resp) {
|
if ("error" in resp) {
|
||||||
notifications.error(
|
notifications.error(
|
||||||
`Failed to reset configuration: ${resp.error.data || "Unknown error"}`,
|
`Failed to reset configuration: ${resp.error.data || "Unknown error"}`,
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue