Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev/refactor v2.0.0 #2

Merged
merged 5 commits into from
Feb 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions Runtime/App.razor
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
@using Quantum.Infrastructure.Models
@using Quantum.Runtime.Services
@inject InjectedCodeManager CodeManager

<!DOCTYPE html>
<html lang="en">

<head>
<title>Quantum</title>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<base href="/"/>
<link rel="stylesheet" href="@Assets["Quantum.Shell.styles.css"]" />
<ImportMap />
<link rel="stylesheet" href="@Assets["Quantum.Runtime.styles.css"]" />
<ImportMap/>
<HeadOutlet @rendermode="RenderMode.InteractiveServer"/>
@foreach (var markupCode in CodeManager.HeadCodes)
{
Expand All @@ -30,11 +31,12 @@
{
@markupCode
}
@* ReSharper disable once Html.PathError *@
<script src="_framework/blazor.web.js"></script>
@foreach (var markupCode in CodeManager.PostBlazorCodes)
{
@markupCode
}
</body>

</html>
</html>
20 changes: 4 additions & 16 deletions Runtime/Components/NavMenu.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@using Quantum.Infrastructure.Abstractions
@using Quantum.Sdk
@inject NavigationManager NavigationManager
@inject IEnumerable<IUiModule> Modules

Expand All @@ -7,7 +7,7 @@
Class="nav-menu"
SelectedKeys="@(new[] { _currentModuleKey })"
OnMenuItemClicked="OnMenuItemClicked">
@foreach (var module in Modules.OrderBy(m => m.ModuleTitle))
@foreach (var module in Modules)
{
<MenuItem Key="@module.DefaultRoute">
<Template>
Expand All @@ -19,32 +19,20 @@
</SpaceItem>
}
<SpaceItem>
<span class="module-title">@module.ModuleTitle</span>
@module.ModuleTitle
</SpaceItem>
</Space>
</Template>
</MenuItem>
}
<MenuItem Key="/accounts">
<Template>
<Space Size="@SpaceSize.Middle">
<SpaceItem>
<Icon Type="user" Theme="IconThemeType.Outline" />
</SpaceItem>
<SpaceItem>
<span class="module-title">账号管理</span>
</SpaceItem>
</Space>
</Template>
</MenuItem>
<MenuItem Key="/modules">
<Template>
<Space Size="@SpaceSize.Middle">
<SpaceItem>
<Icon Type="appstore" Theme="IconThemeType.Outline" />
</SpaceItem>
<SpaceItem>
<span class="module-title">插件管理</span>
插件管理
</SpaceItem>
</Space>
</Template>
Expand Down
3 changes: 1 addition & 2 deletions Runtime/Components/Sidebar.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@using Quantum.Infrastructure.Abstractions
@using Quantum.Infrastructure.Models
@using Quantum.Sdk
@inject IEnumerable<IUiModule> Modules
@inject NavigationManager NavigationManager

Expand Down
96 changes: 49 additions & 47 deletions Runtime/Components/TitleBar.razor
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@using ElectronNET.API
@using Quantum.Sdk
@inject IJSRuntime Js
@inject NavigationManager NavigationManager
@inject IQuantum Quantum

<div class="title-bar">
<div class="drag-area">
Expand All @@ -9,9 +10,9 @@
</div>
<div class="window-controls">
<Button Type="@ButtonType.Link"
Icon="clear"
OnClick="ClearAllCache"
Style="color: rgba(255,255,255,0.65)">
Icon="clear"
OnClick="ClearAllCache"
Style="color: rgba(255,255,255,0.65)">
清除缓存
</Button>
<button class="control-button" @onclick="MinimizeWindow">
Expand All @@ -28,88 +29,89 @@

<style>
.title-bar {
height: 100%;
display: flex;
align-items: center;
justify-content: space-between;
-webkit-app-region: drag;
user-select: none;
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: space-between;
-webkit-app-region: drag;
user-select: none;
width: 100%;
}

.drag-area {
flex: 1;
display: flex;
align-items: center;
padding: 0 12px;
height: 100%;
flex: 1;
display: flex;
align-items: center;
padding: 0 12px;
height: 100%;
}

.app-icon {
font-size: 18px;
color: #1890ff;
font-size: 18px;
color: #1890ff;
}

.app-title {
color: #fff;
font-size: 12px;
opacity: 0.65;
color: #fff;
font-size: 12px;
opacity: 0.65;
}

.window-controls {
display: flex;
height: 100%;
-webkit-app-region: no-drag;
display: flex;
height: 100%;
-webkit-app-region: no-drag;
}

.control-button {
width: 45px;
height: 100%;
border: none;
background: transparent;
color: #fff;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all 0.2s;
opacity: 0.45;
width: 45px;
height: 100%;
border: none;
background: transparent;
color: #fff;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all 0.2s;
opacity: 0.45;
}

