From f138956588e4f66e67a9634cb83781ae198943b7 Mon Sep 17 00:00:00 2001 From: zhaifanhua Date: Sat, 20 Sep 2025 07:59:54 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=A7=BB=E9=99=A4.net8=E6=94=AF?= =?UTF-8?q?=E6=8C=81=EF=BC=8C=E7=A7=BB=E9=99=A4=20Microsoft.PowerShell.SDK?= =?UTF-8?q?=EF=BC=8C=E4=BC=98=E5=8C=96=20logo=20=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=EF=BC=8C=E4=BC=98=E5=8C=96=E7=B3=BB=E7=BB=9F=E7=9B=91=E6=8E=A7?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin.NET.Application.csproj | 2 +- .../Admin.NET.Core/Admin.NET.Core.csproj | 17 +- .../Extension/ConsoleLogoSetup.cs | 11 +- .../Service/Server/SysServerService.cs | 279 ++- .../Update/AutoVersionUpdate.cs | 32 +- .../Admin.NET.Core/Utils/ComputerUtil.cs | 1100 +++++------ .../Admin.NET.Test/Admin.NET.Test.csproj | 2 +- .../Admin.NET.Web.Core.csproj | 2 +- .../Admin.NET.Web.Entry.csproj | 2 +- .../Admin.NET.Plugin.ApprovalFlow.csproj | 2 +- .../Admin.NET.Plugin.DingTalk.csproj | 2 +- .../Admin.NET.Plugin.GoView.csproj | 2 +- .../Admin.NET.Plugin.K3Cloud.csproj | 2 +- .../Admin.NET.Plugin.ReZero.csproj | 2 +- .../Admin.NET.Plugin.WorkWeixin.csproj | 2 +- Web/package.json | 6 +- Web/src/api-services/apis/sys-server-api.ts | 205 +-- Web/src/api-services/models/add-user-input.ts | 2 +- .../admin-result-list-nu-get-package.ts | 71 + .../models/admin-result-system-info.ts | 69 + Web/src/api-services/models/board-info.ts | 46 + Web/src/api-services/models/cpu-info.ts | 64 + Web/src/api-services/models/disk-info.ts | 58 + .../models/generic-parameter-attributes.ts | 3 +- Web/src/api-services/models/gpu-info.ts | 94 + Web/src/api-services/models/index.ts | 13 + .../api-services/models/ip-address-info.ts | 40 + .../models/list-sys-lang-text-input.ts | 16 - Web/src/api-services/models/network-info.ts | 108 ++ .../models/network-interface-statistics.ts | 70 + Web/src/api-services/models/nu-get-package.ts | 34 + Web/src/api-services/models/ram-info.ts | 64 + Web/src/api-services/models/runtime-info.ts | 184 ++ Web/src/api-services/models/sys-lang-text.ts | 2 +- Web/src/api-services/models/sys-lang.ts | 2 +- Web/src/api-services/models/sys-user.ts | 2 +- Web/src/api-services/models/system-info.ts | 71 + Web/src/api-services/models/type-info.ts | 12 +- Web/src/api-services/models/type.ts | 12 +- .../api-services/models/update-menu-input.ts | 2 +- .../api-services/models/update-user-input.ts | 2 +- Web/src/api-services/models/user-output.ts | 2 +- Web/src/views/system/server/index.vue | 1629 +++++++++++++++-- Web/src/views/system/server/new.vue | 1194 ------------ Web/src/views/system/server/old.vue | 228 +++ 45 files changed, 3435 insertions(+), 2329 deletions(-) create mode 100644 Web/src/api-services/models/admin-result-list-nu-get-package.ts create mode 100644 Web/src/api-services/models/admin-result-system-info.ts create mode 100644 Web/src/api-services/models/board-info.ts create mode 100644 Web/src/api-services/models/cpu-info.ts create mode 100644 Web/src/api-services/models/disk-info.ts create mode 100644 Web/src/api-services/models/gpu-info.ts create mode 100644 Web/src/api-services/models/ip-address-info.ts create mode 100644 Web/src/api-services/models/network-info.ts create mode 100644 Web/src/api-services/models/network-interface-statistics.ts create mode 100644 Web/src/api-services/models/nu-get-package.ts create mode 100644 Web/src/api-services/models/ram-info.ts create mode 100644 Web/src/api-services/models/runtime-info.ts create mode 100644 Web/src/api-services/models/system-info.ts delete mode 100644 Web/src/views/system/server/new.vue create mode 100644 Web/src/views/system/server/old.vue diff --git a/Admin.NET/Admin.NET.Application/Admin.NET.Application.csproj b/Admin.NET/Admin.NET.Application/Admin.NET.Application.csproj index 483618044..0141736c1 100644 --- a/Admin.NET/Admin.NET.Application/Admin.NET.Application.csproj +++ b/Admin.NET/Admin.NET.Application/Admin.NET.Application.csproj @@ -1,7 +1,7 @@  - net8.0;net9.0 + net9.0 1701;1702;1591;8632 enable diff --git a/Admin.NET/Admin.NET.Core/Admin.NET.Core.csproj b/Admin.NET/Admin.NET.Core/Admin.NET.Core.csproj index 25a0af4f4..ae08d3989 100644 --- a/Admin.NET/Admin.NET.Core/Admin.NET.Core.csproj +++ b/Admin.NET/Admin.NET.Core/Admin.NET.Core.csproj @@ -1,7 +1,7 @@ - net8.0;net9.0 + net9.0 1701;1702;1591;8632 enable @@ -52,25 +52,12 @@ - - - - - - - - - - - - - - + diff --git a/Admin.NET/Admin.NET.Core/Extension/ConsoleLogoSetup.cs b/Admin.NET/Admin.NET.Core/Extension/ConsoleLogoSetup.cs index be20e9724..57960d4ca 100644 --- a/Admin.NET/Admin.NET.Core/Extension/ConsoleLogoSetup.cs +++ b/Admin.NET/Admin.NET.Core/Extension/ConsoleLogoSetup.cs @@ -4,6 +4,9 @@ // // 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + +using XiHan.Framework.Utils.Logging; + namespace Admin.NET.Core; /// @@ -13,15 +16,15 @@ public static class ConsoleLogoSetup { public static void AddConsoleLogo(this IServiceCollection services) { - Console.ForegroundColor = ConsoleColor.Blue; - Console.WriteLine(@" + LogHelper.SetIsDisplayHeader(false); + LogHelper.Rainbow(@" _ _ _ _ ______ _______ /\ | | (_) | \ | | ____|__ __| / \ __| |_ __ ___ _ _ __ | \| | |__ | | / /\ \ / _` | '_ ` _ \| | '_ \ | . ` | __| | | / ____ \ (_| | | | | | | | | | |_| |\ | |____ | | /_/ \_\__,_|_| |_| |_|_|_| |_(_)_| \_|______| |_| "); - Console.ForegroundColor = ConsoleColor.Yellow; - Console.WriteLine(@"让.NET更简单、更通用、更流行!"); + LogHelper.Info(@"让.NET更简单、更通用、更流行!"); + LogHelper.SetIsDisplayHeader(true); } } \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/Service/Server/SysServerService.cs b/Admin.NET/Admin.NET.Core/Service/Server/SysServerService.cs index fa27e0cd5..d3cd08b02 100644 --- a/Admin.NET/Admin.NET.Core/Service/Server/SysServerService.cs +++ b/Admin.NET/Admin.NET.Core/Service/Server/SysServerService.cs @@ -4,13 +4,11 @@ // // 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! -#if NET9_0_OR_GREATER +//#if NET9_0_OR_GREATER using XiHan.Framework.Utils.Core; using XiHan.Framework.Utils.Reflections; -using ReflectionHelper = XiHan.Framework.Utils.Reflections.ReflectionHelper; -#endif // NET9_0_OR_GREATER namespace Admin.NET.Core.Service; @@ -24,28 +22,15 @@ public class SysServerService : IDynamicApiController, ITransient { } -#if NET9_0_OR_GREATER - /// /// 获取服务器硬件信息 /// /// [DisplayName("获取服务器硬件信息")] - public SystemHardwareInfo HardwareInfo() + public SystemInfo SystemInfo() { - var hardwareInfo = HardwareInfoManager.GetSystemHardwareInfo(); - return hardwareInfo; - } - - /// - /// 获取服务器运行时信息 - /// - /// - [DisplayName("获取服务器运行时信息")] - public SystemRuntimeInfo RuntimeInfo() - { - var systemRuntimeInfo = RuntimeInfoManager.GetSystemRuntimeInfo(); - return systemRuntimeInfo; + var systemInfo = SystemInfoManager.GetSystemInfo(); + return systemInfo; } /// @@ -59,133 +44,131 @@ public class SysServerService : IDynamicApiController, ITransient return nuGetPackages; } -#endif // NET9_0_OR_GREATER - - /// - /// 获取服务器配置信息 🔖 - /// - /// - [DisplayName("获取服务器配置信息")] - public dynamic GetServerBase() - { - return new - { - HostName = Environment.MachineName, // 主机名称 - SystemOs = ComputerUtil.GetOSInfo(),//RuntimeInformation.OSDescription, // 操作系统 - OsArchitecture = Environment.OSVersion.Platform.ToString() + " " + RuntimeInformation.OSArchitecture.ToString(), // 系统架构 - ProcessorCount = Environment.ProcessorCount + " 核", // CPU核心数 - SysRunTime = ComputerUtil.GetRunTime(), // 系统运行时间 - RemoteIp = ComputerUtil.GetIpFromOnline(), // 外网地址 - LocalIp = App.HttpContext?.Connection?.LocalIpAddress!.MapToIPv4().ToString(), // 本地地址 - FrameworkDescription = RuntimeInformation.FrameworkDescription + " / " + App.GetOptions().ConnectionConfigs[0].DbType.ToString(), // NET框架 + 数据库类型 - Environment = App.HostEnvironment.IsDevelopment() ? "Development" : "Production", - Wwwroot = App.WebHostEnvironment.WebRootPath, // 网站根目录 - Stage = App.HostEnvironment.IsStaging() ? "Stage环境" : "非Stage环境", // 是否Stage环境 - }; - } - - /// - /// 获取服务器使用信息 🔖 - /// - /// - [DisplayName("获取服务器使用信息")] - public dynamic GetServerUsed() - { - var programStartTime = Process.GetCurrentProcess().StartTime; - var totalMilliseconds = (DateTime.Now - programStartTime).TotalMilliseconds.ToString(); - var ts = totalMilliseconds.Contains('.') ? totalMilliseconds.Split('.')[0] : totalMilliseconds; - var programRunTime = DateTimeUtil.FormatTime(ts.ParseToLong()); - - var memoryMetrics = ComputerUtil.GetComputerInfo(); - return new - { - memoryMetrics.FreeRam, // 空闲内存 - memoryMetrics.UsedRam, // 已用内存 - memoryMetrics.TotalRam, // 总内存 - memoryMetrics.RamRate, // 内存使用率 - memoryMetrics.CpuRates, // Cpu使用率多CPU未完成 - memoryMetrics.CpuRate, // Cpu 1使用率 - StartTime = programStartTime.ToString("yyyy-MM-dd HH:mm:ss"), // 服务启动时间 - RunTime = programRunTime, // 服务运行时间 - }; - } - - /// - /// 获取服务器磁盘信息 🔖 - /// - /// - [DisplayName("获取服务器磁盘信息")] - public dynamic GetServerDisk() - { - return ComputerUtil.GetDiskInfos(); - } - - /// - /// 获取框架主要程序集 🔖 - /// - /// - [DisplayName("获取框架主要程序集")] - public dynamic GetAssemblyList() - { - var furionAssembly = typeof(App).Assembly.GetName(); - var sqlSugarAssembly = typeof(ISqlSugarClient).Assembly.GetName(); - var yitIdAssembly = typeof(YitIdHelper).Assembly.GetName(); - var redisAssembly = typeof(Redis).Assembly.GetName(); - var jsonAssembly = typeof(NewtonsoftJsonMvcCoreBuilderExtensions).Assembly.GetName(); - var excelAssembly = typeof(IExcelImporter).Assembly.GetName(); - var pdfAssembly = typeof(Magicodes.ExporterAndImporter.Pdf.IPdfExporter).Assembly.GetName(); - var wordAssembly = typeof(Magicodes.ExporterAndImporter.Word.IWordExporter).Assembly.GetName(); - var captchaAssembly = typeof(Lazy.Captcha.Core.ICaptcha).Assembly.GetName(); - var wechatApiAssembly = typeof(WechatApiClient).Assembly.GetName(); - var wechatTenpayAssembly = typeof(WechatTenpayClient).Assembly.GetName(); - var ossAssembly = typeof(OnceMi.AspNetCore.OSS.IOSSServiceFactory).Assembly.GetName(); - var parserAssembly = typeof(Parser).Assembly.GetName(); - var elasticsearchClientAssembly = typeof(Elastic.Clients.Elasticsearch.ElasticsearchClient).Assembly.GetName(); - var limitAssembly = typeof(AspNetCoreRateLimit.IpRateLimitMiddleware).Assembly.GetName(); - var htmlParserAssembly = typeof(AngleSharp.Html.Parser.HtmlParser).Assembly.GetName(); - var fluentEmailAssembly = typeof(MailKit.Net.Smtp.SmtpClient).Assembly.GetName(); - var qRCodeGeneratorAssembly = typeof(QRCoder.QRCodeGenerator).Assembly.GetName(); - var alibabaSendSmsRequestAssembly = typeof(AlibabaCloud.SDK.Dysmsapi20170525.Models.SendSmsRequest).Assembly.GetName(); - var tencentSendSmsRequestAssembly = typeof(TencentCloud.Sms.V20190711.Models.SendSmsRequest).Assembly.GetName(); - var rabbitMQAssembly = typeof(RabbitMQEventSourceStore).Assembly.GetName(); - var ldapConnectionAssembly = typeof(Novell.Directory.Ldap.LdapConnection).Assembly.GetName(); - var ipToolAssembly = typeof(IPTools.Core.IpTool).Assembly.GetName(); - var weixinAuthenticationOptionsAssembly = typeof(AspNet.Security.OAuth.Weixin.WeixinAuthenticationOptions).Assembly.GetName(); - var giteeAuthenticationOptionsAssembly = typeof(AspNet.Security.OAuth.Gitee.GiteeAuthenticationOptions).Assembly.GetName(); - var hashidsAssembly = typeof(HashidsNet.Hashids).Assembly.GetName(); - var sftpClientAssembly = typeof(Renci.SshNet.SftpClient).Assembly.GetName(); - var hardwareInfoAssembly = typeof(Hardware.Info.HardwareInfo).Assembly.GetName(); - - return new[] - { - new { furionAssembly.Name, furionAssembly.Version }, - new { sqlSugarAssembly.Name, sqlSugarAssembly.Version }, - new { yitIdAssembly.Name, yitIdAssembly.Version }, - new { redisAssembly.Name, redisAssembly.Version }, - new { jsonAssembly.Name, jsonAssembly.Version }, - new { excelAssembly.Name, excelAssembly.Version }, - new { pdfAssembly.Name, pdfAssembly.Version }, - new { wordAssembly.Name, wordAssembly.Version }, - new { captchaAssembly.Name, captchaAssembly.Version }, - new { wechatApiAssembly.Name, wechatApiAssembly.Version }, - new { wechatTenpayAssembly.Name, wechatTenpayAssembly.Version }, - new { ossAssembly.Name, ossAssembly.Version }, - new { parserAssembly.Name, parserAssembly.Version }, - new { elasticsearchClientAssembly.Name, elasticsearchClientAssembly.Version }, - new { limitAssembly.Name, limitAssembly.Version }, - new { htmlParserAssembly.Name, htmlParserAssembly.Version }, - new { fluentEmailAssembly.Name, fluentEmailAssembly.Version }, - new { qRCodeGeneratorAssembly.Name, qRCodeGeneratorAssembly.Version }, - new { alibabaSendSmsRequestAssembly.Name, alibabaSendSmsRequestAssembly.Version }, - new { tencentSendSmsRequestAssembly.Name, tencentSendSmsRequestAssembly.Version }, - new { rabbitMQAssembly.Name, rabbitMQAssembly.Version }, - new { ldapConnectionAssembly.Name, ldapConnectionAssembly.Version }, - new { ipToolAssembly.Name, ipToolAssembly.Version }, - new { weixinAuthenticationOptionsAssembly.Name, weixinAuthenticationOptionsAssembly.Version }, - new { giteeAuthenticationOptionsAssembly.Name, giteeAuthenticationOptionsAssembly.Version }, - new { hashidsAssembly.Name, hashidsAssembly.Version }, - new { sftpClientAssembly.Name, sftpClientAssembly.Version }, - new { hardwareInfoAssembly.Name, hardwareInfoAssembly.Version }, - }; - } + ///// + ///// 获取服务器配置信息 🔖 + ///// + ///// + //[DisplayName("获取服务器配置信息")] + //public dynamic GetServerBase() + //{ + // return new + // { + // HostName = Environment.MachineName, // 主机名称 + // SystemOs = ComputerUtil.GetOSInfo(),//RuntimeInformation.OSDescription, // 操作系统 + // OsArchitecture = Environment.OSVersion.Platform.ToString() + " " + RuntimeInformation.OSArchitecture.ToString(), // 系统架构 + // ProcessorCount = Environment.ProcessorCount + " 核", // CPU核心数 + // SysRunTime = ComputerUtil.GetRunTime(), // 系统运行时间 + // RemoteIp = ComputerUtil.GetIpFromOnline(), // 外网地址 + // LocalIp = App.HttpContext?.Connection?.LocalIpAddress!.MapToIPv4().ToString(), // 本地地址 + // FrameworkDescription = RuntimeInformation.FrameworkDescription + " / " + App.GetOptions().ConnectionConfigs[0].DbType.ToString(), // NET框架 + 数据库类型 + // Environment = App.HostEnvironment.IsDevelopment() ? "Development" : "Production", + // Wwwroot = App.WebHostEnvironment.WebRootPath, // 网站根目录 + // Stage = App.HostEnvironment.IsStaging() ? "Stage环境" : "非Stage环境", // 是否Stage环境 + // }; + //} + + ///// + ///// 获取服务器使用信息 🔖 + ///// + ///// + //[DisplayName("获取服务器使用信息")] + //public dynamic GetServerUsed() + //{ + // var programStartTime = Process.GetCurrentProcess().StartTime; + // var totalMilliseconds = (DateTime.Now - programStartTime).TotalMilliseconds.ToString(); + // var ts = totalMilliseconds.Contains('.') ? totalMilliseconds.Split('.')[0] : totalMilliseconds; + // var programRunTime = DateTimeUtil.FormatTime(ts.ParseToLong()); + + // var memoryMetrics = ComputerUtil.GetComputerInfo(); + // return new + // { + // memoryMetrics.FreeRam, // 空闲内存 + // memoryMetrics.UsedRam, // 已用内存 + // memoryMetrics.TotalRam, // 总内存 + // memoryMetrics.RamRate, // 内存使用率 + // memoryMetrics.CpuRates, // Cpu使用率多CPU未完成 + // memoryMetrics.CpuRate, // Cpu 1使用率 + // StartTime = programStartTime.ToString("yyyy-MM-dd HH:mm:ss"), // 服务启动时间 + // RunTime = programRunTime, // 服务运行时间 + // }; + //} + + ///// + ///// 获取服务器磁盘信息 🔖 + ///// + ///// + //[DisplayName("获取服务器磁盘信息")] + //public dynamic GetServerDisk() + //{ + // return ComputerUtil.GetDiskInfos(); + //} + + ///// + ///// 获取框架主要程序集 🔖 + ///// + ///// + //[DisplayName("获取框架主要程序集")] + //public dynamic GetAssemblyList() + //{ + // var furionAssembly = typeof(App).Assembly.GetName(); + // var sqlSugarAssembly = typeof(ISqlSugarClient).Assembly.GetName(); + // var yitIdAssembly = typeof(YitIdHelper).Assembly.GetName(); + // var redisAssembly = typeof(Redis).Assembly.GetName(); + // var jsonAssembly = typeof(NewtonsoftJsonMvcCoreBuilderExtensions).Assembly.GetName(); + // var excelAssembly = typeof(IExcelImporter).Assembly.GetName(); + // var pdfAssembly = typeof(Magicodes.ExporterAndImporter.Pdf.IPdfExporter).Assembly.GetName(); + // var wordAssembly = typeof(Magicodes.ExporterAndImporter.Word.IWordExporter).Assembly.GetName(); + // var captchaAssembly = typeof(Lazy.Captcha.Core.ICaptcha).Assembly.GetName(); + // var wechatApiAssembly = typeof(WechatApiClient).Assembly.GetName(); + // var wechatTenpayAssembly = typeof(WechatTenpayClient).Assembly.GetName(); + // var ossAssembly = typeof(OnceMi.AspNetCore.OSS.IOSSServiceFactory).Assembly.GetName(); + // var parserAssembly = typeof(Parser).Assembly.GetName(); + // var elasticsearchClientAssembly = typeof(Elastic.Clients.Elasticsearch.ElasticsearchClient).Assembly.GetName(); + // var limitAssembly = typeof(AspNetCoreRateLimit.IpRateLimitMiddleware).Assembly.GetName(); + // var htmlParserAssembly = typeof(AngleSharp.Html.Parser.HtmlParser).Assembly.GetName(); + // var fluentEmailAssembly = typeof(MailKit.Net.Smtp.SmtpClient).Assembly.GetName(); + // var qRCodeGeneratorAssembly = typeof(QRCoder.QRCodeGenerator).Assembly.GetName(); + // var alibabaSendSmsRequestAssembly = typeof(AlibabaCloud.SDK.Dysmsapi20170525.Models.SendSmsRequest).Assembly.GetName(); + // var tencentSendSmsRequestAssembly = typeof(TencentCloud.Sms.V20190711.Models.SendSmsRequest).Assembly.GetName(); + // var rabbitMQAssembly = typeof(RabbitMQEventSourceStore).Assembly.GetName(); + // var ldapConnectionAssembly = typeof(Novell.Directory.Ldap.LdapConnection).Assembly.GetName(); + // var ipToolAssembly = typeof(IPTools.Core.IpTool).Assembly.GetName(); + // var weixinAuthenticationOptionsAssembly = typeof(AspNet.Security.OAuth.Weixin.WeixinAuthenticationOptions).Assembly.GetName(); + // var giteeAuthenticationOptionsAssembly = typeof(AspNet.Security.OAuth.Gitee.GiteeAuthenticationOptions).Assembly.GetName(); + // var hashidsAssembly = typeof(HashidsNet.Hashids).Assembly.GetName(); + // var sftpClientAssembly = typeof(Renci.SshNet.SftpClient).Assembly.GetName(); + // var hardwareInfoAssembly = typeof(Hardware.Info.HardwareInfo).Assembly.GetName(); + + // return new[] + // { + // new { furionAssembly.Name, furionAssembly.Version }, + // new { sqlSugarAssembly.Name, sqlSugarAssembly.Version }, + // new { yitIdAssembly.Name, yitIdAssembly.Version }, + // new { redisAssembly.Name, redisAssembly.Version }, + // new { jsonAssembly.Name, jsonAssembly.Version }, + // new { excelAssembly.Name, excelAssembly.Version }, + // new { pdfAssembly.Name, pdfAssembly.Version }, + // new { wordAssembly.Name, wordAssembly.Version }, + // new { captchaAssembly.Name, captchaAssembly.Version }, + // new { wechatApiAssembly.Name, wechatApiAssembly.Version }, + // new { wechatTenpayAssembly.Name, wechatTenpayAssembly.Version }, + // new { ossAssembly.Name, ossAssembly.Version }, + // new { parserAssembly.Name, parserAssembly.Version }, + // new { elasticsearchClientAssembly.Name, elasticsearchClientAssembly.Version }, + // new { limitAssembly.Name, limitAssembly.Version }, + // new { htmlParserAssembly.Name, htmlParserAssembly.Version }, + // new { fluentEmailAssembly.Name, fluentEmailAssembly.Version }, + // new { qRCodeGeneratorAssembly.Name, qRCodeGeneratorAssembly.Version }, + // new { alibabaSendSmsRequestAssembly.Name, alibabaSendSmsRequestAssembly.Version }, + // new { tencentSendSmsRequestAssembly.Name, tencentSendSmsRequestAssembly.Version }, + // new { rabbitMQAssembly.Name, rabbitMQAssembly.Version }, + // new { ldapConnectionAssembly.Name, ldapConnectionAssembly.Version }, + // new { ipToolAssembly.Name, ipToolAssembly.Version }, + // new { weixinAuthenticationOptionsAssembly.Name, weixinAuthenticationOptionsAssembly.Version }, + // new { giteeAuthenticationOptionsAssembly.Name, giteeAuthenticationOptionsAssembly.Version }, + // new { hashidsAssembly.Name, hashidsAssembly.Version }, + // new { sftpClientAssembly.Name, sftpClientAssembly.Version }, + // new { hardwareInfoAssembly.Name, hardwareInfoAssembly.Version }, + // }; + //} } \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/Update/AutoVersionUpdate.cs b/Admin.NET/Admin.NET.Core/Update/AutoVersionUpdate.cs index c60f26f2e..6747e1d59 100644 --- a/Admin.NET/Admin.NET.Core/Update/AutoVersionUpdate.cs +++ b/Admin.NET/Admin.NET.Core/Update/AutoVersionUpdate.cs @@ -4,8 +4,6 @@ // // 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! -#if NET9_0_OR_GREATER - using Microsoft.AspNetCore.Builder; using XiHan.Framework.Utils.Logging; using XiHan.Framework.Utils.Reflections; @@ -38,29 +36,29 @@ public static class AutoVersionUpdate /// public static IApplicationBuilder UseAutoVersionUpdate(this IApplicationBuilder app) { - ConsoleLogger.Info("AutoVersionUpdate 中间件运行"); + LogHelper.Info("AutoVersionUpdate 中间件运行"); var snowIdOpt = App.GetConfig("SnowId", true); if (snowIdOpt.WorkerId != 1) { - ConsoleLogger.Handle("非主节点,不执行脚本"); + LogHelper.Handle("非主节点,不执行脚本"); return app; } var currentVersion = GetEntryAssemblyCurrentVersion(); - ConsoleLogger.Handle($"当前版本:{currentVersion}"); + LogHelper.Handle($"当前版本:{currentVersion}"); var historyVersionInfo = GetEntryAssemblyHistoryVersionInfo(); var historyVersion = historyVersionInfo.Version; var historyDate = historyVersionInfo.Date; var historyIsRunScript = historyVersionInfo.IsRunScript; - ConsoleLogger.Handle($"历史版本:{historyVersion},更新时间:{historyDate},是否已执行{historyIsRunScript}"); + LogHelper.Handle($"历史版本:{historyVersion},更新时间:{historyDate},是否已执行{historyIsRunScript}"); // 历史版本为空、版本号相同,不执行脚本 if (historyVersion == string.Empty) { - ConsoleLogger.Handle("历史版本为空,默认为最新版本,不执行脚本"); + LogHelper.Handle("历史版本为空,默认为最新版本,不执行脚本"); // 保存当前版本信息 SetEntryAssemblyCurrentVersion(currentVersion, true); @@ -69,7 +67,7 @@ public static class AutoVersionUpdate } else if (currentVersion.CompareTo(historyVersion) <= 0 && historyIsRunScript) { - ConsoleLogger.Handle("当前版本号与历史版本号相同,且已执行过脚本,不再执行"); + LogHelper.Handle("当前版本号与历史版本号相同,且已执行过脚本,不再执行"); // 保存当前版本信息 SetEntryAssemblyCurrentVersion(currentVersion, false); @@ -78,14 +76,14 @@ public static class AutoVersionUpdate } else { - ConsoleLogger.Handle("当前版本号与历史版本号不同,或版本号相同但未执行过脚本,开始执行脚本"); + LogHelper.Handle("当前版本号与历史版本号不同,或版本号相同但未执行过脚本,开始执行脚本"); var scriptSqlVersions = GetScriptSqlVersions(); // 若不存在当前版本的脚本,则只保存当前版本信息,不执行脚本 if (scriptSqlVersions.All(s => s.Version.CompareTo(currentVersion) < 0)) { - ConsoleLogger.Handle("不存在当前版本的脚本,只保存当前版本信息,不执行脚本"); + LogHelper.Handle("不存在当前版本的脚本,只保存当前版本信息,不执行脚本"); // 保存当前版本信息 SetEntryAssemblyCurrentVersion(currentVersion, false); @@ -101,12 +99,12 @@ public static class AutoVersionUpdate // 只执行大于历史版本的脚本,或者当前版本但未执行过 if (sqlVersion.CompareTo(historyVersion) < 0) { - ConsoleLogger.Handle($"版本{sqlVersion}低于历史版本,跳过"); + LogHelper.Handle($"版本{sqlVersion}低于历史版本,跳过"); continue; } if (sqlVersion == historyVersion && historyIsRunScript) { - ConsoleLogger.Handle($"版本{sqlVersion}等于历史版本,且已执行过脚本,跳过"); + LogHelper.Handle($"版本{sqlVersion}等于历史版本,且已执行过脚本,跳过"); continue; } @@ -114,14 +112,14 @@ public static class AutoVersionUpdate var sql = File.ReadAllText(sqlFileInfo.FilePath); if (sql != null) { - ConsoleLogger.Handle($"执行版本{sqlVersion}脚本"); + LogHelper.Handle($"执行版本{sqlVersion}脚本"); HandleSqlScript(app, sql, sqlVersion); } } } - ConsoleLogger.Success("AutoVersionUpdate 中间件结束"); + LogHelper.Success("AutoVersionUpdate 中间件结束"); return app; } @@ -219,7 +217,7 @@ public static class AutoVersionUpdate catch (Exception ex) { dbContext.Ado.RollbackTran(); - ConsoleLogger.Error($"AutoVersionUpdate 执行 SQL 脚本出错,版本:{sqlVersion},错误:{ex.Message}"); + LogHelper.Error($"AutoVersionUpdate 执行 SQL 脚本出错,版本:{sqlVersion},错误:{ex.Message}"); } finally { @@ -235,6 +233,4 @@ public static class AutoVersionUpdate } public record SqlFileInfo(string Version, string FilePath); -public record HistoryVersionInfo(string Version, string Date, bool IsRunScript); - -#endif // NET9_0_OR_GREATER \ No newline at end of file +public record HistoryVersionInfo(string Version, string Date, bool IsRunScript); \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/Utils/ComputerUtil.cs b/Admin.NET/Admin.NET.Core/Utils/ComputerUtil.cs index 78d05ec52..2831764be 100644 --- a/Admin.NET/Admin.NET.Core/Utils/ComputerUtil.cs +++ b/Admin.NET/Admin.NET.Core/Utils/ComputerUtil.cs @@ -1,550 +1,550 @@ -// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 -// -// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 -// -// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! - -namespace Admin.NET.Core; - -public static class ComputerUtil -{ - /// - /// 内存信息 - /// - /// - public static MemoryMetrics GetComputerInfo() - { - MemoryMetrics memoryMetrics; - if (IsMacOS()) - { - memoryMetrics = MemoryMetricsClient.GetMacOSMetrics(); - } - else if (IsUnix()) - { - memoryMetrics = MemoryMetricsClient.GetUnixMetrics(); - } - else - { - memoryMetrics = MemoryMetricsClient.GetWindowsMetrics(); - } - memoryMetrics.FreeRam = Math.Round(memoryMetrics.Free / 1024, 2) + "GB"; - memoryMetrics.UsedRam = Math.Round(memoryMetrics.Used / 1024, 2) + "GB"; - memoryMetrics.TotalRam = Math.Round(memoryMetrics.Total / 1024, 2) + "GB"; - memoryMetrics.RamRate = Math.Ceiling(100 * memoryMetrics.Used / memoryMetrics.Total) + "%"; - var cpuRates = GetCPURates(); - if (cpuRates != null) - { - memoryMetrics.CpuRates = cpuRates.Select(u => Math.Ceiling(u.ParseToDouble()) + "%").ToList(); - } - memoryMetrics.CpuRate = memoryMetrics.CpuRates[0]; - return memoryMetrics; - } - - /// - /// 获取正确的操作系统版本(Linux获取发行版本) - /// - /// - public static String GetOSInfo() - { - string operation = string.Empty; - if (IsMacOS()) - { - var output = ShellUtil.Bash("sw_vers | awk 'NR<=2{printf \"%s \", $NF}'"); - if (output != null) - { - operation = output.Replace("%", string.Empty); - } - } - else if (IsUnix()) - { - var output = ShellUtil.Bash("awk -F= '/^VERSION_ID/ {print $2}' /etc/os-release | tr -d '\"'"); - operation = output ?? string.Empty; - } - else - { - operation = RuntimeInformation.OSDescription; - } - return operation; - } - - /// - /// 磁盘信息 - /// - /// - public static List GetDiskInfos() - { - var diskInfos = new List(); - if (IsMacOS()) - { - var output = ShellUtil.Bash(@"df -m | awk '/^\/dev\/disk/ {print $1,$2,$3,$4,$5}'"); - var disks = output.Split('\n', StringSplitOptions.RemoveEmptyEntries); - if (disks.Length < 1) return diskInfos; - foreach (var item in disks) - { - var disk = item.Split(' ', (char)StringSplitOptions.RemoveEmptyEntries); - if (disk.Length < 5) continue; - - var diskInfo = new DiskInfo() - { - DiskName = disk[0], - TypeName = ShellUtil.Bash("diskutil info " + disk[0] + " | awk '/File System Personality/ {print $4}'").Replace("\n", string.Empty), - TotalSize = Math.Round(long.Parse(disk[1]) / 1024.0m, 2, MidpointRounding.AwayFromZero), - Used = Math.Round(long.Parse(disk[2]) / 1024.0m, 2, MidpointRounding.AwayFromZero), - AvailableFreeSpace = Math.Round(long.Parse(disk[3]) / 1024.0m, 2, MidpointRounding.AwayFromZero), - AvailablePercent = decimal.Parse(disk[4].Replace("%", "")) - }; - diskInfos.Add(diskInfo); - } - } - else if (IsUnix()) - { - var output = ShellUtil.Bash(@"df -mT | awk '/^\/dev\/(sd|vd|xvd|nvme|sda|vda|mapper)/ {print $1,$2,$3,$4,$5,$6}'"); - var disks = output.Split('\n', StringSplitOptions.RemoveEmptyEntries); - if (disks.Length < 1) return diskInfos; - - //var rootDisk = disks[1].Split(' ', (char)StringSplitOptions.RemoveEmptyEntries); - //if (rootDisk == null || rootDisk.Length < 1) - // return diskInfos; - - foreach (var item in disks) - { - var disk = item.Split(' ', (char)StringSplitOptions.RemoveEmptyEntries); - if (disk.Length < 6) continue; - - var diskInfo = new DiskInfo() - { - DiskName = disk[0], - TypeName = disk[1], - TotalSize = Math.Round(long.Parse(disk[2]) / 1024.0m, 2, MidpointRounding.AwayFromZero), - Used = Math.Round(long.Parse(disk[3]) / 1024.0m, 2, MidpointRounding.AwayFromZero), - AvailableFreeSpace = Math.Round(long.Parse(disk[4]) / 1024.0m, 2, MidpointRounding.AwayFromZero), - AvailablePercent = decimal.Parse(disk[5].Replace("%", "")) - }; - diskInfos.Add(diskInfo); - } - } - else - { - var driveList = DriveInfo.GetDrives().Where(u => u.IsReady); - foreach (var item in driveList) - { - if (item.DriveType == DriveType.CDRom) continue; - var diskInfo = new DiskInfo() - { - DiskName = item.Name, - TypeName = item.DriveType.ToString(), - TotalSize = Math.Round(item.TotalSize / 1024 / 1024 / 1024.0m, 2, MidpointRounding.AwayFromZero), - AvailableFreeSpace = Math.Round(item.AvailableFreeSpace / 1024 / 1024 / 1024.0m, 2, MidpointRounding.AwayFromZero), - }; - diskInfo.Used = diskInfo.TotalSize - diskInfo.AvailableFreeSpace; - diskInfo.AvailablePercent = decimal.Ceiling(diskInfo.Used / (decimal)diskInfo.TotalSize * 100); - diskInfos.Add(diskInfo); - } - } - return diskInfos; - } - - /// - /// 获取外网IP地址 - /// - /// - public static string GetIpFromOnline() - { - try - { - var url = "https://4.ipw.cn"; - var httpRemoteService = App.GetRequiredService(); - var ip = httpRemoteService.GetAsString(url); - var (ipLocation, _, _) = CommonUtil.GetIpAddress(ip); - return ip + " " + ipLocation; - } - catch - { - return "unknow"; - } - } - - public static bool IsUnix() - { - return RuntimeInformation.IsOSPlatform(OSPlatform.Linux); - } - - public static bool IsMacOS() - { - return RuntimeInformation.IsOSPlatform(OSPlatform.OSX); - } - - public static List GetCPURates() - { - var cpuRates = new List(); - string output = ""; - if (IsMacOS()) - { - output = ShellUtil.Bash("top -l 1 | grep \"CPU usage\" | awk '{print $3 + $5}'"); - cpuRates.Add(output.Trim()); - } - else if (IsUnix()) - { - output = ShellUtil.Bash("awk '{u=$2+$4; t=$2+$4+$5; if (NR==1){u1=u; t1=t;} else print ($2+$4-u1) * 100 / (t-t1); }' <(grep 'cpu ' /proc/stat) <(sleep 1;grep 'cpu ' /proc/stat)"); - cpuRates.Add(output.Trim()); - } - else - { - try - { - output = ShellUtil.Cmd("wmic", "cpu get LoadPercentage"); - } - catch (Exception) - { - output = ShellUtil.PowerShell("Get-CimInstance -ClassName Win32_Processor | Select-Object LoadPercentage"); - output = output.Replace("@", string.Empty).Replace("{", string.Empty).Replace("}", string.Empty).Replace("=", string.Empty).Trim(); - } - cpuRates.AddRange(output.Replace("LoadPercentage", string.Empty).Trim().Split("\r\r\n")); - } - return cpuRates; - } - - /// - /// 获取系统运行时间 - /// - /// - public static string GetRunTime() - { - string runTime = string.Empty; - string output = ""; - if (IsMacOS()) - { - // macOS 获取系统启动时间: - // sysctl -n kern.boottime | awk '{print $4}' | tr -d ',' - // 返回:1705379131 - // 使用date格式化即可 - output = ShellUtil.Bash("date -r $(sysctl -n kern.boottime | awk '{print $4}' | tr -d ',') +\"%Y-%m-%d %H:%M:%S\"").Trim(); - runTime = DateTimeUtil.FormatTime((DateTime.Now - output.ParseToDateTime()).TotalMilliseconds.ToString().Split('.')[0].ParseToLong()); - } - else if (IsUnix()) - { - output = ShellUtil.Bash("date -d \"$(awk -F. '{print $1}' /proc/uptime) second ago\" +\"%Y-%m-%d %H:%M:%S\"").Trim(); - runTime = DateTimeUtil.FormatTime((DateTime.Now - output.ParseToDateTime()).TotalMilliseconds.ToString().Split('.')[0].ParseToLong()); - } - else - { - try - { - output = ShellUtil.Cmd("wmic", "OS get LastBootUpTime/Value"); - string[] outputArr = output.Split('=', (char)StringSplitOptions.RemoveEmptyEntries); - if (outputArr.Length == 2) - runTime = DateTimeUtil.FormatTime((DateTime.Now - outputArr[1].Split('.')[0].ParseToDateTime()).TotalMilliseconds.ToString().Split('.')[0].ParseToLong()); - } - catch (Exception) - { - output = ShellUtil.PowerShell("Get-CimInstance -ClassName Win32_OperatingSystem | Select-Object LastBootUpTime"); - output = output.Replace("LastBootUpTime", string.Empty).Replace("@", string.Empty).Replace("{", string.Empty).Replace("}", string.Empty).Replace("=", string.Empty).Trim(); - runTime = DateTimeUtil.FormatTime((DateTime.Now - output.ParseToDateTime()).TotalMilliseconds.ToString().Split('.')[0].ParseToLong()); - } - } - return runTime; - } -} - -/// -/// 内存信息 -/// -public class MemoryMetrics -{ - [Newtonsoft.Json.JsonIgnore] - [System.Text.Json.Serialization.JsonIgnore] - public double Total { get; set; } - - [Newtonsoft.Json.JsonIgnore] - [System.Text.Json.Serialization.JsonIgnore] - public double Used { get; set; } - - [Newtonsoft.Json.JsonIgnore] - [System.Text.Json.Serialization.JsonIgnore] - public double Free { get; set; } - - /// - /// 已用内存 - /// - public string UsedRam { get; set; } - - /// - /// CPU使用率% - /// - public List CpuRates { get; set; } - - public string CpuRate { get; set; } - - /// - /// 总内存 GB - /// - public string TotalRam { get; set; } - - /// - /// 内存使用率 % - /// - public string RamRate { get; set; } - - /// - /// 空闲内存 - /// - public string FreeRam { get; set; } -} - -/// -/// 磁盘信息 -/// -public class DiskInfo -{ - /// - /// 磁盘名 - /// - public string DiskName { get; set; } - - /// - /// 类型名 - /// - public string TypeName { get; set; } - - /// - /// 总剩余 - /// - public decimal TotalFree { get; set; } - - /// - /// 总量 - /// - public decimal TotalSize { get; set; } - - /// - /// 已使用 - /// - public decimal Used { get; set; } - - /// - /// 可使用 - /// - public decimal AvailableFreeSpace { get; set; } - - /// - /// 使用百分比 - /// - public decimal AvailablePercent { get; set; } -} - -public class MemoryMetricsClient -{ - /// - /// windows系统获取内存信息 - /// - /// - public static MemoryMetrics GetWindowsMetrics() - { - string output = ""; - var metrics = new MemoryMetrics(); - try - { - output = ShellUtil.Cmd("wmic", "OS get FreePhysicalMemory,TotalVisibleMemorySize /Value"); - var lines = output.Trim().Split('\n', (char)StringSplitOptions.RemoveEmptyEntries); - if (lines.Length <= 1) return metrics; - - var freeMemoryParts = lines[0].Split('=', (char)StringSplitOptions.RemoveEmptyEntries); - var totalMemoryParts = lines[1].Split('=', (char)StringSplitOptions.RemoveEmptyEntries); - metrics.Total = Math.Round(double.Parse(totalMemoryParts[1]) / 1024, 0); - metrics.Free = Math.Round(double.Parse(freeMemoryParts[1]) / 1024, 0);//m - } - catch (Exception) - { - output = ShellUtil.PowerShell("Get-CimInstance -ClassName Win32_OperatingSystem | Select-Object FreePhysicalMemory, TotalVisibleMemorySize"); - output = output.Replace("@", string.Empty).Replace("{", string.Empty).Replace("}", string.Empty).Trim(); - var lines = output.Trim().Split(';', (char)StringSplitOptions.RemoveEmptyEntries); - - // 跳过表头与分隔线(通常为前两行) - if (lines.Length >= 2) - { - // 解析并转换为MB(原单位为KB) - metrics.Free = Math.Round(double.Parse(lines[0].Split(new[] { '=' }, StringSplitOptions.RemoveEmptyEntries)[1]) / 1024, 0); - metrics.Total = Math.Round(double.Parse(lines[1].Split(new[] { '=' }, StringSplitOptions.RemoveEmptyEntries)[1]) / 1024, 0); - } - } - metrics.Used = metrics.Total - metrics.Free; - - return metrics; - } - - /// - /// Unix系统获取 - /// - /// - public static MemoryMetrics GetUnixMetrics() - { - string output = ShellUtil.Bash("awk '/MemTotal/ {total=$2} /MemAvailable/ {available=$2} END {print total,available}' /proc/meminfo"); - var metrics = new MemoryMetrics(); - var memory = output.Split(' ', (char)StringSplitOptions.RemoveEmptyEntries); - if (memory.Length != 2) return metrics; - - metrics.Total = double.Parse(memory[0]) / 1024; - metrics.Free = double.Parse(memory[1]) / 1024; - metrics.Used = metrics.Total - metrics.Free; - return metrics; - } - - /// - /// macOS系统获取 - /// - /// - public static MemoryMetrics GetMacOSMetrics() - { - var metrics = new MemoryMetrics(); - //物理内存大小 - var total = ShellUtil.Bash("sysctl -n hw.memsize | awk '{printf \"%.2f\", $1/1024/1024}'"); - metrics.Total = float.Parse(total.Replace("%", string.Empty)); - //TODO:占用内存,检查效率 - var free = ShellUtil.Bash("top -l 1 -s 0 | awk '/PhysMem/ {print $6+$8}'"); - metrics.Free = float.Parse(free); - metrics.Used = metrics.Total - metrics.Free; - return metrics; - } -} - -public class ShellUtil -{ - /// - /// linux 系统命令 - /// - /// - /// - public static string Bash(string command) - { - var escapedArgs = command.Replace("\"", "\\\""); - var process = new Process() - { - StartInfo = new ProcessStartInfo - { - FileName = "/bin/bash", - Arguments = $"-c \"{escapedArgs}\"", - RedirectStandardOutput = true, - UseShellExecute = false, - CreateNoWindow = true, - } - }; - process.Start(); - string result = process.StandardOutput.ReadToEnd(); - process.WaitForExit(); - process.Dispose(); - return result; - } - - /// - /// windows CMD 系统命令 - /// - /// - /// - /// - public static string Cmd(string fileName, string args) - { - var info = new ProcessStartInfo - { - FileName = fileName, - Arguments = args, - RedirectStandardOutput = true - }; - - var output = string.Empty; - using (var process = Process.Start(info)) - { - output = process.StandardOutput.ReadToEnd(); - } - return output; - } - - /// - /// Windows POWERSHELL 系统命令 - /// - /// - /// - public static string PowerShell(string script) - { - using var PowerShellInstance = System.Management.Automation.PowerShell.Create(); - PowerShellInstance.AddScript(script); - var PSOutput = PowerShellInstance.Invoke(); - - var output = new StringBuilder(); - foreach (var outputItem in PSOutput) - { - output.AppendLine(outputItem.ToString()); - } - return output.ToString(); - } -} - -public class ShellHelper -{ - /// - /// Linux 系统命令 - /// - /// - /// - public static string Bash(string command) - { - var escapedArgs = command.Replace("\"", "\\\""); - var process = new Process() - { - StartInfo = new ProcessStartInfo - { - FileName = "/bin/bash", - Arguments = $"-c \"{escapedArgs}\"", - RedirectStandardOutput = true, - UseShellExecute = false, - CreateNoWindow = true, - } - }; - process.Start(); - string result = process.StandardOutput.ReadToEnd(); - process.WaitForExit(); - process.Dispose(); - return result; - } - - /// - /// Windows CMD 系统命令 - /// - /// - /// - /// - public static string Cmd(string fileName, string args) - { - var info = new ProcessStartInfo - { - FileName = fileName, - Arguments = args, - RedirectStandardOutput = true - }; - - var output = string.Empty; - using (var process = Process.Start(info)) - { - output = process.StandardOutput.ReadToEnd(); - } - return output; - } - - /// - /// Windows POWERSHELL 系统命令 - /// - /// - /// - public static string PowerShell(string script) - { - using var PowerShellInstance = System.Management.Automation.PowerShell.Create(); - PowerShellInstance.AddScript(script); - var PSOutput = PowerShellInstance.Invoke(); - - var output = new StringBuilder(); - foreach (var outputItem in PSOutput) - { - output.AppendLine(outputItem.BaseObject.ToString()); - } - return output.ToString(); - } -} \ No newline at end of file +//// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 +//// +//// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 +//// +//// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + +//namespace Admin.NET.Core; + +//public static class ComputerUtil +//{ +// /// +// /// 内存信息 +// /// +// /// +// public static MemoryMetrics GetComputerInfo() +// { +// MemoryMetrics memoryMetrics; +// if (IsMacOS()) +// { +// memoryMetrics = MemoryMetricsClient.GetMacOSMetrics(); +// } +// else if (IsUnix()) +// { +// memoryMetrics = MemoryMetricsClient.GetUnixMetrics(); +// } +// else +// { +// memoryMetrics = MemoryMetricsClient.GetWindowsMetrics(); +// } +// memoryMetrics.FreeRam = Math.Round(memoryMetrics.Free / 1024, 2) + "GB"; +// memoryMetrics.UsedRam = Math.Round(memoryMetrics.Used / 1024, 2) + "GB"; +// memoryMetrics.TotalRam = Math.Round(memoryMetrics.Total / 1024, 2) + "GB"; +// memoryMetrics.RamRate = Math.Ceiling(100 * memoryMetrics.Used / memoryMetrics.Total) + "%"; +// var cpuRates = GetCPURates(); +// if (cpuRates != null) +// { +// memoryMetrics.CpuRates = cpuRates.Select(u => Math.Ceiling(u.ParseToDouble()) + "%").ToList(); +// } +// memoryMetrics.CpuRate = memoryMetrics.CpuRates[0]; +// return memoryMetrics; +// } + +// /// +// /// 获取正确的操作系统版本(Linux获取发行版本) +// /// +// /// +// public static String GetOSInfo() +// { +// string operation = string.Empty; +// if (IsMacOS()) +// { +// var output = ShellUtil.Bash("sw_vers | awk 'NR<=2{printf \"%s \", $NF}'"); +// if (output != null) +// { +// operation = output.Replace("%", string.Empty); +// } +// } +// else if (IsUnix()) +// { +// var output = ShellUtil.Bash("awk -F= '/^VERSION_ID/ {print $2}' /etc/os-release | tr -d '\"'"); +// operation = output ?? string.Empty; +// } +// else +// { +// operation = RuntimeInformation.OSDescription; +// } +// return operation; +// } + +// /// +// /// 磁盘信息 +// /// +// /// +// public static List GetDiskInfos() +// { +// var diskInfos = new List(); +// if (IsMacOS()) +// { +// var output = ShellUtil.Bash(@"df -m | awk '/^\/dev\/disk/ {print $1,$2,$3,$4,$5}'"); +// var disks = output.Split('\n', StringSplitOptions.RemoveEmptyEntries); +// if (disks.Length < 1) return diskInfos; +// foreach (var item in disks) +// { +// var disk = item.Split(' ', (char)StringSplitOptions.RemoveEmptyEntries); +// if (disk.Length < 5) continue; + +// var diskInfo = new DiskInfo() +// { +// DiskName = disk[0], +// TypeName = ShellUtil.Bash("diskutil info " + disk[0] + " | awk '/File System Personality/ {print $4}'").Replace("\n", string.Empty), +// TotalSize = Math.Round(long.Parse(disk[1]) / 1024.0m, 2, MidpointRounding.AwayFromZero), +// Used = Math.Round(long.Parse(disk[2]) / 1024.0m, 2, MidpointRounding.AwayFromZero), +// AvailableFreeSpace = Math.Round(long.Parse(disk[3]) / 1024.0m, 2, MidpointRounding.AwayFromZero), +// AvailablePercent = decimal.Parse(disk[4].Replace("%", "")) +// }; +// diskInfos.Add(diskInfo); +// } +// } +// else if (IsUnix()) +// { +// var output = ShellUtil.Bash(@"df -mT | awk '/^\/dev\/(sd|vd|xvd|nvme|sda|vda|mapper)/ {print $1,$2,$3,$4,$5,$6}'"); +// var disks = output.Split('\n', StringSplitOptions.RemoveEmptyEntries); +// if (disks.Length < 1) return diskInfos; + +// //var rootDisk = disks[1].Split(' ', (char)StringSplitOptions.RemoveEmptyEntries); +// //if (rootDisk == null || rootDisk.Length < 1) +// // return diskInfos; + +// foreach (var item in disks) +// { +// var disk = item.Split(' ', (char)StringSplitOptions.RemoveEmptyEntries); +// if (disk.Length < 6) continue; + +// var diskInfo = new DiskInfo() +// { +// DiskName = disk[0], +// TypeName = disk[1], +// TotalSize = Math.Round(long.Parse(disk[2]) / 1024.0m, 2, MidpointRounding.AwayFromZero), +// Used = Math.Round(long.Parse(disk[3]) / 1024.0m, 2, MidpointRounding.AwayFromZero), +// AvailableFreeSpace = Math.Round(long.Parse(disk[4]) / 1024.0m, 2, MidpointRounding.AwayFromZero), +// AvailablePercent = decimal.Parse(disk[5].Replace("%", "")) +// }; +// diskInfos.Add(diskInfo); +// } +// } +// else +// { +// var driveList = DriveInfo.GetDrives().Where(u => u.IsReady); +// foreach (var item in driveList) +// { +// if (item.DriveType == DriveType.CDRom) continue; +// var diskInfo = new DiskInfo() +// { +// DiskName = item.Name, +// TypeName = item.DriveType.ToString(), +// TotalSize = Math.Round(item.TotalSize / 1024 / 1024 / 1024.0m, 2, MidpointRounding.AwayFromZero), +// AvailableFreeSpace = Math.Round(item.AvailableFreeSpace / 1024 / 1024 / 1024.0m, 2, MidpointRounding.AwayFromZero), +// }; +// diskInfo.Used = diskInfo.TotalSize - diskInfo.AvailableFreeSpace; +// diskInfo.AvailablePercent = decimal.Ceiling(diskInfo.Used / (decimal)diskInfo.TotalSize * 100); +// diskInfos.Add(diskInfo); +// } +// } +// return diskInfos; +// } + +// /// +// /// 获取外网IP地址 +// /// +// /// +// public static string GetIpFromOnline() +// { +// try +// { +// var url = "https://4.ipw.cn"; +// var httpRemoteService = App.GetRequiredService(); +// var ip = httpRemoteService.GetAsString(url); +// var (ipLocation, _, _) = CommonUtil.GetIpAddress(ip); +// return ip + " " + ipLocation; +// } +// catch +// { +// return "unknow"; +// } +// } + +// public static bool IsUnix() +// { +// return RuntimeInformation.IsOSPlatform(OSPlatform.Linux); +// } + +// public static bool IsMacOS() +// { +// return RuntimeInformation.IsOSPlatform(OSPlatform.OSX); +// } + +// //public static List GetCPURates() +// //{ +// // var cpuRates = new List(); +// // string output = ""; +// // if (IsMacOS()) +// // { +// // output = ShellUtil.Bash("top -l 1 | grep \"CPU usage\" | awk '{print $3 + $5}'"); +// // cpuRates.Add(output.Trim()); +// // } +// // else if (IsUnix()) +// // { +// // output = ShellUtil.Bash("awk '{u=$2+$4; t=$2+$4+$5; if (NR==1){u1=u; t1=t;} else print ($2+$4-u1) * 100 / (t-t1); }' <(grep 'cpu ' /proc/stat) <(sleep 1;grep 'cpu ' /proc/stat)"); +// // cpuRates.Add(output.Trim()); +// // } +// // else +// // { +// // try +// // { +// // output = ShellUtil.Cmd("wmic", "cpu get LoadPercentage"); +// // } +// // catch (Exception) +// // { +// // output = ShellUtil.PowerShell("Get-CimInstance -ClassName Win32_Processor | Select-Object LoadPercentage"); +// // output = output.Replace("@", string.Empty).Replace("{", string.Empty).Replace("}", string.Empty).Replace("=", string.Empty).Trim(); +// // } +// // cpuRates.AddRange(output.Replace("LoadPercentage", string.Empty).Trim().Split("\r\r\n")); +// // } +// // return cpuRates; +// //} + +// /// +// /// 获取系统运行时间 +// /// +// /// +// public static string GetRunTime() +// { +// string runTime = string.Empty; +// string output = ""; +// if (IsMacOS()) +// { +// // macOS 获取系统启动时间: +// // sysctl -n kern.boottime | awk '{print $4}' | tr -d ',' +// // 返回:1705379131 +// // 使用date格式化即可 +// output = ShellUtil.Bash("date -r $(sysctl -n kern.boottime | awk '{print $4}' | tr -d ',') +\"%Y-%m-%d %H:%M:%S\"").Trim(); +// runTime = DateTimeUtil.FormatTime((DateTime.Now - output.ParseToDateTime()).TotalMilliseconds.ToString().Split('.')[0].ParseToLong()); +// } +// else if (IsUnix()) +// { +// output = ShellUtil.Bash("date -d \"$(awk -F. '{print $1}' /proc/uptime) second ago\" +\"%Y-%m-%d %H:%M:%S\"").Trim(); +// runTime = DateTimeUtil.FormatTime((DateTime.Now - output.ParseToDateTime()).TotalMilliseconds.ToString().Split('.')[0].ParseToLong()); +// } +// else +// { +// try +// { +// output = ShellUtil.Cmd("wmic", "OS get LastBootUpTime/Value"); +// string[] outputArr = output.Split('=', (char)StringSplitOptions.RemoveEmptyEntries); +// if (outputArr.Length == 2) +// runTime = DateTimeUtil.FormatTime((DateTime.Now - outputArr[1].Split('.')[0].ParseToDateTime()).TotalMilliseconds.ToString().Split('.')[0].ParseToLong()); +// } +// catch (Exception) +// { +// output = ShellUtil.PowerShell("Get-CimInstance -ClassName Win32_OperatingSystem | Select-Object LastBootUpTime"); +// output = output.Replace("LastBootUpTime", string.Empty).Replace("@", string.Empty).Replace("{", string.Empty).Replace("}", string.Empty).Replace("=", string.Empty).Trim(); +// runTime = DateTimeUtil.FormatTime((DateTime.Now - output.ParseToDateTime()).TotalMilliseconds.ToString().Split('.')[0].ParseToLong()); +// } +// } +// return runTime; +// } +//} + +///// +///// 内存信息 +///// +//public class MemoryMetrics +//{ +// [Newtonsoft.Json.JsonIgnore] +// [System.Text.Json.Serialization.JsonIgnore] +// public double Total { get; set; } + +// [Newtonsoft.Json.JsonIgnore] +// [System.Text.Json.Serialization.JsonIgnore] +// public double Used { get; set; } + +// [Newtonsoft.Json.JsonIgnore] +// [System.Text.Json.Serialization.JsonIgnore] +// public double Free { get; set; } + +// /// +// /// 已用内存 +// /// +// public string UsedRam { get; set; } + +// /// +// /// CPU使用率% +// /// +// public List CpuRates { get; set; } + +// public string CpuRate { get; set; } + +// /// +// /// 总内存 GB +// /// +// public string TotalRam { get; set; } + +// /// +// /// 内存使用率 % +// /// +// public string RamRate { get; set; } + +// /// +// /// 空闲内存 +// /// +// public string FreeRam { get; set; } +//} + +///// +///// 磁盘信息 +///// +//public class DiskInfo +//{ +// /// +// /// 磁盘名 +// /// +// public string DiskName { get; set; } + +// /// +// /// 类型名 +// /// +// public string TypeName { get; set; } + +// /// +// /// 总剩余 +// /// +// public decimal TotalFree { get; set; } + +// /// +// /// 总量 +// /// +// public decimal TotalSize { get; set; } + +// /// +// /// 已使用 +// /// +// public decimal Used { get; set; } + +// /// +// /// 可使用 +// /// +// public decimal AvailableFreeSpace { get; set; } + +// /// +// /// 使用百分比 +// /// +// public decimal AvailablePercent { get; set; } +//} + +//public class MemoryMetricsClient +//{ +// /// +// /// windows系统获取内存信息 +// /// +// /// +// public static MemoryMetrics GetWindowsMetrics() +// { +// string output = ""; +// var metrics = new MemoryMetrics(); +// try +// { +// output = ShellUtil.Cmd("wmic", "OS get FreePhysicalMemory,TotalVisibleMemorySize /Value"); +// var lines = output.Trim().Split('\n', (char)StringSplitOptions.RemoveEmptyEntries); +// if (lines.Length <= 1) return metrics; + +// var freeMemoryParts = lines[0].Split('=', (char)StringSplitOptions.RemoveEmptyEntries); +// var totalMemoryParts = lines[1].Split('=', (char)StringSplitOptions.RemoveEmptyEntries); +// metrics.Total = Math.Round(double.Parse(totalMemoryParts[1]) / 1024, 0); +// metrics.Free = Math.Round(double.Parse(freeMemoryParts[1]) / 1024, 0);//m +// } +// catch (Exception) +// { +// output = ShellUtil.PowerShell("Get-CimInstance -ClassName Win32_OperatingSystem | Select-Object FreePhysicalMemory, TotalVisibleMemorySize"); +// output = output.Replace("@", string.Empty).Replace("{", string.Empty).Replace("}", string.Empty).Trim(); +// var lines = output.Trim().Split(';', (char)StringSplitOptions.RemoveEmptyEntries); + +// // 跳过表头与分隔线(通常为前两行) +// if (lines.Length >= 2) +// { +// // 解析并转换为MB(原单位为KB) +// metrics.Free = Math.Round(double.Parse(lines[0].Split(new[] { '=' }, StringSplitOptions.RemoveEmptyEntries)[1]) / 1024, 0); +// metrics.Total = Math.Round(double.Parse(lines[1].Split(new[] { '=' }, StringSplitOptions.RemoveEmptyEntries)[1]) / 1024, 0); +// } +// } +// metrics.Used = metrics.Total - metrics.Free; + +// return metrics; +// } + +// /// +// /// Unix系统获取 +// /// +// /// +// public static MemoryMetrics GetUnixMetrics() +// { +// string output = ShellUtil.Bash("awk '/MemTotal/ {total=$2} /MemAvailable/ {available=$2} END {print total,available}' /proc/meminfo"); +// var metrics = new MemoryMetrics(); +// var memory = output.Split(' ', (char)StringSplitOptions.RemoveEmptyEntries); +// if (memory.Length != 2) return metrics; + +// metrics.Total = double.Parse(memory[0]) / 1024; +// metrics.Free = double.Parse(memory[1]) / 1024; +// metrics.Used = metrics.Total - metrics.Free; +// return metrics; +// } + +// /// +// /// macOS系统获取 +// /// +// /// +// public static MemoryMetrics GetMacOSMetrics() +// { +// var metrics = new MemoryMetrics(); +// //物理内存大小 +// var total = ShellUtil.Bash("sysctl -n hw.memsize | awk '{printf \"%.2f\", $1/1024/1024}'"); +// metrics.Total = float.Parse(total.Replace("%", string.Empty)); +// //TODO:占用内存,检查效率 +// var free = ShellUtil.Bash("top -l 1 -s 0 | awk '/PhysMem/ {print $6+$8}'"); +// metrics.Free = float.Parse(free); +// metrics.Used = metrics.Total - metrics.Free; +// return metrics; +// } +//} + +//public class ShellUtil +//{ +// /// +// /// linux 系统命令 +// /// +// /// +// /// +// public static string Bash(string command) +// { +// var escapedArgs = command.Replace("\"", "\\\""); +// var process = new Process() +// { +// StartInfo = new ProcessStartInfo +// { +// FileName = "/bin/bash", +// Arguments = $"-c \"{escapedArgs}\"", +// RedirectStandardOutput = true, +// UseShellExecute = false, +// CreateNoWindow = true, +// } +// }; +// process.Start(); +// string result = process.StandardOutput.ReadToEnd(); +// process.WaitForExit(); +// process.Dispose(); +// return result; +// } + +// /// +// /// windows CMD 系统命令 +// /// +// /// +// /// +// /// +// public static string Cmd(string fileName, string args) +// { +// var info = new ProcessStartInfo +// { +// FileName = fileName, +// Arguments = args, +// RedirectStandardOutput = true +// }; + +// var output = string.Empty; +// using (var process = Process.Start(info)) +// { +// output = process.StandardOutput.ReadToEnd(); +// } +// return output; +// } + +// ///// +// ///// Windows POWERSHELL 系统命令 +// ///// +// ///// +// ///// +// //public static string PowerShell(string script) +// //{ +// // using var PowerShellInstance = System.Management.Automation.PowerShell.Create(); +// // PowerShellInstance.AddScript(script); +// // var PSOutput = PowerShellInstance.Invoke(); + +// // var output = new StringBuilder(); +// // foreach (var outputItem in PSOutput) +// // { +// // output.AppendLine(outputItem.ToString()); +// // } +// // return output.ToString(); +// //} +//} + +//public class ShellHelper +//{ +// /// +// /// Linux 系统命令 +// /// +// /// +// /// +// public static string Bash(string command) +// { +// var escapedArgs = command.Replace("\"", "\\\""); +// var process = new Process() +// { +// StartInfo = new ProcessStartInfo +// { +// FileName = "/bin/bash", +// Arguments = $"-c \"{escapedArgs}\"", +// RedirectStandardOutput = true, +// UseShellExecute = false, +// CreateNoWindow = true, +// } +// }; +// process.Start(); +// string result = process.StandardOutput.ReadToEnd(); +// process.WaitForExit(); +// process.Dispose(); +// return result; +// } + +// /// +// /// Windows CMD 系统命令 +// /// +// /// +// /// +// /// +// public static string Cmd(string fileName, string args) +// { +// var info = new ProcessStartInfo +// { +// FileName = fileName, +// Arguments = args, +// RedirectStandardOutput = true +// }; + +// var output = string.Empty; +// using (var process = Process.Start(info)) +// { +// output = process.StandardOutput.ReadToEnd(); +// } +// return output; +// } + +// /// +// /// Windows POWERSHELL 系统命令 +// /// +// /// +// /// +// public static string PowerShell(string script) +// { +// using var PowerShellInstance = System.Management.Automation.PowerShell.Create(); +// PowerShellInstance.AddScript(script); +// var PSOutput = PowerShellInstance.Invoke(); + +// var output = new StringBuilder(); +// foreach (var outputItem in PSOutput) +// { +// output.AppendLine(outputItem.BaseObject.ToString()); +// } +// return output.ToString(); +// } +//} \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Test/Admin.NET.Test.csproj b/Admin.NET/Admin.NET.Test/Admin.NET.Test.csproj index 40ffc802e..3acd24e00 100644 --- a/Admin.NET/Admin.NET.Test/Admin.NET.Test.csproj +++ b/Admin.NET/Admin.NET.Test/Admin.NET.Test.csproj @@ -1,6 +1,6 @@ - net8.0;net9.0 + net9.0 1701;1702;1591;8632 enable diff --git a/Admin.NET/Admin.NET.Web.Core/Admin.NET.Web.Core.csproj b/Admin.NET/Admin.NET.Web.Core/Admin.NET.Web.Core.csproj index 2c36180c0..5ccf13874 100644 --- a/Admin.NET/Admin.NET.Web.Core/Admin.NET.Web.Core.csproj +++ b/Admin.NET/Admin.NET.Web.Core/Admin.NET.Web.Core.csproj @@ -1,7 +1,7 @@ - net8.0;net9.0 + net9.0 1701;1702;1591 True diff --git a/Admin.NET/Admin.NET.Web.Entry/Admin.NET.Web.Entry.csproj b/Admin.NET/Admin.NET.Web.Entry/Admin.NET.Web.Entry.csproj index ab3c696be..517ec3172 100644 --- a/Admin.NET/Admin.NET.Web.Entry/Admin.NET.Web.Entry.csproj +++ b/Admin.NET/Admin.NET.Web.Entry/Admin.NET.Web.Entry.csproj @@ -1,7 +1,7 @@  - net8.0;net9.0 + net9.0 enable zh-Hans true diff --git a/Admin.NET/Plugins/Admin.NET.Plugin.ApprovalFlow/Admin.NET.Plugin.ApprovalFlow.csproj b/Admin.NET/Plugins/Admin.NET.Plugin.ApprovalFlow/Admin.NET.Plugin.ApprovalFlow.csproj index 64e9149c8..2c3ab9a12 100644 --- a/Admin.NET/Plugins/Admin.NET.Plugin.ApprovalFlow/Admin.NET.Plugin.ApprovalFlow.csproj +++ b/Admin.NET/Plugins/Admin.NET.Plugin.ApprovalFlow/Admin.NET.Plugin.ApprovalFlow.csproj @@ -1,7 +1,7 @@  - net8.0;net9.0 + net9.0 1701;1702;1591;8632 enable disable diff --git a/Admin.NET/Plugins/Admin.NET.Plugin.DingTalk/Admin.NET.Plugin.DingTalk.csproj b/Admin.NET/Plugins/Admin.NET.Plugin.DingTalk/Admin.NET.Plugin.DingTalk.csproj index ff2c7bab7..4dcd3027a 100644 --- a/Admin.NET/Plugins/Admin.NET.Plugin.DingTalk/Admin.NET.Plugin.DingTalk.csproj +++ b/Admin.NET/Plugins/Admin.NET.Plugin.DingTalk/Admin.NET.Plugin.DingTalk.csproj @@ -1,7 +1,7 @@  - net8.0;net9.0 + net9.0 1701;1702;1591;8632 enable disable diff --git a/Admin.NET/Plugins/Admin.NET.Plugin.GoView/Admin.NET.Plugin.GoView.csproj b/Admin.NET/Plugins/Admin.NET.Plugin.GoView/Admin.NET.Plugin.GoView.csproj index ff2c7bab7..4dcd3027a 100644 --- a/Admin.NET/Plugins/Admin.NET.Plugin.GoView/Admin.NET.Plugin.GoView.csproj +++ b/Admin.NET/Plugins/Admin.NET.Plugin.GoView/Admin.NET.Plugin.GoView.csproj @@ -1,7 +1,7 @@  - net8.0;net9.0 + net9.0 1701;1702;1591;8632 enable disable diff --git a/Admin.NET/Plugins/Admin.NET.Plugin.K3Cloud/Admin.NET.Plugin.K3Cloud.csproj b/Admin.NET/Plugins/Admin.NET.Plugin.K3Cloud/Admin.NET.Plugin.K3Cloud.csproj index 238c651c3..d19bd97ff 100644 --- a/Admin.NET/Plugins/Admin.NET.Plugin.K3Cloud/Admin.NET.Plugin.K3Cloud.csproj +++ b/Admin.NET/Plugins/Admin.NET.Plugin.K3Cloud/Admin.NET.Plugin.K3Cloud.csproj @@ -1,7 +1,7 @@ - net8.0;net9.0 + net9.0 1701;1702;1591;8632 enable disable diff --git a/Admin.NET/Plugins/Admin.NET.Plugin.ReZero/Admin.NET.Plugin.ReZero.csproj b/Admin.NET/Plugins/Admin.NET.Plugin.ReZero/Admin.NET.Plugin.ReZero.csproj index 068461151..8a667497e 100644 --- a/Admin.NET/Plugins/Admin.NET.Plugin.ReZero/Admin.NET.Plugin.ReZero.csproj +++ b/Admin.NET/Plugins/Admin.NET.Plugin.ReZero/Admin.NET.Plugin.ReZero.csproj @@ -1,7 +1,7 @@ - net8.0;net9.0 + net9.0 1701;1702;1591;8632 enable disable diff --git a/Admin.NET/Plugins/Admin.NET.Plugin.WorkWeixin/Admin.NET.Plugin.WorkWeixin.csproj b/Admin.NET/Plugins/Admin.NET.Plugin.WorkWeixin/Admin.NET.Plugin.WorkWeixin.csproj index ff2c7bab7..4dcd3027a 100644 --- a/Admin.NET/Plugins/Admin.NET.Plugin.WorkWeixin/Admin.NET.Plugin.WorkWeixin.csproj +++ b/Admin.NET/Plugins/Admin.NET.Plugin.WorkWeixin/Admin.NET.Plugin.WorkWeixin.csproj @@ -1,7 +1,7 @@  - net8.0;net9.0 + net9.0 1701;1702;1591;8632 enable disable diff --git a/Web/package.json b/Web/package.json index c01f9f4ea..a569e0c80 100644 --- a/Web/package.json +++ b/Web/package.json @@ -7,7 +7,7 @@ "author": "zuohuaijun", "license": "MIT", "scripts": { - "dev": "vite", + "dev": "vite dev", "build": "node --max-old-space-size=8192 ./node_modules/vite/bin/vite build", "lint-fix": "eslint --fix src/", "format": "prettier --write .", @@ -126,7 +126,7 @@ "json-editor-vue", "vue-demi" ], - "overrides": { + "overrides": { "rollup": "4.43.0" } }, @@ -149,4 +149,4 @@ "vue-next-admin", "next-admin" ] -} \ No newline at end of file +} diff --git a/Web/src/api-services/apis/sys-server-api.ts b/Web/src/api-services/apis/sys-server-api.ts index 9a3953793..eb5912725 100644 --- a/Web/src/api-services/apis/sys-server-api.ts +++ b/Web/src/api-services/apis/sys-server-api.ts @@ -17,7 +17,8 @@ import { Configuration } from '../configuration'; // Some imports not used depending on template conditions // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; -import { AdminResultObject } from '../models'; +import { AdminResultListNuGetPackage } from '../models'; +import { AdminResultSystemInfo } from '../models'; /** * SysServerApi - axios parameter creator * @export @@ -26,19 +27,19 @@ export const SysServerApiAxiosParamCreator = function (configuration?: Configura return { /** * - * @summary 获取框架主要程序集 🔖 + * @summary 获取框架主要程序集 * @param {*} [options] Override http request option. * @throws {RequiredError} */ - apiSysServerAssemblyListGet: async (options: AxiosRequestConfig = {}): Promise => { - const localVarPath = `/api/sysServer/assemblyList`; + apiSysServerNuGetPackagesInfoPost: async (options: AxiosRequestConfig = {}): Promise => { + const localVarPath = `/api/sysServer/nuGetPackagesInfo`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } - const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options}; + const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; @@ -69,105 +70,19 @@ export const SysServerApiAxiosParamCreator = function (configuration?: Configura }, /** * - * @summary 获取服务器配置信息 🔖 + * @summary 获取服务器硬件信息 * @param {*} [options] Override http request option. * @throws {RequiredError} */ - apiSysServerServerBaseGet: async (options: AxiosRequestConfig = {}): Promise => { - const localVarPath = `/api/sysServer/serverBase`; + apiSysServerSystemInfoPost: async (options: AxiosRequestConfig = {}): Promise => { + const localVarPath = `/api/sysServer/systemInfo`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } - const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication Bearer required - // http bearer authentication required - if (configuration && configuration.accessToken) { - const accessToken = typeof configuration.accessToken === 'function' - ? await configuration.accessToken() - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + accessToken; - } - - const query = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - query.set(key, localVarQueryParameter[key]); - } - for (const key in options.params) { - query.set(key, options.params[key]); - } - localVarUrlObj.search = (new URLSearchParams(query)).toString(); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, - options: localVarRequestOptions, - }; - }, - /** - * - * @summary 获取服务器磁盘信息 🔖 - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - apiSysServerServerDiskGet: async (options: AxiosRequestConfig = {}): Promise => { - const localVarPath = `/api/sysServer/serverDisk`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication Bearer required - // http bearer authentication required - if (configuration && configuration.accessToken) { - const accessToken = typeof configuration.accessToken === 'function' - ? await configuration.accessToken() - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + accessToken; - } - - const query = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - query.set(key, localVarQueryParameter[key]); - } - for (const key in options.params) { - query.set(key, options.params[key]); - } - localVarUrlObj.search = (new URLSearchParams(query)).toString(); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, - options: localVarRequestOptions, - }; - }, - /** - * - * @summary 获取服务器使用信息 🔖 - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - apiSysServerServerUsedGet: async (options: AxiosRequestConfig = {}): Promise => { - const localVarPath = `/api/sysServer/serverUsed`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options}; + const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; @@ -207,38 +122,12 @@ export const SysServerApiFp = function(configuration?: Configuration) { return { /** * - * @summary 获取框架主要程序集 🔖 - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async apiSysServerAssemblyListGet(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { - const localVarAxiosArgs = await SysServerApiAxiosParamCreator(configuration).apiSysServerAssemblyListGet(options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; - }, - /** - * - * @summary 获取服务器配置信息 🔖 - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async apiSysServerServerBaseGet(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { - const localVarAxiosArgs = await SysServerApiAxiosParamCreator(configuration).apiSysServerServerBaseGet(options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; - }, - /** - * - * @summary 获取服务器磁盘信息 🔖 + * @summary 获取框架主要程序集 * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async apiSysServerServerDiskGet(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { - const localVarAxiosArgs = await SysServerApiAxiosParamCreator(configuration).apiSysServerServerDiskGet(options); + async apiSysServerNuGetPackagesInfoPost(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await SysServerApiAxiosParamCreator(configuration).apiSysServerNuGetPackagesInfoPost(options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); @@ -246,12 +135,12 @@ export const SysServerApiFp = function(configuration?: Configuration) { }, /** * - * @summary 获取服务器使用信息 🔖 + * @summary 获取服务器硬件信息 * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async apiSysServerServerUsedGet(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { - const localVarAxiosArgs = await SysServerApiAxiosParamCreator(configuration).apiSysServerServerUsedGet(options); + async apiSysServerSystemInfoPost(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await SysServerApiAxiosParamCreator(configuration).apiSysServerSystemInfoPost(options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); @@ -268,39 +157,21 @@ export const SysServerApiFactory = function (configuration?: Configuration, base return { /** * - * @summary 获取框架主要程序集 🔖 - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async apiSysServerAssemblyListGet(options?: AxiosRequestConfig): Promise> { - return SysServerApiFp(configuration).apiSysServerAssemblyListGet(options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary 获取服务器配置信息 🔖 + * @summary 获取框架主要程序集 * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async apiSysServerServerBaseGet(options?: AxiosRequestConfig): Promise> { - return SysServerApiFp(configuration).apiSysServerServerBaseGet(options).then((request) => request(axios, basePath)); + async apiSysServerNuGetPackagesInfoPost(options?: AxiosRequestConfig): Promise> { + return SysServerApiFp(configuration).apiSysServerNuGetPackagesInfoPost(options).then((request) => request(axios, basePath)); }, /** * - * @summary 获取服务器磁盘信息 🔖 + * @summary 获取服务器硬件信息 * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async apiSysServerServerDiskGet(options?: AxiosRequestConfig): Promise> { - return SysServerApiFp(configuration).apiSysServerServerDiskGet(options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary 获取服务器使用信息 🔖 - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async apiSysServerServerUsedGet(options?: AxiosRequestConfig): Promise> { - return SysServerApiFp(configuration).apiSysServerServerUsedGet(options).then((request) => request(axios, basePath)); + async apiSysServerSystemInfoPost(options?: AxiosRequestConfig): Promise> { + return SysServerApiFp(configuration).apiSysServerSystemInfoPost(options).then((request) => request(axios, basePath)); }, }; }; @@ -314,42 +185,22 @@ export const SysServerApiFactory = function (configuration?: Configuration, base export class SysServerApi extends BaseAPI { /** * - * @summary 获取框架主要程序集 🔖 - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SysServerApi - */ - public async apiSysServerAssemblyListGet(options?: AxiosRequestConfig) : Promise> { - return SysServerApiFp(this.configuration).apiSysServerAssemblyListGet(options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary 获取服务器配置信息 🔖 - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SysServerApi - */ - public async apiSysServerServerBaseGet(options?: AxiosRequestConfig) : Promise> { - return SysServerApiFp(this.configuration).apiSysServerServerBaseGet(options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary 获取服务器磁盘信息 🔖 + * @summary 获取框架主要程序集 * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SysServerApi */ - public async apiSysServerServerDiskGet(options?: AxiosRequestConfig) : Promise> { - return SysServerApiFp(this.configuration).apiSysServerServerDiskGet(options).then((request) => request(this.axios, this.basePath)); + public async apiSysServerNuGetPackagesInfoPost(options?: AxiosRequestConfig) : Promise> { + return SysServerApiFp(this.configuration).apiSysServerNuGetPackagesInfoPost(options).then((request) => request(this.axios, this.basePath)); } /** * - * @summary 获取服务器使用信息 🔖 + * @summary 获取服务器硬件信息 * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SysServerApi */ - public async apiSysServerServerUsedGet(options?: AxiosRequestConfig) : Promise> { - return SysServerApiFp(this.configuration).apiSysServerServerUsedGet(options).then((request) => request(this.axios, this.basePath)); + public async apiSysServerSystemInfoPost(options?: AxiosRequestConfig) : Promise> { + return SysServerApiFp(this.configuration).apiSysServerSystemInfoPost(options).then((request) => request(this.axios, this.basePath)); } } diff --git a/Web/src/api-services/models/add-user-input.ts b/Web/src/api-services/models/add-user-input.ts index 0b434628f..88aa847e8 100644 --- a/Web/src/api-services/models/add-user-input.ts +++ b/Web/src/api-services/models/add-user-input.ts @@ -392,7 +392,7 @@ export interface AddUserInput { signature?: string | null; /** - * 语言代码(如 zh-CN) + * 语言代码(如 zh_CN) * * @type {string} * @memberof AddUserInput diff --git a/Web/src/api-services/models/admin-result-list-nu-get-package.ts b/Web/src/api-services/models/admin-result-list-nu-get-package.ts new file mode 100644 index 000000000..9feb19bdd --- /dev/null +++ b/Web/src/api-services/models/admin-result-list-nu-get-package.ts @@ -0,0 +1,71 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Admin.NET 通用权限开发平台 + * 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。
👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +import { NuGetPackage } from './nu-get-package'; + /** + * 全局返回结果 + * + * @export + * @interface AdminResultListNuGetPackage + */ +export interface AdminResultListNuGetPackage { + + /** + * 状态码 + * + * @type {number} + * @memberof AdminResultListNuGetPackage + */ + code?: number; + + /** + * 类型success、warning、error + * + * @type {string} + * @memberof AdminResultListNuGetPackage + */ + type?: string | null; + + /** + * 错误信息 + * + * @type {string} + * @memberof AdminResultListNuGetPackage + */ + message?: string | null; + + /** + * 数据 + * + * @type {Array} + * @memberof AdminResultListNuGetPackage + */ + result?: Array | null; + + /** + * 附加数据 + * + * @type {any} + * @memberof AdminResultListNuGetPackage + */ + extras?: any | null; + + /** + * 时间 + * + * @type {Date} + * @memberof AdminResultListNuGetPackage + */ + time?: Date; +} diff --git a/Web/src/api-services/models/admin-result-system-info.ts b/Web/src/api-services/models/admin-result-system-info.ts new file mode 100644 index 000000000..2552c2b98 --- /dev/null +++ b/Web/src/api-services/models/admin-result-system-info.ts @@ -0,0 +1,69 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Admin.NET 通用权限开发平台 + * 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。
👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +import { SystemInfo } from './system-info'; + /** + * 全局返回结果 + * + * @export + * @interface AdminResultSystemInfo + */ +export interface AdminResultSystemInfo { + + /** + * 状态码 + * + * @type {number} + * @memberof AdminResultSystemInfo + */ + code?: number; + + /** + * 类型success、warning、error + * + * @type {string} + * @memberof AdminResultSystemInfo + */ + type?: string | null; + + /** + * 错误信息 + * + * @type {string} + * @memberof AdminResultSystemInfo + */ + message?: string | null; + + /** + * @type {SystemInfo} + * @memberof AdminResultSystemInfo + */ + result?: SystemInfo; + + /** + * 附加数据 + * + * @type {any} + * @memberof AdminResultSystemInfo + */ + extras?: any | null; + + /** + * 时间 + * + * @type {Date} + * @memberof AdminResultSystemInfo + */ + time?: Date; +} diff --git a/Web/src/api-services/models/board-info.ts b/Web/src/api-services/models/board-info.ts new file mode 100644 index 000000000..99d566626 --- /dev/null +++ b/Web/src/api-services/models/board-info.ts @@ -0,0 +1,46 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Admin.NET 通用权限开发平台 + * 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。
👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + /** + * + * + * @export + * @interface BoardInfo + */ +export interface BoardInfo { + + /** + * @type {string} + * @memberof BoardInfo + */ + product?: string | null; + + /** + * @type {string} + * @memberof BoardInfo + */ + manufacturer?: string | null; + + /** + * @type {string} + * @memberof BoardInfo + */ + serialNumber?: string | null; + + /** + * @type {string} + * @memberof BoardInfo + */ + version?: string | null; +} diff --git a/Web/src/api-services/models/cpu-info.ts b/Web/src/api-services/models/cpu-info.ts new file mode 100644 index 000000000..f27782859 --- /dev/null +++ b/Web/src/api-services/models/cpu-info.ts @@ -0,0 +1,64 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Admin.NET 通用权限开发平台 + * 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。
👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + /** + * + * + * @export + * @interface CpuInfo + */ +export interface CpuInfo { + + /** + * @type {string} + * @memberof CpuInfo + */ + processorName?: string | null; + + /** + * @type {string} + * @memberof CpuInfo + */ + processorArchitecture?: string | null; + + /** + * @type {number} + * @memberof CpuInfo + */ + physicalCoreCount?: number; + + /** + * @type {number} + * @memberof CpuInfo + */ + logicalCoreCount?: number; + + /** + * @type {number} + * @memberof CpuInfo + */ + baseClockSpeed?: number; + + /** + * @type {number} + * @memberof CpuInfo + */ + cacheBytes?: number; + + /** + * @type {number} + * @memberof CpuInfo + */ + usagePercentage?: number; +} diff --git a/Web/src/api-services/models/disk-info.ts b/Web/src/api-services/models/disk-info.ts new file mode 100644 index 000000000..55f7ddadd --- /dev/null +++ b/Web/src/api-services/models/disk-info.ts @@ -0,0 +1,58 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Admin.NET 通用权限开发平台 + * 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。
👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + /** + * + * + * @export + * @interface DiskInfo + */ +export interface DiskInfo { + + /** + * @type {string} + * @memberof DiskInfo + */ + diskName?: string | null; + + /** + * @type {string} + * @memberof DiskInfo + */ + typeName?: string | null; + + /** + * @type {number} + * @memberof DiskInfo + */ + totalSpace?: number; + + /** + * @type {number} + * @memberof DiskInfo + */ + freeSpace?: number; + + /** + * @type {number} + * @memberof DiskInfo + */ + usedSpace?: number; + + /** + * @type {number} + * @memberof DiskInfo + */ + availableRate?: number; +} diff --git a/Web/src/api-services/models/generic-parameter-attributes.ts b/Web/src/api-services/models/generic-parameter-attributes.ts index ed5caa8b7..f219764a1 100644 --- a/Web/src/api-services/models/generic-parameter-attributes.ts +++ b/Web/src/api-services/models/generic-parameter-attributes.ts @@ -25,6 +25,7 @@ export enum GenericParameterAttributes { NUMBER_4 = 4, NUMBER_8 = 8, NUMBER_16 = 16, - NUMBER_28 = 28 + NUMBER_28 = 28, + NUMBER_32 = 32 } diff --git a/Web/src/api-services/models/gpu-info.ts b/Web/src/api-services/models/gpu-info.ts new file mode 100644 index 000000000..008396d31 --- /dev/null +++ b/Web/src/api-services/models/gpu-info.ts @@ -0,0 +1,94 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Admin.NET 通用权限开发平台 + * 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。
👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + /** + * + * + * @export + * @interface GpuInfo + */ +export interface GpuInfo { + + /** + * @type {string} + * @memberof GpuInfo + */ + name?: string | null; + + /** + * @type {string} + * @memberof GpuInfo + */ + description?: string | null; + + /** + * @type {string} + * @memberof GpuInfo + */ + vendor?: string | null; + + /** + * @type {string} + * @memberof GpuInfo + */ + deviceId?: string | null; + + /** + * @type {string} + * @memberof GpuInfo + */ + busInfo?: string | null; + + /** + * @type {string} + * @memberof GpuInfo + */ + driverVersion?: string | null; + + /** + * @type {number} + * @memberof GpuInfo + */ + memoryBytes?: number; + + /** + * @type {number} + * @memberof GpuInfo + */ + temperature?: number | null; + + /** + * @type {string} + * @memberof GpuInfo + */ + videoModeDescription?: string | null; + + /** + * @type {string} + * @memberof GpuInfo + */ + status?: string | null; + + /** + * @type {number} + * @memberof GpuInfo + */ + utilizationPercentage?: number | null; + + /** + * @type {number} + * @memberof GpuInfo + */ + memoryUtilizationPercentage?: number | null; +} diff --git a/Web/src/api-services/models/index.ts b/Web/src/api-services/models/index.ts index 0b95b3572..91a1a7d6f 100644 --- a/Web/src/api-services/models/index.ts +++ b/Web/src/api-services/models/index.ts @@ -46,6 +46,7 @@ export * from './admin-result-list-enum-type-output'; export * from './admin-result-list-int64'; export * from './admin-result-list-log-vis-output'; export * from './admin-result-list-menu-output'; +export * from './admin-result-list-nu-get-package'; export * from './admin-result-list-org-tree-output'; export * from './admin-result-list-role-output'; export * from './admin-result-list-string'; @@ -122,6 +123,7 @@ export * from './admin-result-sys-template'; export * from './admin-result-sys-user'; export * from './admin-result-sys-wechat-pay'; export * from './admin-result-sys-wechat-refund'; +export * from './admin-result-system-info'; export * from './admin-result-visual-db-table'; export * from './admin-result-wechat-pay-output'; export * from './admin-result-wechat-pay-para-output'; @@ -137,6 +139,7 @@ export * from './backup-output'; export * from './base-id-input'; export * from './base-proc-input'; export * from './batch-config-input'; +export * from './board-info'; export * from './calendar'; export * from './calendar-algorithm-type'; export * from './calendar-week-rule'; @@ -151,6 +154,7 @@ export * from './column-relation'; export * from './compare-info'; export * from './const-output'; export * from './constructor-info'; +export * from './cpu-info'; export * from './create-entity-input'; export * from './create-seed-data-input'; export * from './culture-info'; @@ -203,6 +207,7 @@ export * from './dict-data-input'; export * from './dict-type-input'; export * from './digit-shapes'; export * from './direction-enum'; +export * from './disk-info'; export * from './enum-entity'; export * from './enum-type-output'; export * from './event-attributes'; @@ -224,6 +229,7 @@ export * from './generate-qrimage-output'; export * from './generate-qrimage-un-limit-input'; export * from './generate-signature-input'; export * from './generic-parameter-attributes'; +export * from './gpu-info'; export * from './http-method-enum'; export * from './iaction-result'; export * from './icomponent'; @@ -236,6 +242,7 @@ export * from './info-save-input'; export * from './int-ptr'; export * from './invoice-info'; export * from './invoice-key-info'; +export * from './ip-address-info'; export * from './jtoken'; export * from './job-create-type-enum'; export * from './job-detail-input'; @@ -268,10 +275,13 @@ export * from './method-info'; export * from './module'; export * from './module-handle'; export * from './move-db-column-input'; +export * from './network-info'; +export * from './network-interface-statistics'; export * from './notice-input'; export * from './notice-status-enum'; export * from './notice-type-enum'; export * from './notice-user-status-enum'; +export * from './nu-get-package'; export * from './number-format-info'; export * from './open-access-input'; export * from './open-access-output'; @@ -305,6 +315,7 @@ export * from './print-type-enum'; export * from './pro-view-template-input'; export * from './property-attributes'; export * from './property-info'; +export * from './ram-info'; export * from './render-template-input'; export * from './reset-pwd-user-input'; export * from './restore-input'; @@ -313,6 +324,7 @@ export * from './role-menu-input'; export * from './role-org-input'; export * from './role-output'; export * from './runtime-field-handle'; +export * from './runtime-info'; export * from './runtime-method-handle'; export * from './runtime-type-handle'; export * from './schedule-input'; @@ -404,6 +416,7 @@ export * from './sys-wechat-pay'; export * from './sys-wechat-refund'; export * from './sys-wechat-user'; export * from './sys-wx-open-upload-avatar-body'; +export * from './system-info'; export * from './table-output'; export * from './table-unique-config-item'; export * from './template-type-enum'; diff --git a/Web/src/api-services/models/ip-address-info.ts b/Web/src/api-services/models/ip-address-info.ts new file mode 100644 index 000000000..a8b1dd467 --- /dev/null +++ b/Web/src/api-services/models/ip-address-info.ts @@ -0,0 +1,40 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Admin.NET 通用权限开发平台 + * 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。
👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + /** + * + * + * @export + * @interface IpAddressInfo + */ +export interface IpAddressInfo { + + /** + * @type {string} + * @memberof IpAddressInfo + */ + address?: string | null; + + /** + * @type {string} + * @memberof IpAddressInfo + */ + subnetMask?: string | null; + + /** + * @type {number} + * @memberof IpAddressInfo + */ + prefixLength?: number; +} diff --git a/Web/src/api-services/models/list-sys-lang-text-input.ts b/Web/src/api-services/models/list-sys-lang-text-input.ts index 07fa6812e..626fc48cd 100644 --- a/Web/src/api-services/models/list-sys-lang-text-input.ts +++ b/Web/src/api-services/models/list-sys-lang-text-input.ts @@ -51,20 +51,4 @@ export interface ListSysLangTextInput { * @memberof ListSysLangTextInput */ langCode?: string | null; - - /** - * 当前页码 - * - * @type {number} - * @memberof PageNoticeInput - */ - page?: number; - - /** - * 页码容量 - * - * @type {number} - * @memberof PageNoticeInput - */ - pageSize?: number; } diff --git a/Web/src/api-services/models/network-info.ts b/Web/src/api-services/models/network-info.ts new file mode 100644 index 000000000..153cf1f31 --- /dev/null +++ b/Web/src/api-services/models/network-info.ts @@ -0,0 +1,108 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Admin.NET 通用权限开发平台 + * 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。
👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +import { IpAddressInfo } from './ip-address-info'; +import { NetworkInterfaceStatistics } from './network-interface-statistics'; + /** + * + * + * @export + * @interface NetworkInfo + */ +export interface NetworkInfo { + + /** + * @type {string} + * @memberof NetworkInfo + */ + name?: string | null; + + /** + * @type {string} + * @memberof NetworkInfo + */ + description?: string | null; + + /** + * @type {string} + * @memberof NetworkInfo + */ + type?: string | null; + + /** + * @type {string} + * @memberof NetworkInfo + */ + operationalStatus?: string | null; + + /** + * @type {string} + * @memberof NetworkInfo + */ + speed?: string | null; + + /** + * @type {string} + * @memberof NetworkInfo + */ + physicalAddress?: string | null; + + /** + * @type {boolean} + * @memberof NetworkInfo + */ + supportsMulticast?: boolean; + + /** + * @type {boolean} + * @memberof NetworkInfo + */ + isReceiveOnly?: boolean; + + /** + * @type {Array} + * @memberof NetworkInfo + */ + dnsAddresses?: Array | null; + + /** + * @type {Array} + * @memberof NetworkInfo + */ + gatewayAddresses?: Array | null; + + /** + * @type {Array} + * @memberof NetworkInfo + */ + dhcpServerAddresses?: Array | null; + + /** + * @type {Array} + * @memberof NetworkInfo + */ + iPv4Addresses?: Array | null; + + /** + * @type {Array} + * @memberof NetworkInfo + */ + iPv6Addresses?: Array | null; + + /** + * @type {NetworkInterfaceStatistics} + * @memberof NetworkInfo + */ + statistics?: NetworkInterfaceStatistics; +} diff --git a/Web/src/api-services/models/network-interface-statistics.ts b/Web/src/api-services/models/network-interface-statistics.ts new file mode 100644 index 000000000..568c1b0a7 --- /dev/null +++ b/Web/src/api-services/models/network-interface-statistics.ts @@ -0,0 +1,70 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Admin.NET 通用权限开发平台 + * 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。
👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + /** + * + * + * @export + * @interface NetworkInterfaceStatistics + */ +export interface NetworkInterfaceStatistics { + + /** + * @type {number} + * @memberof NetworkInterfaceStatistics + */ + bytesReceived?: number; + + /** + * @type {number} + * @memberof NetworkInterfaceStatistics + */ + bytesSent?: number; + + /** + * @type {number} + * @memberof NetworkInterfaceStatistics + */ + packetsReceived?: number; + + /** + * @type {number} + * @memberof NetworkInterfaceStatistics + */ + packetsSent?: number; + + /** + * @type {number} + * @memberof NetworkInterfaceStatistics + */ + incomingPacketsDiscarded?: number; + + /** + * @type {number} + * @memberof NetworkInterfaceStatistics + */ + outgoingPacketsDiscarded?: number; + + /** + * @type {number} + * @memberof NetworkInterfaceStatistics + */ + incomingPacketsWithErrors?: number; + + /** + * @type {number} + * @memberof NetworkInterfaceStatistics + */ + outgoingPacketsWithErrors?: number; +} diff --git a/Web/src/api-services/models/nu-get-package.ts b/Web/src/api-services/models/nu-get-package.ts new file mode 100644 index 000000000..b5a7dd0ef --- /dev/null +++ b/Web/src/api-services/models/nu-get-package.ts @@ -0,0 +1,34 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Admin.NET 通用权限开发平台 + * 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。
👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + /** + * + * + * @export + * @interface NuGetPackage + */ +export interface NuGetPackage { + + /** + * @type {string} + * @memberof NuGetPackage + */ + packageName?: string | null; + + /** + * @type {string} + * @memberof NuGetPackage + */ + packageVersion?: string | null; +} diff --git a/Web/src/api-services/models/ram-info.ts b/Web/src/api-services/models/ram-info.ts new file mode 100644 index 000000000..5c680e69c --- /dev/null +++ b/Web/src/api-services/models/ram-info.ts @@ -0,0 +1,64 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Admin.NET 通用权限开发平台 + * 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。
👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + /** + * + * + * @export + * @interface RamInfo + */ +export interface RamInfo { + + /** + * @type {number} + * @memberof RamInfo + */ + totalBytes?: number; + + /** + * @type {number} + * @memberof RamInfo + */ + usedBytes?: number; + + /** + * @type {number} + * @memberof RamInfo + */ + freeBytes?: number; + + /** + * @type {number} + * @memberof RamInfo + */ + availableBytes?: number; + + /** + * @type {number} + * @memberof RamInfo + */ + buffersCachedBytes?: number; + + /** + * @type {number} + * @memberof RamInfo + */ + usagePercentage?: number; + + /** + * @type {number} + * @memberof RamInfo + */ + availablePercentage?: number; +} diff --git a/Web/src/api-services/models/runtime-info.ts b/Web/src/api-services/models/runtime-info.ts new file mode 100644 index 000000000..2693e2e25 --- /dev/null +++ b/Web/src/api-services/models/runtime-info.ts @@ -0,0 +1,184 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Admin.NET 通用权限开发平台 + * 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。
👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + /** + * + * + * @export + * @interface RuntimeInfo + */ +export interface RuntimeInfo { + + /** + * @type {string} + * @memberof RuntimeInfo + */ + osName?: string | null; + + /** + * @type {string} + * @memberof RuntimeInfo + */ + osDescription?: string | null; + + /** + * @type {string} + * @memberof RuntimeInfo + */ + osVersion?: string | null; + + /** + * @type {string} + * @memberof RuntimeInfo + */ + osArchitecture?: string | null; + + /** + * @type {string} + * @memberof RuntimeInfo + */ + processArchitecture?: string | null; + + /** + * @type {string} + * @memberof RuntimeInfo + */ + frameworkDescription?: string | null; + + /** + * @type {string} + * @memberof RuntimeInfo + */ + runtimeVersion?: string | null; + + /** + * @type {boolean} + * @memberof RuntimeInfo + */ + is64BitOperatingSystem?: boolean; + + /** + * @type {boolean} + * @memberof RuntimeInfo + */ + is64BitProcess?: boolean; + + /** + * @type {boolean} + * @memberof RuntimeInfo + */ + isInteractive?: boolean; + + /** + * @type {string} + * @memberof RuntimeInfo + */ + interactiveMode?: string | null; + + /** + * @type {number} + * @memberof RuntimeInfo + */ + processorCount?: number; + + /** + * @type {string} + * @memberof RuntimeInfo + */ + systemDirectory?: string | null; + + /** + * @type {string} + * @memberof RuntimeInfo + */ + currentDirectory?: string | null; + + /** + * @type {string} + * @memberof RuntimeInfo + */ + machineName?: string | null; + + /** + * @type {string} + * @memberof RuntimeInfo + */ + userName?: string | null; + + /** + * @type {string} + * @memberof RuntimeInfo + */ + userDomainName?: string | null; + + /** + * @type {number} + * @memberof RuntimeInfo + */ + workingSet?: number; + + /** + * @type {Date} + * @memberof RuntimeInfo + */ + systemStartTime?: Date; + + /** + * @type {string} + * @memberof RuntimeInfo + */ + systemUptime?: string; + + /** + * @type {Date} + * @memberof RuntimeInfo + */ + processStartTime?: Date; + + /** + * @type {string} + * @memberof RuntimeInfo + */ + processUptime?: string; + + /** + * @type {number} + * @memberof RuntimeInfo + */ + processId?: number; + + /** + * @type {string} + * @memberof RuntimeInfo + */ + processName?: string | null; + + /** + * @type {string} + * @memberof RuntimeInfo + */ + clrVersion?: string | null; + + /** + * @type {number} + * @memberof RuntimeInfo + */ + environmentVariableCount?: number; + + /** + * @type {Array} + * @memberof RuntimeInfo + */ + commandLineArgs?: Array | null; +} diff --git a/Web/src/api-services/models/sys-lang-text.ts b/Web/src/api-services/models/sys-lang-text.ts index 014b0315a..779df2301 100644 --- a/Web/src/api-services/models/sys-lang-text.ts +++ b/Web/src/api-services/models/sys-lang-text.ts @@ -85,7 +85,7 @@ export interface SysLangText { entityName?: string | null; /** - * 语言代码(如 zh-CN) + * 所属实体ID * * @type {number} * @memberof SysLangText diff --git a/Web/src/api-services/models/sys-lang.ts b/Web/src/api-services/models/sys-lang.ts index 45e065709..b6224d1f9 100644 --- a/Web/src/api-services/models/sys-lang.ts +++ b/Web/src/api-services/models/sys-lang.ts @@ -87,7 +87,7 @@ export interface SysLang { name?: string | null; /** - * 语言代码(如 zh-CN) + * 语言代码(如 zh_CN) * * @type {string} * @memberof SysLang diff --git a/Web/src/api-services/models/sys-user.ts b/Web/src/api-services/models/sys-user.ts index a5bc31644..a644e60eb 100644 --- a/Web/src/api-services/models/sys-user.ts +++ b/Web/src/api-services/models/sys-user.ts @@ -407,7 +407,7 @@ export interface SysUser { signature?: string | null; /** - * 语言代码(如 zh-CN) + * 语言代码(如 zh_CN) * * @type {string} * @memberof SysUser diff --git a/Web/src/api-services/models/system-info.ts b/Web/src/api-services/models/system-info.ts new file mode 100644 index 000000000..cc28ac295 --- /dev/null +++ b/Web/src/api-services/models/system-info.ts @@ -0,0 +1,71 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Admin.NET 通用权限开发平台 + * 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。
👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +import { BoardInfo } from './board-info'; +import { CpuInfo } from './cpu-info'; +import { DiskInfo } from './disk-info'; +import { GpuInfo } from './gpu-info'; +import { NetworkInfo } from './network-info'; +import { RamInfo } from './ram-info'; +import { RuntimeInfo } from './runtime-info'; + /** + * + * + * @export + * @interface SystemInfo + */ +export interface SystemInfo { + + /** + * @type {CpuInfo} + * @memberof SystemInfo + */ + cpuInfo?: CpuInfo; + + /** + * @type {RamInfo} + * @memberof SystemInfo + */ + ramInfo?: RamInfo; + + /** + * @type {Array} + * @memberof SystemInfo + */ + diskInfos?: Array | null; + + /** + * @type {Array} + * @memberof SystemInfo + */ + networkInfos?: Array | null; + + /** + * @type {Array} + * @memberof SystemInfo + */ + gpuInfos?: Array | null; + + /** + * @type {BoardInfo} + * @memberof SystemInfo + */ + boardInfo?: BoardInfo; + + /** + * @type {RuntimeInfo} + * @memberof SystemInfo + */ + runtimeInfo?: RuntimeInfo; +} diff --git a/Web/src/api-services/models/type-info.ts b/Web/src/api-services/models/type-info.ts index daedc99df..16275f73b 100644 --- a/Web/src/api-services/models/type-info.ts +++ b/Web/src/api-services/models/type-info.ts @@ -61,12 +61,6 @@ export interface TypeInfo { */ metadataToken?: number; - /** - * @type {boolean} - * @memberof TypeInfo - */ - isInterface?: boolean; - /** * @type {MemberTypes} * @memberof TypeInfo @@ -103,6 +97,12 @@ export interface TypeInfo { */ module?: Module; + /** + * @type {boolean} + * @memberof TypeInfo + */ + isInterface?: boolean; + /** * @type {boolean} * @memberof TypeInfo diff --git a/Web/src/api-services/models/type.ts b/Web/src/api-services/models/type.ts index 53851b46e..02fbaf641 100644 --- a/Web/src/api-services/models/type.ts +++ b/Web/src/api-services/models/type.ts @@ -55,12 +55,6 @@ export interface Type { */ metadataToken?: number; - /** - * @type {boolean} - * @memberof Type - */ - isInterface?: boolean; - /** * @type {MemberTypes} * @memberof Type @@ -97,6 +91,12 @@ export interface Type { */ module?: Module; + /** + * @type {boolean} + * @memberof Type + */ + isInterface?: boolean; + /** * @type {boolean} * @memberof Type diff --git a/Web/src/api-services/models/update-menu-input.ts b/Web/src/api-services/models/update-menu-input.ts index 3127a0663..f02288c48 100644 --- a/Web/src/api-services/models/update-menu-input.ts +++ b/Web/src/api-services/models/update-menu-input.ts @@ -139,7 +139,7 @@ export interface UpdateMenuInput { * @type {string} * @memberof UpdateMenuInput */ - icon?: string; + icon?: string | null; /** * 是否内嵌 diff --git a/Web/src/api-services/models/update-user-input.ts b/Web/src/api-services/models/update-user-input.ts index 66578f83c..188f53207 100644 --- a/Web/src/api-services/models/update-user-input.ts +++ b/Web/src/api-services/models/update-user-input.ts @@ -392,7 +392,7 @@ export interface UpdateUserInput { signature?: string | null; /** - * 语言代码(如 zh-CN) + * 语言代码(如 zh_CN) * * @type {string} * @memberof UpdateUserInput diff --git a/Web/src/api-services/models/user-output.ts b/Web/src/api-services/models/user-output.ts index a41e4cea6..41e882c80 100644 --- a/Web/src/api-services/models/user-output.ts +++ b/Web/src/api-services/models/user-output.ts @@ -407,7 +407,7 @@ export interface UserOutput { signature?: string | null; /** - * 语言代码(如 zh-CN) + * 语言代码(如 zh_CN) * * @type {string} * @memberof UserOutput diff --git a/Web/src/views/system/server/index.vue b/Web/src/views/system/server/index.vue index 532b35e89..377804926 100644 --- a/Web/src/views/system/server/index.vue +++ b/Web/src/views/system/server/index.vue @@ -1,228 +1,1509 @@