web socket添加token验证能力(使用token+创建时设置验证回调);flowEnv添加WebSocket处理消息能力,下一步将开发远程登录登录工具。

This commit is contained in:
fengjiayi
2024-10-15 21:56:09 +08:00
parent dbbde4f03e
commit 1d97ea5da1
64 changed files with 811 additions and 395 deletions

View File

@@ -8,7 +8,7 @@ using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
namespace Serein.WorkBench.Node.ViewModel
namespace Serein.Workbench.Node.ViewModel
{
public abstract class NodeControlViewModelBase : INotifyPropertyChanged
{

View File

@@ -1,12 +1,12 @@
<local:NodeControlBase x:Class="Serein.WorkBench.Node.View.ActionNodeControl"
<local:NodeControlBase x:Class="Serein.Workbench.Node.View.ActionNodeControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Serein.WorkBench.Node.View"
xmlns:vm="clr-namespace:Serein.WorkBench.Node.ViewModel"
xmlns:Converters="clr-namespace:Serein.WorkBench.Tool.Converters"
xmlns:themes="clr-namespace:Serein.WorkBench.Themes"
xmlns:local="clr-namespace:Serein.Workbench.Node.View"
xmlns:vm="clr-namespace:Serein.Workbench.Node.ViewModel"
xmlns:Converters="clr-namespace:Serein.Workbench.Tool.Converters"
xmlns:themes="clr-namespace:Serein.Workbench.Themes"
MaxWidth="300">
<UserControl.Resources>
<!--<BooleanToVisibilityConverter x:Key="BoolToVisConverter" />-->

View File

@@ -1,9 +1,9 @@
using Serein.NodeFlow.Model;
using Serein.WorkBench.Node.ViewModel;
using Serein.Workbench.Node.ViewModel;
using System.Runtime.CompilerServices;
using System.Windows.Controls;
namespace Serein.WorkBench.Node.View
namespace Serein.Workbench.Node.View
{
/// <summary>
/// ActionNode.xaml 的交互逻辑

View File

@@ -1,9 +1,9 @@
<local:NodeControlBase x:Class="Serein.WorkBench.Node.View.ActionRegionControl"
<local:NodeControlBase x:Class="Serein.Workbench.Node.View.ActionRegionControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Serein.WorkBench.Node.View"
xmlns:local="clr-namespace:Serein.Workbench.Node.View"
MaxWidth="300">
<Grid>
<!--<Border BorderBrush="Black" BorderThickness="1" Padding="10">

View File

@@ -1,11 +1,12 @@
using Serein.NodeFlow;
using Serein.NodeFlow.Model;
using Serein.Workbench.Node.View;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Input;
namespace Serein.WorkBench.Node.View
namespace Serein.Workbench.Node.View
{
/// <summary>
/// ActionRegion.xaml 的交互逻辑

View File

@@ -1,11 +1,11 @@
<local:NodeControlBase x:Class="Serein.WorkBench.Node.View.ConditionNodeControl"
<local:NodeControlBase x:Class="Serein.Workbench.Node.View.ConditionNodeControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Serein.WorkBench.Node.View"
xmlns:vm="clr-namespace:Serein.WorkBench.Node.ViewModel"
xmlns:themes="clr-namespace:Serein.WorkBench.Themes"
xmlns:local="clr-namespace:Serein.Workbench.Node.View"
xmlns:vm="clr-namespace:Serein.Workbench.Node.ViewModel"
xmlns:themes="clr-namespace:Serein.Workbench.Themes"
MaxWidth="300">
<UserControl.Resources>

View File

@@ -1,7 +1,7 @@
using Serein.NodeFlow.Model;
using Serein.WorkBench.Node.ViewModel;
using Serein.Workbench.Node.ViewModel;
namespace Serein.WorkBench.Node.View
namespace Serein.Workbench.Node.View
{
/// <summary>
/// ConditionNode.xaml 的交互逻辑

View File

@@ -1,9 +1,9 @@
<local:NodeControlBase x:Class="Serein.WorkBench.Node.View.ConditionRegionControl"
<local:NodeControlBase x:Class="Serein.Workbench.Node.View.ConditionRegionControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Serein.WorkBench.Node.View"
xmlns:local="clr-namespace:Serein.Workbench.Node.View"
MaxWidth="300">
<Grid>
<Border BorderBrush="Black" BorderThickness="1" Padding="10">

View File

@@ -1,11 +1,11 @@
using Serein.NodeFlow.Model;
using Serein.WorkBench.Node.ViewModel;
using Serein.Workbench.Node.ViewModel;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Input;
namespace Serein.WorkBench.Node.View
namespace Serein.Workbench.Node.View
{
/// <summary>
/// ConditionRegion.xaml 的交互逻辑

View File

@@ -1,9 +1,9 @@
<UserControl x:Class="Serein.WorkBench.Node.View.DllControl"
<UserControl x:Class="Serein.Workbench.Node.View.DllControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Serein.WorkBench.Node.View"
xmlns:local="clr-namespace:Serein.Workbench.Node.View"
MaxWidth="300"
>
<DockPanel>
@@ -21,7 +21,7 @@
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<GroupBox x:Name="ActionNodes" Grid.Row="0" Header="动作" Margin="5">
<GroupBox x:Name="Ac" Grid.Row="0" Header="动作" Margin="5">
<ListBox x:Name="ActionsListBox" Background="#D0F1F9"/>
</GroupBox>
<GroupBox x:Name="FlipflopNodes" Grid.Row="1" Header="触发器" Margin="5" >

View File

@@ -8,7 +8,7 @@ using System.Windows.Automation;
using System.Windows.Controls;
using System.Windows.Input;
namespace Serein.WorkBench.Node.View
namespace Serein.Workbench.Node.View
{

View File

@@ -1,9 +1,9 @@
<local:NodeControlBase x:Class="Serein.WorkBench.Node.View.ExpOpNodeControl"
<local:NodeControlBase x:Class="Serein.Workbench.Node.View.ExpOpNodeControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Serein.WorkBench.Node.View"
xmlns:local="clr-namespace:Serein.Workbench.Node.View"
MaxWidth="300">
<Grid>
<Grid.RowDefinitions>

View File

@@ -1,7 +1,7 @@
using Serein.NodeFlow.Model;
using Serein.WorkBench.Node.ViewModel;
using Serein.Workbench.Node.ViewModel;
namespace Serein.WorkBench.Node.View
namespace Serein.Workbench.Node.View
{
/// <summary>
/// ExprOpNodeControl.xaml 的交互逻辑

View File

@@ -1,13 +1,13 @@
<local:NodeControlBase x:Class="Serein.WorkBench.Node.View.FlipflopNodeControl"
<local:NodeControlBase x:Class="Serein.Workbench.Node.View.FlipflopNodeControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:Converters="clr-namespace:Serein.WorkBench.Tool.Converters"
xmlns:local="clr-namespace:Serein.WorkBench.Node.View"
xmlns:vm="clr-namespace:Serein.WorkBench.Node.ViewModel"
xmlns:themes="clr-namespace:Serein.WorkBench.Themes"
xmlns:Converters="clr-namespace:Serein.Workbench.Tool.Converters"
xmlns:local="clr-namespace:Serein.Workbench.Node.View"
xmlns:vm="clr-namespace:Serein.Workbench.Node.ViewModel"
xmlns:themes="clr-namespace:Serein.Workbench.Themes"
MaxWidth="300">
<UserControl.Resources>

View File

@@ -1,7 +1,7 @@
using Serein.NodeFlow.Model;
using Serein.WorkBench.Node.ViewModel;
using Serein.Workbench.Node.ViewModel;
namespace Serein.WorkBench.Node.View
namespace Serein.Workbench.Node.View
{
/// <summary>
/// StateNode.xaml 的交互逻辑

View File

@@ -1,7 +1,7 @@
using Serein.Library.Api;
using Serein.Library.Entity;
using Serein.NodeFlow.Base;
using Serein.WorkBench.Node.ViewModel;
using Serein.Workbench.Node.ViewModel;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
@@ -9,7 +9,7 @@ using System.Runtime.CompilerServices;
using System.Windows.Controls;
using System.Windows.Media;
namespace Serein.WorkBench.Node.View
namespace Serein.Workbench.Node.View
{
/// <summary>
@@ -34,24 +34,19 @@ namespace Serein.WorkBench.Node.View
//public class FLowNodeObObservableCollection<T> : ObservableCollection<T>
//{
public class FLowNodeObObservableCollection<T> : ObservableCollection<T>
{
public void AddRange(IEnumerable<T> items)
{
foreach (var item in items)
{
this.Items.Add(item);
}
OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add));
}
}
// public void AddRange(IEnumerable<T> items)
// {
// foreach (var item in items)
// {
// this.Items.Add(item);
// }
// OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add));
// }
//}
}

View File

@@ -1,7 +1,7 @@
using Serein.NodeFlow.Model;
using Serein.WorkBench.Node.View;
using Serein.Workbench.Node.View;
namespace Serein.WorkBench.Node.ViewModel
namespace Serein.Workbench.Node.ViewModel
{
public class ActionNodeControlViewModel : NodeControlViewModelBase
{

View File

@@ -1,8 +1,11 @@
using Serein.NodeFlow.Model;
using Serein.WorkBench.Node.View;
using Serein.Workbench.Node.View;
namespace Serein.WorkBench.Node.ViewModel
namespace Serein.Workbench.Node.ViewModel
{
/// <summary>
/// 条件节点
/// </summary>
public class ConditionNodeControlViewModel : NodeControlViewModelBase
{
private readonly SingleConditionNode singleConditionNode;
@@ -32,6 +35,10 @@ namespace Serein.WorkBench.Node.ViewModel
set { singleConditionNode.Expression = value; OnPropertyChanged(); }
}
/// <summary>
/// 条件节点
/// </summary>
/// <param name="node"></param>
public ConditionNodeControlViewModel(SingleConditionNode node) : base(node)
{
this.singleConditionNode = node;

View File

@@ -1,12 +1,12 @@
using Serein.NodeFlow.Model;
using Serein.WorkBench.Node.View;
using Serein.Workbench.Node.View;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Serein.WorkBench.Node.ViewModel
namespace Serein.Workbench.Node.ViewModel
{
public class ConditionRegionNodeControlViewModel : NodeControlViewModelBase
{

View File

@@ -1,7 +1,7 @@
using Serein.NodeFlow.Model;
using Serein.WorkBench.Node.View;
using Serein.Workbench.Node.View;
namespace Serein.WorkBench.Node.ViewModel
namespace Serein.Workbench.Node.ViewModel
{
public class ExpOpNodeViewModel: NodeControlViewModelBase
{

View File

@@ -1,7 +1,7 @@
using Serein.NodeFlow.Model;
using Serein.WorkBench.Node.View;
using Serein.Workbench.Node.View;
namespace Serein.WorkBench.Node.ViewModel
namespace Serein.Workbench.Node.ViewModel
{
public class FlipflopNodeControlViewModel : NodeControlViewModelBase
{

View File

@@ -6,7 +6,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
namespace Serein.WorkBench.Node.ViewModel
namespace Serein.Workbench.Node.ViewModel
{
public class TypeToStringConverter : IValueConverter
{