mirror of
https://github.com/wavetermdev/backup.git
synced 2026-08-05 13:57:07 -07:00
refactor cmdqueue out of blockcontroller (#65)
This commit is contained in:
@@ -52,6 +52,11 @@ func CommandTypeUnionMeta() tsgenmeta.TypeUnionMeta {
|
||||
}
|
||||
}
|
||||
|
||||
type CmdContextType struct {
|
||||
BlockId string
|
||||
TabId string
|
||||
}
|
||||
|
||||
type baseCommand struct {
|
||||
Command string `json:"command"`
|
||||
}
|
||||
@@ -60,6 +65,10 @@ type BlockCommand interface {
|
||||
GetCommand() string
|
||||
}
|
||||
|
||||
type BlockControllerCommand interface {
|
||||
GetBlockId() string
|
||||
}
|
||||
|
||||
type BlockCommandWrapper struct {
|
||||
BlockCommand
|
||||
}
|
||||
@@ -86,6 +95,7 @@ func ParseCmdMap(cmdMap map[string]any) (BlockCommand, error) {
|
||||
}
|
||||
|
||||
type BlockInputCommand struct {
|
||||
BlockId string `json:"blockid"`
|
||||
Command string `json:"command" tstype:"\"controller:input\""`
|
||||
InputData64 string `json:"inputdata64,omitempty"`
|
||||
SigName string `json:"signame,omitempty"`
|
||||
@@ -96,6 +106,10 @@ func (ic *BlockInputCommand) GetCommand() string {
|
||||
return BlockCommand_Input
|
||||
}
|
||||
|
||||
func (ic *BlockInputCommand) GetBlockId() string {
|
||||
return ic.BlockId
|
||||
}
|
||||
|
||||
type ResolveIdsCommand struct {
|
||||
Command string `json:"command" tstype:"\"resolveids\""`
|
||||
Ids []string `json:"ids"`
|
||||
@@ -164,6 +178,7 @@ func (bwc *BlockAppendIJsonCommand) GetCommand() string {
|
||||
|
||||
type CreateBlockCommand struct {
|
||||
Command string `json:"command" tstype:"\"createblock\""`
|
||||
TabId string `json:"tabid"`
|
||||
BlockDef *wstore.BlockDef `json:"blockdef"`
|
||||
RtOpts *wstore.RuntimeOpts `json:"rtopts,omitempty"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user