~#;lt=s^6_OccmRd>o{*=>)KS=lM
zZ!)iG|8G0-9s3VLm`bsa6e
ze*TlRxAjXtm^F8V`M1%s5d@tYS>&+_ga#xKGb|!oUBx3uc@mj1%=MaH4GR0tPBG_&
z9OZE;->dO@`Q)nr<%dHAsEZRKl
zedN6+3+uGHejJp;Q==pskSAcRcyh@6mjm2z-uG;s%dM-u0*u##7OxI7wwyCGpS?4U
zBFAr(%GBv5j$jS@@t@iI8?ZqE36I^4t+P^J9D^ELbS5KMtZ
z{Qn#JnSd$15nJ$ggkF%I4yUQC+BjDF^}AtB7w348EL>7#sAsLWs}ndp8^DsAcOIL9
zTOO!!0!k2`9BLk25)NeZp7ev>I1Mn={cWI3Yhx2Q#DnAo4IphoV~R^c0x&nw*MoIV
zPthX?{6{u}sMS(MxD*dmd5rU(YazQE59b|TsB5Tm)I4a!VaN@HYOR)DwH1U5y(E)z
zQqQU*B%MwtRQ$%x&;1p%ANmc|PkoFJZ%<-uq%PX&C!c-7ypis=eP+FCeuv+B@h#{4
zGx1m0PjS~FJt}3mdt4c!lel`1;4W|03kcZRG+DzkTy|7-F~eDsV2Tx!73dM0H0CTh
zl)F-YUkE1zEzEW(;JXc|KR5{ox%YTh{$%F$a36JP6Nb<0%#NbSh$dMYF-{
z1_x(Vx)}fs?5_|!5xBTWiiIQHG<%)*e=45Fhjw_tlnmlixq;mUdC$R8v#j(
zhQ$9YR-o%i5Uc`S?6EC51!bTRK=Xkyb<18FkCKnS2;o*qlij1YA@-nRpq#OMTX&RbL<^2q@0qja!uIvI;j$6>~k@IMwD42=8$$!+R^@5o6HX(*n~ now) {
+ const result = await response.text();
+
+ return result;
+ }
+ }
+
+ return "";
+}
+
+export async function remove(url, method, body = "") {
+ const cache = await openCacheStorage();
+
+ if (cache != null) {
+ const request = createRequest(url, method, body);
+ await cache.delete(request);
+ }
+}
+
+export async function removeAll() {
+ const cache = await openCacheStorage();
+
+ if (cache != null) {
+ cache.keys().then(function(names) {
+ for (let name of names)
+ cache.delete(name);
+ });
+ //let requests = await cache.keys();
+
+ //for (let request in requests) {
+ // await cache.delete(request);
+ //}
+ }
+}
\ No newline at end of file
diff --git a/test/DaprTool.AbstractionsTest/Base/DbDependencySetupFixture.cs b/test/DaprTool.AbstractionsTest/Base/DbDependencySetupFixture.cs
index 6ad1e79..87b212a 100644
--- a/test/DaprTool.AbstractionsTest/Base/DbDependencySetupFixture.cs
+++ b/test/DaprTool.AbstractionsTest/Base/DbDependencySetupFixture.cs
@@ -11,7 +11,7 @@ public class DbDependencySetupFixture : DependencySetupFixture
{
// 注册 业务数据库
ServiceCollection.AddLogging();
- ServiceCollection.AddAppDataConnection(Configuration);
+ ServiceCollection.AddOrderAppDataConnection(Configuration);
}
}
@@ -25,7 +25,7 @@ public class ObserverDependencySetupFixture : DependencySetupFixture
// 注册 MediatR
ServiceCollection.AddLogging();
ServiceCollection.AddAppMediators();
- ServiceCollection.AddAppDataConnection(Configuration);
+ ServiceCollection.AddOrderAppDataConnection(Configuration);
}
}
--
Gitee
From 2464dcb74ec1f03f0e6fdce65da5a28391ca24e6 Mon Sep 17 00:00:00 2001
From: iamshen
Date: Tue, 30 Apr 2024 15:23:58 +0800
Subject: [PATCH 2/2] Update web admin ui blazor-flent-ui
---
Common.props | 2 +-
DaprTool.Solution.sln | 31 +-
Directory.Packages.props | 27 +-
src/Web/WebAdmin.Client/Layout/NavMenu.razor | 18 +
.../WebAdmin.Client/Pages/Counter.razor | 0
src/Web/WebAdmin.Client/Program.cs | 5 +
.../WebAdmin.Client/WebAdmin.Client.csproj | 15 +-
.../WebAdmin.Client/WebAdmin.Client.xml | 0
.../WebAdmin.Client/_Imports.razor | 2 +-
.../wwwroot/appsettings.Development.json} | 0
.../WebAdmin.Client/wwwroot/appsettings.json | 8 +
.../Components}/CultureSelector.razor | 6 +-
.../Components}/CultureSelector.razor.cs | 4 +-
.../Components}/CultureSelector.razor.css | 0
.../Components}/SiteLinks.razor | 7 +-
.../Components}/SiteLinks.razor.css | 0
.../Components/SiteSearch.razor} | 4 +-
.../Components/SiteSearch.razor.cs} | 7 +-
.../Components}/SiteSettings.razor | 7 +-
.../Components}/SiteSettings.razor.cs | 4 +-
.../Components}/SiteSettingsPanel.razor | 39 +-
.../Components}/SiteSettingsPanel.razor.cs | 24 +-
.../Components/TableOfContents.razor | 14 +
.../Components/TableOfContents.razor.cs | 170 ++++++++
.../Components/TableOfContents.razor.css | 57 +++
.../Components/TableOfContents.razor.js | 74 ++++
.../Components}/UserProfile.razor | 8 +-
.../Components}/UserProfile.razor.css | 0
.../Configurations/AdminUiOptions.cs | 4 +-
.../Configurations/ConfigurationConsts.cs | 3 +-
.../Infrastructure/AppVersionService.cs | 2 +-
.../Infrastructure/CacheStorageAccessor.cs | 4 +-
.../Infrastructure}/CustomIcons.cs | 2 +-
.../HttpBasedStaticAssetService.cs | 57 +++
.../Infrastructure/IAppVersionService.cs | 2 +-
.../Infrastructure/IStaticAssetService.cs | 6 +
.../Infrastructure}/NavProvider.cs | 12 +-
.../Infrastructure/OfficeColorNameMapper.cs | 38 ++
.../ServerStaticAssetService.cs | 21 +
.../ServiceCollectionExtensions.cs | 34 ++
.../WebAdmin.Shared/Layout/MainLayout.razor | 111 ++++++
.../Layout/MainLayout.razor.js | 12 +
.../Layout/NavMenu.razor | 4 +-
.../Layout/NavMenu.razor.css | 0
.../Layout/NavMenuItem.razor | 3 +-
.../Layout/NavMenuItem.razor.css | 1 +
.../Records}/NavItem.cs | 8 +-
.../Resources}/Layout/NavMenu.cs | 2 +-
.../Resources}/Layout/NavMenu.en.resx | 0
.../Resources}/Layout/NavMenu.zh-Hans.resx | 0
.../WebAdmin.Shared.csproj} | 11 +-
src/Web/WebAdmin.Shared/_App.razor | 13 +
src/Web/WebAdmin.Shared/_App.razor.cs | 15 +
src/Web/WebAdmin.Shared/_Imports.razor | 23 ++
.../wwwroot/css}/app.css | 362 ++++++++++--------
.../wwwroot/js/CacheStorageAccessor.js | 0
src/Web/WebAdmin/Components/App.razor | 19 +
.../Components/Layout/MainLayout.razor | 26 +-
.../Components/Pages/Error.razor | 0
src/Web/WebAdmin/Components/Pages/Home.razor | 123 ++++++
.../WebAdmin/Components/Pages/Weather.razor | 65 ++++
.../{WebAdmin => }/Components/Routes.razor | 6 +-
.../{WebAdmin => }/Components/_Imports.razor | 12 +-
.../Controllers/CultureController.cs | 11 +-
src/Web/WebAdmin/{WebAdmin => }/Program.cs | 55 +--
.../Properties/launchSettings.json | 12 +-
.../Components/Pages/CustomerList.en.resx | 0
.../Pages/CustomerList.zh-Hans.resx | 0
.../Resources/Components/Pages/Home.en.resx | 0
.../Components/Pages/Home.zh-Hans.resx | 0
.../Components/Pages/Weather.en.resx | 123 ++++++
.../Components/Pages/Weather.zh-Hans.resx | 123 ++++++
src/Web/WebAdmin/WebAdmin.Client/Program.cs | 24 --
.../wwwroot/appsettings.Development.json | 13 -
src/Web/WebAdmin/WebAdmin.csproj | 17 +
src/Web/WebAdmin/WebAdmin.xml | 8 +
.../WebAdmin/WebAdmin/Components/App.razor | 26 --
.../Components/Layout/MainLayout.razor.css | 31 --
.../Components/Pages/CustomerLevels.razor | 3 -
.../Components/Pages/CustomerList.razor | 52 ---
.../WebAdmin/Components/Pages/Home.razor | 45 ---
.../Components/Pages/PurchaseOrder.razor | 81 ----
src/Web/WebAdmin/WebAdmin/WebAdmin.xml | 110 ------
src/Web/WebAdmin/WebAdmin/wwwroot/favicon.png | Bin 1148 -> 0 bytes
.../appsettings.Development.json | 0
.../WebAdmin/{WebAdmin => }/appsettings.json | 0
src/Web/WebAdmin/wwwroot/app.css | 177 +++++++++
src/Web/WebAdmin/wwwroot/favicon.ico | Bin 0 -> 15086 bytes
88 files changed, 1712 insertions(+), 733 deletions(-)
create mode 100644 src/Web/WebAdmin.Client/Layout/NavMenu.razor
rename src/Web/{WebAdmin => }/WebAdmin.Client/Pages/Counter.razor (100%)
create mode 100644 src/Web/WebAdmin.Client/Program.cs
rename src/Web/{WebAdmin => }/WebAdmin.Client/WebAdmin.Client.csproj (34%)
rename src/Web/{WebAdmin => }/WebAdmin.Client/WebAdmin.Client.xml (100%)
rename src/Web/{WebAdmin => }/WebAdmin.Client/_Imports.razor (100%)
rename src/Web/{WebAdmin/WebAdmin.Client/wwwroot/appsettings.json => WebAdmin.Client/wwwroot/appsettings.Development.json} (100%)
create mode 100644 src/Web/WebAdmin.Client/wwwroot/appsettings.json
rename src/Web/{WebAdmin/WebAdmin/Components/Shared => WebAdmin.Shared/Components}/CultureSelector.razor (87%)
rename src/Web/{WebAdmin/WebAdmin/Components/Shared => WebAdmin.Shared/Components}/CultureSelector.razor.cs (94%)
rename src/Web/{WebAdmin/WebAdmin/Components/Shared => WebAdmin.Shared/Components}/CultureSelector.razor.css (100%)
rename src/Web/{WebAdmin/WebAdmin/Components/Shared => WebAdmin.Shared/Components}/SiteLinks.razor (70%)
rename src/Web/{WebAdmin/WebAdmin/Components/Shared => WebAdmin.Shared/Components}/SiteLinks.razor.css (100%)
rename src/Web/{WebAdmin/WebAdmin/Components/Layout/MainSearch.razor => WebAdmin.Shared/Components/SiteSearch.razor} (89%)
rename src/Web/{WebAdmin/WebAdmin/Components/Layout/MainSearch.razor.cs => WebAdmin.Shared/Components/SiteSearch.razor.cs} (91%)
rename src/Web/{WebAdmin/WebAdmin/Components/Shared => WebAdmin.Shared/Components}/SiteSettings.razor (31%)
rename src/Web/{WebAdmin/WebAdmin/Components/Shared => WebAdmin.Shared/Components}/SiteSettings.razor.cs (88%)
rename src/Web/{WebAdmin/WebAdmin/Components/Shared => WebAdmin.Shared/Components}/SiteSettingsPanel.razor (52%)
rename src/Web/{WebAdmin/WebAdmin/Components/Shared => WebAdmin.Shared/Components}/SiteSettingsPanel.razor.cs (76%)
create mode 100644 src/Web/WebAdmin.Shared/Components/TableOfContents.razor
create mode 100644 src/Web/WebAdmin.Shared/Components/TableOfContents.razor.cs
create mode 100644 src/Web/WebAdmin.Shared/Components/TableOfContents.razor.css
create mode 100644 src/Web/WebAdmin.Shared/Components/TableOfContents.razor.js
rename src/Web/{WebAdmin/WebAdmin/Components/Shared => WebAdmin.Shared/Components}/UserProfile.razor (50%)
rename src/Web/{WebAdmin/WebAdmin/Components/Shared => WebAdmin.Shared/Components}/UserProfile.razor.css (100%)
rename src/Web/{WebAdmin/WebAdmin => WebAdmin.Shared}/Configurations/AdminUiOptions.cs (97%)
rename src/Web/{WebAdmin/WebAdmin => WebAdmin.Shared}/Configurations/ConfigurationConsts.cs (48%)
rename src/Web/{WebAdmin/WebAdmin => WebAdmin.Shared}/Infrastructure/AppVersionService.cs (94%)
rename src/Web/{WebAdmin/WebAdmin => WebAdmin.Shared}/Infrastructure/CacheStorageAccessor.cs (96%)
rename src/Web/{WebAdmin/WebAdmin/Components/Shared => WebAdmin.Shared/Infrastructure}/CustomIcons.cs (97%)
create mode 100644 src/Web/WebAdmin.Shared/Infrastructure/HttpBasedStaticAssetService.cs
rename src/Web/{WebAdmin/WebAdmin => WebAdmin.Shared}/Infrastructure/IAppVersionService.cs (73%)
create mode 100644 src/Web/WebAdmin.Shared/Infrastructure/IStaticAssetService.cs
rename src/Web/{WebAdmin/WebAdmin/Components/Shared => WebAdmin.Shared/Infrastructure}/NavProvider.cs (94%)
create mode 100644 src/Web/WebAdmin.Shared/Infrastructure/OfficeColorNameMapper.cs
create mode 100644 src/Web/WebAdmin.Shared/Infrastructure/ServerStaticAssetService.cs
create mode 100644 src/Web/WebAdmin.Shared/Infrastructure/ServiceCollectionExtensions.cs
create mode 100644 src/Web/WebAdmin.Shared/Layout/MainLayout.razor
create mode 100644 src/Web/WebAdmin.Shared/Layout/MainLayout.razor.js
rename src/Web/{WebAdmin/WebAdmin/Components => WebAdmin.Shared}/Layout/NavMenu.razor (87%)
rename src/Web/{WebAdmin/WebAdmin/Components => WebAdmin.Shared}/Layout/NavMenu.razor.css (100%)
rename src/Web/{WebAdmin/WebAdmin/Components => WebAdmin.Shared}/Layout/NavMenuItem.razor (90%)
create mode 100644 src/Web/WebAdmin.Shared/Layout/NavMenuItem.razor.css
rename src/Web/{WebAdmin/WebAdmin/Components/Shared => WebAdmin.Shared/Records}/NavItem.cs (91%)
rename src/Web/{WebAdmin/WebAdmin/Resources/Components => WebAdmin.Shared/Resources}/Layout/NavMenu.cs (32%)
rename src/Web/{WebAdmin/WebAdmin/Resources/Components => WebAdmin.Shared/Resources}/Layout/NavMenu.en.resx (100%)
rename src/Web/{WebAdmin/WebAdmin/Resources/Components => WebAdmin.Shared/Resources}/Layout/NavMenu.zh-Hans.resx (100%)
rename src/Web/{WebAdmin/WebAdmin/WebAdmin.csproj => WebAdmin.Shared/WebAdmin.Shared.csproj} (73%)
create mode 100644 src/Web/WebAdmin.Shared/_App.razor
create mode 100644 src/Web/WebAdmin.Shared/_App.razor.cs
create mode 100644 src/Web/WebAdmin.Shared/_Imports.razor
rename src/Web/{WebAdmin/WebAdmin/wwwroot => WebAdmin.Shared/wwwroot/css}/app.css (61%)
rename src/Web/{WebAdmin/WebAdmin => WebAdmin.Shared}/wwwroot/js/CacheStorageAccessor.js (100%)
create mode 100644 src/Web/WebAdmin/Components/App.razor
rename src/Web/WebAdmin/{WebAdmin => }/Components/Layout/MainLayout.razor (43%)
rename src/Web/WebAdmin/{WebAdmin => }/Components/Pages/Error.razor (100%)
create mode 100644 src/Web/WebAdmin/Components/Pages/Home.razor
create mode 100644 src/Web/WebAdmin/Components/Pages/Weather.razor
rename src/Web/WebAdmin/{WebAdmin => }/Components/Routes.razor (31%)
rename src/Web/WebAdmin/{WebAdmin => }/Components/_Imports.razor (64%)
rename src/Web/WebAdmin/{WebAdmin => }/Controllers/CultureController.cs (60%)
rename src/Web/WebAdmin/{WebAdmin => }/Program.cs (62%)
rename src/Web/WebAdmin/{WebAdmin => }/Properties/launchSettings.json (48%)
rename src/Web/WebAdmin/{WebAdmin => }/Resources/Components/Pages/CustomerList.en.resx (100%)
rename src/Web/WebAdmin/{WebAdmin => }/Resources/Components/Pages/CustomerList.zh-Hans.resx (100%)
rename src/Web/WebAdmin/{WebAdmin => }/Resources/Components/Pages/Home.en.resx (100%)
rename src/Web/WebAdmin/{WebAdmin => }/Resources/Components/Pages/Home.zh-Hans.resx (100%)
create mode 100644 src/Web/WebAdmin/Resources/Components/Pages/Weather.en.resx
create mode 100644 src/Web/WebAdmin/Resources/Components/Pages/Weather.zh-Hans.resx
delete mode 100644 src/Web/WebAdmin/WebAdmin.Client/Program.cs
delete mode 100644 src/Web/WebAdmin/WebAdmin.Client/wwwroot/appsettings.Development.json
create mode 100644 src/Web/WebAdmin/WebAdmin.csproj
create mode 100644 src/Web/WebAdmin/WebAdmin.xml
delete mode 100644 src/Web/WebAdmin/WebAdmin/Components/App.razor
delete mode 100644 src/Web/WebAdmin/WebAdmin/Components/Layout/MainLayout.razor.css
delete mode 100644 src/Web/WebAdmin/WebAdmin/Components/Pages/CustomerLevels.razor
delete mode 100644 src/Web/WebAdmin/WebAdmin/Components/Pages/CustomerList.razor
delete mode 100644 src/Web/WebAdmin/WebAdmin/Components/Pages/Home.razor
delete mode 100644 src/Web/WebAdmin/WebAdmin/Components/Pages/PurchaseOrder.razor
delete mode 100644 src/Web/WebAdmin/WebAdmin/WebAdmin.xml
delete mode 100644 src/Web/WebAdmin/WebAdmin/wwwroot/favicon.png
rename src/Web/WebAdmin/{WebAdmin => }/appsettings.Development.json (100%)
rename src/Web/WebAdmin/{WebAdmin => }/appsettings.json (100%)
create mode 100644 src/Web/WebAdmin/wwwroot/app.css
create mode 100644 src/Web/WebAdmin/wwwroot/favicon.ico
diff --git a/Common.props b/Common.props
index e01f9df..a518bd0 100644
--- a/Common.props
+++ b/Common.props
@@ -4,7 +4,7 @@
net8.0
enable
enable
- NU1803;NU1507;1701;1702;1591;8002
+ NU1803;NU1507;1701;1702;1591;8002;CS1573;
diff --git a/DaprTool.Solution.sln b/DaprTool.Solution.sln
index c71afb4..a9c0118 100644
--- a/DaprTool.Solution.sln
+++ b/DaprTool.Solution.sln
@@ -119,9 +119,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dependency", "src\BuildingB
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Validation", "src\BuildingBlocks\Validation\Validation.csproj", "{7449D8D4-0F2A-4D35-BC2F-0DEF40833C91}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebAdmin", "src\Web\WebAdmin\WebAdmin\WebAdmin.csproj", "{20F4D5A5-8047-4ACA-B8A0-6F1EB2D2F5B9}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebAdmin.Shared", "src\Web\WebAdmin.Shared\WebAdmin.Shared.csproj", "{9FCF0D70-CF60-4C0D-8667-42DB50BC6EE2}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebAdmin.Client", "src\Web\WebAdmin\WebAdmin.Client\WebAdmin.Client.csproj", "{8E19ECB4-9DC8-45A9-95F6-AB0E1D5D1A4B}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebAdmin.Client", "src\Web\WebAdmin.Client\WebAdmin.Client.csproj", "{306E933B-914F-4935-A924-DA756F766753}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebAdmin", "src\Web\WebAdmin\WebAdmin.csproj", "{EA794699-4DD1-4622-A80F-DB138AB53D86}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -213,14 +215,18 @@ Global
{7449D8D4-0F2A-4D35-BC2F-0DEF40833C91}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7449D8D4-0F2A-4D35-BC2F-0DEF40833C91}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7449D8D4-0F2A-4D35-BC2F-0DEF40833C91}.Release|Any CPU.Build.0 = Release|Any CPU
- {20F4D5A5-8047-4ACA-B8A0-6F1EB2D2F5B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {20F4D5A5-8047-4ACA-B8A0-6F1EB2D2F5B9}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {20F4D5A5-8047-4ACA-B8A0-6F1EB2D2F5B9}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {20F4D5A5-8047-4ACA-B8A0-6F1EB2D2F5B9}.Release|Any CPU.Build.0 = Release|Any CPU
- {8E19ECB4-9DC8-45A9-95F6-AB0E1D5D1A4B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {8E19ECB4-9DC8-45A9-95F6-AB0E1D5D1A4B}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {8E19ECB4-9DC8-45A9-95F6-AB0E1D5D1A4B}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {8E19ECB4-9DC8-45A9-95F6-AB0E1D5D1A4B}.Release|Any CPU.Build.0 = Release|Any CPU
+ {9FCF0D70-CF60-4C0D-8667-42DB50BC6EE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {9FCF0D70-CF60-4C0D-8667-42DB50BC6EE2}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {9FCF0D70-CF60-4C0D-8667-42DB50BC6EE2}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {9FCF0D70-CF60-4C0D-8667-42DB50BC6EE2}.Release|Any CPU.Build.0 = Release|Any CPU
+ {306E933B-914F-4935-A924-DA756F766753}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {306E933B-914F-4935-A924-DA756F766753}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {306E933B-914F-4935-A924-DA756F766753}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {306E933B-914F-4935-A924-DA756F766753}.Release|Any CPU.Build.0 = Release|Any CPU
+ {EA794699-4DD1-4622-A80F-DB138AB53D86}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {EA794699-4DD1-4622-A80F-DB138AB53D86}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {EA794699-4DD1-4622-A80F-DB138AB53D86}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {EA794699-4DD1-4622-A80F-DB138AB53D86}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -269,8 +275,9 @@ Global
{88C29601-0AA3-4751-9AF2-65F93743AA5D} = {7910C4F6-E2F6-4309-BC0F-45285E1124D7}
{631B0704-ED1C-444A-95AB-E52952756F43} = {121D78F3-3F0F-4F00-B2C9-3C797653C951}
{7449D8D4-0F2A-4D35-BC2F-0DEF40833C91} = {121D78F3-3F0F-4F00-B2C9-3C797653C951}
- {20F4D5A5-8047-4ACA-B8A0-6F1EB2D2F5B9} = {6720D68A-1AF5-48BA-8CB5-349E70E151B0}
- {8E19ECB4-9DC8-45A9-95F6-AB0E1D5D1A4B} = {6720D68A-1AF5-48BA-8CB5-349E70E151B0}
+ {9FCF0D70-CF60-4C0D-8667-42DB50BC6EE2} = {6720D68A-1AF5-48BA-8CB5-349E70E151B0}
+ {306E933B-914F-4935-A924-DA756F766753} = {6720D68A-1AF5-48BA-8CB5-349E70E151B0}
+ {EA794699-4DD1-4622-A80F-DB138AB53D86} = {6720D68A-1AF5-48BA-8CB5-349E70E151B0}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {CE377903-BDA1-4347-BEC2-62ED2F807EE3}
diff --git a/Directory.Packages.props b/Directory.Packages.props
index 9a69802..b0e6f36 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -5,6 +5,7 @@
8.0.0
8.0.0
+ 8.0.4
1.13.0
@@ -15,10 +16,6 @@
-
-
-
-
@@ -29,16 +26,24 @@
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/src/Web/WebAdmin.Client/Layout/NavMenu.razor b/src/Web/WebAdmin.Client/Layout/NavMenu.razor
new file mode 100644
index 0000000..8f3dffe
--- /dev/null
+++ b/src/Web/WebAdmin.Client/Layout/NavMenu.razor
@@ -0,0 +1,18 @@
+@rendermode InteractiveAuto
+
+
+
+@code {
+ private bool expanded = true;
+
+}
\ No newline at end of file
diff --git a/src/Web/WebAdmin/WebAdmin.Client/Pages/Counter.razor b/src/Web/WebAdmin.Client/Pages/Counter.razor
similarity index 100%
rename from src/Web/WebAdmin/WebAdmin.Client/Pages/Counter.razor
rename to src/Web/WebAdmin.Client/Pages/Counter.razor
diff --git a/src/Web/WebAdmin.Client/Program.cs b/src/Web/WebAdmin.Client/Program.cs
new file mode 100644
index 0000000..519269f
--- /dev/null
+++ b/src/Web/WebAdmin.Client/Program.cs
@@ -0,0 +1,5 @@
+using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
+
+var builder = WebAssemblyHostBuilder.CreateDefault(args);
+
+await builder.Build().RunAsync();
diff --git a/src/Web/WebAdmin/WebAdmin.Client/WebAdmin.Client.csproj b/src/Web/WebAdmin.Client/WebAdmin.Client.csproj
similarity index 34%
rename from src/Web/WebAdmin/WebAdmin.Client/WebAdmin.Client.csproj
rename to src/Web/WebAdmin.Client/WebAdmin.Client.csproj
index 5e7aadc..1ad68c0 100644
--- a/src/Web/WebAdmin/WebAdmin.Client/WebAdmin.Client.csproj
+++ b/src/Web/WebAdmin.Client/WebAdmin.Client.csproj
@@ -1,28 +1,17 @@
- net8.0
- enable
- enable
true
Default
- true
-
-
-
+
-
- PreserveNewest
-
-
- PreserveNewest
-
+
diff --git a/src/Web/WebAdmin/WebAdmin.Client/WebAdmin.Client.xml b/src/Web/WebAdmin.Client/WebAdmin.Client.xml
similarity index 100%
rename from src/Web/WebAdmin/WebAdmin.Client/WebAdmin.Client.xml
rename to src/Web/WebAdmin.Client/WebAdmin.Client.xml
diff --git a/src/Web/WebAdmin/WebAdmin.Client/_Imports.razor b/src/Web/WebAdmin.Client/_Imports.razor
similarity index 100%
rename from src/Web/WebAdmin/WebAdmin.Client/_Imports.razor
rename to src/Web/WebAdmin.Client/_Imports.razor
index a97f169..8f2ecdb 100644
--- a/src/Web/WebAdmin/WebAdmin.Client/_Imports.razor
+++ b/src/Web/WebAdmin.Client/_Imports.razor
@@ -5,6 +5,6 @@
@using Microsoft.AspNetCore.Components.Web
@using static Microsoft.AspNetCore.Components.Web.RenderMode
@using Microsoft.AspNetCore.Components.Web.Virtualization
-@using Microsoft.JSInterop
@using Microsoft.FluentUI.AspNetCore.Components
+@using Microsoft.JSInterop
@using WebAdmin.Client
diff --git a/src/Web/WebAdmin/WebAdmin.Client/wwwroot/appsettings.json b/src/Web/WebAdmin.Client/wwwroot/appsettings.Development.json
similarity index 100%
rename from src/Web/WebAdmin/WebAdmin.Client/wwwroot/appsettings.json
rename to src/Web/WebAdmin.Client/wwwroot/appsettings.Development.json
diff --git a/src/Web/WebAdmin.Client/wwwroot/appsettings.json b/src/Web/WebAdmin.Client/wwwroot/appsettings.json
new file mode 100644
index 0000000..0c208ae
--- /dev/null
+++ b/src/Web/WebAdmin.Client/wwwroot/appsettings.json
@@ -0,0 +1,8 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Information",
+ "Microsoft.AspNetCore": "Warning"
+ }
+ }
+}
diff --git a/src/Web/WebAdmin/WebAdmin/Components/Shared/CultureSelector.razor b/src/Web/WebAdmin.Shared/Components/CultureSelector.razor
similarity index 87%
rename from src/Web/WebAdmin/WebAdmin/Components/Shared/CultureSelector.razor
rename to src/Web/WebAdmin.Shared/Components/CultureSelector.razor
index 42e3acb..ae7c62c 100644
--- a/src/Web/WebAdmin/WebAdmin/Components/Shared/CultureSelector.razor
+++ b/src/Web/WebAdmin.Shared/Components/CultureSelector.razor
@@ -1,9 +1,9 @@
-
-
+
diff --git a/src/Web/WebAdmin/WebAdmin/Components/Shared/CultureSelector.razor.cs b/src/Web/WebAdmin.Shared/Components/CultureSelector.razor.cs
similarity index 94%
rename from src/Web/WebAdmin/WebAdmin/Components/Shared/CultureSelector.razor.cs
rename to src/Web/WebAdmin.Shared/Components/CultureSelector.razor.cs
index 9b5ab2b..5454434 100644
--- a/src/Web/WebAdmin/WebAdmin/Components/Shared/CultureSelector.razor.cs
+++ b/src/Web/WebAdmin.Shared/Components/CultureSelector.razor.cs
@@ -2,9 +2,9 @@
using Microsoft.AspNetCore.Components;
using Microsoft.FluentUI.AspNetCore.Components;
using Microsoft.JSInterop;
-using WebAdmin.Configurations;
+using WebAdmin.Shared.Configurations;
-namespace WebAdmin.Components.Shared;
+namespace WebAdmin.Shared.Components;
public partial class CultureSelector
{
diff --git a/src/Web/WebAdmin/WebAdmin/Components/Shared/CultureSelector.razor.css b/src/Web/WebAdmin.Shared/Components/CultureSelector.razor.css
similarity index 100%
rename from src/Web/WebAdmin/WebAdmin/Components/Shared/CultureSelector.razor.css
rename to src/Web/WebAdmin.Shared/Components/CultureSelector.razor.css
diff --git a/src/Web/WebAdmin/WebAdmin/Components/Shared/SiteLinks.razor b/src/Web/WebAdmin.Shared/Components/SiteLinks.razor
similarity index 70%
rename from src/Web/WebAdmin/WebAdmin/Components/Shared/SiteLinks.razor
rename to src/Web/WebAdmin.Shared/Components/SiteLinks.razor
index 518de77..fdc6184 100644
--- a/src/Web/WebAdmin/WebAdmin/Components/Shared/SiteLinks.razor
+++ b/src/Web/WebAdmin.Shared/Components/SiteLinks.razor
@@ -1,10 +1,9 @@
-@rendermode InteractiveServer
-
-
+
diff --git a/src/Web/WebAdmin/WebAdmin/Components/Shared/SiteLinks.razor.css b/src/Web/WebAdmin.Shared/Components/SiteLinks.razor.css
similarity index 100%
rename from src/Web/WebAdmin/WebAdmin/Components/Shared/SiteLinks.razor.css
rename to src/Web/WebAdmin.Shared/Components/SiteLinks.razor.css
diff --git a/src/Web/WebAdmin/WebAdmin/Components/Layout/MainSearch.razor b/src/Web/WebAdmin.Shared/Components/SiteSearch.razor
similarity index 89%
rename from src/Web/WebAdmin/WebAdmin/Components/Layout/MainSearch.razor
rename to src/Web/WebAdmin.Shared/Components/SiteSearch.razor
index 8c95ff3..6188b8c 100644
--- a/src/Web/WebAdmin/WebAdmin/Components/Layout/MainSearch.razor
+++ b/src/Web/WebAdmin.Shared/Components/SiteSearch.razor
@@ -1,6 +1,4 @@
-@using Microsoft.Extensions.Localization
-@rendermode InteractiveServer
-@inject IStringLocalizer
L
+@inject IStringLocalizer L
-
-
+
+
\ No newline at end of file
diff --git a/src/Web/WebAdmin/WebAdmin/Components/Shared/SiteSettings.razor.cs b/src/Web/WebAdmin.Shared/Components/SiteSettings.razor.cs
similarity index 88%
rename from src/Web/WebAdmin/WebAdmin/Components/Shared/SiteSettings.razor.cs
rename to src/Web/WebAdmin.Shared/Components/SiteSettings.razor.cs
index 20b4f78..fdbf713 100644
--- a/src/Web/WebAdmin/WebAdmin/Components/Shared/SiteSettings.razor.cs
+++ b/src/Web/WebAdmin.Shared/Components/SiteSettings.razor.cs
@@ -1,6 +1,6 @@
using Microsoft.FluentUI.AspNetCore.Components;
-namespace WebAdmin.Components.Shared;
+namespace WebAdmin.Shared.Components;
public partial class SiteSettings
{
@@ -12,7 +12,7 @@ public partial class SiteSettings
_dialog = await DialogService.ShowPanelAsync(new DialogParameters()
{
ShowTitle = true,
- Title = "Site settings",
+ Title = "网站设置",
Alignment = HorizontalAlignment.Right,
PrimaryAction = "OK",
SecondaryAction = null,
diff --git a/src/Web/WebAdmin/WebAdmin/Components/Shared/SiteSettingsPanel.razor b/src/Web/WebAdmin.Shared/Components/SiteSettingsPanel.razor
similarity index 52%
rename from src/Web/WebAdmin/WebAdmin/Components/Shared/SiteSettingsPanel.razor
rename to src/Web/WebAdmin.Shared/Components/SiteSettingsPanel.razor
index ae123cd..fb330df 100644
--- a/src/Web/WebAdmin/WebAdmin/Components/Shared/SiteSettingsPanel.razor
+++ b/src/Web/WebAdmin.Shared/Components/SiteSettingsPanel.razor
@@ -8,13 +8,13 @@
StorageName="theme" />
-
-
- @context
+ @OfficeColorNameMapper.Map(context)
-
- These values (except for Direction) are persisted in the LocalStorage.
- and will be recovered during your next visits.
- Use the 'Reset settings button' below to go back to the system theme and a random color.
+ 这些值(方向值除外)将被持久保存在 LocalStorage 中,并将在下次访问时恢复。
+
+ "重置设置" 按钮 重置系统主题和颜色。
+
+ "随机设置" 按钮 随机系统主题和随机颜色。
+
-
+
- This site stores settings for the theme and color and downloaded samples, emoji and icons in the browser' cache and local storage.
+ 该网站会在浏览器缓存和本地存储中存储主题和颜色设置,以及下载的样本、表情符号和图标。
- You can check the contents of the cache and storage in the browser's developer tools. If you are using Edge or Chrome, you can do this by
- going to the Application tab and then clicking on the Cache Storage or Local Storagesection.
- In Firefox, you can do this by going to the Storage tab and then clicking on the Cache Storage or Local Storage section.
+ 您可以在浏览器的开发工具中检查缓存和存储的内容。如果您使用的是 Edge 或 Chrome 浏览器,可以进入 "应用程序 "选项卡,然后点击 "缓存存储 "或 "本地存储 "部分。
+
+ 在火狐浏览器中,您可以进入 "存储 "选项卡,然后单击 "缓存存储 "或 "本地存储 "部分。
- If you feel like you're not seeing the latest and greatest of samples. emoji or icons, or you want to clear out the stored theme and color,
- click the button below to clear the cache and delete local storage.
+ 如果你觉得没有看到最新和最好的样本、表情符号或图标,或者你想清除存储的主题和颜色,请单击下面的按钮清除缓存并删除本地存储。
- Don't worry, this will only reset stored data for this site. It will not clear any of your browser's cache for other sites!
+ 别担心, 这将仅 重置此 网站的存储数据。它不会清除浏览器中其他网站的任何缓存!
- Reset settings
+ 随机主题
+ 重置设置
diff --git a/src/Web/WebAdmin/WebAdmin/Components/Shared/SiteSettingsPanel.razor.cs b/src/Web/WebAdmin.Shared/Components/SiteSettingsPanel.razor.cs
similarity index 76%
rename from src/Web/WebAdmin/WebAdmin/Components/Shared/SiteSettingsPanel.razor.cs
rename to src/Web/WebAdmin.Shared/Components/SiteSettingsPanel.razor.cs
index ed25e6c..e9f25a8 100644
--- a/src/Web/WebAdmin/WebAdmin/Components/Shared/SiteSettingsPanel.razor.cs
+++ b/src/Web/WebAdmin.Shared/Components/SiteSettingsPanel.razor.cs
@@ -1,9 +1,10 @@
using Microsoft.AspNetCore.Components;
+using Microsoft.Extensions.Logging;
using Microsoft.FluentUI.AspNetCore.Components.Extensions;
using Microsoft.FluentUI.AspNetCore.Components;
-using WebAdmin.Infrastructure;
+using WebAdmin.Shared.Infrastructure;
-namespace WebAdmin.Components.Shared;
+namespace WebAdmin.Shared.Components;
public partial class SiteSettingsPanel
{
@@ -55,7 +56,7 @@ public partial class SiteSettingsPanel
private async Task ResetSiteAsync()
{
- var msg = "Site settings reset and cache cleared!";
+ var msg = "重置网站设置并清除缓存!";
await CacheStorageAccessor.RemoveAllAsync();
_theme?.ClearLocalStorageAsync();
@@ -63,10 +64,25 @@ public partial class SiteSettingsPanel
Logger.LogInformation(msg);
_status = msg;
- OfficeColor = OfficeColorUtilities.GetRandom();
+ OfficeColor = Microsoft.FluentUI.AspNetCore.Components.OfficeColor.Default;
Mode = DesignThemeModes.System;
}
+ private async Task RandomSiteAsync()
+ {
+ var msg = "随机网站主题颜色和模式!";
+
+ await CacheStorageAccessor.RemoveAllAsync();
+ _theme?.ClearLocalStorageAsync();
+
+ Logger.LogInformation(msg);
+ _status = msg;
+
+ OfficeColor = OfficeColorUtilities.GetRandom();
+ var themeModes = Enum.GetValues();
+ Mode = themeModes.ElementAt(Random.Shared.Next(themeModes.Length));
+ }
+
private static string? GetCustomColor(OfficeColor? color)
{
return color switch
diff --git a/src/Web/WebAdmin.Shared/Components/TableOfContents.razor b/src/Web/WebAdmin.Shared/Components/TableOfContents.razor
new file mode 100644
index 0000000..ddff685
--- /dev/null
+++ b/src/Web/WebAdmin.Shared/Components/TableOfContents.razor
@@ -0,0 +1,14 @@
+
+
+
+
+ @GetTocItems(_anchors)
+
+
+
+
+ @if (ShowBackButton)
+ {
+ 返回顶部
+ }
+
\ No newline at end of file
diff --git a/src/Web/WebAdmin.Shared/Components/TableOfContents.razor.cs b/src/Web/WebAdmin.Shared/Components/TableOfContents.razor.cs
new file mode 100644
index 0000000..5db072d
--- /dev/null
+++ b/src/Web/WebAdmin.Shared/Components/TableOfContents.razor.cs
@@ -0,0 +1,170 @@
+using System.Diagnostics.CodeAnalysis;
+using Microsoft.AspNetCore.Components;
+using Microsoft.AspNetCore.Components.Routing;
+using Microsoft.FluentUI.AspNetCore.Components;
+using Microsoft.JSInterop;
+
+namespace WebAdmin.Shared.Components;
+
+public partial class TableOfContents : IAsyncDisposable
+{
+ private Anchor[]? _anchors;
+ private bool _expanded = true;
+
+ private IJSObjectReference _jsModule = default!;
+
+ [Inject] protected IJSRuntime JSRuntime { get; set; } = default!;
+
+ [Inject] protected NavigationManager NavigationManager { get; set; } = default!;
+
+ ///
+ /// Gets or sets the heading for the ToC
+ /// Defaults to 'In this article'
+ ///
+ [Parameter]
+ public string Heading { get; set; } = "导航";
+
+ ///
+ /// Gets or sets a value indicating whether a 'Back to top' button should be rendered.
+ /// Defaults to true
+ ///
+ [Parameter]
+ public bool ShowBackButton { get; set; } = true;
+
+ ///
+ /// Gets or sets the content to be rendered inside the component.
+ ///
+
+ [Parameter]
+ public RenderFragment? ChildContent { get; set; }
+
+ async ValueTask IAsyncDisposable.DisposeAsync()
+ {
+ try
+ {
+ // Unsubscribe from the event when our component is disposed
+ NavigationManager.LocationChanged -= LocationChanged;
+
+ if (_jsModule is not null) await _jsModule.DisposeAsync();
+ }
+ catch (Exception ex) when (ex is JSDisconnectedException ||
+ ex is OperationCanceledException)
+ {
+ // The JSRuntime side may routinely be gone already if the reason we're disposing is that
+ // the client disconnected. This is not an error.
+ }
+ }
+
+ protected override async Task OnAfterRenderAsync(bool firstRender)
+ {
+ if (firstRender)
+ {
+ _jsModule = await JSRuntime.InvokeAsync("import",
+ "./_content/WebAdmin.Shared/Components/TableOfContents.razor.js");
+ var mobile = await _jsModule!.InvokeAsync("isDevice");
+
+ if (mobile) _expanded = false;
+
+ await BackToTopAsync();
+ await QueryDomAsync();
+ }
+ }
+
+ private async Task BackToTopAsync()
+ {
+ if (_jsModule is null) return;
+ await _jsModule.InvokeAsync("backToTop");
+ }
+
+ private async Task QueryDomAsync()
+ {
+ if (_jsModule is null) return;
+
+ var foundAnchors = await _jsModule.InvokeAsync("queryDomForTocEntries");
+
+ if (AnchorsEqual(_anchors, foundAnchors)) return;
+
+ _anchors = foundAnchors;
+ StateHasChanged();
+ }
+
+ private bool AnchorsEqual(Anchor[]? firstSet, Anchor[]? secondSet) => (firstSet ?? [])
+ .SequenceEqual(secondSet ?? []);
+
+ protected override void OnInitialized()
+ {
+ // Subscribe to the event
+ NavigationManager.LocationChanged += LocationChanged;
+ }
+
+ private async void LocationChanged(object? sender, LocationChangedEventArgs e)
+ {
+ try
+ {
+ await BackToTopAsync();
+ await QueryDomAsync();
+ }
+ catch (Exception)
+ {
+ // Already disposed
+ }
+ }
+
+ [SuppressMessage("Style", "VSTHRD200:Use `Async` suffix for async methods",
+ Justification = "#vNext: To update in the next version")]
+ public async Task Refresh()
+ {
+ await QueryDomAsync();
+ }
+
+ private RenderFragment? GetTocItems(IEnumerable? items)
+ {
+ if (items is not null)
+ return builder =>
+ {
+ var i = 0;
+
+ builder.OpenElement(i++, "ul");
+ foreach (var item in items)
+ {
+ builder.OpenElement(i++, "li");
+ builder.OpenComponent(i++);
+ builder.AddAttribute(i++, "Href", item.Href);
+ builder.AddAttribute(i++, "Appearance", Appearance.Hypertext);
+ builder.AddAttribute(i++, "ChildContent",
+ (RenderFragment)(content => { content.AddContent(i++, item.Text); }));
+ builder.CloseComponent();
+ if (item.Anchors is not null) builder.AddContent(i++, GetTocItems(item.Anchors));
+ builder.CloseElement();
+ }
+
+ builder.CloseElement();
+ };
+ return builder => { builder.AddContent(0, ChildContent); };
+ }
+
+ private record Anchor(string Level, string Text, string Href, Anchor[] Anchors)
+ {
+ public virtual bool Equals(Anchor? other)
+ {
+ if (other is null) return false;
+
+ if (Level != other.Level ||
+ Text != other.Text ||
+ Href != other.Href ||
+ (Anchors?.Length ?? 0) != (other.Anchors?.Length ?? 0))
+ return false;
+
+ if (Anchors is not null &&
+ Anchors.Length > 0)
+ for (var i = 0; i < Anchors.Length; i++)
+ if (!Anchors[i].Equals(other.Anchors![i]))
+ return false;
+
+ return true;
+ }
+
+ public override int GetHashCode()
+ => HashCode.Combine(Level, Text, Href);
+ }
+}
\ No newline at end of file
diff --git a/src/Web/WebAdmin.Shared/Components/TableOfContents.razor.css b/src/Web/WebAdmin.Shared/Components/TableOfContents.razor.css
new file mode 100644
index 0000000..f27538b
--- /dev/null
+++ b/src/Web/WebAdmin.Shared/Components/TableOfContents.razor.css
@@ -0,0 +1,57 @@
+::deep ul {
+ list-style: none;
+ text-overflow: ellipsis;
+}
+
+::deep ul:first-of-type {
+ padding-left: 1rem;
+}
+
+[dir="rtl"] * ::deep ul:first-of-type {
+ padding-right: 1rem;
+}
+
+
+li {
+ text-overflow: ellipsis;
+}
+
+
+::deep fluent-anchor::part(control) {
+ color: var(--neutral-foreground-rest);
+ text-decoration: none;
+ overflow: hidden;
+ white-space: break-spaces;
+ line-height: var(--type-ramp-base-line-height);
+}
+
+::deep fluent-anchor::part(control):focus {
+ outline: 1px dashed;
+ outline-offset: 3px;
+ border-radius: 0;
+}
+
+::deep fluent-anchor::part(control):hover {
+ text-decoration: underline;
+}
+
+
+::deep fluent-button {
+ display: none;
+ position: fixed;
+ bottom: 45px;
+ right: 20px;
+ left: unset;
+ z-index: 99;
+ cursor: pointer;
+}
+
+[dir="rtl"] * ::deep fluent-button {
+ display: none;
+ position: fixed;
+ bottom: 45px;
+ left: 20px;
+ right: unset;
+ z-index: 99;
+ cursor: pointer;
+}
\ No newline at end of file
diff --git a/src/Web/WebAdmin.Shared/Components/TableOfContents.razor.js b/src/Web/WebAdmin.Shared/Components/TableOfContents.razor.js
new file mode 100644
index 0000000..ea0e4bc
--- /dev/null
+++ b/src/Web/WebAdmin.Shared/Components/TableOfContents.razor.js
@@ -0,0 +1,74 @@
+export function queryDomForTocEntries() {
+ const article = document.getElementById('article');
+ const headings = article.querySelectorAll("h2, h3, h4");
+
+ let tocArray = new Array()
+ let chapter = null;
+ let subchapter = null;
+
+ for (let element of headings) {
+ if (!element.id) {
+ let anchorText = element.innerText;
+ let elementId = anchorText.replaceAll(" ", "-", "/", "\\", "#", "$", "@", ":", ",").toLowerCase();
+ element.id = elementId;
+ }
+ if (element.innerText) {
+ let anchor = {
+ "level": element.nodeName,
+ "text": element.innerText,
+ "href": "#" + element.id,
+ "anchors": new Array()
+ };
+
+ if ("H3" === element.nodeName) {
+ if (chapter) {
+ subchapter = anchor;
+ chapter.anchors.push(subchapter);
+
+ }
+ } else if ("H4" === element.nodeName) {
+ if (subchapter) {
+ subchapter.anchors.push(anchor);
+ }
+ }
+ else {
+ chapter = anchor;
+ tocArray.push(chapter);
+
+ }
+ }
+ }
+ return tocArray;
+}
+
+let backToTopButton = document.getElementById("backtotop");
+
+// When the user scrolls down 20px from the top of the document, show the button
+let bodycontent = document.getElementById('body-content');
+if (!bodycontent) {
+ bodycontent = document.body;
+}
+
+bodycontent.onscroll = function () {
+ scrollFunction()
+};
+
+function scrollFunction() {
+ if (document.body.scrollTop > 20 || document.getElementById('body-content').scrollTop > 20 || document.documentElement.scrollTop > 20) {
+ backToTopButton.style.display = "flex";
+ } else {
+ backToTopButton.style.display = "none";
+ }
+}
+
+// When the user clicks on the button, scroll to the top of the document
+export function backToTop() {
+ document.body.scrollTop = 0;
+ document.documentElement.scrollTop = 0;
+ document.getElementById('body-content').scrollTop = 0;
+}
+
+// Very simple check to see if mobile or tablet is being used
+export function isDevice() {
+ return /android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini|mobile/i.test(navigator.userAgent);
+}
\ No newline at end of file
diff --git a/src/Web/WebAdmin/WebAdmin/Components/Shared/UserProfile.razor b/src/Web/WebAdmin.Shared/Components/UserProfile.razor
similarity index 50%
rename from src/Web/WebAdmin/WebAdmin/Components/Shared/UserProfile.razor
rename to src/Web/WebAdmin.Shared/Components/UserProfile.razor
index d2fa480..bc665dd 100644
--- a/src/Web/WebAdmin/WebAdmin/Components/Shared/UserProfile.razor
+++ b/src/Web/WebAdmin.Shared/Components/UserProfile.razor
@@ -1,9 +1,9 @@
-
/// 管理后台配置
diff --git a/src/Web/WebAdmin/WebAdmin/Configurations/ConfigurationConsts.cs b/src/Web/WebAdmin.Shared/Configurations/ConfigurationConsts.cs
similarity index 48%
rename from src/Web/WebAdmin/WebAdmin/Configurations/ConfigurationConsts.cs
rename to src/Web/WebAdmin.Shared/Configurations/ConfigurationConsts.cs
index 096d802..080bf0f 100644
--- a/src/Web/WebAdmin/WebAdmin/Configurations/ConfigurationConsts.cs
+++ b/src/Web/WebAdmin.Shared/Configurations/ConfigurationConsts.cs
@@ -1,6 +1,7 @@
-namespace WebAdmin.Configurations;
+namespace WebAdmin.Shared.Configurations;
public class ConfigurationConsts
{
public const string ResourcesPath = "Resources";
+ public const string HeaderColor = "#ffffff";
}
\ No newline at end of file
diff --git a/src/Web/WebAdmin/WebAdmin/Infrastructure/AppVersionService.cs b/src/Web/WebAdmin.Shared/Infrastructure/AppVersionService.cs
similarity index 94%
rename from src/Web/WebAdmin/WebAdmin/Infrastructure/AppVersionService.cs
rename to src/Web/WebAdmin.Shared/Infrastructure/AppVersionService.cs
index 7538310..8529499 100644
--- a/src/Web/WebAdmin/WebAdmin/Infrastructure/AppVersionService.cs
+++ b/src/Web/WebAdmin.Shared/Infrastructure/AppVersionService.cs
@@ -1,6 +1,6 @@
using System.Reflection;
-namespace WebAdmin.Infrastructure;
+namespace WebAdmin.Shared.Infrastructure;
///
/// AppVersion Service
diff --git a/src/Web/WebAdmin/WebAdmin/Infrastructure/CacheStorageAccessor.cs b/src/Web/WebAdmin.Shared/Infrastructure/CacheStorageAccessor.cs
similarity index 96%
rename from src/Web/WebAdmin/WebAdmin/Infrastructure/CacheStorageAccessor.cs
rename to src/Web/WebAdmin.Shared/Infrastructure/CacheStorageAccessor.cs
index 2361039..3a12018 100644
--- a/src/Web/WebAdmin/WebAdmin/Infrastructure/CacheStorageAccessor.cs
+++ b/src/Web/WebAdmin.Shared/Infrastructure/CacheStorageAccessor.cs
@@ -1,9 +1,9 @@
using Microsoft.FluentUI.AspNetCore.Components.Utilities;
using Microsoft.JSInterop;
-namespace WebAdmin.Infrastructure;
+namespace WebAdmin.Shared.Infrastructure;
-public class CacheStorageAccessor(IJSRuntime js, IAppVersionService vs) : JSModule(js, "./js/CacheStorageAccessor.js")
+public class CacheStorageAccessor(IJSRuntime js, IAppVersionService vs) : JSModule(js, "./_content/WebAdmin.Shared/js/CacheStorageAccessor.js")
{
private readonly IAppVersionService _vs = vs;
private string? _currentCacheVersion = default;
diff --git a/src/Web/WebAdmin/WebAdmin/Components/Shared/CustomIcons.cs b/src/Web/WebAdmin.Shared/Infrastructure/CustomIcons.cs
similarity index 97%
rename from src/Web/WebAdmin/WebAdmin/Components/Shared/CustomIcons.cs
rename to src/Web/WebAdmin.Shared/Infrastructure/CustomIcons.cs
index 71352e2..8fdce66 100644
--- a/src/Web/WebAdmin/WebAdmin/Components/Shared/CustomIcons.cs
+++ b/src/Web/WebAdmin.Shared/Infrastructure/CustomIcons.cs
@@ -1,6 +1,6 @@
using Microsoft.FluentUI.AspNetCore.Components;
-namespace WebAdmin.Components.Shared;
+namespace WebAdmin.Shared.Infrastructure;
public static class CustomIcons
{
diff --git a/src/Web/WebAdmin.Shared/Infrastructure/HttpBasedStaticAssetService.cs b/src/Web/WebAdmin.Shared/Infrastructure/HttpBasedStaticAssetService.cs
new file mode 100644
index 0000000..cad8c84
--- /dev/null
+++ b/src/Web/WebAdmin.Shared/Infrastructure/HttpBasedStaticAssetService.cs
@@ -0,0 +1,57 @@
+using Microsoft.AspNetCore.Components;
+
+namespace WebAdmin.Shared.Infrastructure;
+
+public class HttpBasedStaticAssetService : IStaticAssetService
+{
+ private readonly HttpClient _httpClient;
+ private readonly CacheStorageAccessor _cacheStorageAccessor;
+
+ public HttpBasedStaticAssetService(HttpClient httpClient, NavigationManager navigationManager, CacheStorageAccessor cacheStorageAccessor)
+ {
+ _httpClient = httpClient;
+ _httpClient.BaseAddress ??= new Uri(navigationManager.BaseUri);
+ _cacheStorageAccessor = cacheStorageAccessor;
+ }
+
+ public async Task GetAsync(string assetUrl, bool useCache = true)
+ {
+ string? result = null;
+
+ HttpRequestMessage? message = CreateMessage(assetUrl);
+
+ if (useCache)
+ {
+ // Get the result from the cache
+ result = await _cacheStorageAccessor.GetAsync(message);
+ }
+
+ if (string.IsNullOrEmpty(result))
+ {
+ //It not in the cache (or cache not used), download the asset
+ HttpResponseMessage? response = await _httpClient.SendAsync(message);
+
+ // If successful, store the response in the cache and get the result
+ if (response.IsSuccessStatusCode)
+ {
+ if (useCache)
+ {
+ // Store the response in the cache and get the result
+ result = await _cacheStorageAccessor.PutAndGetAsync(message, response);
+ }
+ else
+ {
+ result = await response.Content.ReadAsStringAsync();
+ }
+ }
+ else
+ {
+ result = string.Empty;
+ }
+ }
+
+ return result;
+ }
+
+ private static HttpRequestMessage CreateMessage(string url) => new(HttpMethod.Get, url);
+}
\ No newline at end of file
diff --git a/src/Web/WebAdmin/WebAdmin/Infrastructure/IAppVersionService.cs b/src/Web/WebAdmin.Shared/Infrastructure/IAppVersionService.cs
similarity index 73%
rename from src/Web/WebAdmin/WebAdmin/Infrastructure/IAppVersionService.cs
rename to src/Web/WebAdmin.Shared/Infrastructure/IAppVersionService.cs
index c7c09e3..e6e925b 100644
--- a/src/Web/WebAdmin/WebAdmin/Infrastructure/IAppVersionService.cs
+++ b/src/Web/WebAdmin.Shared/Infrastructure/IAppVersionService.cs
@@ -1,4 +1,4 @@
-namespace WebAdmin.Infrastructure;
+namespace WebAdmin.Shared.Infrastructure;
///
/// AppVersion Service
diff --git a/src/Web/WebAdmin.Shared/Infrastructure/IStaticAssetService.cs b/src/Web/WebAdmin.Shared/Infrastructure/IStaticAssetService.cs
new file mode 100644
index 0000000..789ccca
--- /dev/null
+++ b/src/Web/WebAdmin.Shared/Infrastructure/IStaticAssetService.cs
@@ -0,0 +1,6 @@
+namespace WebAdmin.Shared.Infrastructure;
+
+public interface IStaticAssetService
+{
+ public Task GetAsync(string assetUrl, bool useCache = true);
+}
\ No newline at end of file
diff --git a/src/Web/WebAdmin/WebAdmin/Components/Shared/NavProvider.cs b/src/Web/WebAdmin.Shared/Infrastructure/NavProvider.cs
similarity index 94%
rename from src/Web/WebAdmin/WebAdmin/Components/Shared/NavProvider.cs
rename to src/Web/WebAdmin.Shared/Infrastructure/NavProvider.cs
index fb2edb3..d1c8b97 100644
--- a/src/Web/WebAdmin/WebAdmin/Components/Shared/NavProvider.cs
+++ b/src/Web/WebAdmin.Shared/Infrastructure/NavProvider.cs
@@ -1,7 +1,9 @@
using Microsoft.AspNetCore.Components.Routing;
using Microsoft.FluentUI.AspNetCore.Components;
+using WebAdmin.Shared.Records;
+using NavLink = WebAdmin.Shared.Records.NavLink;
-namespace WebAdmin.Components.Shared;
+namespace WebAdmin.Shared.Infrastructure;
public class NavProvider
{
@@ -23,6 +25,14 @@ public class NavProvider
name: "Counter"
),
+
+ new NavLink(
+ href: "/weather",
+ match: NavLinkMatch.All,
+ icon: new Icons.Regular.Size20.PersonKey(),
+ name: "Weather"
+ ),
+
// 会员管理
new NavGroup(
icon: new Icons.Regular.Size20.Group(),
diff --git a/src/Web/WebAdmin.Shared/Infrastructure/OfficeColorNameMapper.cs b/src/Web/WebAdmin.Shared/Infrastructure/OfficeColorNameMapper.cs
new file mode 100644
index 0000000..cb6dbf0
--- /dev/null
+++ b/src/Web/WebAdmin.Shared/Infrastructure/OfficeColorNameMapper.cs
@@ -0,0 +1,38 @@
+using Microsoft.FluentUI.AspNetCore.Components;
+
+namespace WebAdmin.Shared.Infrastructure;
+
+///
+public static class OfficeColorNameMapper
+{
+ ///
+ public static string Map(OfficeColor? color) => color switch
+ {
+ OfficeColor.Default => "源远流长",
+ OfficeColor.Access => "朱砂古韵",
+ OfficeColor.Booking => "碧波荡漾",
+ OfficeColor.Exchange => "晴空万里",
+ OfficeColor.Excel => "竹翠绿意",
+ OfficeColor.GroupMe => "青天碧海",
+ OfficeColor.Office => "朱门绯影",
+ OfficeColor.OneDrive => "浩瀚蓝天",
+ OfficeColor.OneNote => "紫气东来",
+ OfficeColor.Outlook => "高望碧空",
+ OfficeColor.Planner => "绿野策划",
+ OfficeColor.PowerApps => "暗紫深思",
+ OfficeColor.PowerBI => "金黄智慧",
+ OfficeColor.PowerPoint => "赤日炎炎",
+ OfficeColor.Project => "绿意盎然",
+ OfficeColor.Publisher => "碧泉出版",
+ OfficeColor.SharePoint => "分享蓝图",
+ OfficeColor.Skype => "蓝天通话",
+ OfficeColor.Stream => "红流媒体",
+ OfficeColor.Sway => "水绿摇曳",
+ OfficeColor.Teams => "深蓝合作",
+ OfficeColor.Visio => "视觉蓝图",
+ OfficeColor.Windows => "开窗见蓝",
+ OfficeColor.Word => "字海泛蓝",
+ OfficeColor.Yammer => "沟通蓝天",
+ _ => throw new ArgumentOutOfRangeException(nameof(color), color, null)
+ };
+}
\ No newline at end of file
diff --git a/src/Web/WebAdmin.Shared/Infrastructure/ServerStaticAssetService.cs b/src/Web/WebAdmin.Shared/Infrastructure/ServerStaticAssetService.cs
new file mode 100644
index 0000000..881c641
--- /dev/null
+++ b/src/Web/WebAdmin.Shared/Infrastructure/ServerStaticAssetService.cs
@@ -0,0 +1,21 @@
+using Microsoft.AspNetCore.Components;
+
+namespace WebAdmin.Shared.Infrastructure;
+
+internal class ServerStaticAssetService : IStaticAssetService
+{
+ private readonly HttpClient _httpClient;
+
+ public ServerStaticAssetService(HttpClient httpClient, NavigationManager navigationManager)
+ {
+ _httpClient = httpClient;
+ _httpClient.BaseAddress ??= new Uri(navigationManager.BaseUri);
+ }
+ public async Task GetAsync(string assetUrl, bool useCache = true)
+ {
+ var message = new HttpRequestMessage(HttpMethod.Get, assetUrl);
+ var response = await _httpClient.SendAsync(message);
+
+ return await response.Content.ReadAsStringAsync();
+ }
+}
\ No newline at end of file
diff --git a/src/Web/WebAdmin.Shared/Infrastructure/ServiceCollectionExtensions.cs b/src/Web/WebAdmin.Shared/Infrastructure/ServiceCollectionExtensions.cs
new file mode 100644
index 0000000..fb3be99
--- /dev/null
+++ b/src/Web/WebAdmin.Shared/Infrastructure/ServiceCollectionExtensions.cs
@@ -0,0 +1,34 @@
+using Microsoft.Extensions.DependencyInjection;
+
+namespace WebAdmin.Shared.Infrastructure;
+
+public static class ServiceCollectionExtensions
+{
+ ///
+ /// 为 Blazor 库添加 Web UI Web 组件所需的常用客户端服务
+ ///
+ /// Service collection
+ public static IServiceCollection AddAdminUiClientServices(this IServiceCollection services)
+ {
+ services.AddSingleton();
+ services.AddSingleton();
+ services.AddHttpClient();
+ services.AddSingleton();
+
+ return services;
+ }
+
+ ///
+ /// 为 Blazor 库添加 Web UI 组件所需的通用服务器服务
+ ///
+ /// Service collection
+ public static IServiceCollection AddAdminUiServerServices(this IServiceCollection services)
+ {
+ services.AddScoped();
+ services.AddScoped();
+ services.AddHttpClient();
+ services.AddSingleton();
+
+ return services;
+ }
+}
\ No newline at end of file
diff --git a/src/Web/WebAdmin.Shared/Layout/MainLayout.razor b/src/Web/WebAdmin.Shared/Layout/MainLayout.razor
new file mode 100644
index 0000000..99ff0f9
--- /dev/null
+++ b/src/Web/WebAdmin.Shared/Layout/MainLayout.razor
@@ -0,0 +1,111 @@
+@inherits LayoutComponentBase
+
+
+
+
+
+
+
+
+
+
+
+ @Body
+
+
+
+
+
+
+
+
+
+
+
+
+
+ github
+
+ Copyright Ⓒ 2024 WebAdmin
+
+
+
+
+@code
+{
+
+ private const string MESSAGES_NOTIFICATION_CENTER = "NOTIFICATION_CENTER";
+ private const string MESSAGES_TOP = "TOP";
+ private const string MESSAGES_DIALOG = "DIALOG";
+ private const string MESSAGES_CARD = "CARD";
+ private const string JAVASCRIPT_FILE = "./_content/WebAdmin.Shared/Layout/MainLayout.razor.js";
+ private string? _version;
+ private bool _mobile;
+ private string? _prevUri;
+ private TableOfContents? _toc;
+ private bool _menuChecked = true;
+
+ [Inject]
+ private NavigationManager NavigationManager { get; set; } = default!;
+
+ [Inject]
+ public IJSRuntime JSRuntime { get; set; } = default!;
+
+ protected override void OnInitialized()
+ {
+ _version = AppVersionService.GetVersionFromAssembly();
+
+ _prevUri = NavigationManager.Uri;
+ NavigationManager.LocationChanged += LocationChanged;
+ }
+
+ protected override async Task OnAfterRenderAsync(bool firstRender)
+ {
+ if (firstRender)
+ {
+ var jsModule = await JSRuntime.InvokeAsync("import", JAVASCRIPT_FILE);
+ _mobile = await jsModule.InvokeAsync("isDevice");
+ await jsModule.DisposeAsync();
+ }
+ }
+
+ public EventCallback OnRefreshTableOfContents => EventCallback.Factory.Create(this, RefreshTableOfContentsAsync);
+
+ private async Task RefreshTableOfContentsAsync()
+ {
+ await _toc!.Refresh();
+ }
+
+ private void HandleChecked()
+ {
+ _menuChecked = !_menuChecked;
+ }
+
+ private void LocationChanged(object? sender, LocationChangedEventArgs e)
+ {
+
+ if (!e.IsNavigationIntercepted && new Uri(_prevUri!).AbsolutePath != new Uri(e.Location).AbsolutePath)
+ {
+ _prevUri = e.Location;
+ if (_mobile && _menuChecked == true)
+ {
+ _menuChecked = false;
+ StateHasChanged();
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Web/WebAdmin.Shared/Layout/MainLayout.razor.js b/src/Web/WebAdmin.Shared/Layout/MainLayout.razor.js
new file mode 100644
index 0000000..76e0d31
--- /dev/null
+++ b/src/Web/WebAdmin.Shared/Layout/MainLayout.razor.js
@@ -0,0 +1,12 @@
+export function isDevice() {
+ return /android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini|mobile/i.test(navigator.userAgent);
+}
+
+export function isDarkMode() {
+ let matched = window.matchMedia("(prefers-color-scheme: dark)").matches;
+
+ if (matched)
+ return true;
+ else
+ return false;
+}
\ No newline at end of file
diff --git a/src/Web/WebAdmin/WebAdmin/Components/Layout/NavMenu.razor b/src/Web/WebAdmin.Shared/Layout/NavMenu.razor
similarity index 87%
rename from src/Web/WebAdmin/WebAdmin/Components/Layout/NavMenu.razor
rename to src/Web/WebAdmin.Shared/Layout/NavMenu.razor
index 2e5da45..b27e290 100644
--- a/src/Web/WebAdmin/WebAdmin/Components/Layout/NavMenu.razor
+++ b/src/Web/WebAdmin.Shared/Layout/NavMenu.razor
@@ -1,6 +1,4 @@
-@using Microsoft.Extensions.Localization
-@rendermode InteractiveServer
-@inject IStringLocalizer L
+@inject IStringLocalizer L
@inject NavProvider NavProvider
@code {
diff --git a/src/Web/WebAdmin/WebAdmin/Components/Layout/NavMenu.razor.css b/src/Web/WebAdmin.Shared/Layout/NavMenu.razor.css
similarity index 100%
rename from src/Web/WebAdmin/WebAdmin/Components/Layout/NavMenu.razor.css
rename to src/Web/WebAdmin.Shared/Layout/NavMenu.razor.css
diff --git a/src/Web/WebAdmin/WebAdmin/Components/Layout/NavMenuItem.razor b/src/Web/WebAdmin.Shared/Layout/NavMenuItem.razor
similarity index 90%
rename from src/Web/WebAdmin/WebAdmin/Components/Layout/NavMenuItem.razor
rename to src/Web/WebAdmin.Shared/Layout/NavMenuItem.razor
index e74bac9..66345e3 100644
--- a/src/Web/WebAdmin/WebAdmin/Components/Layout/NavMenuItem.razor
+++ b/src/Web/WebAdmin.Shared/Layout/NavMenuItem.razor
@@ -1,5 +1,4 @@
-@using Microsoft.Extensions.Localization
-@using NavLink = WebAdmin.Components.Shared.NavLink
+@using NavLink = WebAdmin.Shared.Records.NavLink
@inject IStringLocalizer L
@switch (Value)
diff --git a/src/Web/WebAdmin.Shared/Layout/NavMenuItem.razor.css b/src/Web/WebAdmin.Shared/Layout/NavMenuItem.razor.css
new file mode 100644
index 0000000..5f28270
--- /dev/null
+++ b/src/Web/WebAdmin.Shared/Layout/NavMenuItem.razor.css
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/Web/WebAdmin/WebAdmin/Components/Shared/NavItem.cs b/src/Web/WebAdmin.Shared/Records/NavItem.cs
similarity index 91%
rename from src/Web/WebAdmin/WebAdmin/Components/Shared/NavItem.cs
rename to src/Web/WebAdmin.Shared/Records/NavItem.cs
index 9f25c53..b43ab89 100644
--- a/src/Web/WebAdmin/WebAdmin/Components/Shared/NavItem.cs
+++ b/src/Web/WebAdmin.Shared/Records/NavItem.cs
@@ -1,7 +1,7 @@
using Microsoft.AspNetCore.Components.Routing;
using Microsoft.FluentUI.AspNetCore.Components;
-namespace WebAdmin.Components.Shared;
+namespace WebAdmin.Shared.Records;
public abstract record NavItem
{
@@ -15,9 +15,9 @@ public abstract record NavItem
public record NavLink : NavItem
{
public NavLink(
- string? href,
- Icon icon,
- string name,
+ string? href,
+ Icon icon,
+ string name,
NavLinkMatch match = NavLinkMatch.Prefix,
Color iconColor = Color.Accent)
{
diff --git a/src/Web/WebAdmin/WebAdmin/Resources/Components/Layout/NavMenu.cs b/src/Web/WebAdmin.Shared/Resources/Layout/NavMenu.cs
similarity index 32%
rename from src/Web/WebAdmin/WebAdmin/Resources/Components/Layout/NavMenu.cs
rename to src/Web/WebAdmin.Shared/Resources/Layout/NavMenu.cs
index eeaea36..4b0c41c 100644
--- a/src/Web/WebAdmin/WebAdmin/Resources/Components/Layout/NavMenu.cs
+++ b/src/Web/WebAdmin.Shared/Resources/Layout/NavMenu.cs
@@ -1,4 +1,4 @@
-namespace WebAdmin.Resources.Components.Layout;
+namespace WebAdmin.Shared.Resources.Layout;
public class NavMenu
{
diff --git a/src/Web/WebAdmin/WebAdmin/Resources/Components/Layout/NavMenu.en.resx b/src/Web/WebAdmin.Shared/Resources/Layout/NavMenu.en.resx
similarity index 100%
rename from src/Web/WebAdmin/WebAdmin/Resources/Components/Layout/NavMenu.en.resx
rename to src/Web/WebAdmin.Shared/Resources/Layout/NavMenu.en.resx
diff --git a/src/Web/WebAdmin/WebAdmin/Resources/Components/Layout/NavMenu.zh-Hans.resx b/src/Web/WebAdmin.Shared/Resources/Layout/NavMenu.zh-Hans.resx
similarity index 100%
rename from src/Web/WebAdmin/WebAdmin/Resources/Components/Layout/NavMenu.zh-Hans.resx
rename to src/Web/WebAdmin.Shared/Resources/Layout/NavMenu.zh-Hans.resx
diff --git a/src/Web/WebAdmin/WebAdmin/WebAdmin.csproj b/src/Web/WebAdmin.Shared/WebAdmin.Shared.csproj
similarity index 73%
rename from src/Web/WebAdmin/WebAdmin/WebAdmin.csproj
rename to src/Web/WebAdmin.Shared/WebAdmin.Shared.csproj
index c84d102..984f136 100644
--- a/src/Web/WebAdmin/WebAdmin/WebAdmin.csproj
+++ b/src/Web/WebAdmin.Shared/WebAdmin.Shared.csproj
@@ -1,10 +1,6 @@
-
+
- net8.0
- enable
- enable
- latest
false
false
false
@@ -30,7 +26,7 @@
-
+
@@ -38,8 +34,7 @@
-
-
+
\ No newline at end of file
diff --git a/src/Web/WebAdmin.Shared/_App.razor b/src/Web/WebAdmin.Shared/_App.razor
new file mode 100644
index 0000000..6bf8f26
--- /dev/null
+++ b/src/Web/WebAdmin.Shared/_App.razor
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+ 404 Not found 页面未找到
+
+ 抱歉,该地址没有任何信息.
+
+
+
\ No newline at end of file
diff --git a/src/Web/WebAdmin.Shared/_App.razor.cs b/src/Web/WebAdmin.Shared/_App.razor.cs
new file mode 100644
index 0000000..551f55f
--- /dev/null
+++ b/src/Web/WebAdmin.Shared/_App.razor.cs
@@ -0,0 +1,15 @@
+//namespace WebAdmin.Shared;
+
+//public partial class App
+//{
+
+// public static string PageTitle(string page)
+// {
+// return $"{page} - WebAdmin";
+// }
+
+// public const string MESSAGES_NOTIFICATION_CENTER = "NOTIFICATION_CENTER";
+// public const string MESSAGES_TOP = "TOP";
+// public const string MESSAGES_DIALOG = "DIALOG";
+// public const string MESSAGES_CARD = "CARD";
+//}
\ No newline at end of file
diff --git a/src/Web/WebAdmin.Shared/_Imports.razor b/src/Web/WebAdmin.Shared/_Imports.razor
new file mode 100644
index 0000000..17a8711
--- /dev/null
+++ b/src/Web/WebAdmin.Shared/_Imports.razor
@@ -0,0 +1,23 @@
+@using System.Net.Http
+@using System.Net.Http.Json
+
+@using WebAdmin.Shared.Infrastructure
+@using WebAdmin.Shared.Components
+@using WebAdmin.Shared.Records
+@using WebAdmin.Shared.Layout
+@using WebAdmin.Shared
+@using WebAdmin.Shared.Configurations
+
+@using Microsoft.AspNetCore.Components.Forms
+@using Microsoft.AspNetCore.Components.Routing
+@using Microsoft.AspNetCore.Components.Web
+@using Microsoft.AspNetCore.Components.Web.Virtualization
+
+@using Microsoft.Extensions.Logging;
+@using Microsoft.Extensions.Localization
+
+@using Microsoft.FluentUI.AspNetCore.Components
+@using Microsoft.FluentUI.AspNetCore.Components.Extensions
+@using Microsoft.FluentUI.AspNetCore.Components.DesignTokens
+
+@using Microsoft.JSInterop
diff --git a/src/Web/WebAdmin/WebAdmin/wwwroot/app.css b/src/Web/WebAdmin.Shared/wwwroot/css/app.css
similarity index 61%
rename from src/Web/WebAdmin/WebAdmin/wwwroot/app.css
rename to src/Web/WebAdmin.Shared/wwwroot/css/app.css
index da5e427..1de6cdb 100644
--- a/src/Web/WebAdmin/WebAdmin/wwwroot/app.css
+++ b/src/Web/WebAdmin.Shared/wwwroot/css/app.css
@@ -1,6 +1,4 @@
-@import '/_content/Microsoft.FluentUI.AspNetCore.Components/css/reboot.css';
-
-@import '/_content/Microsoft.FluentUI.AspNetCore.Components/css/reboot.css';
+@import '/_content/Microsoft.FluentUI.AspNetCore.Components/css/reboot.css';
body {
height: 100%;
@@ -12,41 +10,41 @@ body {
margin-bottom: 0 !important;
}
-.siteheader .logo {
- grid-column: 1;
- height: 23px;
- width: 108px;
-}
+ .siteheader .logo {
+ width: 108px;
+ height: 23px;
+ grid-column: 1;
+ }
-.siteheader .search {
- align-items: center;
- display: flex;
- padding-right: 20px;
-}
+ .siteheader .search {
+ display: flex;
+ align-items: center;
+ padding-right: 20px;
+ }
-.siteheader .links {
- align-items: center;
- display: flex;
- padding-right: 10px;
-}
+ .siteheader .links {
+ padding-right: 10px;
+ display: flex;
+ align-items: center;
+ }
-.siteheader .notifications {
- align-items: center;
- display: flex;
-}
+ .siteheader .notifications {
+ display: flex;
+ align-items: center;
+ }
-.siteheader .settings {
- align-items: center;
- display: flex;
- margin-left: 0;
- margin-right: 10px;
- padding-right: 6px;
-}
+ .siteheader .settings {
+ padding-right: 6px;
+ display: flex;
+ align-items: center;
+ margin-left: 0;
+ margin-right: 10px;
+ }
[dir="rtl"] .siteheader .settings {
+ padding: 0 0 0 6px;
margin-left: 10px;
margin-right: 0;
- padding: 0 0 0 6px;
}
[dir="rtl"] .siteheader .search {
@@ -54,105 +52,123 @@ body {
padding-right: 0;
}
-[dir="rtl"] .siteheader .links { padding-left: 10px; }
+[dir="rtl"] .siteheader .links {
+ padding-left: 10px;
+}
-.search-result-icon { vertical-align: middle; }
+.search-result-icon {
+ vertical-align: middle;
+}
-.body-stack { flex-direction: row; }
+.body-stack {
+ flex-direction: row;
+}
.footer {
- background: var(--neutral-layer-4);
- color: var(--neutral-foreground-rest) !important;
display: flex !important;
flex-direction: row !important;
- margin-top: 0px !important;
+ background: var(--neutral-layer-4);
+ color: var(--neutral-foreground-rest) !important;
padding: 10px 10px;
+ margin-top: 0px !important;
}
-.footer .version a {
- color: var(--neutral-foreground-rest);
- text-decoration: none;
-}
+ .footer .version a {
+ color: var(--neutral-foreground-rest);
+ text-decoration: none;
+ }
-.footer .version a:focus {
- outline: 1px dashed;
- outline-offset: 3px;
-}
+ .footer .version a:focus {
+ outline: 1px dashed;
+ outline-offset: 3px;
+ }
-.footer .version a:hover { text-decoration: underline; }
+ .footer .version a:hover {
+ text-decoration: underline;
+ }
nav.sitenav {
background-color: var(--neutral-layer-1);
- height: calc(100dvh - 90px);
- overflow-y: auto;
padding: 1.5rem 1rem;
+ height: calc(100dvh - 90px);
width: 18rem;
+ overflow-y: auto;
}
nav h2 {
font-size: var(--type-ramp-plus-1-font-size);
line-height: var(--type-ramp-plus-1-line-height);
- margin: 0;
padding: 15px 0;
+ margin: 0;
pointer-events: none;
}
nav h3 {
font-size: var(--type-ramp-base-font-size);
line-height: var(--type-ramp-minus-1-line-height);
- margin: 0;
padding: 10px 0;
+ margin: 0;
pointer-events: none;
}
nav fluent-anchor {
- color: var(--fill-color);
width: 100%;
+ color: var(--fill-color);
}
-nav fluent-anchor::part(control) {
- background: var(--accent-fill-rest);
- justify-content: start;
-}
+ nav fluent-anchor::part(control) {
+ justify-content: start;
+ background: var(--accent-fill-rest);
+ }
-.fluent-nav-link.notactive .fluent-nav-text { font-weight: 600 !important; }
+.fluent-nav-link.notactive .fluent-nav-text {
+ font-weight: 600 !important;
+}
-/*.content {
- background-color: var(--neutral-layer-1);
+.content {
display: flex;
-}*/
+ background-color: var(--neutral-layer-1);
+}
article {
+ padding: 1.5rem 1rem;
border-right: 1px solid var(--neutral-stroke-divider-rest);
margin: 0 0;
overflow-x: hidden;
- padding: 1.5rem 1rem;
transition: all 300ms ease-in-out;
width: calc(100% - 18rem);
}
aside {
- height: 100vh;
padding: 1.5rem 1rem;
- position: sticky;
top: 0px;
+ height: 100vh;
+ position: sticky;
width: 18rem;
}
-#navmenu-toggle { display: none; }
+#navmenu-toggle {
+ display: none;
+}
-.navmenu-icon { display: none; }
+.navmenu-icon {
+ display: none;
+}
-#navmenu-toggle:checked > nav { width: 0px; }
+#navmenu-toggle:checked > nav {
+ width: 0px;
+}
-[dir="rtl"] #navmenu-toggle:checked ~ nav { right: 0px; }
+[dir="rtl"] #navmenu-toggle:checked ~ nav {
+ right: 0px;
+}
#color {
- margin-left: 0;
margin-right: 10px;
+ margin-left: 0;
}
[dir="rtl"] #color {
@@ -171,123 +187,140 @@ label {
padding: 7px;
}
-code { background: var(--neutral-stroke-layer-rest); }
+code {
+ background: var(--neutral-stroke-layer-rest);
+}
.demopanel {
border: 1px dashed var(--accent-fill-rest);
padding: 5px;
}
-.highlighted-row { background-color: var(--neutral-fill-secondary-hover); }
+.highlighted-row {
+ background-color: var(--neutral-fill-secondary-hover);
+}
kbd {
+ padding: 0.10rem 0.25rem;
+ font-size: 0.875em;
+ color: var(--neutral-foreground-rest);
background-color: var(--neutral-fill-secondary-rest);
- border: 1px solid var(--accent-fill-rest);
border-radius: 0.25rem;
- color: var(--neutral-foreground-rest);
- font-size: 0.875em;
- padding: 0.10rem 0.25rem;
+ border: 1px solid var(--accent-fill-rest);
}
#blazor-error-ui {
background: lightyellow;
bottom: 0;
box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
- color: var(--neutral-foreground-rest);
display: none;
left: 0;
- margin: 20px 0;
padding: 0.6rem 1.25rem 0.7rem 1.25rem;
position: fixed;
width: 100%;
z-index: 1000;
+ margin: 20px 0;
+ color: var(--neutral-foreground-rest);
}
-#blazor-error-ui .dismiss {
- cursor: pointer;
- position: absolute;
- right: 0.75rem;
- top: 0.5rem;
-}
+ #blazor-error-ui .dismiss {
+ cursor: pointer;
+ position: absolute;
+ right: 0.75rem;
+ top: 0.5rem;
+ }
.blazor-error-boundary {
- background: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0nNDgnIGhlaWdodD0nNDgnIHhtbG5zPSdodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZycgeG1sbnM6eGxpbms9J2h0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsnIG92ZXJmbG93PSdoaWRkZW4nIGZpbGw9JyNCQzJGMzInPjxwYXRoIGQ9J00yNCA0YTIwIDIwIDAgMSAwIDAgNDAgMjAgMjAgMCAwIDAgMC00MFptMCA5Yy42OSAwIDEuMjUuNTYgMS4yNSAxLjI1djEyLjVhMS4yNSAxLjI1IDAgMSAxLTIuNSAwdi0xMi41YzAtLjY5LjU2LTEuMjUgMS4yNS0xLjI1Wm0wIDIxYTIgMiAwIDEgMSAwLTQgMiAyIDAgMCAxIDAgNFonPjwvcGF0aD48L3N2Zz4=") no-repeat 1rem/1.8rem;
border: 1px dashed var(--error);
+ background: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0nNDgnIGhlaWdodD0nNDgnIHhtbG5zPSdodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZycgeG1sbnM6eGxpbms9J2h0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsnIG92ZXJmbG93PSdoaWRkZW4nIGZpbGw9JyNCQzJGMzInPjxwYXRoIGQ9J00yNCA0YTIwIDIwIDAgMSAwIDAgNDAgMjAgMjAgMCAwIDAgMC00MFptMCA5Yy42OSAwIDEuMjUuNTYgMS4yNSAxLjI1djEyLjVhMS4yNSAxLjI1IDAgMSAxLTIuNSAwdi0xMi41YzAtLjY5LjU2LTEuMjUgMS4yNS0xLjI1Wm0wIDIxYTIgMiAwIDEgMSAwLTQgMiAyIDAgMCAxIDAgNFonPjwvcGF0aD48L3N2Zz4=") no-repeat 1rem/1.8rem;
padding: 1rem 1rem 1rem 3.7rem;
}
-.blazor-error-boundary::before { content: "An error has occurred: " }
+ .blazor-error-boundary::before {
+ content: "An error has occurred: "
+ }
.loading-progress {
+ position: relative;
display: block;
+ width: 8rem;
height: 8rem;
margin: 20vh auto 1rem auto;
- position: relative;
- width: 8rem;
}
-.loading-progress circle {
- fill: none;
- stroke: var(--neutral-fill-layer-rest);
- stroke-width: 0.6rem;
- transform: rotate(-90deg);
- transform-origin: 50% 50%;
-}
+ .loading-progress circle {
+ fill: none;
+ stroke: var( --neutral-fill-layer-rest);
+ stroke-width: 0.6rem;
+ transform-origin: 50% 50%;
+ transform: rotate(-90deg);
+ }
-.loading-progress circle:last-child {
- stroke: #1b6ec2;
- stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
- transition: stroke-dasharray 0.05s ease-in-out;
-}
+ .loading-progress circle:last-child {
+ stroke: #1b6ec2;
+ stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
+ transition: stroke-dasharray 0.05s ease-in-out;
+ }
.loading-progress-text {
- font-weight: bold;
- inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
position: absolute;
text-align: center;
+ font-weight: bold;
+ inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}
-.loading-progress-text:after { content: var(--blazor-load-percentage-text, "Loading"); }
+ .loading-progress-text:after {
+ content: var(--blazor-load-percentage-text, "Loading");
+ }
@media (max-width: 767px) {
+
.siteheader {
- align-items: center;
grid-area: header;
grid-template-columns: 150px 1fr;
+ align-items: center;
justify-content: flex-start;
}
- .siteheader .search { display: none; }
+ .siteheader .search {
+ display: none;
+ }
- .siteheader .logo {
- height: 23px;
- width: 160px;
- /*padding: 0 25px;*/
- }
+ .siteheader .logo {
+ width: 160px;
+ height: 23px;
+ /*padding: 0 25px;*/
+ }
- .body-stack { flex-direction: column !important; }
+ .body-stack {
+ flex-direction: column !important;
+ }
nav.sitenav {
- height: calc(100dvh - 50px);
width: 100%;
+ height: calc(100dvh - 50px);
}
- .navmenu { width: 100%; }
+ .navmenu {
+ width: 100%;
+ }
- #navmenu-toggle { appearance: none; }
+ #navmenu-toggle {
+ appearance: none;
+ }
.navmenu-icon {
- border: none;
cursor: pointer;
+ z-index: 10;
display: block;
- height: 20px;
- left: unset;
position: absolute;
- right: 20px;
top: 15px;
+ left: unset;
+ right: 20px;
width: 20px;
- z-index: 10;
+ height: 20px;
+ border: none;
}
[dir="rtl"] .navmenu-icon {
@@ -295,15 +328,25 @@ kbd {
right: unset
}
- #navmenu-toggle ~ nav { display: none; }
+ #navmenu-toggle ~ nav {
+ display: none;
+ }
- #navmenu-toggle:checked ~ nav { display: block; }
+ #navmenu-toggle:checked ~ nav {
+ display: block;
+ }
- #navmenu-toggle ~ article { display: block; }
+ #navmenu-toggle ~ article {
+ display: block;
+ }
- #navmenu-toggle:checked ~ article { display: none; }
+ #navmenu-toggle:checked ~ article {
+ display: none;
+ }
- .content { flex-direction: column; }
+ .content {
+ flex-direction: column;
+ }
article {
padding-top: 0px;
@@ -320,27 +363,34 @@ kbd {
grid-template-columns: 10px auto 10px;
}
- .footer .version {
- grid-column: 2;
- justify-self: start;
- }
+ .footer .version {
+ grid-column: 2;
+ justify-self: start;
+ }
- .footer .copy {
- grid-column: 2;
- grid-row: 2;
- justify-self: end;
- }
+ .footer .copy {
+ grid-column: 2;
+ grid-row: 2;
+ justify-self: end;
+ }
@media screen and (max-width: 767px) and (orientation: landscape) {
- nav { padding: 25px 40px; }
- nav ul { margin: 0 0; }
+ nav {
+ padding: 25px 40px;
+ }
+
+ nav ul {
+ margin: 0 0;
+ }
}
}
@media (min-width: 768px) and (max-width: 1024px) {
- fluent-select::part(control) { width: 150px; }
+ fluent-select::part(control) {
+ width: 150px;
+ }
aside {
padding: 1.5em 0.75em 1em 0.75em;
@@ -355,30 +405,30 @@ kbd {
/* Surface Duo specific styling */
-
@media (horizontal-viewport-segments: 2) {
+
.siteheader {
- align-items: center;
- background-color: var(--neutral-layer-4);
- display: grid;
grid-area: header;
+ display: grid;
grid-template-columns: 150px calc(env(viewport-segment-width 0 0) - 160px) 1fr;
grid-template-rows: 1fr;
+ align-items: center;
justify-content: flex-start;
padding: 12px 0;
+ background-color: var(--neutral-layer-4);
}
- .siteheader a {
- color: var(--neutral-foreground-rest);
- padding: 0px 15px;
- }
+ .siteheader a {
+ padding: 0px 15px;
+ color: var(--neutral-foreground-rest);
+ }
- .siteheader .logo {
- grid-column: 1;
- height: 23px;
- width: 108px;
- /*padding: 0 30px;*/
- }
+ .siteheader .logo {
+ grid-column: 1;
+ width: 108px;
+ height: 23px;
+ /*padding: 0 30px;*/
+ }
main {
display: grid;
@@ -397,18 +447,18 @@ kbd {
}
aside {
- grid-area: 2/2/3/3;
- margin-inline-end: calc(100% - env(viewport-segment-left 1 0));
- margin-inline-start: calc(env(viewport-segment-left 1 0) - env(viewport-segment-right 0 0)); /* hinge width */
+ grid-area: 2 / 2 / 3 / 3;
padding: 1.5em 0.75em 1em 0.75em;
+ margin-inline-start: calc(env(viewport-segment-left 1 0) - env(viewport-segment-right 0 0)); /* hinge width */
+ margin-inline-end: calc(100% - env(viewport-segment-left 1 0));
width: auto;
}
article {
- grid-area: 1/2/2/3;
- margin-inline-end: calc(100% - env(viewport-segment-left 1 0));
- margin-inline-start: calc(env(viewport-segment-left 1 0) - env(viewport-segment-right 0 0)); /* hinge width */
+ grid-area: 1 / 2 / 2 / 3;
padding-top: 0px;
+ margin-inline-start: calc(env(viewport-segment-left 1 0) - env(viewport-segment-right 0 0)); /* hinge width */
+ margin-inline-end: calc(100% - env(viewport-segment-left 1 0));
width: auto;
}
}
@@ -416,10 +466,14 @@ kbd {
@media (min-width: 800px) {
- .fluent-dialog-main { --dialog-width: 340px; }
+ .fluent-dialog-main {
+ --dialog-width: 340px;
+ }
}
@media (max-width: 480px) {
- .fluent-dialog-main { --dialog-width: 100vw; }
+ .fluent-dialog-main {
+ --dialog-width: 100vw;
+ }
}
diff --git a/src/Web/WebAdmin/WebAdmin/wwwroot/js/CacheStorageAccessor.js b/src/Web/WebAdmin.Shared/wwwroot/js/CacheStorageAccessor.js
similarity index 100%
rename from src/Web/WebAdmin/WebAdmin/wwwroot/js/CacheStorageAccessor.js
rename to src/Web/WebAdmin.Shared/wwwroot/js/CacheStorageAccessor.js
diff --git a/src/Web/WebAdmin/Components/App.razor b/src/Web/WebAdmin/Components/App.razor
new file mode 100644
index 0000000..c825426
--- /dev/null
+++ b/src/Web/WebAdmin/Components/App.razor
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Web/WebAdmin/WebAdmin/Components/Layout/MainLayout.razor b/src/Web/WebAdmin/Components/Layout/MainLayout.razor
similarity index 43%
rename from src/Web/WebAdmin/WebAdmin/Components/Layout/MainLayout.razor
rename to src/Web/WebAdmin/Components/Layout/MainLayout.razor
index 8f91d3d..653dbdd 100644
--- a/src/Web/WebAdmin/WebAdmin/Components/Layout/MainLayout.razor
+++ b/src/Web/WebAdmin/Components/Layout/MainLayout.razor
@@ -1,18 +1,8 @@
@inherits LayoutComponentBase
-
-
-
-
-
-
-
- github
+ Documentation and demos
- Copyright Ⓒ 2024 DaprTool-Solution
+ About Blazor
@@ -39,4 +23,4 @@
An unhandled error has occurred.
Reload
🗙
-
\ No newline at end of file
+
diff --git a/src/Web/WebAdmin/WebAdmin/Components/Pages/Error.razor b/src/Web/WebAdmin/Components/Pages/Error.razor
similarity index 100%
rename from src/Web/WebAdmin/WebAdmin/Components/Pages/Error.razor
rename to src/Web/WebAdmin/Components/Pages/Error.razor
diff --git a/src/Web/WebAdmin/Components/Pages/Home.razor b/src/Web/WebAdmin/Components/Pages/Home.razor
new file mode 100644
index 0000000..50caea5
--- /dev/null
+++ b/src/Web/WebAdmin/Components/Pages/Home.razor
@@ -0,0 +1,123 @@
+@page "/"
+@inject IStringLocalizer
L
+@inject AdminConfiguration AdminConfiguration
+@inject IToastService ToastService
+@inject NavigationManager NavigationManager
+
+@L["PageTitle"] - @AdminConfiguration.PageTitle
+
+Hello, world!
+
+Welcome to new Blazor Web App Admin
+
+
+
+ MessageBar
+
+
+ 当你听到一些人对于精致的概念模型侃侃而谈,请保持清醒。
+
+
+
+ 物换星移 泥牛入海 黑暗好像 一颗巨石 按在胸口 独脚大盗
+ 百万富翁 摸爬滚打 黑暗好像 一颗巨石 按在胸口
+
+
+
+ 可以照亮最黑暗的夜,也可以燃尽一切过往。
+ 在时间的长河里,我们都是匆匆的过客,留下的只有脚印和故事。
+ 一颗心被封存太久,就会生锈,忘记了如何跳动。
+ 命运之轮不停转动,我们不过是其中的一粒尘埃,飘忽不定。
+
+
+
+ 不会苦一辈子,但总有苦的一段时间。
+ 当我们站得太高时,忘记了脚下的路有多远。
+ 每个人的心里都有一座孤岛,时常有潮水上涨,也有退潮时刻。
+
+
+
+ 都有下坡的一天。
+ 当我们把昨天抛在身后,明天的路也会变得更加宽广。
+ 有些事,可以预见未来,但无法阻止发生。
+
+
+
+ 不是一个终点,它在于持续的努力而非偶然的机遇。
+
+
+
+ Toast
+
+
+ ToastService.ShowSuccess("成功确认。"))">
+
+ 显示成功
+
+ ToastService.ShowWarning("警告确认。"))">
+
+ 显示警告
+
+ ToastService.ShowError("错误确认。"))">
+
+ 显示错误
+
+ ToastService.ShowInfo("信息确认。"))">
+
+ 显示信息
+
+ ToastService.ShowProgress("进度确认。"))">
+
+ 显示进度
+
+ ToastService.ShowUpload("上传确认。"))">
+
+ 显示上传
+
+ ToastService.ShowDownload("下载确认。"))">
+
+ 显示下载
+
+ ToastService.ShowEvent("活动确认。"))">
+
+ 展示活动
+
+ ToastService.ShowMention("提及确认。"))">
+
+ 显示提及
+
+ ToastService.ShowCustom("自定义确认。", null, null, null, (new Icons.Regular.Size24.Delete(), Color.Accent)))">
+
+ 显示自定义
+
+
+
+ ToastService.ShowCustom("无图标确认。"))">
+ 无图标
+
+
+ ToastService.ShowSuccess("用 Action 确认成功。", null, "Action", EventCallback.Factory.Create(this, HandleTopAction)))">
+ 有 Action
+
+
+ ToastService.ShowInfo("信息确认自定义设置。"))">
+ 自定义超时
+
+
+ ToastService.ShowSuccess("用大量文字进行成功确认,看看 Toast 写得很大时是什么样子。"))">
+
+ 长时间 成功
+
+
+
+
+
+
+@code {
+
+ private void HandleTopAction(ToastResult result)
+ {
+ Console.WriteLine("Toast clicked");
+ }
+
+}
\ No newline at end of file
diff --git a/src/Web/WebAdmin/Components/Pages/Weather.razor b/src/Web/WebAdmin/Components/Pages/Weather.razor
new file mode 100644
index 0000000..d1e493b
--- /dev/null
+++ b/src/Web/WebAdmin/Components/Pages/Weather.razor
@@ -0,0 +1,65 @@
+@page "/weather"
+@inject IStringLocalizer L
+@inject AdminConfiguration AdminConfiguration
+@attribute [StreamRendering]
+
+@L["PageTitle"] - @AdminConfiguration.PageTitle
+
+Weather
+
+该组件用于显示数据。
+
+
+ DataGrid
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+@code {
+ private IQueryable? forecasts;
+
+ protected override async Task OnInitializedAsync()
+ {
+ await OnQueryAsync();
+
+ StateHasChanged();
+ }
+ public async Task OnRefreshAsync()
+ {
+ await OnQueryAsync();
+
+ return true;
+ }
+ private async Task OnQueryAsync()
+ {
+ await Task.Delay(Random.Shared.Next(400, 800));
+
+ var startDate = DateOnly.FromDateTime(DateTime.Now);
+ var summaries = new[] { "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" };
+ forecasts = Enumerable.Range(1, 5).Select(index => new WeatherForecast
+ {
+ Date = startDate.AddDays(index),
+ TemperatureC = Random.Shared.Next(-20, 55),
+ Summary = summaries[Random.Shared.Next(summaries.Length)]
+ }).AsQueryable();
+ }
+
+ private class WeatherForecast
+ {
+ public DateOnly Date { get; set; }
+ public int TemperatureC { get; set; }
+ public string? Summary { get; set; }
+ public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
+ }
+}
diff --git a/src/Web/WebAdmin/WebAdmin/Components/Routes.razor b/src/Web/WebAdmin/Components/Routes.razor
similarity index 31%
rename from src/Web/WebAdmin/WebAdmin/Components/Routes.razor
rename to src/Web/WebAdmin/Components/Routes.razor
index d39c7e8..c006189 100644
--- a/src/Web/WebAdmin/WebAdmin/Components/Routes.razor
+++ b/src/Web/WebAdmin/Components/Routes.razor
@@ -1,6 +1,8 @@
-
+
+
+
-
+
diff --git a/src/Web/WebAdmin/WebAdmin/Components/_Imports.razor b/src/Web/WebAdmin/Components/_Imports.razor
similarity index 64%
rename from src/Web/WebAdmin/WebAdmin/Components/_Imports.razor
rename to src/Web/WebAdmin/Components/_Imports.razor
index 84ad10d..4e38619 100644
--- a/src/Web/WebAdmin/WebAdmin/Components/_Imports.razor
+++ b/src/Web/WebAdmin/Components/_Imports.razor
@@ -3,17 +3,13 @@
@using Microsoft.AspNetCore.Components.Forms
@using Microsoft.AspNetCore.Components.Routing
@using Microsoft.AspNetCore.Components.Web
+@using Microsoft.Extensions.Localization
@using static Microsoft.AspNetCore.Components.Web.RenderMode
@using Microsoft.AspNetCore.Components.Web.Virtualization
-@using Microsoft.JSInterop
@using Microsoft.FluentUI.AspNetCore.Components
+@using Microsoft.JSInterop
@using WebAdmin
@using WebAdmin.Client
+@using WebAdmin.Client.Layout
@using WebAdmin.Components
-@using WebAdmin.Configurations
-@using Ordering.Infrastructure.Repository
-@using Ordering.Infrastructure.Repository.Entities
-@using System.Globalization
-@using Microsoft.AspNetCore.Localization
-@using WebAdmin.Components.Shared
-@using System.Threading
+@using WebAdmin.Shared.Configurations
diff --git a/src/Web/WebAdmin/WebAdmin/Controllers/CultureController.cs b/src/Web/WebAdmin/Controllers/CultureController.cs
similarity index 60%
rename from src/Web/WebAdmin/WebAdmin/Controllers/CultureController.cs
rename to src/Web/WebAdmin/Controllers/CultureController.cs
index a59a176..06644bd 100644
--- a/src/Web/WebAdmin/WebAdmin/Controllers/CultureController.cs
+++ b/src/Web/WebAdmin/Controllers/CultureController.cs
@@ -1,17 +1,18 @@
using Microsoft.AspNetCore.Localization;
using Microsoft.AspNetCore.Mvc;
-namespace WebAdmin.Controllers;
-
-[Route("Culture/[action]")]
+[Route("[controller]/[action]")]
public class CultureController : Controller
{
public IActionResult SetCulture(string culture, string redirectUri)
{
if (culture != null)
- Response.Cookies.Append(
+ {
+ HttpContext.Response.Cookies.Append(
CookieRequestCultureProvider.DefaultCookieName,
- CookieRequestCultureProvider.MakeCookieValue(new RequestCulture(culture)));
+ CookieRequestCultureProvider.MakeCookieValue(
+ new RequestCulture(culture, culture)));
+ }
return LocalRedirect(redirectUri);
}
diff --git a/src/Web/WebAdmin/WebAdmin/Program.cs b/src/Web/WebAdmin/Program.cs
similarity index 62%
rename from src/Web/WebAdmin/WebAdmin/Program.cs
rename to src/Web/WebAdmin/Program.cs
index c009174..7f7b80f 100644
--- a/src/Web/WebAdmin/WebAdmin/Program.cs
+++ b/src/Web/WebAdmin/Program.cs
@@ -1,41 +1,30 @@
-using Microsoft.AspNetCore.Hosting.StaticWebAssets;
+using System.Globalization;
using Microsoft.FluentUI.AspNetCore.Components;
using WebAdmin.Components;
-using WebAdmin.Components.Shared;
-using WebAdmin.Configurations;
-using WebAdmin.Infrastructure;
-using _Imports = WebAdmin.Client._Imports;
+using WebAdmin.Shared.Configurations;
+using WebAdmin.Shared.Infrastructure;
var builder = WebApplication.CreateBuilder(args);
-StaticWebAssetsLoader.UseStaticWebAssets(builder.Environment, builder.Configuration);
-
-// Add services to the container.
-
var adminUiOptions = new AdminUiOptions();
-adminUiOptions.BindConfiguration(builder.Configuration);
+adminUiOptions.BindConfiguration(builder.Configuration);
builder.Services.AddSingleton(adminUiOptions);
builder.Services.AddSingleton(adminUiOptions.Admin);
builder.Services.AddSingleton(adminUiOptions.Culture);
builder.Services.AddSingleton(adminUiOptions.Http);
-
-builder.Services.AddScoped();
-builder.Services.AddSingleton();
-builder.Services.AddSingleton();
-
+// Add services to the container.
builder.Services.AddRazorComponents()
.AddInteractiveServerComponents()
.AddInteractiveWebAssemblyComponents();
-builder.Services.AddControllers();
-builder.Services.AddFluentUIComponents();
-builder.Services.AddOrderAppDataConnection(builder.Configuration);
-builder.Services.AddLocalization(opt => opt.ResourcesPath = ConfigurationConsts.ResourcesPath);
+builder.Services.AddLocalization(opts => opts.ResourcesPath = ConfigurationConsts.ResourcesPath);
+builder.Services.AddAdminUiServerServices();
+builder.Services.AddFluentUIComponents();
+builder.Services.AddControllers();
var app = builder.Build();
-
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
@@ -43,7 +32,7 @@ if (app.Environment.IsDevelopment())
}
else
{
- app.UseExceptionHandler("/Error", true);
+ app.UseExceptionHandler("/Error", createScopeForErrors: true);
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
@@ -53,32 +42,26 @@ app.MapControllers();
app.UseRequestLocalization(options =>
{
var cultureConfiguration = adminUiOptions.Culture;
-
var supportedCultureCodes =
(cultureConfiguration?.Cultures?.Count > 0
? cultureConfiguration.Cultures.Intersect(CultureConfiguration.AvailableCultures)
: CultureConfiguration.AvailableCultures).ToArray();
-
- if (supportedCultureCodes.Length == 0) supportedCultureCodes = CultureConfiguration.AvailableCultures;
-
- var defaultCultureCode = string.IsNullOrEmpty(cultureConfiguration!.DefaultCulture)
+ if (!supportedCultureCodes.Any())
+ supportedCultureCodes = CultureConfiguration.AvailableCultures;
+ var defaultCultureCode = string.IsNullOrEmpty(cultureConfiguration?.DefaultCulture)
? CultureConfiguration.DefaultRequestCulture
- : cultureConfiguration.DefaultCulture;
-
+ : cultureConfiguration?.DefaultCulture;
if (!supportedCultureCodes.Contains(defaultCultureCode))
defaultCultureCode = supportedCultureCodes.FirstOrDefault();
- options
- .SetDefaultCulture(defaultCultureCode!)
- .AddSupportedCultures(supportedCultureCodes)
- .AddSupportedUICultures(supportedCultureCodes);
+ options.AddSupportedCultures(supportedCultureCodes)
+ .AddSupportedUICultures(supportedCultureCodes)
+ .SetDefaultCulture(defaultCultureCode!);
});
app.UseStaticFiles();
app.UseAntiforgery();
-
app.MapRazorComponents()
.AddInteractiveServerRenderMode()
.AddInteractiveWebAssemblyRenderMode()
- .AddAdditionalAssemblies(typeof(_Imports).Assembly);
-
-app.Run();
\ No newline at end of file
+ .AddAdditionalAssemblies(typeof(WebAdmin.Client._Imports).Assembly);
+app.Run();
diff --git a/src/Web/WebAdmin/WebAdmin/Properties/launchSettings.json b/src/Web/WebAdmin/Properties/launchSettings.json
similarity index 48%
rename from src/Web/WebAdmin/WebAdmin/Properties/launchSettings.json
rename to src/Web/WebAdmin/Properties/launchSettings.json
index ae96d44..8e35d65 100644
--- a/src/Web/WebAdmin/WebAdmin/Properties/launchSettings.json
+++ b/src/Web/WebAdmin/Properties/launchSettings.json
@@ -1,22 +1,12 @@
{
"$schema": "http://json.schemastore.org/launchsettings.json",
"profiles": {
- "http": {
- "commandName": "Project",
- "dotnetRunMessages": true,
- "launchBrowser": true,
- "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
- "applicationUrl": "http://localhost:5103",
- "environmentVariables": {
- "ASPNETCORE_ENVIRONMENT": "Development"
- }
- },
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
- "applicationUrl": "https://localhost:7039;http://localhost:5103",
+ "applicationUrl": "https://localhost:7273;http://localhost:5172",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
diff --git a/src/Web/WebAdmin/WebAdmin/Resources/Components/Pages/CustomerList.en.resx b/src/Web/WebAdmin/Resources/Components/Pages/CustomerList.en.resx
similarity index 100%
rename from src/Web/WebAdmin/WebAdmin/Resources/Components/Pages/CustomerList.en.resx
rename to src/Web/WebAdmin/Resources/Components/Pages/CustomerList.en.resx
diff --git a/src/Web/WebAdmin/WebAdmin/Resources/Components/Pages/CustomerList.zh-Hans.resx b/src/Web/WebAdmin/Resources/Components/Pages/CustomerList.zh-Hans.resx
similarity index 100%
rename from src/Web/WebAdmin/WebAdmin/Resources/Components/Pages/CustomerList.zh-Hans.resx
rename to src/Web/WebAdmin/Resources/Components/Pages/CustomerList.zh-Hans.resx
diff --git a/src/Web/WebAdmin/WebAdmin/Resources/Components/Pages/Home.en.resx b/src/Web/WebAdmin/Resources/Components/Pages/Home.en.resx
similarity index 100%
rename from src/Web/WebAdmin/WebAdmin/Resources/Components/Pages/Home.en.resx
rename to src/Web/WebAdmin/Resources/Components/Pages/Home.en.resx
diff --git a/src/Web/WebAdmin/WebAdmin/Resources/Components/Pages/Home.zh-Hans.resx b/src/Web/WebAdmin/Resources/Components/Pages/Home.zh-Hans.resx
similarity index 100%
rename from src/Web/WebAdmin/WebAdmin/Resources/Components/Pages/Home.zh-Hans.resx
rename to src/Web/WebAdmin/Resources/Components/Pages/Home.zh-Hans.resx
diff --git a/src/Web/WebAdmin/Resources/Components/Pages/Weather.en.resx b/src/Web/WebAdmin/Resources/Components/Pages/Weather.en.resx
new file mode 100644
index 0000000..ce9675e
--- /dev/null
+++ b/src/Web/WebAdmin/Resources/Components/Pages/Weather.en.resx
@@ -0,0 +1,123 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ Weather
+
+
\ No newline at end of file
diff --git a/src/Web/WebAdmin/Resources/Components/Pages/Weather.zh-Hans.resx b/src/Web/WebAdmin/Resources/Components/Pages/Weather.zh-Hans.resx
new file mode 100644
index 0000000..f3223f7
--- /dev/null
+++ b/src/Web/WebAdmin/Resources/Components/Pages/Weather.zh-Hans.resx
@@ -0,0 +1,123 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ 天气
+
+
\ No newline at end of file
diff --git a/src/Web/WebAdmin/WebAdmin.Client/Program.cs b/src/Web/WebAdmin/WebAdmin.Client/Program.cs
deleted file mode 100644
index 9cd5f49..0000000
--- a/src/Web/WebAdmin/WebAdmin.Client/Program.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using System.Globalization;
-using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
-using Microsoft.FluentUI.AspNetCore.Components;
-using Microsoft.JSInterop;
-
-var builder = WebAssemblyHostBuilder.CreateDefault(args);
-
-builder.Services.AddFluentUIComponents();
-builder.Services.AddLocalization(opt => opt.ResourcesPath = "Resources");
-
-var host = builder.Build();
-
-const string defaultCulture = "en";
-var js = host.Services.GetRequiredService();
-var result = await js.InvokeAsync("blazorCulture.get");
-var culture = CultureInfo.GetCultureInfo(result ?? defaultCulture);
-
-if (result == null) await js.InvokeVoidAsync("blazorCulture.set", defaultCulture);
-
-CultureInfo.DefaultThreadCurrentCulture = culture;
-CultureInfo.DefaultThreadCurrentUICulture = culture;
-
-
-await host.RunAsync();
\ No newline at end of file
diff --git a/src/Web/WebAdmin/WebAdmin.Client/wwwroot/appsettings.Development.json b/src/Web/WebAdmin/WebAdmin.Client/wwwroot/appsettings.Development.json
deleted file mode 100644
index 2f85d82..0000000
--- a/src/Web/WebAdmin/WebAdmin.Client/wwwroot/appsettings.Development.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "Logging": {
- "LogLevel": {
- "Default": "Information",
- "Microsoft.AspNetCore": "Warning"
- }
- },
- "ConnectionStrings": {
- "Catalog": "Server=192.168.8.112;Port=5432;Database=dapr_catalog;User Id=dapr;Password=Local@Db;Pooling=true;MaxPoolSize=100;",
- "Identity": "Server=192.168.8.112;Port=5432;Database=dapr_identity;User Id=dapr;Password=Local@Db;Pooling=true;MaxPoolSize=100;",
- "Ordering": "Server=192.168.8.112;Port=5432;Database=dapr_ordering;User Id=dapr;Password=Local@Db;Pooling=true;MaxPoolSize=100;"
- }
-}
diff --git a/src/Web/WebAdmin/WebAdmin.csproj b/src/Web/WebAdmin/WebAdmin.csproj
new file mode 100644
index 0000000..3c46fc8
--- /dev/null
+++ b/src/Web/WebAdmin/WebAdmin.csproj
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Designer
+
+
+
diff --git a/src/Web/WebAdmin/WebAdmin.xml b/src/Web/WebAdmin/WebAdmin.xml
new file mode 100644
index 0000000..5be91c2
--- /dev/null
+++ b/src/Web/WebAdmin/WebAdmin.xml
@@ -0,0 +1,8 @@
+
+
+
+ WebAdmin
+
+
+
+
diff --git a/src/Web/WebAdmin/WebAdmin/Components/App.razor b/src/Web/WebAdmin/WebAdmin/Components/App.razor
deleted file mode 100644
index c89570b..0000000
--- a/src/Web/WebAdmin/WebAdmin/Components/App.razor
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/Web/WebAdmin/WebAdmin/Components/Layout/MainLayout.razor.css b/src/Web/WebAdmin/WebAdmin/Components/Layout/MainLayout.razor.css
deleted file mode 100644
index 669ad4d..0000000
--- a/src/Web/WebAdmin/WebAdmin/Components/Layout/MainLayout.razor.css
+++ /dev/null
@@ -1,31 +0,0 @@
-.siteheader {
- background-color: var(--neutral-layer-4) !important;
- border-bottom: calc(var(--stroke-width) * 2px) solid var(--accent-fill-rest);
- margin-bottom: 0 !important;
-}
-
-.siteheader .logo {
- width: 108px;
- height: 23px;
- grid-column: 1;
-}
-
-.siteheader .search {
- display: flex;
- align-items: center;
- padding-right: 20px;
-}
-
-
-.siteheader .notifications {
- display: flex;
- align-items: center;
-}
-
-.siteheader .settings {
- padding-right: 6px;
- display: flex;
- align-items: center;
- margin-left: 0;
- margin-right: 10px;
-}
diff --git a/src/Web/WebAdmin/WebAdmin/Components/Pages/CustomerLevels.razor b/src/Web/WebAdmin/WebAdmin/Components/Pages/CustomerLevels.razor
deleted file mode 100644
index 72f7d44..0000000
--- a/src/Web/WebAdmin/WebAdmin/Components/Pages/CustomerLevels.razor
+++ /dev/null
@@ -1,3 +0,0 @@
-@page "/customer-level"
-
-CustomerLevelMgr
diff --git a/src/Web/WebAdmin/WebAdmin/Components/Pages/CustomerList.razor b/src/Web/WebAdmin/WebAdmin/Components/Pages/CustomerList.razor
deleted file mode 100644
index 77e02d5..0000000
--- a/src/Web/WebAdmin/WebAdmin/Components/Pages/CustomerList.razor
+++ /dev/null
@@ -1,52 +0,0 @@
-@page "/customer/list"
-@using Microsoft.Extensions.Localization
-@attribute [StreamRendering]
-@inject AdminConfiguration AdminConfiguration
-@inject IStringLocalizer L
-
-@L["PageTitle"] - @AdminConfiguration.PageTitle
-
-会员
-
-This component demonstrates showing data.
-
-
-@if (_customers == null)
-{
- Loading...
-}
-else
-{
-
-
-
-
-
-
-}
-
-@code {
- private IQueryable? _customers;
-
- protected override async Task OnInitializedAsync()
- {
- // Simulate asynchronous loading to demonstrate streaming rendering
- await Task.Delay(500);
-
- var startDate = DateOnly.FromDateTime(DateTime.Now);
- var summaries = new[] { "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" };
- _customers = Enumerable.Range(1, 5).Select(index => new CustomerTable
- {
- BirthDate = startDate.AddDays(index),
- Age = Random.Shared.Next(-20, 55),
- Name = summaries[Random.Shared.Next(summaries.Length)]
- }).AsQueryable();
- }
-
- private class CustomerTable
- {
- public int Age { get; init; }
- public string? Name { get; init; }
- public DateOnly BirthDate { get; init; }
- }
-}
diff --git a/src/Web/WebAdmin/WebAdmin/Components/Pages/Home.razor b/src/Web/WebAdmin/WebAdmin/Components/Pages/Home.razor
deleted file mode 100644
index cacb649..0000000
--- a/src/Web/WebAdmin/WebAdmin/Components/Pages/Home.razor
+++ /dev/null
@@ -1,45 +0,0 @@
-@page "/"
-@using System.Globalization
-@using Microsoft.Extensions.Localization
-@inject AdminConfiguration AdminConfiguration
-@inject IStringLocalizer L
-
-@L["PageTitle"] - @AdminConfiguration?.PageTitle
-
-
-
- Hello, world!
-
- @L["PageTitle"]
-
-
- 当前语言: @CultureInfo.CurrentCulture.DisplayName | @CultureInfo.CurrentCulture.Name
-
-
-
- The following <input>
elements use
- CultureInfo.InvariantCulture
.
-
-
-
- Welcome to your new app.
-
- TestKey: @L["TestKey"]
-
-
-
-
-
-
-
- @(new Emojis.Objects.Color.Default.Accordion().ToMarkup("280px"))
- @(new Emojis.TravelPlaces.Color.Default.Ambulance().ToMarkup("500px"))
-
-
- Icon:
- Emoji:
- Button: Click Me
-
-
-
-
\ No newline at end of file
diff --git a/src/Web/WebAdmin/WebAdmin/Components/Pages/PurchaseOrder.razor b/src/Web/WebAdmin/WebAdmin/Components/Pages/PurchaseOrder.razor
deleted file mode 100644
index 47fd86e..0000000
--- a/src/Web/WebAdmin/WebAdmin/Components/Pages/PurchaseOrder.razor
+++ /dev/null
@@ -1,81 +0,0 @@
-@page "/order"
-@attribute [StreamRendering]
-@rendermode InteractiveServer
-@inject AppDataConnection DataConnection
-
-暂无数据"))"
- Items="@FilteredItems"
- ResizableColumns="true"
- Pagination="@_pagination"
- GridTemplateColumns="0.4fr 0.2fr 0.2fr 0.2fr 0.2fr 0.2fr 0.2fr 0.2fr"
- RowClass="@_rowClass"
- RowStyle="@_rowStyle"
- Style="height: 405px; overflow: auto;">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-@code {
- bool _clearItems;
- IQueryable? _items;
- readonly PaginationState _pagination = new() { ItemsPerPage = 10 };
- string _orderNoFilter = string.Empty;
- readonly Func _rowClass = x => x.OrderNo.EndsWith("00000000") ? "highlighted-row" : null;
- readonly Func _rowStyle = x => x.OrderNo.StartsWith("Au") ? "background-color: var(--highlight-bg);" : null;
-
- IQueryable? FilteredItems => _items?.Where(x => x.OrderNo.Contains(_orderNoFilter, StringComparison.CurrentCultureIgnoreCase));
-
- protected override async Task OnInitializedAsync()
- {
- _items = DataConnection.PurchaseOrder.Where(x => x.DeletedTime == 0);
-
- await Task.CompletedTask;
- }
-
- private void HandleOrderFilter(ChangeEventArgs args)
- {
- if (args.Value is string value)
- {
- _orderNoFilter = value;
- }
- }
-
- private void HandleClear()
- {
- if (string.IsNullOrWhiteSpace(_orderNoFilter))
- {
- _orderNoFilter = string.Empty;
- }
- }
-
- private async Task ToggleItemsAsync()
- {
- _items = _clearItems ? null : DataConnection.PurchaseOrder.Where(x => x.DeletedTime == 0);
-
- await Task.CompletedTask;
- }
-
-}
\ No newline at end of file
diff --git a/src/Web/WebAdmin/WebAdmin/WebAdmin.xml b/src/Web/WebAdmin/WebAdmin/WebAdmin.xml
deleted file mode 100644
index 8536ce5..0000000
--- a/src/Web/WebAdmin/WebAdmin/WebAdmin.xml
+++ /dev/null
@@ -1,110 +0,0 @@
-
-
-
- WebAdmin
-
-
-
-
- 管理后台配置
-
-
-
- 管理后台的基础配置
-
-
- 全球化配置
-
-
- HTTP 托管环境配置
-
-
-
- 将从 appsettings 文件解析的配置应用到这些选项中。
-
- 绑定到此实例的配置
-
-
-
- 管理后台的基础配置
-
-
-
- Page Name
-
-
- Favicon Uri
-
-
- Web Admin Redirect Uri
-
-
- Scopes
-
-
- Administration Role Name
-
-
- Require HttpsMetadata
-
-
- Web Admin CookieName
-
-
- Web Admin Cookie Expires UtcHours
-
-
- Token Validation ClaimName
-
-
- Token Validation ClaimRole
-
-
- IdentityServer BaseUrl
-
-
- ClientId
-
-
- ClientSecret
-
-
- Oidc ResponseType
-
-
-
- 全球化配置
-
-
-
- 可用的多语言文化
-
-
- 默认的文化
-
-
- 可用的多语言文化列表
-
-
- 默认的文化
-
-
-
- Http 配置
-
-
-
- BasePath
-
-
-
- AppVersion Service
-
-
-
-
- AppVersion Service
-
-
-
-
diff --git a/src/Web/WebAdmin/WebAdmin/wwwroot/favicon.png b/src/Web/WebAdmin/WebAdmin/wwwroot/favicon.png
deleted file mode 100644
index 8422b59695935d180d11d5dbe99653e711097819..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 1148
zcmV-?1cUpDP)9h26h2-Cs%i*@Moc3?#6qJID|D#|3|2Hn7gTIYEkr|%Xjp);YgvFmB&0#2E2b=|
zkVr)lMv9=KqwN&%obTp-$<51T%rx*NCwceh-E+=&e(oLO`@Z~7gybJ#U|^tB2Pai}
zRN@5%1qsZ1e@R(XC8n~)nU1S0QdzEYlWPdUpH{wJ2Pd4V8kI3BM=)sG^IkUXF2-j{
zrPTYA6sxpQ`Q1c6mtar~gG~#;lt=s^6_OccmRd>o{*=>)KS=lM
zZ!)iG|8G0-9s3VLm`bsa6e
ze*TlRxAjXtm^F8V`M1%s5d@tYS>&+_ga#xKGb|!oUBx3uc@mj1%=MaH4GR0tPBG_&
z9OZE;->dO@`Q)nr<%dHAsEZRKl
zedN6+3+uGHejJp;Q==pskSAcRcyh@6mjm2z-uG;s%dM-u0*u##7OxI7wwyCGpS?4U
zBFAr(%GBv5j$jS@@t@iI8?ZqE36I^4t+P^J9D^ELbS5KMtZ
z{Qn#JnSd$15nJ$ggkF%I4yUQC+BjDF^}AtB7w348EL>7#sAsLWs}ndp8^DsAcOIL9
zTOO!!0!k2`9BLk25)NeZp7ev>I1Mn={cWI3Yhx2Q#DnAo4IphoV~R^c0x&nw*MoIV
zPthX?{6{u}sMS(MxD*dmd5rU(YazQE59b|TsB5Tm)I4a!VaN@HYOR)DwH1U5y(E)z
zQqQU*B%MwtRQ$%x&;1p%ANmc|PkoFJZ%<-uq%PX&C!c-7ypis=eP+FCeuv+B@h#{4
zGx1m0PjS~FJt}3mdt4c!lel`1;4W|03kcZRG+DzkTy|7-F~eDsV2Tx!73dM0H0CTh
zl)F-YUkE1zEzEW(;JXc|KR5{ox%YTh{$%F$a36JP6Nb<0%#NbSh$dMYF-{
z1_x(Vx)}fs?5_|!5xBTWiiIQHG<%)*e=45Fhjw_tlnmlixq;mUdC$R8v#j(
zhQ$9YR-o%i5Uc`S?6EC51!bTRK=Xkyb<18FkCKnS2;o*qlij1YA@-nRpq#OMTX&RbL<^2q@0qja!uIvI;j$6>~k@IMwD42=8$$!+R^@5o6HX(*n~ div:first-child:is(.expander) {
+ display: none;
+ }
+
+ .navmenu {
+ width: 100%;
+ }
+
+ #navmenu-toggle {
+ appearance: none;
+ }
+
+ #navmenu-toggle ~ nav {
+ display: none;
+ }
+
+ #navmenu-toggle:checked ~ nav {
+ display: block;
+ }
+
+ .navmenu-icon {
+ cursor: pointer;
+ z-index: 10;
+ display: block;
+ position: absolute;
+ top: 15px;
+ right: 20px;
+ width: 20px;
+ height: 20px;
+ border: none;
+ }
+}
diff --git a/src/Web/WebAdmin/wwwroot/favicon.ico b/src/Web/WebAdmin/wwwroot/favicon.ico
new file mode 100644
index 0000000000000000000000000000000000000000..e189d8e579e552ab2b3c82a949bccbc5ea00f3ed
GIT binary patch
literal 15086
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
literal 0
HcmV?d00001
--
Gitee