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:
@@ -5,9 +5,10 @@ package gui
|
||||
// готова к упаковке (нет external JS/CSS, fetch к /api/* через origin).
|
||||
//
|
||||
// navigation state:
|
||||
// sel = { kind:'section', section:'today'|'inbox'|'clients'|'projects'|'recipes'|'documents'|'archive' }
|
||||
// or { kind:'node', nodeId:'<uuid>' }
|
||||
// tab = 'ov'|'notes'|'files'|'actions'|'worklog'|'activity'
|
||||
//
|
||||
// sel = { kind:'section', section:'today'|'inbox'|'clients'|'projects'|'recipes'|'documents'|'archive' }
|
||||
// or { kind:'node', nodeId:'<uuid>' }
|
||||
// tab = 'ov'|'notes'|'files'|'actions'|'worklog'|'activity'
|
||||
const indexHTML = `<!DOCTYPE html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
|
||||
+13
-11
@@ -11,8 +11,8 @@ import (
|
||||
|
||||
"verstak/internal/core/actions"
|
||||
"verstak/internal/core/files"
|
||||
"verstak/internal/core/notes"
|
||||
"verstak/internal/core/nodes"
|
||||
"verstak/internal/core/notes"
|
||||
"verstak/internal/core/plugins"
|
||||
"verstak/internal/core/search"
|
||||
"verstak/internal/core/storage"
|
||||
@@ -280,7 +280,9 @@ func (s *Server) handleNotes(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
jsonOK(w, n)
|
||||
case "PUT":
|
||||
var req struct{ Content string `json:"content"` }
|
||||
var req struct {
|
||||
Content string `json:"content"`
|
||||
}
|
||||
json.NewDecoder(r.Body).Decode(&req)
|
||||
if err := s.notes.Save(path, req.Content); err != nil {
|
||||
jsonErr(w, 500, err.Error())
|
||||
@@ -365,15 +367,15 @@ func (s *Server) handleActions(w http.ResponseWriter, r *http.Request) {
|
||||
jsonOK(w, list)
|
||||
case "POST":
|
||||
var req struct {
|
||||
NodeID string `json:"node_id"`
|
||||
Kind string `json:"kind"`
|
||||
Title string `json:"title"`
|
||||
Command string `json:"command"`
|
||||
URL string `json:"url"`
|
||||
WorkingDir string `json:"working_dir"`
|
||||
Args []string `json:"args"`
|
||||
Confirm bool `json:"confirm"`
|
||||
Capture bool `json:"capture"`
|
||||
NodeID string `json:"node_id"`
|
||||
Kind string `json:"kind"`
|
||||
Title string `json:"title"`
|
||||
Command string `json:"command"`
|
||||
URL string `json:"url"`
|
||||
WorkingDir string `json:"working_dir"`
|
||||
Args []string `json:"args"`
|
||||
Confirm bool `json:"confirm"`
|
||||
Capture bool `json:"capture"`
|
||||
}
|
||||
json.NewDecoder(r.Body).Decode(&req)
|
||||
rec, err := s.actions.Create(req.NodeID, req.Kind, req.Title, req.Command, req.WorkingDir, req.URL, req.Args, req.Confirm, req.Capture)
|
||||
|
||||
Reference in New Issue
Block a user