mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-02-07 00:12:21 +01:00
add ephemeral to line
This commit is contained in:
parent
429c41cfd0
commit
709920ad8e
@ -66,6 +66,7 @@ CREATE TABLE line (
|
||||
linetype varchar(10) NOT NULL,
|
||||
text text NOT NULL,
|
||||
cmdid varchar(36) NOT NULL,
|
||||
ephemeral boolean NOT NULL,
|
||||
PRIMARY KEY (sessionid, windowid, lineid)
|
||||
);
|
||||
|
||||
|
@ -386,6 +386,10 @@ func evalCommandInternal(ctx context.Context, pk *scpacket.FeCommandPacketType)
|
||||
MetaSubCmd: metaSubCmd,
|
||||
Kwargs: pk.Kwargs,
|
||||
}
|
||||
if strings.HasSuffix(commandStr, " ?") {
|
||||
newPk.Kwargs["ephemeral"] = "1"
|
||||
commandStr = commandStr[0 : len(commandStr)-2]
|
||||
}
|
||||
if metaCmd == "run" || metaCmd == "comment" {
|
||||
newPk.Args = []string{commandStr}
|
||||
} else if (metaCmd == "setenv" || metaCmd == "unset") && metaSubCmd == "" {
|
||||
|
@ -398,8 +398,8 @@ func InsertLine(ctx context.Context, line *LineType, cmd *CmdType) error {
|
||||
if !hasWindow {
|
||||
return fmt.Errorf("window not found, cannot insert line[%s/%s]", line.SessionId, line.WindowId)
|
||||
}
|
||||
query = `INSERT INTO line ( sessionid, windowid, lineid, ts, userid, linetype, text, cmdid)
|
||||
VALUES (:sessionid,:windowid,:lineid,:ts,:userid,:linetype,:text,:cmdid)`
|
||||
query = `INSERT INTO line ( sessionid, windowid, lineid, ts, userid, linetype, text, cmdid, ephemeral)
|
||||
VALUES (:sessionid,:windowid,:lineid,:ts,:userid,:linetype,:text,:cmdid,:ephemeral)`
|
||||
tx.NamedExecWrap(query, line)
|
||||
if cmd != nil {
|
||||
cmdMap := cmd.ToMap()
|
||||
|
@ -278,6 +278,7 @@ type LineType struct {
|
||||
LineType string `json:"linetype"`
|
||||
Text string `json:"text,omitempty"`
|
||||
CmdId string `json:"cmdid,omitempty"`
|
||||
Ephemeral bool `json:"ephemeral,omitempty"`
|
||||
Remove bool `json:"remove,omitempty"`
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user