fix: add E:edit to footer, generate UUID+timestamps in TUI forms

This commit is contained in:
swanadiva
2026-06-23 18:15:36 +07:00
parent 9b27388455
commit 512cf5ce1f
4 changed files with 17 additions and 2 deletions
+5
View File
@@ -3,10 +3,12 @@ package tui
import (
"fmt"
"strings"
"time"
"github.com/charmbracelet/bubbles/textinput"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/lipgloss"
"github.com/google/uuid"
"git.tukangketik.id/swanadiva/hostkeeper/internal/models"
)
@@ -188,10 +190,13 @@ func (t *SnippetFormTab) submit() (Tab, tea.Cmd) {
sn.Tags = tags
} else {
sn = &models.Snippet{
ID: uuid.New().String(),
Name: name,
Command: command,
Description: t.inputs[snippetFieldDescription].Value(),
Tags: tags,
CreatedAt: time.Now(),
UpdatedAt: time.Now(),
}
}