mirror of
https://github.com/wwiinnddyy/LanMountainDesktop.git
synced 2026-06-20 23:54:26 +08:00
0.7.3
修东西
This commit is contained in:
@@ -337,6 +337,14 @@ public sealed class PostHogUsageTelemetryService : IDisposable
|
||||
["timestamp"] = timestamp.ToString("o"),
|
||||
["properties"] = new Dictionary<string, object?>
|
||||
{
|
||||
["install_id"] = installId,
|
||||
["app_version"] = TelemetryEnvironmentInfo.GetAppVersion(),
|
||||
["os_name"] = TelemetryEnvironmentInfo.GetOsName(),
|
||||
["os_version"] = TelemetryEnvironmentInfo.GetOsVersion(),
|
||||
["device_model"] = TelemetryEnvironmentInfo.GetDeviceModel(),
|
||||
["device_arch"] = TelemetryEnvironmentInfo.GetDeviceArchitecture(),
|
||||
["runtime_version"] = TelemetryEnvironmentInfo.GetRuntimeVersion(),
|
||||
["language"] = TelemetryEnvironmentInfo.GetSystemLanguage(),
|
||||
["launch_time_utc"] = timestamp.ToString("o")
|
||||
}
|
||||
};
|
||||
|
||||
@@ -78,25 +78,6 @@ public sealed class TelemetryIdentityService
|
||||
}
|
||||
}
|
||||
|
||||
public string RefreshTelemetryId()
|
||||
{
|
||||
lock (_syncRoot)
|
||||
{
|
||||
EnsureInitialized();
|
||||
|
||||
var snapshot = _settingsFacade.Settings.LoadSnapshot<AppSettingsSnapshot>(SettingsScope.App);
|
||||
snapshot.TelemetryId = GenerateId();
|
||||
_settingsFacade.Settings.SaveSnapshot(
|
||||
SettingsScope.App,
|
||||
snapshot,
|
||||
changedKeys: [nameof(AppSettingsSnapshot.TelemetryId)]);
|
||||
|
||||
_telemetryId = snapshot.TelemetryId ?? GenerateId();
|
||||
AppLogger.Info("TelemetryIdentity", $"Telemetry id refreshed. TelemetryId={_telemetryId}");
|
||||
return _telemetryId;
|
||||
}
|
||||
}
|
||||
|
||||
public bool MarkBaselineReported()
|
||||
{
|
||||
lock (_syncRoot)
|
||||
|
||||
@@ -58,9 +58,6 @@ public sealed partial class PrivacySettingsPageViewModel : ViewModelBase
|
||||
[ObservableProperty]
|
||||
private string _telemetryIdDescription = string.Empty;
|
||||
|
||||
[ObservableProperty]
|
||||
private string _refreshTelemetryIdText = string.Empty;
|
||||
|
||||
[ObservableProperty]
|
||||
private string _viewPrivacyPolicyText = string.Empty;
|
||||
|
||||
@@ -75,27 +72,6 @@ public sealed partial class PrivacySettingsPageViewModel : ViewModelBase
|
||||
TelemetryId = TelemetryServices.Identity?.TelemetryId ?? string.Empty;
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
private void RefreshTelemetryId()
|
||||
{
|
||||
try
|
||||
{
|
||||
var identity = TelemetryServices.Identity;
|
||||
if (identity is null)
|
||||
{
|
||||
AppLogger.Warn("PrivacySettings", "Telemetry identity service is unavailable.");
|
||||
return;
|
||||
}
|
||||
|
||||
TelemetryId = identity.RefreshTelemetryId();
|
||||
AppLogger.Info("PrivacySettings", $"Telemetry ID refreshed: {TelemetryId}");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
AppLogger.Warn("PrivacySettings", "Failed to refresh telemetry ID.", ex);
|
||||
}
|
||||
}
|
||||
|
||||
partial void OnUploadAnonymousCrashDataChanged(bool value)
|
||||
{
|
||||
if (_isInitializing)
|
||||
@@ -137,8 +113,7 @@ public sealed partial class PrivacySettingsPageViewModel : ViewModelBase
|
||||
TelemetryIdHeader = L("settings.privacy.telemetry_id_title", "Telemetry ID");
|
||||
TelemetryIdDescription = L(
|
||||
"settings.privacy.telemetry_id_description",
|
||||
"A refreshable anonymous identifier used for detailed telemetry sessions.");
|
||||
RefreshTelemetryIdText = L("settings.privacy.refresh_telemetry_id", "Refresh");
|
||||
"An anonymous identifier used for detailed telemetry sessions.");
|
||||
PrivacyPolicyHintPrefix = L("settings.privacy.policy_hint_prefix", "For more details, please ");
|
||||
ViewPrivacyPolicyText = L("settings.privacy.view_policy", "view our privacy policy");
|
||||
}
|
||||
|
||||
@@ -62,15 +62,34 @@
|
||||
</ui:InfoBar.IconSource>
|
||||
</ui:InfoBar>
|
||||
|
||||
<Border Classes="settings-section-card">
|
||||
<StackPanel Spacing="12">
|
||||
<controls:IconText Icon="WindowConsole"
|
||||
Text="{Binding RenderBackendLabel}" />
|
||||
<TextBlock Classes="settings-item-description"
|
||||
Text="{Binding RenderBackendText}"
|
||||
TextWrapping="Wrap" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<!-- 版权声明 - 放在渲染显示前面 -->
|
||||
<ui:SettingsExpander Header="版权声明"
|
||||
IsExpanded="True">
|
||||
<ui:SettingsExpander.IconSource>
|
||||
<fi:SymbolIconSource Symbol="Document" />
|
||||
</ui:SettingsExpander.IconSource>
|
||||
<ui:SettingsExpanderItem>
|
||||
<ui:SettingsExpanderItem.Footer>
|
||||
<WrapPanel>
|
||||
<WrapPanel.Styles>
|
||||
<Style Selector="HyperlinkButton">
|
||||
<Setter Property="Padding" Value="4" />
|
||||
<Setter Property="Margin" Value="2" />
|
||||
</Style>
|
||||
</WrapPanel.Styles>
|
||||
<HyperlinkButton NavigateUri="https://github.com/Lincube/LanMountainDesktop">
|
||||
<TextBlock Text="GitHub 仓库" />
|
||||
</HyperlinkButton>
|
||||
<HyperlinkButton NavigateUri="https://github.com/Lincube/LanMountainDesktop/issues">
|
||||
<TextBlock Text="问题反馈" />
|
||||
</HyperlinkButton>
|
||||
</WrapPanel>
|
||||
</ui:SettingsExpanderItem.Footer>
|
||||
<TextBlock>
|
||||
<Run Text="Copyright (c) 2024-" /><Run Text="2025" /> Lincube
|
||||
</TextBlock>
|
||||
</ui:SettingsExpanderItem>
|
||||
</ui:SettingsExpander>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</UserControl>
|
||||
|
||||
@@ -51,14 +51,9 @@
|
||||
FontFamily="Consolas"
|
||||
FontSize="12"
|
||||
Focusable="False"
|
||||
IsTabStop="False" />
|
||||
IsTabStop="False"
|
||||
HorizontalAlignment="Stretch" />
|
||||
</StackPanel>
|
||||
<Button Grid.Column="1"
|
||||
Content="{Binding RefreshTelemetryIdText}"
|
||||
Command="{Binding RefreshTelemetryIdCommand}"
|
||||
VerticalAlignment="Center"
|
||||
Margin="16,0,0,0"
|
||||
Classes="accent-button" />
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user