Skip to content

Commit

Permalink
修改了创建任务的按钮逻辑,支持了创建远程任务并启动队列
Browse files Browse the repository at this point in the history
  • Loading branch information
autodotua committed Jun 18, 2024
1 parent 2d57abb commit 48ca950
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 20 deletions.
65 changes: 48 additions & 17 deletions SimpleFFmpegGUI.WPF/Pages/AddTaskPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@
xmlns:ui="http://schemas.modernwpf.com/2019"
Loaded="Window_Loaded"
mc:Ignorable="d">
<UserControl.Resources>
<Style
x:Key="FlyoutButtonStyle"
BasedOn="{StaticResource DefaultButtonStyle}"
TargetType="{x:Type Button}">
<Setter Property="Background" Value="Transparent" />
</Style>
</UserControl.Resources>
<Grid Margin="8,8,0,8">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
Expand Down Expand Up @@ -66,6 +74,7 @@
<panels:CodeArgumentsPanel x:Name="argumentsPanel" />
</GroupBox>
</Grid>

<ui:CommandBar
Grid.Row="4"
Grid.ColumnSpan="99"
Expand All @@ -89,29 +98,51 @@
Label="保存为预设" />
<ui:AppBarSeparator />

<ui:AppBarButton
Command="{Binding AddToRemoteHostCommand}"
Label="提交到远程">
<ui:AppBarButton Label="创建远程任务">
<ui:AppBarButton.Icon>
<ui:FontIcon Glyph="&#xE836;" />
</ui:AppBarButton.Icon>
<ui:AppBarButton.Flyout>
<ui:MenuFlyout>
<MenuItem
Command="{Binding AddToRemoteHostCommand}"
Header="仅创建任务">
<MenuItem.CommandParameter>
<system:Boolean>false</system:Boolean>
</MenuItem.CommandParameter>
</MenuItem>
<MenuItem
Command="{Binding AddToRemoteHostCommand}"
Header="创建并启动队列">
<MenuItem.CommandParameter>
<system:Boolean>true</system:Boolean>
</MenuItem.CommandParameter>
</MenuItem>
</ui:MenuFlyout>
</ui:AppBarButton.Flyout>
</ui:AppBarButton>

<ui:AppBarButton
Command="{Binding AddToQueueCommand}"
Icon="Add"
Label="创建任务">
<ui:AppBarButton.CommandParameter>
<system:Boolean>false</system:Boolean>
</ui:AppBarButton.CommandParameter>
</ui:AppBarButton>
<ui:AppBarButton
Command="{Binding AddToQueueCommand}"
Icon="Add"
Label="创建并启动"
Tag="queue">
<ui:AppBarButton.CommandParameter>
<system:Boolean>true</system:Boolean>
</ui:AppBarButton.CommandParameter>
Label="创建本地任务">
<ui:AppBarButton.Flyout>
<ui:MenuFlyout>
<MenuItem
Command="{Binding AddToQueueCommand}"
Header="仅创建任务">
<MenuItem.CommandParameter>
<system:Boolean>false</system:Boolean>
</MenuItem.CommandParameter>
</MenuItem>
<MenuItem
Command="{Binding AddToQueueCommand}"
Header="创建并启动队列">
<MenuItem.CommandParameter>
<system:Boolean>true</system:Boolean>
</MenuItem.CommandParameter>
</MenuItem>
</ui:MenuFlyout>
</ui:AppBarButton.Flyout>
</ui:AppBarButton>
<ui:AppBarSeparator />
<ui:CommandBar.SecondaryCommands>
Expand Down
4 changes: 2 additions & 2 deletions SimpleFFmpegGUI.WPF/ViewModels/AddTaskPageViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ private async Task AddToQueueAsync(bool addToQueue)
}

[RelayCommand]
private async Task AddToRemoteHost()
private async Task AddToRemoteHost(bool addToQueue)
{
var args = CodeArgumentsViewModel.GetArguments();
try
Expand Down Expand Up @@ -191,7 +191,7 @@ private async Task AddToRemoteHost()
Inputs = inputs,
Output = output,
Argument = args,
Start = false
Start = addToQueue
};
await PostAsync(host, "Task/Add/" + Type.ToString(), data);

Expand Down
6 changes: 5 additions & 1 deletion 日志.md
Original file line number Diff line number Diff line change
Expand Up @@ -699,4 +699,8 @@

【Web】修复了多选取消任务无效的BUG

修复了多个dbContext实例导致数据不同步的BUG并修改Logger为静态类
修复了多个dbContext实例导致数据不同步的BUG并修改Logger为静态类

## 20240618

【WPF】修改了创建任务的按钮逻辑,支持了创建远程任务并启动队列

0 comments on commit 48ca950

Please sign in to comment.