stabilization: server.go split + i18n templates + frontend localization
cmd/verstak-server/server.go (2838→127 строк): разделён на 12 файлов - config.go, tokens.go, schema.go - server.go (только struct + NewServer + ListenAndServe) - routes.go, middleware.go, smtp.go - handlers_api.go, handlers_user.go, handlers_web_user.go, handlers_admin.go - templates.go (конвертирован в функции с i18n.T()) frontend: все русские строки заменены на t() вызовы - App.svelte, FileTreeRow.svelte, ConfirmModal.svelte - FilePreviewModal.svelte, fileUtils.js core: gofmt по всему проекту Все сборки (CLI, server, gui, frontend), go vet, go test проходят. check-i18n.sh: frontend чист, Go-файлы с кириллицей — только тесты/легаси.
This commit is contained in:
@@ -15,29 +15,29 @@ import (
|
||||
|
||||
// Kind constants.
|
||||
const (
|
||||
KindOpenURL = "open_url"
|
||||
KindOpenFile = "open_file"
|
||||
KindOpenFolder = "open_folder"
|
||||
KindRunCommand = "run_command"
|
||||
KindRunScript = "run_script"
|
||||
KindOpenURL = "open_url"
|
||||
KindOpenFile = "open_file"
|
||||
KindOpenFolder = "open_folder"
|
||||
KindRunCommand = "run_command"
|
||||
KindRunScript = "run_script"
|
||||
KindOpenTerminal = "open_terminal"
|
||||
KindLaunchApp = "launch_app"
|
||||
KindLaunchApp = "launch_app"
|
||||
)
|
||||
|
||||
// Record represents an action attached to a node.
|
||||
type Record struct {
|
||||
ID string `json:"id"`
|
||||
NodeID string `json:"node_id"`
|
||||
Title string `json:"title"`
|
||||
Kind string `json:"kind"`
|
||||
Command string `json:"command,omitempty"`
|
||||
Args []string `json:"args,omitempty"`
|
||||
WorkingDir string `json:"working_dir,omitempty"`
|
||||
URL string `json:"url,omitempty"`
|
||||
ConfirmRequired bool `json:"confirm_required"`
|
||||
CaptureOutput bool `json:"capture_output"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
ID string `json:"id"`
|
||||
NodeID string `json:"node_id"`
|
||||
Title string `json:"title"`
|
||||
Kind string `json:"kind"`
|
||||
Command string `json:"command,omitempty"`
|
||||
Args []string `json:"args,omitempty"`
|
||||
WorkingDir string `json:"working_dir,omitempty"`
|
||||
URL string `json:"url,omitempty"`
|
||||
ConfirmRequired bool `json:"confirm_required"`
|
||||
CaptureOutput bool `json:"capture_output"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
// RunResult is returned after executing an action.
|
||||
|
||||
@@ -130,10 +130,10 @@ func TestGetNotFound(t *testing.T) {
|
||||
|
||||
func TestKindLabel(t *testing.T) {
|
||||
cases := map[string]string{
|
||||
KindOpenURL: "Открыть URL",
|
||||
KindRunCommand: "Запустить команду",
|
||||
KindOpenFolder: "Открыть папку",
|
||||
"unknown": "unknown",
|
||||
KindOpenURL: "Открыть URL",
|
||||
KindRunCommand: "Запустить команду",
|
||||
KindOpenFolder: "Открыть папку",
|
||||
"unknown": "unknown",
|
||||
}
|
||||
for kind, want := range cases {
|
||||
got := KindLabel(kind)
|
||||
|
||||
Reference in New Issue
Block a user