mirror of
https://github.com/wavetermdev/backup.git
synced 2026-08-05 13:57:07 -07:00
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:
@@ -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:
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user