.control-button:hover {
background: rgba(255,255,255,0.1);
opacity: 0.85;
background: rgba(255,255,255,0.1);
opacity: 0.85;
}

.control-button.close:hover {
background: #e81123;
opacity: 1;
background: #e81123;
opacity: 1;
}

:global(.control-button .anticon) {
font-size: 10px;
font-size: 10px;
}

:global(.title-bar .ant-btn-link) {
height: 32px;
padding: 4px 8px;
height: 32px;
padding: 4px 8px;
}

:global(.title-bar .ant-btn-link:hover) {
color: white !important;
background: rgba(255,255,255,0.1);
color: white !important;
background: rgba(255,255,255,0.1);
}
</style>

@code {
private void MinimizeWindow()
{
Electron.WindowManager.BrowserWindows.First().Minimize();
Quantum.Window?.Minimize();
}

private async Task MaximizeWindow()
{
var window = Electron.WindowManager.BrowserWindows.First();
var window = Quantum.Window;
if(window is null){ return; }
if (await window.IsMaximizedAsync())
{
window.Unmaximize();
Expand All @@ -122,7 +124,7 @@

private void CloseWindow()
{
Electron.WindowManager.BrowserWindows.First().Close();
Quantum.Window?.Close();
}

private async Task ClearAllCache()
Expand Down
Binary file added Runtime/Modules/ZdbkService/HtmlAgilityPack.dll
Binary file not shown.
75 changes: 75 additions & 0 deletions Runtime/Modules/ZdbkService/ZdbkService.deps.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v9.0",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v9.0": {
"ZdbkService/1.0.0": {
"dependencies": {
"HtmlAgilityPack": "1.11.72",
"Microsoft.Extensions.Logging.Abstractions": "9.0.1"
},
"runtime": {
"ZdbkService.dll": {}
}
},
"HtmlAgilityPack/1.11.72": {
"runtime": {
"lib/netstandard2.0/HtmlAgilityPack.dll": {
"assemblyVersion": "1.11.72.0",
"fileVersion": "1.11.72.0"
}
}
},
"Microsoft.Extensions.DependencyInjection.Abstractions/9.0.1": {
"runtime": {
"lib/net9.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll": {
"assemblyVersion": "9.0.0.0",
"fileVersion": "9.0.124.61010"
}
}
},
"Microsoft.Extensions.Logging.Abstractions/9.0.1": {
"dependencies": {
"Microsoft.Extensions.DependencyInjection.Abstractions": "9.0.1"
},
"runtime": {
"lib/net9.0/Microsoft.Extensions.Logging.Abstractions.dll": {
"assemblyVersion": "9.0.0.0",
"fileVersion": "9.0.124.61010"
}
}
}
}
},
"libraries": {
"ZdbkService/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
},
"HtmlAgilityPack/1.11.72": {
"type": "package",
"serviceable": true,
"sha512": "sha512-RNLgXxTFdIGFI+o5l8c2aJ2L5StIRn9Uv8HKR76p7QP4ZUL26wzpWUCWh08xWUdkL2kocl+Xhv6VUu0rA1npVg==",
"path": "htmlagilitypack/1.11.72",
"hashPath": "htmlagilitypack.1.11.72.nupkg.sha512"
},
"Microsoft.Extensions.DependencyInjection.Abstractions/9.0.1": {
"type": "package",
"serviceable": true,
"sha512": "sha512-Tr74eP0oQ3AyC24ch17N8PuEkrPbD0JqIfENCYqmgKYNOmL8wQKzLJu3ObxTUDrjnn4rHoR1qKa37/eQyHmCDA==",
"path": "microsoft.extensions.dependencyinjection.abstractions/9.0.1",
"hashPath": "microsoft.extensions.dependencyinjection.abstractions.9.0.1.nupkg.sha512"
},
"Microsoft.Extensions.Logging.Abstractions/9.0.1": {
"type": "package",
"serviceable": true,
"sha512": "sha512-w2gUqXN/jNIuvqYwX3lbXagsizVNXYyt6LlF57+tMve4JYCEgCMMAjRce6uKcDASJgpMbErRT1PfHy2OhbkqEA==",
"path": "microsoft.extensions.logging.abstractions/9.0.1",
"hashPath": "microsoft.extensions.logging.abstractions.9.0.1.nupkg.sha512"
}
}
}
Binary file added Runtime/Modules/ZdbkService/ZdbkService.dll
Binary file not shown.
25 changes: 0 additions & 25 deletions Runtime/Pages/AccountManagement.razor

This file was deleted.

2 changes: 1 addition & 1 deletion Runtime/Pages/Home.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@page "/home"
@using Quantum.Infrastructure.Abstractions
@using Quantum.Sdk
@inject NavigationManager NavigationManager
@inject IEnumerable<IUiModule> Modules

Expand Down
Loading