feat: 外部通知设置显示移至UI判断 (#7244)

This commit is contained in:
MistEO
2023-11-08 15:09:59 +08:00
committed by GitHub
7 changed files with 48 additions and 58 deletions

View File

@@ -36,15 +36,15 @@
<system:String x:Key="ExternalNotificationSendTest">Send Test</system:String>
<system:String x:Key="ExternalNotificationSendTestTitle">MAA external notification test</system:String>
<system:String x:Key="ExternalNotificationSendTestContent">This is MAA external notification test information. If you see this content, the notification was sent successfully!</system:String>
<system:String x:Key="ExternalNotificationServerChanSendKey">[Server Chan] Send Key</system:String>
<system:String x:Key="ExternalNotificationSmtpTo">[SMTP] Recipient</system:String>
<system:String x:Key="ExternalNotificationSmtpServer">[SMTP] Server</system:String>
<system:String x:Key="ExternalNotificationSmtpPort">[SMTP] Port</system:String>
<system:String x:Key="ExternalNotificationSmtpSsl">[SMTP] Use SSL</system:String>
<system:String x:Key="ExternalNotificationSmtpAuth">[SMTP] Authentication Required</system:String>
<system:String x:Key="ExternalNotificationSmtpUser">[SMTP] Username</system:String>
<system:String x:Key="ExternalNotificationSmtpPassword">[SMTP] Password</system:String>
<system:String x:Key="ExternalNotificationSmtpFrom">[SMTP] Sender</system:String>
<system:String x:Key="ExternalNotificationServerChanSendKey">Server Chan Send Key</system:String>
<system:String x:Key="ExternalNotificationSmtpTo">Recipient</system:String>
<system:String x:Key="ExternalNotificationSmtpServer">SMTP Server</system:String>
<system:String x:Key="ExternalNotificationSmtpPort">Port</system:String>
<system:String x:Key="ExternalNotificationSmtpSsl">Use SSL</system:String>
<system:String x:Key="ExternalNotificationSmtpAuth">Authentication Required</system:String>
<system:String x:Key="ExternalNotificationSmtpUser">Username</system:String>
<system:String x:Key="ExternalNotificationSmtpPassword">Password</system:String>
<system:String x:Key="ExternalNotificationSmtpFrom">Sender</system:String>
<!-- Settings Guide -->
<system:String x:Key="TaskSettings">Task Settings</system:String>
<system:String x:Key="SettingsGuide">Settings Guide</system:String>

View File

@@ -36,15 +36,15 @@
<system:String x:Key="ExternalNotificationSendTest">テストを送信する</system:String>
<system:String x:Key="ExternalNotificationSendTestTitle">MAA 外部通知テスト</system:String>
<system:String x:Key="ExternalNotificationSendTestContent">これは MAA 外部通知テスト情報です。 このコンテンツが表示された場合、通知は正常に送信されました。</system:String>
<system:String x:Key="ExternalNotificationServerChanSendKey">[ServerChan] Send Key</system:String>
<system:String x:Key="ExternalNotificationSmtpServer">[SMTP] サーバ</system:String>
<system:String x:Key="ExternalNotificationSmtpPort">[SMTP] ポート</system:String>
<system:String x:Key="ExternalNotificationSmtpSsl">[SMTP] SSL を使用します</system:String>
<system:String x:Key="ExternalNotificationSmtpAuth">[SMTP] ログインが必要です</system:String>
<system:String x:Key="ExternalNotificationSmtpUser">[SMTP] ユーザー名</system:String>
<system:String x:Key="ExternalNotificationSmtpPassword">[SMTP] パスワード</system:String>
<system:String x:Key="ExternalNotificationSmtpFrom">[SMTP] 送信者</system:String>
<system:String x:Key="ExternalNotificationSmtpTo">[SMTP] 受信者</system:String>
<system:String x:Key="ExternalNotificationServerChanSendKey">ServerChan Send Key</system:String>
<system:String x:Key="ExternalNotificationSmtpServer">SMTP サーバ</system:String>
<system:String x:Key="ExternalNotificationSmtpPort">ポート</system:String>
<system:String x:Key="ExternalNotificationSmtpSsl">SSL を使用します</system:String>
<system:String x:Key="ExternalNotificationSmtpAuth">ログインが必要です</system:String>
<system:String x:Key="ExternalNotificationSmtpUser">ユーザー名</system:String>
<system:String x:Key="ExternalNotificationSmtpPassword">パスワード</system:String>
<system:String x:Key="ExternalNotificationSmtpFrom">送信者</system:String>
<system:String x:Key="ExternalNotificationSmtpTo">受信者</system:String>
<!-- 設定ガイド -->
<system:String x:Key="TaskSettings">タスク設定</system:String>
<system:String x:Key="SettingsGuide">設定ガイド</system:String>

View File

@@ -36,15 +36,15 @@
<system:String x:Key="ExternalNotificationSendTest">테스트 보내기</system:String>
<system:String x:Key="ExternalNotificationSendTestTitle">MAA 외부 알림 테스트</system:String>
<system:String x:Key="ExternalNotificationSendTestContent">MAA 외부 알림 테스트 정보입니다. 이 콘텐츠가 표시되면 알림이 성공적으로 전송된 것입니다!</system:String>
<system:String x:Key="ExternalNotificationServerChanSendKey">[Server Chan]이 키를 보냅니다.</system:String>
<system:String x:Key="ExternalNotificationSmtpServer">[SMTP] 서버</system:String>
<system:String x:Key="ExternalNotificationSmtpPort">[SMTP] 포트</system:String>
<system:String x:Key="ExternalNotificationSmtpSsl">[SMTP]는 SSL을 사용합니다.</system:String>
<system:String x:Key="ExternalNotificationSmtpAuth">[SMTP]에 로그인해야 합니다.</system:String>
<system:String x:Key="ExternalNotificationSmtpUser">[SMTP] 사용자 이름</system:String>
<system:String x:Key="ExternalNotificationSmtpPassword">[SMTP] 비밀번호</system:String>
<system:String x:Key="ExternalNotificationSmtpFrom">[SMTP] 보낸 사람</system:String>
<system:String x:Key="ExternalNotificationSmtpTo">[SMTP] 받는 사람</system:String>
<system:String x:Key="ExternalNotificationServerChanSendKey">Server Chan 이 키를 보냅니다.</system:String>
<system:String x:Key="ExternalNotificationSmtpServer">SMTP 서버</system:String>
<system:String x:Key="ExternalNotificationSmtpPort">포트</system:String>
<system:String x:Key="ExternalNotificationSmtpSsl">는 SSL을 사용합니다.</system:String>
<system:String x:Key="ExternalNotificationSmtpAuth">에 로그인해야 합니다.</system:String>
<system:String x:Key="ExternalNotificationSmtpUser">사용자 이름</system:String>
<system:String x:Key="ExternalNotificationSmtpPassword">비밀번호</system:String>
<system:String x:Key="ExternalNotificationSmtpFrom">보낸 사람</system:String>
<system:String x:Key="ExternalNotificationSmtpTo">받는 사람</system:String>
<!-- 설정 가이드 -->
<system:String x:Key="TaskSettings">작업 설정</system:String>
<system:String x:Key="SettingsGuide">설정 가이드</system:String>

View File

@@ -36,15 +36,15 @@
<system:String x:Key="ExternalNotificationSendTest">发送测试</system:String>
<system:String x:Key="ExternalNotificationSendTestTitle">MAA 外部通知测试</system:String>
<system:String x:Key="ExternalNotificationSendTestContent">这是 MAA 外部通知测试信息。如果你看到了这段内容,就说明通知发送成功了!</system:String>
<system:String x:Key="ExternalNotificationServerChanSendKey">[Server Chan] 发送密钥</system:String>
<system:String x:Key="ExternalNotificationSmtpServer">[SMTP] 服务器</system:String>
<system:String x:Key="ExternalNotificationSmtpPort">[SMTP] 端口</system:String>
<system:String x:Key="ExternalNotificationSmtpSsl">[SMTP] 使用 SSL</system:String>
<system:String x:Key="ExternalNotificationSmtpAuth">[SMTP] 需要登录</system:String>
<system:String x:Key="ExternalNotificationSmtpUser">[SMTP] 用户名</system:String>
<system:String x:Key="ExternalNotificationSmtpPassword">[SMTP] 密码</system:String>
<system:String x:Key="ExternalNotificationSmtpFrom">[SMTP] 发件人</system:String>
<system:String x:Key="ExternalNotificationSmtpTo">[SMTP] 收件人</system:String>
<system:String x:Key="ExternalNotificationServerChanSendKey">Server Chan 发送密钥</system:String>
<system:String x:Key="ExternalNotificationSmtpServer">SMTP 服务器</system:String>
<system:String x:Key="ExternalNotificationSmtpPort">端口</system:String>
<system:String x:Key="ExternalNotificationSmtpSsl">使用 SSL</system:String>
<system:String x:Key="ExternalNotificationSmtpAuth">需要登录</system:String>
<system:String x:Key="ExternalNotificationSmtpUser">用户名</system:String>
<system:String x:Key="ExternalNotificationSmtpPassword">密码</system:String>
<system:String x:Key="ExternalNotificationSmtpFrom">发件人</system:String>
<system:String x:Key="ExternalNotificationSmtpTo">收件人</system:String>
<!-- 设置指引 -->
<system:String x:Key="TaskSettings">任务设置</system:String>
<system:String x:Key="SettingsGuide">设置指引</system:String>

View File

@@ -36,15 +36,15 @@
<system:String x:Key="ExternalNotificationSendTest">發送測試</system:String>
<system:String x:Key="ExternalNotificationSendTestTitle">MAA 外部通知測試</system:String>
<system:String x:Key="ExternalNotificationSendTestContent">這是 MAA 外部通知測試資訊。 如果你看到了這段內容,就說明通知發送成功了!</system:String>
<system:String x:Key="ExternalNotificationServerChanSendKey">[Server Chan] 發送金鑰</system:String>
<system:String x:Key="ExternalNotificationSmtpServer">[SMTP] 伺服器</system:String>
<system:String x:Key="ExternalNotificationSmtpPort">[SMTP] 埠</system:String>
<system:String x:Key="ExternalNotificationSmtpSsl">[SMTP] 使用 SSL</system:String>
<system:String x:Key="ExternalNotificationSmtpAuth">[SMTP] 需要登錄</system:String>
<system:String x:Key="ExternalNotificationSmtpUser">[SMTP] 使用者名</system:String>
<system:String x:Key="ExternalNotificationSmtpPassword">[SMTP] 密碼</system:String>
<system:String x:Key="ExternalNotificationSmtpFrom">[SMTP] 發件者</system:String>
<system:String x:Key="ExternalNotificationSmtpTo">[SMTP] 收件者</system:String>
<system:String x:Key="ExternalNotificationServerChanSendKey">Server Chan 發送金鑰</system:String>
<system:String x:Key="ExternalNotificationSmtpServer">SMTP 伺服器</system:String>
<system:String x:Key="ExternalNotificationSmtpPort">埠</system:String>
<system:String x:Key="ExternalNotificationSmtpSsl">使用 SSL</system:String>
<system:String x:Key="ExternalNotificationSmtpAuth">需要登錄</system:String>
<system:String x:Key="ExternalNotificationSmtpUser">使用者名</system:String>
<system:String x:Key="ExternalNotificationSmtpPassword">密碼</system:String>
<system:String x:Key="ExternalNotificationSmtpFrom">發件者</system:String>
<system:String x:Key="ExternalNotificationSmtpTo">收件者</system:String>
<!-- 設定指引 -->
<system:String x:Key="TaskSettings">任務設定</system:String>
<system:String x:Key="SettingsGuide">設定指引</system:String>

View File

@@ -291,12 +291,6 @@ namespace MaaWpfGui.ViewModels.UI
private string _enabledExternalNotificationProvider = ConfigurationHelper.GetValue(ConfigurationKeys.ExternalNotificationEnabled, "Off");
public bool IsEnabled => _enabledExternalNotificationProvider != "Off";
public bool IsServerChan => _enabledExternalNotificationProvider == "ServerChan";
public bool IsSmtp => _enabledExternalNotificationProvider == "SMTP";
public string EnabledExternalNotificationProvider
{
get => _enabledExternalNotificationProvider;
@@ -304,10 +298,6 @@ namespace MaaWpfGui.ViewModels.UI
{
SetAndNotify(ref _enabledExternalNotificationProvider, value);
ConfigurationHelper.SetValue(ConfigurationKeys.ExternalNotificationEnabled, value);
NotifyOfPropertyChange(nameof(IsEnabled));
NotifyOfPropertyChange(nameof(IsSmtp));
NotifyOfPropertyChange(nameof(IsServerChan));
}
}

View File

@@ -83,14 +83,14 @@
Margin="5"
Command="{s:Action ExternalNotificationSendTest}"
Content="{DynamicResource ExternalNotificationSendTest}"
IsEnabled="{c:Binding IsEnabled}" />
IsEnabled="{c:Binding 'EnabledExternalNotificationProvider != &quot;Off&quot;'}" />
</Grid>
</StackPanel>
<StackPanel
Grid.Row="2"
Grid.Column="0"
IsEnabled="{c:Binding IsServerChan}"
Visibility="{c:Binding 'EnabledExternalNotificationProvider == &quot;ServerChan&quot;'}"
Orientation="Horizontal">
<Grid>
<Grid.ColumnDefinitions>
@@ -120,7 +120,7 @@
<StackPanel
Grid.Row="3"
Grid.Column="0"
IsEnabled="{c:Binding IsSmtp}"
Visibility="{c:Binding 'EnabledExternalNotificationProvider == &quot;SMTP&quot;'}"
Orientation="Horizontal">
<Grid>
<Grid.RowDefinitions>