Files
terminal/server/api/access_setting_api.go
T

45 lines
1.2 KiB
Go

package api
import (
"next-terminal/server/common/maps"
"github.com/labstack/echo/v4"
)
type AccessSettingApi struct{}
func (api AccessSettingApi) GetEndpoint(c echo.Context) error {
return Success(c, maps.Map{
"fontSize": "14",
"lineHeight": "1.5",
"fontFamily": "JetBrains Mono, Consolas, monospace",
"selectionCopy": "true",
"rightClickPaste": "true",
"treeExpandedKeys": "",
"useSnippets": "true",
"interceptSearchShortcut": "false",
})
}
func (api AccessSettingApi) SetEndpoint(c echo.Context) error {
var req map[string]interface{}
if err := c.Bind(&req); err != nil {
return err
}
_ = req
return Success(c, nil)
}
func (api AccessSettingApi) ShellAssistantEnabledEndpoint(c echo.Context) error {
return Success(c, maps.Map{"enabled": false})
}
func (api AccessSettingApi) ShellAssistantEndpoint(c echo.Context) error {
c.Response().Header().Set("Content-Type", "text/event-stream")
c.Response().Header().Set("Cache-Control", "no-cache")
c.Response().Header().Set("Connection", "keep-alive")
c.Response().Write([]byte("data: {\"success\":false,\"error\":\"Shell assistant is not configured\"}\n\n"))
return nil
}