mirror of
https://github.com/openziti/zrok.git
synced 2025-02-02 03:20:26 +01:00
roughed in share and release through the agent ui (#221)
This commit is contained in:
parent
258980c1a1
commit
05aa12e742
@ -1232,7 +1232,7 @@ var file_agent_agentGrpc_agent_proto_rawDesc = []byte{
|
||||
0x73, 0x65, 0x12, 0x0c, 0x0a, 0x01, 0x76, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x76,
|
||||
0x12, 0x28, 0x0a, 0x0f, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x45, 0x6e, 0x64, 0x70, 0x6f,
|
||||
0x69, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x73, 0x6f,
|
||||
0x6c, 0x65, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x32, 0x95, 0x04, 0x0a, 0x05, 0x41,
|
||||
0x6c, 0x65, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x32, 0xee, 0x04, 0x0a, 0x05, 0x41,
|
||||
0x67, 0x65, 0x6e, 0x74, 0x12, 0x40, 0x0a, 0x0d, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x50, 0x72,
|
||||
0x69, 0x76, 0x61, 0x74, 0x65, 0x12, 0x15, 0x2e, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x50, 0x72,
|
||||
0x69, 0x76, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x41,
|
||||
@ -1241,35 +1241,40 @@ var file_agent_agentGrpc_agent_proto_rawDesc = []byte{
|
||||
0x65, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x15, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73,
|
||||
0x65, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16,
|
||||
0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65,
|
||||
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x0c, 0x52, 0x65, 0x6c, 0x65,
|
||||
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5b, 0x0a, 0x0c, 0x52, 0x65, 0x6c, 0x65,
|
||||
0x61, 0x73, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x12, 0x14, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61,
|
||||
0x73, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15,
|
||||
0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x52, 0x65, 0x73,
|
||||
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x40, 0x0a, 0x0d, 0x53, 0x68, 0x61, 0x72, 0x65,
|
||||
0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x12, 0x15, 0x2e, 0x53, 0x68, 0x61, 0x72, 0x65,
|
||||
0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
|
||||
0x16, 0x2e, 0x53, 0x68, 0x61, 0x72, 0x65, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x52,
|
||||
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x0c, 0x53, 0x68, 0x61,
|
||||
0x72, 0x65, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x12, 0x14, 0x2e, 0x53, 0x68, 0x61, 0x72,
|
||||
0x65, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
|
||||
0x15, 0x2e, 0x53, 0x68, 0x61, 0x72, 0x65, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x52, 0x65,
|
||||
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3a, 0x0a, 0x0b, 0x53, 0x68, 0x61, 0x72,
|
||||
0x65, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x12, 0x13, 0x2e, 0x53, 0x68, 0x61, 0x72, 0x65, 0x50,
|
||||
0x75, 0x62, 0x6c, 0x69, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x53,
|
||||
0x68, 0x61, 0x72, 0x65, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
|
||||
0x73, 0x65, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0e,
|
||||
0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f,
|
||||
0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
|
||||
0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x12, 0x10, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x67, 0x65,
|
||||
0x6e, 0x74, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x47, 0x0a, 0x07, 0x56, 0x65, 0x72,
|
||||
0x73, 0x69, 0x6f, 0x6e, 0x12, 0x0f, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65,
|
||||
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x10, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52,
|
||||
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x12,
|
||||
0x11, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2f, 0x76, 0x65, 0x72, 0x73, 0x69,
|
||||
0x6f, 0x6e, 0x42, 0x2a, 0x5a, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d,
|
||||
0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x7a, 0x69, 0x74, 0x69, 0x2f, 0x7a, 0x72, 0x6f, 0x6b, 0x2f, 0x61,
|
||||
0x67, 0x65, 0x6e, 0x74, 0x2f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x47, 0x72, 0x70, 0x63, 0x62, 0x06,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x22, 0x16, 0x2f,
|
||||
0x76, 0x31, 0x2f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65,
|
||||
0x53, 0x68, 0x61, 0x72, 0x65, 0x12, 0x40, 0x0a, 0x0d, 0x53, 0x68, 0x61, 0x72, 0x65, 0x52, 0x65,
|
||||
0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x12, 0x15, 0x2e, 0x53, 0x68, 0x61, 0x72, 0x65, 0x52, 0x65,
|
||||
0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e,
|
||||
0x53, 0x68, 0x61, 0x72, 0x65, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x52, 0x65, 0x73,
|
||||
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5b, 0x0a, 0x0c, 0x53, 0x68, 0x61, 0x72, 0x65,
|
||||
0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x12, 0x14, 0x2e, 0x53, 0x68, 0x61, 0x72, 0x65, 0x50,
|
||||
0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e,
|
||||
0x53, 0x68, 0x61, 0x72, 0x65, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70,
|
||||
0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x22, 0x16, 0x2f, 0x76,
|
||||
0x31, 0x2f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x50, 0x72, 0x69,
|
||||
0x76, 0x61, 0x74, 0x65, 0x12, 0x57, 0x0a, 0x0b, 0x53, 0x68, 0x61, 0x72, 0x65, 0x50, 0x75, 0x62,
|
||||
0x6c, 0x69, 0x63, 0x12, 0x13, 0x2e, 0x53, 0x68, 0x61, 0x72, 0x65, 0x50, 0x75, 0x62, 0x6c, 0x69,
|
||||
0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x53, 0x68, 0x61, 0x72, 0x65,
|
||||
0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1d,
|
||||
0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x22, 0x15, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x67, 0x65, 0x6e,
|
||||
0x74, 0x2f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x12, 0x43, 0x0a,
|
||||
0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0e, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73,
|
||||
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73,
|
||||
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12,
|
||||
0x12, 0x10, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2f, 0x73, 0x74, 0x61, 0x74,
|
||||
0x75, 0x73, 0x12, 0x47, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x0f, 0x2e,
|
||||
0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x10,
|
||||
0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
||||
0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x12, 0x11, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x67,
|
||||
0x65, 0x6e, 0x74, 0x2f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x2a, 0x5a, 0x28, 0x67,
|
||||
0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x7a, 0x69,
|
||||
0x74, 0x69, 0x2f, 0x7a, 0x72, 0x6f, 0x6b, 0x2f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2f, 0x61, 0x67,
|
||||
0x65, 0x6e, 0x74, 0x47, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
|
@ -31,6 +31,114 @@ var _ = runtime.String
|
||||
var _ = utilities.NewDoubleArray
|
||||
var _ = metadata.Join
|
||||
|
||||
var (
|
||||
filter_Agent_ReleaseShare_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
||||
)
|
||||
|
||||
func request_Agent_ReleaseShare_0(ctx context.Context, marshaler runtime.Marshaler, client AgentClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq ReleaseShareRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Agent_ReleaseShare_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.ReleaseShare(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_Agent_ReleaseShare_0(ctx context.Context, marshaler runtime.Marshaler, server AgentServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq ReleaseShareRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Agent_ReleaseShare_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.ReleaseShare(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
var (
|
||||
filter_Agent_SharePrivate_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
||||
)
|
||||
|
||||
func request_Agent_SharePrivate_0(ctx context.Context, marshaler runtime.Marshaler, client AgentClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq SharePrivateRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Agent_SharePrivate_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.SharePrivate(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_Agent_SharePrivate_0(ctx context.Context, marshaler runtime.Marshaler, server AgentServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq SharePrivateRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Agent_SharePrivate_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.SharePrivate(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
var (
|
||||
filter_Agent_SharePublic_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
||||
)
|
||||
|
||||
func request_Agent_SharePublic_0(ctx context.Context, marshaler runtime.Marshaler, client AgentClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq SharePublicRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Agent_SharePublic_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.SharePublic(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_Agent_SharePublic_0(ctx context.Context, marshaler runtime.Marshaler, server AgentServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq SharePublicRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Agent_SharePublic_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.SharePublic(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func request_Agent_Status_0(ctx context.Context, marshaler runtime.Marshaler, client AgentClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq StatusRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
@ -73,6 +181,81 @@ func local_request_Agent_Version_0(ctx context.Context, marshaler runtime.Marsha
|
||||
// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterAgentHandlerFromEndpoint instead.
|
||||
func RegisterAgentHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AgentServer) error {
|
||||
|
||||
mux.Handle("POST", pattern_Agent_ReleaseShare_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
var stream runtime.ServerTransportStream
|
||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/.Agent/ReleaseShare", runtime.WithHTTPPathPattern("/v1/agent/releaseShare"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_Agent_ReleaseShare_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_Agent_ReleaseShare_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_Agent_SharePrivate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
var stream runtime.ServerTransportStream
|
||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/.Agent/SharePrivate", runtime.WithHTTPPathPattern("/v1/agent/sharePrivate"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_Agent_SharePrivate_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_Agent_SharePrivate_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_Agent_SharePublic_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
var stream runtime.ServerTransportStream
|
||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/.Agent/SharePublic", runtime.WithHTTPPathPattern("/v1/agent/sharePublic"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_Agent_SharePublic_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_Agent_SharePublic_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_Agent_Status_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
@ -164,6 +347,72 @@ func RegisterAgentHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc
|
||||
// "AgentClient" to call the correct interceptors.
|
||||
func RegisterAgentHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AgentClient) error {
|
||||
|
||||
mux.Handle("POST", pattern_Agent_ReleaseShare_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/.Agent/ReleaseShare", runtime.WithHTTPPathPattern("/v1/agent/releaseShare"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_Agent_ReleaseShare_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_Agent_ReleaseShare_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_Agent_SharePrivate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/.Agent/SharePrivate", runtime.WithHTTPPathPattern("/v1/agent/sharePrivate"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_Agent_SharePrivate_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_Agent_SharePrivate_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_Agent_SharePublic_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/.Agent/SharePublic", runtime.WithHTTPPathPattern("/v1/agent/sharePublic"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_Agent_SharePublic_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_Agent_SharePublic_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_Agent_Status_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
@ -212,12 +461,24 @@ func RegisterAgentHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
|
||||
}
|
||||
|
||||
var (
|
||||
pattern_Agent_ReleaseShare_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "agent", "releaseShare"}, ""))
|
||||
|
||||
pattern_Agent_SharePrivate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "agent", "sharePrivate"}, ""))
|
||||
|
||||
pattern_Agent_SharePublic_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "agent", "sharePublic"}, ""))
|
||||
|
||||
pattern_Agent_Status_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "agent", "status"}, ""))
|
||||
|
||||
pattern_Agent_Version_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "agent", "version"}, ""))
|
||||
)
|
||||
|
||||
var (
|
||||
forward_Agent_ReleaseShare_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_Agent_SharePrivate_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_Agent_SharePublic_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_Agent_Status_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_Agent_Version_0 = runtime.ForwardResponseMessage
|
||||
|
@ -7,10 +7,22 @@ import "google/api/annotations.proto";
|
||||
service Agent {
|
||||
rpc AccessPrivate(AccessPrivateRequest) returns (AccessPrivateResponse) {}
|
||||
rpc ReleaseAccess(ReleaseAccessRequest) returns (ReleaseAccessResponse) {}
|
||||
rpc ReleaseShare(ReleaseShareRequest) returns (ReleaseShareResponse) {}
|
||||
rpc ReleaseShare(ReleaseShareRequest) returns (ReleaseShareResponse) {
|
||||
option(google.api.http) = {
|
||||
post: "/v1/agent/releaseShare"
|
||||
};
|
||||
}
|
||||
rpc ShareReserved(ShareReservedRequest) returns (ShareReservedResponse) {}
|
||||
rpc SharePrivate(SharePrivateRequest) returns (SharePrivateResponse) {}
|
||||
rpc SharePublic(SharePublicRequest) returns (SharePublicResponse) {}
|
||||
rpc SharePrivate(SharePrivateRequest) returns (SharePrivateResponse) {
|
||||
option(google.api.http) = {
|
||||
post: "/v1/agent/sharePrivate"
|
||||
};
|
||||
}
|
||||
rpc SharePublic(SharePublicRequest) returns (SharePublicResponse) {
|
||||
option(google.api.http) = {
|
||||
post: "/v1/agent/sharePublic"
|
||||
};
|
||||
}
|
||||
rpc Status(StatusRequest) returns (StatusResponse) {
|
||||
option(google.api.http) = {
|
||||
get: "/v1/agent/status"
|
||||
|
@ -16,6 +16,194 @@
|
||||
"application/json"
|
||||
],
|
||||
"paths": {
|
||||
"/v1/agent/releaseShare": {
|
||||
"post": {
|
||||
"operationId": "Agent_ReleaseShare",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "A successful response.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/ReleaseShareResponse"
|
||||
}
|
||||
},
|
||||
"default": {
|
||||
"description": "An unexpected error response.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/rpcStatus"
|
||||
}
|
||||
}
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
"name": "token",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"Agent"
|
||||
]
|
||||
}
|
||||
},
|
||||
"/v1/agent/sharePrivate": {
|
||||
"post": {
|
||||
"operationId": "Agent_SharePrivate",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "A successful response.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/SharePrivateResponse"
|
||||
}
|
||||
},
|
||||
"default": {
|
||||
"description": "An unexpected error response.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/rpcStatus"
|
||||
}
|
||||
}
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
"name": "target",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "backendMode",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "insecure",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "closed",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "accessGrants",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"collectionFormat": "multi"
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"Agent"
|
||||
]
|
||||
}
|
||||
},
|
||||
"/v1/agent/sharePublic": {
|
||||
"post": {
|
||||
"operationId": "Agent_SharePublic",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "A successful response.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/SharePublicResponse"
|
||||
}
|
||||
},
|
||||
"default": {
|
||||
"description": "An unexpected error response.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/rpcStatus"
|
||||
}
|
||||
}
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
"name": "target",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "basicAuth",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"collectionFormat": "multi"
|
||||
},
|
||||
{
|
||||
"name": "frontendSelection",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"collectionFormat": "multi"
|
||||
},
|
||||
{
|
||||
"name": "backendMode",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "insecure",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "oauthProvider",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "oauthEmailAddressPatterns",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"collectionFormat": "multi"
|
||||
},
|
||||
{
|
||||
"name": "oauthCheckInterval",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "closed",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "accessGrants",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"collectionFormat": "multi"
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"Agent"
|
||||
]
|
||||
}
|
||||
},
|
||||
"/v1/agent/status": {
|
||||
"get": {
|
||||
"operationId": "Agent_Status",
|
||||
|
69
agent/agentUi/package-lock.json
generated
69
agent/agentUi/package-lock.json
generated
@ -13,6 +13,7 @@
|
||||
"@mui/icons-material": "^6.1.2",
|
||||
"@mui/material": "^6.1.2",
|
||||
"bootstrap": "^5.3.3",
|
||||
"formik": "^2.4.6",
|
||||
"react": "^18.3.1",
|
||||
"react-bootstrap": "^2.10.5",
|
||||
"react-data-table-component": "^7.6.2",
|
||||
@ -1728,6 +1729,16 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/hoist-non-react-statics": {
|
||||
"version": "3.3.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.5.tgz",
|
||||
"integrity": "sha512-SbcrWzkKBw2cdwRTwQAswfpB9g9LJWfjtUeW/jvNwbhC8cpmmNYVePa+ncbUe0rGTQ7G3Ff6mYUN2VMfLVr+Sg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/react": "*",
|
||||
"hoist-non-react-statics": "^3.3.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/json-schema": {
|
||||
"version": "7.0.15",
|
||||
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz",
|
||||
@ -3170,6 +3181,40 @@
|
||||
"url": "https://ko-fi.com/tunnckoCore/commissions"
|
||||
}
|
||||
},
|
||||
"node_modules/formik": {
|
||||
"version": "2.4.6",
|
||||
"resolved": "https://registry.npmjs.org/formik/-/formik-2.4.6.tgz",
|
||||
"integrity": "sha512-A+2EI7U7aG296q2TLGvNapDNTZp1khVt5Vk0Q/fyfSROss0V/V6+txt2aJnwEos44IxTCW/LYAi/zgWzlevj+g==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "individual",
|
||||
"url": "https://opencollective.com/formik"
|
||||
}
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@types/hoist-non-react-statics": "^3.3.1",
|
||||
"deepmerge": "^2.1.1",
|
||||
"hoist-non-react-statics": "^3.3.0",
|
||||
"lodash": "^4.17.21",
|
||||
"lodash-es": "^4.17.21",
|
||||
"react-fast-compare": "^2.0.1",
|
||||
"tiny-warning": "^1.0.2",
|
||||
"tslib": "^2.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": ">=16.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/formik/node_modules/deepmerge": {
|
||||
"version": "2.2.1",
|
||||
"resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-2.2.1.tgz",
|
||||
"integrity": "sha512-R9hc1Xa/NOBi9WRVUWg19rl1UB7Tt4kuPd+thNJgFZoxXsTz7ncaPaeIm+40oSGuP33DfMb4sZt1QIGiJzC4EA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/fsevents": {
|
||||
"version": "2.3.3",
|
||||
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
|
||||
@ -4016,6 +4061,18 @@
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/lodash": {
|
||||
"version": "4.17.21",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
||||
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/lodash-es": {
|
||||
"version": "4.17.21",
|
||||
"resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz",
|
||||
"integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/lodash.merge": {
|
||||
"version": "4.6.2",
|
||||
"resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",
|
||||
@ -4560,6 +4617,12 @@
|
||||
"react": "^18.3.1"
|
||||
}
|
||||
},
|
||||
"node_modules/react-fast-compare": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/react-fast-compare/-/react-fast-compare-2.0.4.tgz",
|
||||
"integrity": "sha512-suNP+J1VU1MWFKcyt7RtjiSWUjvidmQSlqu+eHslq+342xCbGTYmC0mEhPCOHxlW0CywylOC1u2DFAT+bv4dBw==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/react-is": {
|
||||
"version": "18.3.1",
|
||||
"resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz",
|
||||
@ -5121,6 +5184,12 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/tiny-warning": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz",
|
||||
"integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/to-fast-properties": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz",
|
||||
|
@ -15,6 +15,7 @@
|
||||
"@mui/icons-material": "^6.1.2",
|
||||
"@mui/material": "^6.1.2",
|
||||
"bootstrap": "^5.3.3",
|
||||
"formik": "^2.4.6",
|
||||
"react": "^18.3.1",
|
||||
"react-bootstrap": "^2.10.5",
|
||||
"react-data-table-component": "^7.6.2",
|
||||
|
@ -5,12 +5,11 @@ import {useEffect, useState} from "react";
|
||||
import {AgentApi, ApiClient} from "./api/src/index.js";
|
||||
import buildOverview from "./model/overview.js";
|
||||
import NavBar from "./NavBar.jsx";
|
||||
import {Box, Modal} from "@mui/material";
|
||||
import {Box, Button, MenuItem, Modal, TextField} from "@mui/material";
|
||||
import {useFormik} from "formik";
|
||||
|
||||
const AgentUi = () => {
|
||||
const [version, setVersion] = useState("");
|
||||
const [shares, setShares] = useState([]);
|
||||
const [accesses, setAccesses] = useState([]);
|
||||
const [overview, setOverview] = useState(new Map());
|
||||
const [newShare, setNewShare] = useState(false);
|
||||
|
||||
@ -46,8 +45,6 @@ const AgentUi = () => {
|
||||
let interval = setInterval(() => {
|
||||
api.agentStatus((err, data) => {
|
||||
if(mounted) {
|
||||
setShares(data.shares);
|
||||
setAccesses(data.accesses);
|
||||
setOverview(buildOverview(data));
|
||||
}
|
||||
});
|
||||
@ -58,17 +55,54 @@ const AgentUi = () => {
|
||||
}
|
||||
});
|
||||
|
||||
const releaseShare = (opts) => {
|
||||
api.agentReleaseShare(opts, (err, data) => {
|
||||
console.log(data);
|
||||
})
|
||||
}
|
||||
|
||||
const router = createBrowserRouter([
|
||||
{
|
||||
path: "/",
|
||||
element: <Overview version={version} overview={overview} />
|
||||
element: <Overview releaseShare={releaseShare} version={version} overview={overview} shareClick={openNewShare} />
|
||||
},
|
||||
{
|
||||
path: "/share/:token",
|
||||
element: <ShareDetail version={version} shares={shares} />
|
||||
element: <ShareDetail version={version} />
|
||||
}
|
||||
]);
|
||||
|
||||
const shareHandler = (values) => {
|
||||
switch(values.shareMode) {
|
||||
case "public":
|
||||
api.agentSharePublic({
|
||||
target: values.target,
|
||||
backendMode: values.backendMode,
|
||||
}, (err, data) => {
|
||||
closeNewShare();
|
||||
});
|
||||
break;
|
||||
|
||||
case "private":
|
||||
api.agentSharePrivate({
|
||||
target: values.target,
|
||||
backendMode: values.backendMode,
|
||||
}, (err, data) => {
|
||||
closeNewShare();
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
const formik = useFormik({
|
||||
initialValues: {
|
||||
shareMode: "public",
|
||||
backendMode: "proxy",
|
||||
target: "",
|
||||
},
|
||||
onSubmit: shareHandler,
|
||||
});
|
||||
|
||||
return (
|
||||
<>
|
||||
<NavBar version={version} shareClick={openNewShare} />
|
||||
@ -78,7 +112,51 @@ const AgentUi = () => {
|
||||
onClose={closeNewShare}
|
||||
>
|
||||
<Box sx={{ ...shareStyle }}>
|
||||
<h2>New Share</h2>
|
||||
<h2>Share...</h2>
|
||||
<form onSubmit={formik.handleSubmit}>
|
||||
<TextField
|
||||
fullWidth
|
||||
select
|
||||
id="shareMode"
|
||||
name="shareMode"
|
||||
label="Share Mode"
|
||||
value={formik.values.shareMode}
|
||||
onChange={formik.handleChange}
|
||||
onBlur={formik.handleBlur}
|
||||
sx={{ mt: 2 }}
|
||||
>
|
||||
<MenuItem value="public">public</MenuItem>
|
||||
<MenuItem value="private">private</MenuItem>
|
||||
</TextField>
|
||||
<TextField
|
||||
fullWidth select
|
||||
id="backendMode"
|
||||
name="backendMode"
|
||||
label="Backend Mode"
|
||||
value={formik.values.backendMode}
|
||||
onChange={formik.handleChange}
|
||||
onBlur={formik.handleBlur}
|
||||
sx={{ mt: 2 }}
|
||||
>
|
||||
<MenuItem value="proxy">proxy</MenuItem>
|
||||
<MenuItem value="web">web</MenuItem>
|
||||
</TextField>
|
||||
<TextField
|
||||
fullWidth
|
||||
id="target"
|
||||
name="target"
|
||||
label="Target"
|
||||
value={formik.values.target}
|
||||
onChange={formik.handleChange}
|
||||
onBlur={formik.handleBlur}
|
||||
sx={{ mt: 2 }}
|
||||
>
|
||||
|
||||
</TextField>
|
||||
<Button color="primary" variant="contained" type="submit" sx={{ mt: 2 }}>
|
||||
Create Share
|
||||
</Button>
|
||||
</form>
|
||||
</Box>
|
||||
</Modal>
|
||||
</>
|
||||
|
@ -1,27 +1,30 @@
|
||||
import "bootstrap/dist/css/bootstrap.min.css";
|
||||
import ShareCard from "./ShareCard.jsx";
|
||||
import AccessCard from "./AccessCard.jsx";
|
||||
import LanIcon from "@mui/icons-material/Lan";
|
||||
import ShareIcon from "@mui/icons-material/Share";
|
||||
|
||||
const Overview = (props) => {
|
||||
let cards = [];
|
||||
props.overview.forEach((row) => {
|
||||
switch(row.type) {
|
||||
case "share":
|
||||
cards.push(<ShareCard share={row.v} />);
|
||||
break;
|
||||
if(props.overview.size > 0) {
|
||||
props.overview.forEach((row) => {
|
||||
switch(row.type) {
|
||||
case "share":
|
||||
cards.push(<ShareCard releaseShare={props.releaseShare} share={row.v} />);
|
||||
break;
|
||||
|
||||
case "access":
|
||||
cards.push(<AccessCard access={row.v} />);
|
||||
break;
|
||||
}
|
||||
case "access":
|
||||
cards.push(<AccessCard access={row.v} />);
|
||||
break;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
cards.push(<div key="help" className={"card"}>
|
||||
<h5>Your zrok Agent is empty! Add a <a href="#" onClick={props.shareClick}>share <ShareIcon /></a> or <a href={"#"}>access <LanIcon /></a> share to get started.</h5>
|
||||
</div>);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
return (
|
||||
<>
|
||||
{cards}
|
||||
</>
|
||||
)
|
||||
return <>{cards}</>;
|
||||
}
|
||||
|
||||
export default Overview;
|
||||
|
@ -1,4 +1,5 @@
|
||||
import ShareIcon from "@mui/icons-material/Share";
|
||||
import DeleteIcon from "@mui/icons-material/Delete";
|
||||
|
||||
const ShareCard = (props) => {
|
||||
let frontends = [];
|
||||
@ -6,6 +7,10 @@ const ShareCard = (props) => {
|
||||
frontends.push(<a href={fe.toString()} target={"_"}>{fe}</a>);
|
||||
})
|
||||
|
||||
const releaseClicked = () => {
|
||||
props.releaseShare({token: props.share.token}, (err, data) => { console.log("releaseClicked", data); });
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={"card"}>
|
||||
<h2>{props.share.token} [<ShareIcon />]</h2>
|
||||
@ -13,6 +18,7 @@ const ShareCard = (props) => {
|
||||
<p>
|
||||
{props.share.backendEndpoint} → {frontends}
|
||||
</p>
|
||||
<p><DeleteIcon onClick={releaseClicked}/></p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
@ -103,6 +103,9 @@ var AgentAgentGrpcAgentProto = require('agent_agent_grpc_agent_proto');
|
||||
|
||||
|
||||
var api = new AgentAgentGrpcAgentProto.AgentApi()
|
||||
var opts = {
|
||||
'token': "token_example" // {String}
|
||||
};
|
||||
var callback = function(error, data, response) {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
@ -110,7 +113,7 @@ var callback = function(error, data, response) {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}
|
||||
};
|
||||
api.agentStatus(callback);
|
||||
api.agentReleaseShare(opts, callback);
|
||||
|
||||
```
|
||||
|
||||
@ -120,6 +123,9 @@ All URIs are relative to *http://localhost*
|
||||
|
||||
Class | Method | HTTP request | Description
|
||||
------------ | ------------- | ------------- | -------------
|
||||
*AgentAgentGrpcAgentProto.AgentApi* | [**agentReleaseShare**](docs/AgentApi.md#agentReleaseShare) | **POST** /v1/agent/releaseShare |
|
||||
*AgentAgentGrpcAgentProto.AgentApi* | [**agentSharePrivate**](docs/AgentApi.md#agentSharePrivate) | **POST** /v1/agent/sharePrivate |
|
||||
*AgentAgentGrpcAgentProto.AgentApi* | [**agentSharePublic**](docs/AgentApi.md#agentSharePublic) | **POST** /v1/agent/sharePublic |
|
||||
*AgentAgentGrpcAgentProto.AgentApi* | [**agentStatus**](docs/AgentApi.md#agentStatus) | **GET** /v1/agent/status |
|
||||
*AgentAgentGrpcAgentProto.AgentApi* | [**agentVersion**](docs/AgentApi.md#agentVersion) | **GET** /v1/agent/version |
|
||||
|
||||
|
@ -4,11 +4,175 @@ All URIs are relative to *http://localhost*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**agentReleaseShare**](AgentApi.md#agentReleaseShare) | **POST** /v1/agent/releaseShare |
|
||||
[**agentSharePrivate**](AgentApi.md#agentSharePrivate) | **POST** /v1/agent/sharePrivate |
|
||||
[**agentSharePublic**](AgentApi.md#agentSharePublic) | **POST** /v1/agent/sharePublic |
|
||||
[**agentStatus**](AgentApi.md#agentStatus) | **GET** /v1/agent/status |
|
||||
[**agentVersion**](AgentApi.md#agentVersion) | **GET** /v1/agent/version |
|
||||
|
||||
|
||||
|
||||
## agentReleaseShare
|
||||
|
||||
> Object agentReleaseShare(opts)
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
|
||||
```javascript
|
||||
import AgentAgentGrpcAgentProto from 'agent_agent_grpc_agent_proto';
|
||||
|
||||
let apiInstance = new AgentAgentGrpcAgentProto.AgentApi();
|
||||
let opts = {
|
||||
'token': "token_example" // String |
|
||||
};
|
||||
apiInstance.agentReleaseShare(opts, (error, data, response) => {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
} else {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**token** | **String**| | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
**Object**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json
|
||||
|
||||
|
||||
## agentSharePrivate
|
||||
|
||||
> SharePrivateResponse agentSharePrivate(opts)
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
|
||||
```javascript
|
||||
import AgentAgentGrpcAgentProto from 'agent_agent_grpc_agent_proto';
|
||||
|
||||
let apiInstance = new AgentAgentGrpcAgentProto.AgentApi();
|
||||
let opts = {
|
||||
'target': "target_example", // String |
|
||||
'backendMode': "backendMode_example", // String |
|
||||
'insecure': true, // Boolean |
|
||||
'closed': true, // Boolean |
|
||||
'accessGrants': ["null"] // [String] |
|
||||
};
|
||||
apiInstance.agentSharePrivate(opts, (error, data, response) => {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
} else {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**target** | **String**| | [optional]
|
||||
**backendMode** | **String**| | [optional]
|
||||
**insecure** | **Boolean**| | [optional]
|
||||
**closed** | **Boolean**| | [optional]
|
||||
**accessGrants** | [**[String]**](String.md)| | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
[**SharePrivateResponse**](SharePrivateResponse.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json
|
||||
|
||||
|
||||
## agentSharePublic
|
||||
|
||||
> SharePublicResponse agentSharePublic(opts)
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
|
||||
```javascript
|
||||
import AgentAgentGrpcAgentProto from 'agent_agent_grpc_agent_proto';
|
||||
|
||||
let apiInstance = new AgentAgentGrpcAgentProto.AgentApi();
|
||||
let opts = {
|
||||
'target': "target_example", // String |
|
||||
'basicAuth': ["null"], // [String] |
|
||||
'frontendSelection': ["null"], // [String] |
|
||||
'backendMode': "backendMode_example", // String |
|
||||
'insecure': true, // Boolean |
|
||||
'oauthProvider': "oauthProvider_example", // String |
|
||||
'oauthEmailAddressPatterns': ["null"], // [String] |
|
||||
'oauthCheckInterval': "oauthCheckInterval_example", // String |
|
||||
'closed': true, // Boolean |
|
||||
'accessGrants': ["null"] // [String] |
|
||||
};
|
||||
apiInstance.agentSharePublic(opts, (error, data, response) => {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
} else {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**target** | **String**| | [optional]
|
||||
**basicAuth** | [**[String]**](String.md)| | [optional]
|
||||
**frontendSelection** | [**[String]**](String.md)| | [optional]
|
||||
**backendMode** | **String**| | [optional]
|
||||
**insecure** | **Boolean**| | [optional]
|
||||
**oauthProvider** | **String**| | [optional]
|
||||
**oauthEmailAddressPatterns** | [**[String]**](String.md)| | [optional]
|
||||
**oauthCheckInterval** | **String**| | [optional]
|
||||
**closed** | **Boolean**| | [optional]
|
||||
**accessGrants** | [**[String]**](String.md)| | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
[**SharePublicResponse**](SharePublicResponse.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json
|
||||
|
||||
|
||||
## agentStatus
|
||||
|
||||
> StatusResponse agentStatus()
|
||||
|
@ -14,6 +14,8 @@
|
||||
|
||||
import ApiClient from "../ApiClient";
|
||||
import RpcStatus from '../model/RpcStatus';
|
||||
import SharePrivateResponse from '../model/SharePrivateResponse';
|
||||
import SharePublicResponse from '../model/SharePublicResponse';
|
||||
import StatusResponse from '../model/StatusResponse';
|
||||
import VersionResponse from '../model/VersionResponse';
|
||||
|
||||
@ -36,6 +38,149 @@ export default class AgentApi {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Callback function to receive the result of the agentReleaseShare operation.
|
||||
* @callback module:api/AgentApi~agentReleaseShareCallback
|
||||
* @param {String} error Error message, if any.
|
||||
* @param {Object} data The data returned by the service call.
|
||||
* @param {String} response The complete HTTP response.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @param {Object} opts Optional parameters
|
||||
* @param {String} [token]
|
||||
* @param {module:api/AgentApi~agentReleaseShareCallback} callback The callback function, accepting three arguments: error, data, response
|
||||
* data is of type: {@link Object}
|
||||
*/
|
||||
agentReleaseShare(opts, callback) {
|
||||
opts = opts || {};
|
||||
let postBody = null;
|
||||
|
||||
let pathParams = {
|
||||
};
|
||||
let queryParams = {
|
||||
'token': opts['token']
|
||||
};
|
||||
let headerParams = {
|
||||
};
|
||||
let formParams = {
|
||||
};
|
||||
|
||||
let authNames = [];
|
||||
let contentTypes = [];
|
||||
let accepts = ['application/json'];
|
||||
let returnType = Object;
|
||||
return this.apiClient.callApi(
|
||||
'/v1/agent/releaseShare', 'POST',
|
||||
pathParams, queryParams, headerParams, formParams, postBody,
|
||||
authNames, contentTypes, accepts, returnType, null, callback
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback function to receive the result of the agentSharePrivate operation.
|
||||
* @callback module:api/AgentApi~agentSharePrivateCallback
|
||||
* @param {String} error Error message, if any.
|
||||
* @param {module:model/SharePrivateResponse} data The data returned by the service call.
|
||||
* @param {String} response The complete HTTP response.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @param {Object} opts Optional parameters
|
||||
* @param {String} [target]
|
||||
* @param {String} [backendMode]
|
||||
* @param {Boolean} [insecure]
|
||||
* @param {Boolean} [closed]
|
||||
* @param {Array.<String>} [accessGrants]
|
||||
* @param {module:api/AgentApi~agentSharePrivateCallback} callback The callback function, accepting three arguments: error, data, response
|
||||
* data is of type: {@link module:model/SharePrivateResponse}
|
||||
*/
|
||||
agentSharePrivate(opts, callback) {
|
||||
opts = opts || {};
|
||||
let postBody = null;
|
||||
|
||||
let pathParams = {
|
||||
};
|
||||
let queryParams = {
|
||||
'target': opts['target'],
|
||||
'backendMode': opts['backendMode'],
|
||||
'insecure': opts['insecure'],
|
||||
'closed': opts['closed'],
|
||||
'accessGrants': this.apiClient.buildCollectionParam(opts['accessGrants'], 'multi')
|
||||
};
|
||||
let headerParams = {
|
||||
};
|
||||
let formParams = {
|
||||
};
|
||||
|
||||
let authNames = [];
|
||||
let contentTypes = [];
|
||||
let accepts = ['application/json'];
|
||||
let returnType = SharePrivateResponse;
|
||||
return this.apiClient.callApi(
|
||||
'/v1/agent/sharePrivate', 'POST',
|
||||
pathParams, queryParams, headerParams, formParams, postBody,
|
||||
authNames, contentTypes, accepts, returnType, null, callback
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback function to receive the result of the agentSharePublic operation.
|
||||
* @callback module:api/AgentApi~agentSharePublicCallback
|
||||
* @param {String} error Error message, if any.
|
||||
* @param {module:model/SharePublicResponse} data The data returned by the service call.
|
||||
* @param {String} response The complete HTTP response.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @param {Object} opts Optional parameters
|
||||
* @param {String} [target]
|
||||
* @param {Array.<String>} [basicAuth]
|
||||
* @param {Array.<String>} [frontendSelection]
|
||||
* @param {String} [backendMode]
|
||||
* @param {Boolean} [insecure]
|
||||
* @param {String} [oauthProvider]
|
||||
* @param {Array.<String>} [oauthEmailAddressPatterns]
|
||||
* @param {String} [oauthCheckInterval]
|
||||
* @param {Boolean} [closed]
|
||||
* @param {Array.<String>} [accessGrants]
|
||||
* @param {module:api/AgentApi~agentSharePublicCallback} callback The callback function, accepting three arguments: error, data, response
|
||||
* data is of type: {@link module:model/SharePublicResponse}
|
||||
*/
|
||||
agentSharePublic(opts, callback) {
|
||||
opts = opts || {};
|
||||
let postBody = null;
|
||||
|
||||
let pathParams = {
|
||||
};
|
||||
let queryParams = {
|
||||
'target': opts['target'],
|
||||
'basicAuth': this.apiClient.buildCollectionParam(opts['basicAuth'], 'multi'),
|
||||
'frontendSelection': this.apiClient.buildCollectionParam(opts['frontendSelection'], 'multi'),
|
||||
'backendMode': opts['backendMode'],
|
||||
'insecure': opts['insecure'],
|
||||
'oauthProvider': opts['oauthProvider'],
|
||||
'oauthEmailAddressPatterns': this.apiClient.buildCollectionParam(opts['oauthEmailAddressPatterns'], 'multi'),
|
||||
'oauthCheckInterval': opts['oauthCheckInterval'],
|
||||
'closed': opts['closed'],
|
||||
'accessGrants': this.apiClient.buildCollectionParam(opts['accessGrants'], 'multi')
|
||||
};
|
||||
let headerParams = {
|
||||
};
|
||||
let formParams = {
|
||||
};
|
||||
|
||||
let authNames = [];
|
||||
let contentTypes = [];
|
||||
let accepts = ['application/json'];
|
||||
let returnType = SharePublicResponse;
|
||||
return this.apiClient.callApi(
|
||||
'/v1/agent/sharePublic', 'POST',
|
||||
pathParams, queryParams, headerParams, formParams, postBody,
|
||||
authNames, contentTypes, accepts, returnType, null, callback
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback function to receive the result of the agentStatus operation.
|
||||
* @callback module:api/AgentApi~agentStatusCallback
|
||||
|
@ -59,4 +59,4 @@ button:focus-visible {
|
||||
margin-top: 2em;
|
||||
padding: 1em;
|
||||
border: 0;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user