update settings list

This commit is contained in:
SrGooglo 2024-01-27 15:40:01 +01:00
parent 782cbc1093
commit c01a77ab0f
4 changed files with 77 additions and 40 deletions

View File

@ -1,4 +0,0 @@
node_modules
dist
out
.gitignore

View File

@ -1,9 +0,0 @@
module.exports = {
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'@electron-toolkit',
'@electron-toolkit/eslint-config-prettier'
]
}

View File

@ -1,4 +1,4 @@
singleQuote: true singleQuote: false
semi: false semi: false
printWidth: 100 printWidth: 100
trailingComma: none trailingComma: none

View File

@ -1,52 +1,64 @@
import { Button } from "antd" import { Button } from "antd"
export default [ export default [
{ {
id: "services",
name: "Services",
icon: "MdAccountTree",
children: [
{
id: "drive_auth", id: "drive_auth",
name: "Google Drive Authorize", name: "Google Drive",
description: "Authorize your Google Drive account to be used for bundles installation.", description: "Authorize your Google Drive account to be used for bundles installation.",
icon: "SiGoogledrive", icon: "SiGoogledrive",
type: "button", type: "button",
storaged: false, storaged: false,
watchIpc: ["drive:authorized", "drive:unauthorized"], watchIpc: ["drive:authorized", "drive:unauthorized"],
defaultValue: async () => { defaultValue: async () => {
return await api.settings.get("drive_auth") return await api.settings.get("drive_auth")
}, },
render: (props) => { render: (props) => {
return <Button return (
type={props.value ? "primary" : "default"} <Button
onClick={() => { type={props.value ? "primary" : "default"}
if (!props.value) { onClick={() => {
message.info("Authorizing...") if (!props.value) {
message.info("Authorizing...")
return ipc.exec("drive:authorize") return ipc.exec("drive:authorize")
}
return ipc.exec("drive:unauthorize")
}}
>
{
props.value ? "Unauthorize" : "Authorize"
} }
return ipc.exec("drive:unauthorize")
}}
>
{props.value ? "Unauthorize" : "Authorize"}
</Button> </Button>
)
} }
}, }
{ ]
},
{
id: "updates",
name: "Updates",
icon: "MdUpdate",
children: [
{
id: "check_update", id: "check_update",
name: "Check for updates", name: "Check for updates",
description: "Check for updates to the app.", description: "Check for updates to the app.",
icon: "MdUpdate", icon: "MdUpdate",
type: "button", type: "button",
props: { props: {
children: "Check", children: "Check",
onClick: () => { onClick: () => {
message.info("Checking for updates...") message.info("Checking for updates...")
app.checkUpdates() app.checkUpdates()
} }
}, },
storaged: false storaged: false
}, },
{ {
id: "pkg_auto_update_on_execute", id: "pkg_auto_update_on_execute",
name: "Packages auto update", name: "Packages auto update",
description: "If a update is available, automatically update the app when it is executed.", description: "If a update is available, automatically update the app when it is executed.",
@ -54,5 +66,43 @@ export default [
type: "switch", type: "switch",
storaged: true, storaged: true,
defaultValue: false defaultValue: false
} }
]
},
{
id: "other",
name: "Other",
icon: "MdSettings",
children: [
{
id: "open_settings_path",
name: "Open settings path",
description: "Open the folder where all packages are stored.",
icon: "MdFolder",
type: "button",
type: "button",
props: {
children: "Open",
onClick: () => {
ipc.send("open-runtime-path")
}
},
storaged: false
},
{
id: "open_dev_logs",
name: "Open internal logs",
description: "Open the internal logs of the app.",
icon: "MdTerminal",
type: "button",
props: {
children: "Open",
onClick: () => {
ipc.send("open-dev-logs")
}
},
storaged: false
}
]
}
] ]