diff --git a/src/SwashbucklerDiary.Rcl/Models/UrlScheme.cs b/src/SwashbucklerDiary.Rcl/Models/UrlScheme.cs new file mode 100644 index 00000000..0222a8f4 --- /dev/null +++ b/src/SwashbucklerDiary.Rcl/Models/UrlScheme.cs @@ -0,0 +1,9 @@ +namespace SwashbucklerDiary.Rcl.Models +{ + public class UrlScheme + { + public string Name { get; set; } = string.Empty; + + public string Path { get; set; } = string.Empty; + } +} diff --git a/src/SwashbucklerDiary.Rcl/Pages/Mine/About/AboutPage.razor.cs b/src/SwashbucklerDiary.Rcl/Pages/Mine/About/AboutPage.razor.cs index dd7149c7..c57bd30f 100644 --- a/src/SwashbucklerDiary.Rcl/Pages/Mine/About/AboutPage.razor.cs +++ b/src/SwashbucklerDiary.Rcl/Pages/Mine/About/AboutPage.razor.cs @@ -49,14 +49,19 @@ private void LoadView() viewLists = [ [ - new(this, "About.SourceCode.Name","mdi-book-open-page-variant-outline",() => showSourceCode = true), new(this, "About.Agreement.Name","mdi-file-document-multiple-outline",() => To("user-agreement")), new(this, "About.Privacy.Name","mdi-lock-outline",() => To("privacy-policy")), + ], + [ new(this, "About.Check for updates.Name","mdi-update",CheckForUpdates), + new(this, "About.LogFile.Name","mdi-file-document-edit-outline",() => To("log")), + new(this, "Url Scheme","mdi-link-variant",() => To("urlScheme"),()=>PlatformIntegration.CurrentPlatform != AppDevicePlatform.Browser), ], [ + new(this, "About.SourceCode.Name","mdi-book-open-page-variant-outline",() => showSourceCode = true), new(this, "About.Related.Name","mdi-xml",() => To("relatedOSP")), - new(this, "About.LogFile.Name","mdi-file-document-edit-outline",() => To("log")), + ], + [ new(this, "About.Evaluation.Name","mdi-star-outline",OpenAppDetails), new(this, "About.Sponsor.Name","mdi-hand-heart-outline",()=>To("sponsor")), ] diff --git a/src/SwashbucklerDiary.Rcl/Pages/Mine/About/UrlSchemePage.razor b/src/SwashbucklerDiary.Rcl/Pages/Mine/About/UrlSchemePage.razor new file mode 100644 index 00000000..ea346015 --- /dev/null +++ b/src/SwashbucklerDiary.Rcl/Pages/Mine/About/UrlSchemePage.razor @@ -0,0 +1,50 @@ +@page "/urlScheme" +@namespace SwashbucklerDiary.Rcl.Pages +@inherits ImportantComponentBase + + + + + + + @foreach (var item in schemes) + { + + @item + + } + + + + + @foreach (var item in urlSchemes) + { + + + + @(I18n.T(item.Name)) + + + @($"{scheme}://{item.Path}") + + + + mdi-content-copy + + + + + } + + + + + diff --git a/src/SwashbucklerDiary.Rcl/Pages/Mine/About/UrlSchemePage.razor.cs b/src/SwashbucklerDiary.Rcl/Pages/Mine/About/UrlSchemePage.razor.cs new file mode 100644 index 00000000..0c22c5e4 --- /dev/null +++ b/src/SwashbucklerDiary.Rcl/Pages/Mine/About/UrlSchemePage.razor.cs @@ -0,0 +1,34 @@ +using Masa.Blazor; +using SwashbucklerDiary.Rcl.Components; +using SwashbucklerDiary.Rcl.Models; + +namespace SwashbucklerDiary.Rcl.Pages +{ + public partial class UrlSchemePage : ImportantComponentBase + { + private StringNumber? scheme; + + private readonly string[] schemes = ["swashbucklerdiary", "xiakeriji"]; + + private List urlSchemes = []; + + protected override async Task OnInitializedAsync() + { + await base.OnInitializedAsync(); + + await ReadJson(); + } + + private async Task ReadJson() + { + urlSchemes = await StaticWebAssets.ReadJsonAsync>("json/url-scheme/url-scheme.json"); + } + + private async Task CopyAsync(string path) + { + var text = $"{scheme}://{path}"; + await PlatformIntegration.SetClipboard(text); + await PopupServiceHelper.Success(I18n.T("Share.CopySuccess")); + } + } +} \ No newline at end of file diff --git a/src/SwashbucklerDiary.Rcl/wwwroot/i18n/en-US.json b/src/SwashbucklerDiary.Rcl/wwwroot/i18n/en-US.json index 3d0c24f4..b02ae312 100644 --- a/src/SwashbucklerDiary.Rcl/wwwroot/i18n/en-US.json +++ b/src/SwashbucklerDiary.Rcl/wwwroot/i18n/en-US.json @@ -264,6 +264,9 @@ "Name": "Log file", "Path": "About / Log file" }, + "UrlScheme": { + "Path": "About / Url Scheme" + }, "Sponsor": { "Name": "Sponsor we", "Path": "About / Sponsor we", @@ -780,5 +783,18 @@ "Name": "Support it", "Content": "If you think this software is pretty good, you can donate and support it. Your support is the greatest motivation for developers.", "To support": "Sponsor" + }, + "UrlScheme": { + "Index": "Index", + "History": "History", + "FileBrowse": "File browse", + "Mine": "Mine", + "Search": "Search", + "SearchFunction": "Search function", + "Write": "Write diary", + "Setting": "Setting", + "Backup": "Backup", + "Export": "Export", + "About": "About" } } \ No newline at end of file diff --git a/src/SwashbucklerDiary.Rcl/wwwroot/i18n/zh-CN.json b/src/SwashbucklerDiary.Rcl/wwwroot/i18n/zh-CN.json index a5510032..771630d0 100644 --- a/src/SwashbucklerDiary.Rcl/wwwroot/i18n/zh-CN.json +++ b/src/SwashbucklerDiary.Rcl/wwwroot/i18n/zh-CN.json @@ -264,6 +264,9 @@ "Name": "日志文件", "Path": "关于 / 日志文件" }, + "UrlScheme": { + "Path": "关于 / Url Scheme" + }, "Sponsor": { "Name": "捐助我们", "Path": "关于 / 捐助我们", @@ -780,5 +783,18 @@ "Name": "支持一下", "Content": "如果你觉得此软件还不错的话,可以捐助支持一下。你的支持就是开发者最大的动力。", "To support": "捐助" + }, + "UrlScheme": { + "Index": "首页", + "History": "日历", + "FileBrowse": "文件", + "Mine": "我的", + "Search": "搜索", + "SearchFunction": "搜索功能", + "Write": "创建日记", + "Setting": "设置", + "Backup": "备份", + "Export": "导出", + "About": "关于" } } \ No newline at end of file diff --git a/src/SwashbucklerDiary.Rcl/wwwroot/json/app-functions/app-functions.json b/src/SwashbucklerDiary.Rcl/wwwroot/json/app-functions/app-functions.json index f53bbf21..4e4853d2 100644 --- a/src/SwashbucklerDiary.Rcl/wwwroot/json/app-functions/app-functions.json +++ b/src/SwashbucklerDiary.Rcl/wwwroot/json/app-functions/app-functions.json @@ -275,6 +275,12 @@ "Path": "About.LogFile.Path", "Href": "log" }, + { + "Name": "Url Scheme", + "Icon": "mdi-link-variant", + "Path": "About.UrlScheme.Path", + "Href": "urlScheme" + }, { "Name": "About.Evaluation.Name", "Icon": "mdi-star-outline", diff --git a/src/SwashbucklerDiary.Rcl/wwwroot/json/url-scheme/url-scheme.json b/src/SwashbucklerDiary.Rcl/wwwroot/json/url-scheme/url-scheme.json new file mode 100644 index 00000000..02554c59 --- /dev/null +++ b/src/SwashbucklerDiary.Rcl/wwwroot/json/url-scheme/url-scheme.json @@ -0,0 +1,46 @@ +[ + { + "Name": "UrlScheme.Index", + "Path": "" + }, + { + "Name": "UrlScheme.History", + "Path": "history" + }, + { + "Name": "UrlScheme.FileBrowse", + "Path": "fileBrowse" + }, + { + "Name": "UrlScheme.Mine", + "Path": "mine" + }, + { + "Name": "UrlScheme.Search", + "Path": "search?query=" + }, + { + "Name": "UrlScheme.SearchFunction", + "Path": "searchAppFunction?query=" + }, + { + "Name": "UrlScheme.Write", + "Path": "write" + }, + { + "Name": "UrlScheme.Setting", + "Path": "setting" + }, + { + "Name": "UrlScheme.Backup", + "Path": "backups" + }, + { + "Name": "UrlScheme.Export", + "Path": "export" + }, + { + "Name": "UrlScheme.About", + "Path": "about" + } +] \ No newline at end of file