Files
better-genshin-impact/BetterGenshinImpact/View/Windows/Editable/ScriptGroupProjectEditor.xaml

99 lines
5.6 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<UserControl x:Class="BetterGenshinImpact.View.Windows.Editable.ScriptGroupProjectEditor"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BetterGenshinImpact.Core.Script.Group"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:editable="clr-namespace:BetterGenshinImpact.ViewModel.Windows.Editable"
xmlns:sys="clr-namespace:System;assembly=System.Runtime"
MinWidth="350"
MinHeight="300"
d:DesignHeight="200"
d:DesignWidth="350"
mc:Ignorable="d">
<UserControl.Resources>
<ObjectDataProvider x:Key="StatusDescriptionsProvider"
MethodName="GetStatusDescriptions"
ObjectType="{x:Type local:ScriptGroupProjectExtensions}" />
<ObjectDataProvider x:Key="ScheduleDescriptionsProvider"
MethodName="GetScheduleDescriptions"
ObjectType="{x:Type local:ScriptGroupProjectExtensions}" />
<BooleanToVisibilityConverter x:Key="BoolToVisConverter"/>
</UserControl.Resources>
<Grid>
<ScrollViewer MaxHeight="350" VerticalScrollBarVisibility="Auto">
<StackPanel Margin="0,0,20,0">
<!--<TextBlock Margin="0,0,0,10" Text="执行周期" />
<ComboBox Margin="0,0,0,20"
DisplayMemberPath="Value"
ItemsSource="{Binding Source={StaticResource ScheduleDescriptionsProvider}}"
SelectedValue="{Binding Schedule, Mode=TwoWay}"
SelectedValuePath="Key" />
<TextBlock Margin="0,0,0,10" Text="执行次数" />
<TextBox Margin="0,0,0,20" Text="{Binding RunNum, Mode=TwoWay}" />-->
<TextBlock Margin="0,0,0,10" Text="状态" />
<ComboBox DisplayMemberPath="Value"
ItemsSource="{Binding Source={StaticResource StatusDescriptionsProvider}}"
SelectedValue="{Binding Status, Mode=TwoWay}"
SelectedValuePath="Key" />
<TextBlock Margin="0,10,0,5" Text="JS 通知权限"
Visibility="{Binding IsJsScript, Converter={StaticResource BoolToVisConverter}}"/>
<ComboBox Margin="0,0,0,10"
ItemsSource="{Binding JsNotificationOptions}"
DisplayMemberPath="Value"
SelectedValuePath="Key"
IsEnabled="{Binding GlobalJsNotificationEnabled}"
ToolTip="{Binding JsNotificationToolTip}"
SelectedValue="{Binding AllowJsNotification, Mode=TwoWay}"
Visibility="{Binding IsJsScript, Converter={StaticResource BoolToVisConverter}}">
</ComboBox>
<TextBlock Margin="0,10,0,5" Text="JS HTTP权限"
Visibility="{Binding IsJsScript, Converter={StaticResource BoolToVisConverter}}"/>
<TextBlock Margin="0,0,0,5"
Text="允许脚本发送HTTP请求可能会带来安全风险请谨慎开启。"
Foreground="Orange"
Visibility="{Binding IsJsScript, Converter={StaticResource BoolToVisConverter}}"/>
<TextBlock Margin="0,0,0,5"
Text="注意脚本更新http_allowed_urls后需手动重新启用权限。"
Foreground="Orange"
Visibility="{Binding IsJsScript, Converter={StaticResource BoolToVisConverter}}"/>
<ItemsControl Margin="0,0,0,0" ItemsSource="{Binding JsHTTPInfoText}"
Visibility="{Binding IsJsScript, Converter={StaticResource BoolToVisConverter}}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Text}"
Foreground="{Binding Color}"
FontSize="11"
TextWrapping="NoWrap"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<ItemsControl Margin="0,0,0,10" ItemsSource="{Binding JsHTTPInfo}"
Visibility="{Binding IsJsScript, Converter={StaticResource BoolToVisConverter}}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<TextBox Text="{Binding Text}"
IsReadOnly="True"
Foreground="{Binding Color}"
FontSize="11"
FontFamily="Consolas"
TextWrapping="NoWrap"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<ComboBox DisplayMemberPath="Value"
ItemsSource="{Binding JsNotificationOptions}"
SelectedValue="{Binding AllowJsHTTP, Mode=TwoWay}"
SelectedValuePath="Key"
Visibility="{Binding IsJsScript, Converter={StaticResource BoolToVisConverter}}">
</ComboBox>
</StackPanel>
</ScrollViewer>
</Grid>
</UserControl>