mirror of https://github.com/jetkvm/kvm.git
added slug dependency
device name slugified to dns name when set
This commit is contained in:
parent
fa01d7c828
commit
10af116404
|
@ -313,6 +313,11 @@ func rpcSetDeviceName(deviceName string) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func rpcGetDNSName() (string, error) {
|
||||
LoadConfig()
|
||||
return config.DNSName, nil
|
||||
}
|
||||
|
||||
func rpcGetDevModeState() (DevModeState, error) {
|
||||
devModeEnabled := false
|
||||
if _, err := os.Stat(devModeFile); err != nil {
|
||||
|
@ -777,6 +782,7 @@ var rpcHandlers = map[string]RPCHandler{
|
|||
"tryUpdate": {Func: rpcTryUpdate},
|
||||
"getDeviceName": {Func: rpcGetDeviceName},
|
||||
"setDeviceName": {Func: rpcSetDeviceName, Params: []string{"deviceName"}},
|
||||
"getDNSName": {Func: rpcGetDNSName},
|
||||
"getDevModeState": {Func: rpcGetDevModeState},
|
||||
"setDevModeState": {Func: rpcSetDevModeState, Params: []string{"enabled"}},
|
||||
"getSSHKeyState": {Func: rpcGetSSHKeyState},
|
||||
|
|
|
@ -362,6 +362,8 @@ export default function SettingsSidebar() {
|
|||
document.title = deviceName;
|
||||
});
|
||||
|
||||
|
||||
|
||||
send("getDevModeState", {}, resp => {
|
||||
if ("error" in resp) return;
|
||||
const result = resp.result as { enabled: boolean };
|
||||
|
@ -865,6 +867,14 @@ export default function SettingsSidebar() {
|
|||
onChange={e => handleDeviceNameChange(e.target.value)}
|
||||
/>
|
||||
</SettingsItem>
|
||||
<div className="flex items-center gap-x-2">
|
||||
<Button
|
||||
size="SM"
|
||||
theme="primary"
|
||||
text="Update Device Name"
|
||||
onClick={handleDeviceNameChange}
|
||||
/>
|
||||
</div>
|
||||
<div className="h-[1px] w-full bg-slate-800/10 dark:bg-slate-300/20"/>
|
||||
<div className="pb-2 space-y-4">
|
||||
<SectionHeader
|
||||
|
@ -910,7 +920,8 @@ export default function SettingsSidebar() {
|
|||
}}
|
||||
/>
|
||||
</SettingsItem>
|
||||
<SettingsItem title="Turn off Display After" description="Set how long to wait before turning off the display">
|
||||
<SettingsItem title="Turn off Display After"
|
||||
description="Set how long to wait before turning off the display">
|
||||
<SelectMenuBasic
|
||||
size="SM"
|
||||
label=""
|
||||
|
|
Loading…
Reference in New Issue