fix: add conn prefix to askbeforewshinstall flag (#1013)

This commit is contained in:
Sylvie Crowe 2024-10-10 17:23:27 -07:00 committed by GitHub
parent da0b8b044e
commit 1354c34921
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 11 additions and 8 deletions

View File

@ -471,7 +471,8 @@ declare global {
"window:disablehardwareacceleration"?: boolean; "window:disablehardwareacceleration"?: boolean;
"telemetry:*"?: boolean; "telemetry:*"?: boolean;
"telemetry:enabled"?: boolean; "telemetry:enabled"?: boolean;
askbeforewshinstall?: boolean; "conn:*"?: boolean;
"conn:askbeforewshinstall"?: boolean;
}; };
// waveobj.StickerClickOptsType // waveobj.StickerClickOptsType

View File

@ -315,11 +315,11 @@ func (conn *SSHConn) CheckAndInstallWsh(ctx context.Context, clientDisplayName s
} }
if response.CheckboxStat { if response.CheckboxStat {
meta := waveobj.MetaMapType{ meta := waveobj.MetaMapType{
wconfig.ConfigKey_AskBeforeWshInstall: false, wconfig.ConfigKey_ConnAskBeforeWshInstall: false,
} }
err := wconfig.SetBaseConfigValue(meta) err := wconfig.SetBaseConfigValue(meta)
if err != nil { if err != nil {
return fmt.Errorf("error setting askbeforewshinstall value: %w", err) return fmt.Errorf("error setting conn:askbeforewshinstall value: %w", err)
} }
} }
} }
@ -438,7 +438,7 @@ func (conn *SSHConn) connectInternal(ctx context.Context) error {
return err return err
} }
config := wconfig.ReadFullConfig() config := wconfig.ReadFullConfig()
installErr := conn.CheckAndInstallWsh(ctx, clientDisplayName, &WshInstallOpts{NoUserPrompt: !config.Settings.AskBeforeWshInstall}) installErr := conn.CheckAndInstallWsh(ctx, clientDisplayName, &WshInstallOpts{NoUserPrompt: !config.Settings.ConnAskBeforeWshInstall})
if installErr != nil { if installErr != nil {
log.Printf("error: unable to install wsh shell extensions for %s: %v\n", conn.GetName(), err) log.Printf("error: unable to install wsh shell extensions for %s: %v\n", conn.GetName(), err)
return fmt.Errorf("conncontroller %s wsh install error: %v", conn.GetName(), installErr) return fmt.Errorf("conncontroller %s wsh install error: %v", conn.GetName(), installErr)

View File

@ -5,10 +5,10 @@
"autoupdate:enabled": true, "autoupdate:enabled": true,
"autoupdate:installonquit": true, "autoupdate:installonquit": true,
"autoupdate:intervalms": 3600000, "autoupdate:intervalms": 3600000,
"conn:askbeforewshinstall": true,
"editor:minimapenabled": true, "editor:minimapenabled": true,
"web:defaulturl": "https://github.com/wavetermdev/waveterm", "web:defaulturl": "https://github.com/wavetermdev/waveterm",
"web:defaultsearch": "https://www.google.com/search?q={query}", "web:defaultsearch": "https://www.google.com/search?q={query}",
"window:tilegapsize": 3, "window:tilegapsize": 3,
"telemetry:enabled": true, "telemetry:enabled": true
"askbeforewshinstall": true
} }

View File

@ -62,6 +62,7 @@ const (
ConfigKey_TelemetryClear = "telemetry:*" ConfigKey_TelemetryClear = "telemetry:*"
ConfigKey_TelemetryEnabled = "telemetry:enabled" ConfigKey_TelemetryEnabled = "telemetry:enabled"
ConfigKey_AskBeforeWshInstall = "askbeforewshinstall" ConfigKey_ConnClear = "conn:*"
ConfigKey_ConnAskBeforeWshInstall = "conn:askbeforewshinstall"
) )

View File

@ -96,7 +96,8 @@ type SettingsType struct {
TelemetryClear bool `json:"telemetry:*,omitempty"` TelemetryClear bool `json:"telemetry:*,omitempty"`
TelemetryEnabled bool `json:"telemetry:enabled,omitempty"` TelemetryEnabled bool `json:"telemetry:enabled,omitempty"`
AskBeforeWshInstall bool `json:"askbeforewshinstall,omitempty"` ConnClear bool `json:"conn:*,omitempty"`
ConnAskBeforeWshInstall bool `json:"conn:askbeforewshinstall,omitempty"`
} }
type ConfigError struct { type ConfigError struct {