mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-02 18:39:05 +01:00
move vdomclient to waveapp (#1290)
This commit is contained in:
parent
2dfdf66169
commit
8b672211a9
@ -1,7 +1,7 @@
|
|||||||
// Copyright 2024, Command Line Inc.
|
// Copyright 2024, Command Line Inc.
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
package vdomclient
|
package waveapp
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
@ -1,7 +1,7 @@
|
|||||||
// Copyright 2024, Command Line Inc.
|
// Copyright 2024, Command Line Inc.
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
package vdomclient
|
package waveapp
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
@ -44,7 +44,7 @@ type Client struct {
|
|||||||
RootElem *vdom.VDomElem
|
RootElem *vdom.VDomElem
|
||||||
RpcClient *wshutil.WshRpc
|
RpcClient *wshutil.WshRpc
|
||||||
RpcContext *wshrpc.RpcContext
|
RpcContext *wshrpc.RpcContext
|
||||||
ServerImpl *VDomServerImpl
|
ServerImpl *WaveAppServerImpl
|
||||||
IsDone bool
|
IsDone bool
|
||||||
RouteId string
|
RouteId string
|
||||||
VDomContextBlockId string
|
VDomContextBlockId string
|
||||||
@ -171,7 +171,7 @@ func (client *Client) Connect() error {
|
|||||||
if client.RpcContext == nil || client.RpcContext.BlockId == "" {
|
if client.RpcContext == nil || client.RpcContext.BlockId == "" {
|
||||||
return fmt.Errorf("no block id in rpc context")
|
return fmt.Errorf("no block id in rpc context")
|
||||||
}
|
}
|
||||||
client.ServerImpl = &VDomServerImpl{BlockId: client.RpcContext.BlockId, Client: client}
|
client.ServerImpl = &WaveAppServerImpl{BlockId: client.RpcContext.BlockId, Client: client}
|
||||||
sockName, err := wshutil.ExtractUnverifiedSocketName(jwtToken)
|
sockName, err := wshutil.ExtractUnverifiedSocketName(jwtToken)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error extracting socket name from %s: %v", wshutil.WaveJwtTokenVarName, err)
|
return fmt.Errorf("error extracting socket name from %s: %v", wshutil.WaveJwtTokenVarName, err)
|
@ -1,7 +1,7 @@
|
|||||||
// Copyright 2024, Command Line Inc.
|
// Copyright 2024, Command Line Inc.
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
package vdomclient
|
package waveapp
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
@ -14,14 +14,14 @@ import (
|
|||||||
"github.com/wavetermdev/waveterm/pkg/wshrpc"
|
"github.com/wavetermdev/waveterm/pkg/wshrpc"
|
||||||
)
|
)
|
||||||
|
|
||||||
type VDomServerImpl struct {
|
type WaveAppServerImpl struct {
|
||||||
Client *Client
|
Client *Client
|
||||||
BlockId string
|
BlockId string
|
||||||
}
|
}
|
||||||
|
|
||||||
func (*VDomServerImpl) WshServerImpl() {}
|
func (*WaveAppServerImpl) WshServerImpl() {}
|
||||||
|
|
||||||
func (impl *VDomServerImpl) VDomRenderCommand(ctx context.Context, feUpdate vdom.VDomFrontendUpdate) chan wshrpc.RespOrErrorUnion[*vdom.VDomBackendUpdate] {
|
func (impl *WaveAppServerImpl) VDomRenderCommand(ctx context.Context, feUpdate vdom.VDomFrontendUpdate) chan wshrpc.RespOrErrorUnion[*vdom.VDomBackendUpdate] {
|
||||||
respChan := make(chan wshrpc.RespOrErrorUnion[*vdom.VDomBackendUpdate], 5)
|
respChan := make(chan wshrpc.RespOrErrorUnion[*vdom.VDomBackendUpdate], 5)
|
||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
@ -99,7 +99,7 @@ func (impl *VDomServerImpl) VDomRenderCommand(ctx context.Context, feUpdate vdom
|
|||||||
return respChan
|
return respChan
|
||||||
}
|
}
|
||||||
|
|
||||||
func (impl *VDomServerImpl) VDomUrlRequestCommand(ctx context.Context, data wshrpc.VDomUrlRequestData) chan wshrpc.RespOrErrorUnion[wshrpc.VDomUrlRequestResponse] {
|
func (impl *WaveAppServerImpl) VDomUrlRequestCommand(ctx context.Context, data wshrpc.VDomUrlRequestData) chan wshrpc.RespOrErrorUnion[wshrpc.VDomUrlRequestResponse] {
|
||||||
respChan := make(chan wshrpc.RespOrErrorUnion[wshrpc.VDomUrlRequestResponse])
|
respChan := make(chan wshrpc.RespOrErrorUnion[wshrpc.VDomUrlRequestResponse])
|
||||||
writer := NewStreamingResponseWriter(respChan)
|
writer := NewStreamingResponseWriter(respChan)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user