User Input (#119)

Port the User Input feature from the previous version of the app. This
is currently being used to verify a few different prompts for ssh.
This commit is contained in:
Sylvie Crowe
2024-07-18 15:21:33 -07:00
committed by GitHub
parent 01d61dabec
commit f3743f90ec
16 changed files with 438 additions and 126 deletions
+7 -5
View File
@@ -13,6 +13,7 @@ import (
"github.com/wavetermdev/thenextwave/pkg/service/clientservice"
"github.com/wavetermdev/thenextwave/pkg/service/fileservice"
"github.com/wavetermdev/thenextwave/pkg/service/objectservice"
"github.com/wavetermdev/thenextwave/pkg/service/userinputservice"
"github.com/wavetermdev/thenextwave/pkg/service/windowservice"
"github.com/wavetermdev/thenextwave/pkg/tsgen/tsgenmeta"
"github.com/wavetermdev/thenextwave/pkg/util/utilfn"
@@ -22,11 +23,12 @@ import (
)
var ServiceMap = map[string]any{
"block": blockservice.BlockServiceInstance,
"object": &objectservice.ObjectService{},
"file": &fileservice.FileService{},
"client": &clientservice.ClientService{},
"window": &windowservice.WindowService{},
"block": blockservice.BlockServiceInstance,
"object": &objectservice.ObjectService{},
"file": &fileservice.FileService{},
"client": &clientservice.ClientService{},
"window": &windowservice.WindowService{},
"userinput": &userinputservice.UserInputService{},
}
var contextRType = reflect.TypeOf((*context.Context)(nil)).Elem()
@@ -0,0 +1,18 @@
// Copyright 2024, Command Line Inc.
// SPDX-License-Identifier: Apache-2.0
package userinputservice
import (
"github.com/wavetermdev/thenextwave/pkg/userinput"
)
type UserInputService struct {
}
func (uis *UserInputService) SendUserInputResponse(response *userinput.UserInputResponse) {
select {
case userinput.MainUserInputHandler.Channels[response.RequestId] <- response:
default:
}
}