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
printWidth: 100
trailingComma: none

View File

@ -1,52 +1,64 @@
import { Button } from "antd"
export default [
{
{
id: "services",
name: "Services",
icon: "MdAccountTree",
children: [
{
id: "drive_auth",
name: "Google Drive Authorize",
name: "Google Drive",
description: "Authorize your Google Drive account to be used for bundles installation.",
icon: "SiGoogledrive",
type: "button",
storaged: false,
watchIpc: ["drive:authorized", "drive:unauthorized"],
defaultValue: async () => {
return await api.settings.get("drive_auth")
return await api.settings.get("drive_auth")
},
render: (props) => {
return <Button
type={props.value ? "primary" : "default"}
onClick={() => {
if (!props.value) {
message.info("Authorizing...")
return (
<Button
type={props.value ? "primary" : "default"}
onClick={() => {
if (!props.value) {
message.info("Authorizing...")
return ipc.exec("drive:authorize")
}
return ipc.exec("drive:unauthorize")
}}
>
{
props.value ? "Unauthorize" : "Authorize"
return ipc.exec("drive:authorize")
}
return ipc.exec("drive:unauthorize")
}}
>
{props.value ? "Unauthorize" : "Authorize"}
</Button>
)
}
},
{
}
]
},
{
id: "updates",
name: "Updates",
icon: "MdUpdate",
children: [
{
id: "check_update",
name: "Check for updates",
description: "Check for updates to the app.",
icon: "MdUpdate",
type: "button",
props: {
children: "Check",
onClick: () => {
message.info("Checking for updates...")
app.checkUpdates()
}
children: "Check",
onClick: () => {
message.info("Checking for updates...")
app.checkUpdates()
}
},
storaged: false
},
{
},
{
id: "pkg_auto_update_on_execute",
name: "Packages auto update",
description: "If a update is available, automatically update the app when it is executed.",
@ -54,5 +66,43 @@ export default [
type: "switch",
storaged: true,
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
}
]
}
]