mirror of
https://github.com/nsnail/NetAdmin.git
synced 2025-08-02 18:17:31 +08:00
ci: 🎡 版本发布脚本 (#110)
This commit is contained in:
@ -9,9 +9,9 @@
|
||||
<PackageReference Include="Cronos" Version="0.8.4"/>
|
||||
<PackageReference Include="FreeSql.DbContext.NS" Version="3.2.821-ns1"/>
|
||||
<PackageReference Include="FreeSql.Provider.Sqlite.NS" Version="3.2.821-ns1"/>
|
||||
<PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.9.2.19"/>
|
||||
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster.NS" Version="4.9.2.19-ns3"/>
|
||||
<PackageReference Include="Furion.Pure.NS" Version="4.9.2.19-ns3"/>
|
||||
<PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.9.2.31"/>
|
||||
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster.NS" Version="4.9.2.31-ns1"/>
|
||||
<PackageReference Include="Furion.Pure.NS" Version="4.9.2.31-ns1"/>
|
||||
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="9.0.0-preview.3.24172.13"/>
|
||||
<PackageReference Include="Minio" Version="6.0.2"/>
|
||||
<PackageReference Include="NSExt" Version="2.1.0"/>
|
||||
|
@ -1,21 +0,0 @@
|
||||
using Furion.Schedule;
|
||||
using NetAdmin.ScheduledService.Jobs;
|
||||
|
||||
namespace NetAdmin.ScheduledService.Extensions;
|
||||
|
||||
/// <summary>
|
||||
/// ServiceCollection 扩展方法
|
||||
/// </summary>
|
||||
[SuppressSniffer]
|
||||
public static class ServiceCollectionExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// 添加定时任务
|
||||
/// </summary>
|
||||
public static IServiceCollection AddSchedules(this IServiceCollection me)
|
||||
{
|
||||
return me.AddSchedule( //
|
||||
builder => builder //
|
||||
.AddJob<ExampleJob>(false, Triggers.Minutely().SetRunOnStart(true)));
|
||||
}
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
using Furion.Schedule;
|
||||
|
||||
namespace NetAdmin.ScheduledService.Jobs;
|
||||
|
||||
/// <summary>
|
||||
/// 示例Job
|
||||
/// </summary>
|
||||
public sealed class ExampleJob : WorkBase<ExampleJob>, IJob
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ExampleJob" /> class.
|
||||
/// </summary>
|
||||
public ExampleJob() { }
|
||||
|
||||
/// <summary>
|
||||
/// 具体处理逻辑
|
||||
/// </summary>
|
||||
/// <param name="context">作业执行前上下文</param>
|
||||
/// <param name="stoppingToken">取消任务 Token</param>
|
||||
/// <exception cref="NetAdminGetLockerException">加锁失败异常</exception>
|
||||
public async Task ExecuteAsync(JobExecutingContext context, CancellationToken stoppingToken)
|
||||
{
|
||||
await WorkflowAsync(stoppingToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 通用工作流
|
||||
/// </summary>
|
||||
protected override ValueTask WorkflowAsync(CancellationToken cancelToken)
|
||||
{
|
||||
return ValueTask.CompletedTask;
|
||||
}
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
<Import Project="$(SolutionDir)/build/code.quality.props"/>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="../NetAdmin.Host/NetAdmin.Host.csproj"/>
|
||||
<ProjectReference Include="../NetAdmin.AdmServer.Cache/NetAdmin.AdmServer.Cache.csproj"/>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Update="*.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -1 +0,0 @@
|
||||
global using NetAdmin.Host.BackgroundRunning;
|
@ -1,14 +0,0 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/launchsettings.json",
|
||||
"profiles": {
|
||||
"NetAdmin.ScheduledService": {
|
||||
"commandName": "Project",
|
||||
"dotnetRunMessages": true,
|
||||
"launchUrl": "http://localhost:65080",
|
||||
"applicationUrl": "http://[::]:65080",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,70 +0,0 @@
|
||||
using NetAdmin.Host.Extensions;
|
||||
using NetAdmin.Host.Middlewares;
|
||||
using NetAdmin.ScheduledService.Extensions;
|
||||
#if !DEBUG
|
||||
using Prometheus;
|
||||
#endif
|
||||
|
||||
namespace NetAdmin.ScheduledService;
|
||||
|
||||
/// <summary>
|
||||
/// 启动类
|
||||
/// </summary>
|
||||
public sealed class Startup : Host.Startup
|
||||
{
|
||||
/// <summary>
|
||||
/// 程序入口
|
||||
/// </summary>
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
ShowBanner();
|
||||
_ = Serve.Run(RunOptions.Default.WithArgs(args));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 配置应用程序中间件
|
||||
/// </summary>
|
||||
public void Configure(IApplicationBuilder app, IHostApplicationLifetime lifeTime)
|
||||
{
|
||||
_ = app //
|
||||
.UseMiddleware<SafetyShopHostMiddleware>() // 安全停机中间件
|
||||
.EnableBuffering() // 启用请求体缓冲,允许多次读取请求体
|
||||
.UseMiddleware<RequestAuditMiddleware>() // 使用RequestAuditMiddleware中间件,执行请求审计
|
||||
#if DEBUG
|
||||
.UseOpenApiSkin() // 使用OpenApiSkin中间件(仅在调试模式下),提供Swagger UI皮肤
|
||||
#else
|
||||
.UseHttpMetrics() // 使用HttpMetrics中间件,启用HTTP性能监控
|
||||
#endif
|
||||
.UseInject(string.Empty) // 使用Inject中间件,Furion脚手架的依赖注入支持
|
||||
.UseUnifyResultStatusCodes() // 使用UnifyResultStatusCodes中间件,用于统一处理结果状态码
|
||||
.UseCorsAccessor() // 使用CorsAccessor中间件,启用跨域资源共享(CORS)支持
|
||||
.UseRouting() // 使用Routing中间件,配置路由映射
|
||||
.UseMiddleware<RemoveNullNodeMiddleware>() // 使用RemoveNullNodeMiddleware中间件,删除JSON中的空节点
|
||||
.UseEndpoints(); // 配置端点以处理请求
|
||||
_ = lifeTime.ApplicationStopping.Register(SafetyShopHostMiddleware.OnStopping);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 配置服务容器
|
||||
/// </summary>
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
_ = services //
|
||||
.AddConsoleFormatter() // 添加控制台日志格式化器
|
||||
.AddAllOptions() // 添加所有的配置选项
|
||||
.AddSnowflake() // 添加雪花算法生成器
|
||||
.AddEventBus() // 添加事件总线
|
||||
.AddFreeSql() // 添加FreeSql数据库访问
|
||||
.AddCorsAccessor() // 添加跨域资源共享(CORS)访问支持
|
||||
.AddRedisCache() // 添加 Redis 缓存支持
|
||||
.AddContextUser() // 添加上下文用户支持
|
||||
.AddSchedules() // 添加计划任务
|
||||
.AddRemoteRequest() // 添加远程请求支持
|
||||
|
||||
// IMvcBuilder
|
||||
.AddControllers() // 添加控制器
|
||||
.AddJsonSerializer() // 添加JSON序列化器
|
||||
.AddDefaultApiResultHandler() // 添加默认的API结果处理程序
|
||||
;
|
||||
}
|
||||
}
|
@ -1 +0,0 @@
|
||||
{}
|
@ -1 +0,0 @@
|
||||
{}
|
@ -1,16 +0,0 @@
|
||||
{
|
||||
"$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json",
|
||||
"SpecificationDocumentSettings": {
|
||||
"GroupOpenApiInfos": [
|
||||
{
|
||||
"Group": "Default",
|
||||
"Title": "计划任务服务",
|
||||
"Description": "NetAdmin - 计划任务服务",
|
||||
},
|
||||
{
|
||||
"Group": "Health",
|
||||
"Visible": false
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
@ -3,9 +3,9 @@
|
||||
<ProjectReference Include="../NetAdmin.Host/NetAdmin.Host.csproj"/>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="xunit" Version="2.7.1"/>
|
||||
<PackageReference Include="xunit" Version="2.8.0"/>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.0-preview.3.24172.13"/>
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.8">
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.0">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
|
30
src/frontend/admin/src/components/naIp/index.vue
Normal file
30
src/frontend/admin/src/components/naIp/index.vue
Normal file
@ -0,0 +1,30 @@
|
||||
<template>
|
||||
<p>{{ ip ?? '-' }}</p>
|
||||
<p style="overflow: hidden">{{ region ?? '-' }}</p>
|
||||
</template>
|
||||
<script>
|
||||
import http from '@/utils/request'
|
||||
|
||||
export default {
|
||||
emits: [],
|
||||
props: ['ip'],
|
||||
data() {
|
||||
return {
|
||||
region: null,
|
||||
}
|
||||
},
|
||||
mounted() {},
|
||||
created() {
|
||||
if (this.ip) {
|
||||
this.region = '...'
|
||||
http.get(`http://ip.yaopy.com/?ip=${this.ip}`).then((x) => {
|
||||
this.region = x.region
|
||||
})
|
||||
}
|
||||
},
|
||||
components: {},
|
||||
computed: {},
|
||||
methods: {},
|
||||
}
|
||||
</script>
|
||||
<style scoped></style>
|
@ -1,3 +1,5 @@
|
||||
// noinspection ES6UnusedImports
|
||||
|
||||
import * as elIcons from '@element-plus/icons-vue'
|
||||
import * as scIcons from '@/assets/icons'
|
||||
import api from '@/api'
|
||||
@ -31,6 +33,7 @@ import scForm from '@/components/scForm'
|
||||
import scFormTable from '@/components/scFormTable'
|
||||
import scPageHeader from '@/components/scPageHeader'
|
||||
import scSelect from '@/components/scSelect'
|
||||
import scSelectFilter from '@/components/scSelectFilter'
|
||||
import scStatusIndicator from '@/components/scMini/scStatusIndicator'
|
||||
import scTable from '@/components/scTable'
|
||||
import scTableColumn from '@/components/scTable/column.js'
|
||||
@ -40,7 +43,6 @@ import scUpload from '@/components/scUpload'
|
||||
import scUploadFile from '@/components/scUpload/file'
|
||||
import scUploadMultiple from '@/components/scUpload/multiple'
|
||||
import scWaterMark from '@/components/scWaterMark'
|
||||
import scSelectFilter from '@/components/scSelectFilter'
|
||||
|
||||
// net-admin组件
|
||||
import naArea from '@/components/naArea/index.vue'
|
||||
@ -55,6 +57,7 @@ import naColUser from '@/components/naColUser/index.vue'
|
||||
import naDept from '@/components/naDept/index.vue'
|
||||
import naDicCatalog from '@/components/naDicCatalog/index.vue'
|
||||
import naFormEmail from '@/components/naFormEmail/index.vue'
|
||||
import naIp from '@/components/naIp/index.vue'
|
||||
import naSearch from '@/components/naSearch'
|
||||
import naUserSelect from '@/components/naUserSelect/index.vue'
|
||||
|
||||
@ -94,6 +97,7 @@ export default {
|
||||
app.component('naDept', naDept)
|
||||
app.component('naDicCatalog', naDicCatalog)
|
||||
app.component('naFormEmail', naFormEmail)
|
||||
app.component('naIp', naIp)
|
||||
app.component('naSearch', naSearch)
|
||||
app.component('naUserSelect', naUserSelect)
|
||||
|
||||
@ -105,6 +109,7 @@ export default {
|
||||
app.component('scFormTable', scFormTable)
|
||||
app.component('scPageHeader', scPageHeader)
|
||||
app.component('scSelect', scSelect)
|
||||
app.component('scSelectFilter', scSelectFilter)
|
||||
app.component('scStatusIndicator', scStatusIndicator)
|
||||
app.component('scTable', scTable)
|
||||
app.component('scTableColumn', scTableColumn)
|
||||
@ -114,7 +119,6 @@ export default {
|
||||
app.component('scUploadFile', scUploadFile)
|
||||
app.component('scUploadMultiple', scUploadMultiple)
|
||||
app.component('scWaterMark', scWaterMark)
|
||||
app.component('scSelectFilter', scSelectFilter)
|
||||
|
||||
//注册全局指令
|
||||
app.directive('auth', auth)
|
||||
|
Reference in New Issue
Block a user