step 7: actions — table, service, CLI, GUI tab + confirm dialog
- Migration 005: actions table (node_id, title, kind, command, args_json, working_dir, url, confirm_required, capture_output) - ActionService: Create, Get, ListByNode, Delete, Run Run dispatches: open_url/file/folder (xdg-open), run_command/script (exec.Command), open_terminal, launch_app - CLI: verstak action add/list/run/delete 'run' shows confirm prompt for confirm_required actions - GUI 'Действия' tab: button list with kind label, confirm_required opens editor overlay with action info + confirm, delete button - 7 unit tests for ActionService Acceptance: go build ./... pass, go test ./... pass.
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
package storage
|
||||
|
||||
// migration005 — actions table for runnable actions attached to nodes.
|
||||
const migration005 = `
|
||||
CREATE TABLE IF NOT EXISTS actions (
|
||||
id TEXT PRIMARY KEY,
|
||||
node_id TEXT NOT NULL REFERENCES nodes(id),
|
||||
title TEXT NOT NULL,
|
||||
kind TEXT NOT NULL,
|
||||
command TEXT NULL,
|
||||
args_json TEXT NULL,
|
||||
working_dir TEXT NULL,
|
||||
url TEXT NULL,
|
||||
confirm_required INTEGER NOT NULL DEFAULT 0,
|
||||
capture_output INTEGER NOT NULL DEFAULT 0,
|
||||
created_at TEXT NOT NULL,
|
||||
updated_at TEXT NOT NULL
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_actions_node ON actions(node_id);
|
||||
`
|
||||
@@ -61,7 +61,8 @@ var migrationFiles = map[int]string{
|
||||
2: migration002,
|
||||
3: migration003,
|
||||
4: migration004,
|
||||
// 5: migration005, etc.
|
||||
5: migration005,
|
||||
// 6: migration006, etc.
|
||||
}
|
||||
|
||||
func (db *DB) runInitialSchema() error {
|
||||
|
||||
Reference in New Issue
Block a user