This commit is contained in:
rmbgame
2021-05-26 01:18:55 +08:00
parent 31eae8b056
commit 746fed8cdb
5 changed files with 37 additions and 11 deletions
@@ -8,10 +8,6 @@
</Border>
</Design.PreviewWith>
<Style Selector="TabControl TabItem">
<Setter Property="FontSize" Value="16"></Setter>
</Style>
<Style Selector="TabControl.flat">
<Setter Property="Padding" Value="0"></Setter>
</Style>
@@ -26,6 +22,9 @@
</Style>
<Style Selector="TabControl TabItem">
<Setter Property="FontSize" Value="16"></Setter>
</Style>
<Style Selector="TabControl.NavBar">
<Setter Property="TabStripPlacement" Value="Left"/>
@@ -14,10 +14,18 @@
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="System.Application.UI.Views.Pages.LocalAuthPage">
<Panel HorizontalAlignment="Stretch">
<TextBlock IsVisible="{CompiledBinding IsAuthenticatorsEmpty}"
Text="{ReflectionBinding Path=Res.LocalAuth_NoAuthTip,Mode=OneWay,Source={x:Static resx:R.Current}}"
TextWrapping="WrapWithOverflow"
VerticalAlignment="Center" HorizontalAlignment="Center"></TextBlock>
Text="{ReflectionBinding Path=Res.LocalAuth_NoAuthTip,Mode=OneWay,Source={x:Static resx:R.Current}}"
TextWrapping="WrapWithOverflow"
VerticalAlignment="Center" HorizontalAlignment="Center"></TextBlock>
<!--<StackPanel IsVisible="{CompiledBinding IsAuthenticatorsEmptyAndHasPassword}" VerticalAlignment="Center" HorizontalAlignment="Center" Spacing="10">
<TextBlock
Text="{ReflectionBinding Path=Res.LocalAuth_NoAuthTip,Mode=OneWay,Source={x:Static resx:R.Current}}"
TextWrapping="WrapWithOverflow"></TextBlock>
</StackPanel>-->
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" Padding="40 0 40 10">
<ItemsRepeater Items="{Binding Authenticators,Mode=OneWay}">
<ItemsRepeater.Layout>
@@ -61,8 +69,6 @@
</PathIcon>
</MenuItem.Icon>
</MenuItem>
</ContextMenu>
</Border.ContextMenu>
<i:Interaction.Behaviors>
+9
View File
@@ -1872,6 +1872,15 @@ namespace System.Application.UI.Resx {
}
}
/// <summary>
/// 查找类似 当前数据已加密,请先解锁才能访问。 的本地化字符串。
/// </summary>
public static string LocalAuth_HasPasswordUnEncryptionAuth {
get {
return ResourceManager.GetString("LocalAuth_HasPasswordUnEncryptionAuth", resourceCulture);
}
}
/// <summary>
/// 查找类似 导入失败,请检查数据是否正确。 的本地化字符串。
/// </summary>
@@ -726,6 +726,9 @@
<data name="LocalAuth_ExportAuth_SelectPath" xml:space="preserve">
<value>选择路径</value>
</data>
<data name="LocalAuth_HasPasswordUnEncryptionAuth" xml:space="preserve">
<value>当前数据已加密,请先解锁才能访问。</value>
</data>
<data name="LocalAuth_ImportFaild" xml:space="preserve">
<value>导入失败,请检查数据是否正确。</value>
</data>
@@ -87,6 +87,10 @@ namespace System.Application.UI.ViewModels
public bool IsAuthenticatorsEmpty => !AuthService.Current.Authenticators.Items.Any_Nullable();
public bool IsAuthenticatorsEmptyAndHasPassword => SourceAuthCount > 0 && IsAuthenticatorsEmpty == true;
public int SourceAuthCount { get; set; }
public ReactiveCommand<Unit, Unit> AddAuthCommand { get; }
public ReactiveCommand<Unit, Unit> EncryptionAuthCommand { get; }
@@ -99,13 +103,18 @@ namespace System.Application.UI.ViewModels
internal async override void Activation()
{
var authcount = await AuthService.Current.GetRealAuthenticatorCount();
SourceAuthCount = await AuthService.Current.GetRealAuthenticatorCount();
//if (IsFirstActivation)
if (authcount > 0 && IsAuthenticatorsEmpty == true)
if (IsAuthenticatorsEmptyAndHasPassword)
AuthService.Current.Initialize();
base.Activation();
}
public void Refreshing()
{
AuthService.Current.Initialize();
}
void AddAuthMenu_Click()
{
if (!AppSettings.IsOfficialChannelPackage) return;