mirror of
https://github.com/wavetermdev/backup.git
synced 2026-08-05 13:57:07 -07:00
add addons-webgl, protected with clientsettings flag (#532)
This commit is contained in:
@@ -5849,8 +5849,20 @@ func ClientSetCommand(ctx context.Context, pk *scpacket.FeCommandPacketType) (sc
|
||||
return nil, fmt.Errorf("error updating client openai base url: %v", err)
|
||||
}
|
||||
}
|
||||
if webglStr, found := pk.Kwargs["webgl"]; found {
|
||||
webglVal := resolveBool(webglStr, false)
|
||||
if webglVal {
|
||||
varsUpdated = append(varsUpdated, "webgl")
|
||||
}
|
||||
clientOpts := clientData.ClientOpts
|
||||
clientOpts.WebGL = webglVal
|
||||
err = sstore.SetClientOpts(ctx, clientOpts)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error updating client webgl: %v", err)
|
||||
}
|
||||
}
|
||||
if len(varsUpdated) == 0 {
|
||||
return nil, fmt.Errorf("/client:set requires a value to set: %s", formatStrs([]string{"termfontsize", "termfontfamily", "openaiapitoken", "openaimodel", "openaibaseurl", "openaimaxtokens", "openaimaxchoices"}, "or", false))
|
||||
return nil, fmt.Errorf("/client:set requires a value to set: %s", formatStrs([]string{"termfontsize", "termfontfamily", "openaiapitoken", "openaimodel", "openaibaseurl", "openaimaxtokens", "openaimaxchoices", "webgl"}, "or", false))
|
||||
}
|
||||
clientData, err = sstore.EnsureClientData(ctx)
|
||||
if err != nil {
|
||||
|
||||
@@ -246,6 +246,7 @@ type ClientOptsType struct {
|
||||
RightSidebar *SidebarValueType `json:"rightsidebar,omitempty"`
|
||||
GlobalShortcut string `json:"globalshortcut,omitempty"`
|
||||
GlobalShortcutEnabled bool `json:"globalshortcutenabled,omitempty"`
|
||||
WebGL bool `json:"webgl,omitempty"`
|
||||
}
|
||||
|
||||
type FeOptsType struct {
|
||||
|
||||
Reference in New Issue
Block a user