Skip to content

Commit

Permalink
调整应用导航条
Browse files Browse the repository at this point in the history
  • Loading branch information
nnhy committed Mar 5, 2024
1 parent 94bdc1f commit e99b8a5
Show file tree
Hide file tree
Showing 11 changed files with 127 additions and 94 deletions.
18 changes: 9 additions & 9 deletions Stardust.Data/Entity/Model.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,18 @@
<Column Name="Secret" DataType="String" Description="密钥" />
<Column Name="Category" DataType="String" Description="类别" />
<Column Name="Enable" DataType="Boolean" Description="启用" />
<Column Name="AutoActive" DataType="Boolean" Description="自动激活。新登录应用是否自动激活,只有激活的应用,才提供服务" />
<Column Name="Version" DataType="String" Description="版本。多版本实例使用时,仅记录最新版本" />
<Column Name="Compile" DataType="DateTime" Description="编译时间。客户端" />
<Column Name="Period" DataType="Int32" Description="采样周期。默认60秒" />
<Column Name="AutoActive" DataType="Boolean" Description="自动激活。自动激活启用该应用在注册中心提供的服务,供其它消费者使用" />
<Column Name="Version" DataType="String" Description="版本。多版本实例使用时,仅记录最大版本" />
<Column Name="Compile" DataType="DateTime" Description="编译时间。最大版本应用的编译时间" />
<Column Name="Period" DataType="Int32" Description="采样周期。应用定期采样并上报性能数据,默认60秒" />
<Column Name="Singleton" DataType="Boolean" Description="单例。每个节点只部署一个实例,多节点多实例,此时使用本地IP作为唯一标识,便于管理实例" />
<Column Name="WhiteIPs" DataType="String" Description="IP白名单。符合条件的来源IP才允许访问,支持*通配符,多个逗号隔开" />
<Column Name="BlackIPs" DataType="String" Description="IP黑名单。符合条件的来源IP禁止访问,支持*通配符,多个逗号隔开" />
<Column Name="WebHook" DataType="String" Length="500" Description="告警机器人。钉钉、企业微信等" />
<Column Name="AlarmOnOffline" DataType="Boolean" Description="下线告警。节点下线时,发送告警" />
<Column Name="WhiteIPs" DataType="String" Description="IP白名单。符合条件的来源IP才允许访问,支持*通配符,多个逗号隔开" Category="安全告警" />
<Column Name="BlackIPs" DataType="String" Description="IP黑名单。符合条件的来源IP禁止访问,支持*通配符,多个逗号隔开" Category="安全告警" />
<Column Name="WebHook" DataType="String" Length="500" Description="告警机器人。钉钉、企业微信等" Category="安全告警" />
<Column Name="AlarmOnOffline" DataType="Boolean" Description="下线告警。节点下线时,发送告警" Category="安全告警" />
<Column Name="LastLogin" DataType="DateTime" Description="最后登录" />
<Column Name="LastIP" DataType="String" Description="最后IP" />
<Column Name="AllowControlNodes" DataType="String" Description="节点控制。安全性设计,允许该应用发指令控制的目标节点编码或目标应用名称,多节点逗号分隔,*表示全部节点" />
<Column Name="AllowControlNodes" DataType="String" Description="节点控制。安全性设计,允许该应用发指令控制的目标节点编码或目标应用名称,多节点逗号分隔,*表示全部节点" Category="安全告警" />
<Column Name="Remark" DataType="String" Length="500" Description="内容" Category="扩展" />
<Column Name="CreateUser" DataType="String" Description="创建者" Category="扩展" />
<Column Name="CreateUserID" DataType="Int32" Description="创建者" Category="扩展" />
Expand Down
8 changes: 4 additions & 4 deletions Stardust.Data/Entity/Stardust.htm
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ <h3>应用系统(StarApp)</h3>
<td></td>
<td></td>
<td>N</td>
<td>新登录应用是否自动激活,只有激活的应用,才提供服务</td>
<td>自动激活启用该应用在注册中心提供的服务,供其它消费者使用</td>
</tr>

<tr>
Expand All @@ -145,7 +145,7 @@ <h3>应用系统(StarApp)</h3>
<td></td>
<td></td>
<td></td>
<td>多版本实例使用时,仅记录最新版本</td>
<td>多版本实例使用时,仅记录最大版本</td>
</tr>

<tr>
Expand All @@ -156,7 +156,7 @@ <h3>应用系统(StarApp)</h3>
<td></td>
<td></td>
<td></td>
<td>客户端</td>
<td>最大版本应用的编译时间</td>
</tr>

<tr>
Expand All @@ -167,7 +167,7 @@ <h3>应用系统(StarApp)</h3>
<td></td>
<td></td>
<td>N</td>
<td>默认60秒</td>
<td>应用定期采样并上报性能数据,默认60秒</td>
</tr>

<tr>
Expand Down
2 changes: 1 addition & 1 deletion Stardust.Data/Entity/应用在线.Biz.cs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ public void Fill(App app, AppInfo info)
else if (new Version(info.Version) > new Version(app.Version))
app.Version = info.Version;

if (Version.IsNullOrEmpty()) Version = app.Version;
if (Version.IsNullOrEmpty()) Version = info.Version;
}
}

Expand Down
45 changes: 25 additions & 20 deletions Stardust.Data/Entity/应用系统.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,35 +80,35 @@ public partial class App
public Boolean Enable { get => _Enable; set { if (OnPropertyChanging("Enable", value)) { _Enable = value; OnPropertyChanged("Enable"); } } }

private Boolean _AutoActive;
/// <summary>自动激活。新登录应用是否自动激活,只有激活的应用,才提供服务</summary>
/// <summary>自动激活。自动激活启用该应用在注册中心提供的服务,供其它消费者使用</summary>
[DisplayName("自动激活")]
[Description("自动激活。新登录应用是否自动激活,只有激活的应用,才提供服务")]
[Description("自动激活。自动激活启用该应用在注册中心提供的服务,供其它消费者使用")]
[DataObjectField(false, false, false, 0)]
[BindColumn("AutoActive", "自动激活。新登录应用是否自动激活,只有激活的应用,才提供服务", "")]
[BindColumn("AutoActive", "自动激活。自动激活启用该应用在注册中心提供的服务,供其它消费者使用", "")]
public Boolean AutoActive { get => _AutoActive; set { if (OnPropertyChanging("AutoActive", value)) { _AutoActive = value; OnPropertyChanged("AutoActive"); } } }

private String _Version;
/// <summary>版本。多版本实例使用时,仅记录最新版本</summary>
/// <summary>版本。多版本实例使用时,仅记录最大版本</summary>
[DisplayName("版本")]
[Description("版本。多版本实例使用时,仅记录最新版本")]
[Description("版本。多版本实例使用时,仅记录最大版本")]
[DataObjectField(false, false, true, 50)]
[BindColumn("Version", "版本。多版本实例使用时,仅记录最新版本", "")]
[BindColumn("Version", "版本。多版本实例使用时,仅记录最大版本", "")]
public String Version { get => _Version; set { if (OnPropertyChanging("Version", value)) { _Version = value; OnPropertyChanged("Version"); } } }

private DateTime _Compile;
/// <summary>编译时间。客户端</summary>
/// <summary>编译时间。最大版本应用的编译时间</summary>
[DisplayName("编译时间")]
[Description("编译时间。客户端")]
[Description("编译时间。最大版本应用的编译时间")]
[DataObjectField(false, false, true, 0)]
[BindColumn("Compile", "编译时间。客户端", "")]
[BindColumn("Compile", "编译时间。最大版本应用的编译时间", "")]
public DateTime Compile { get => _Compile; set { if (OnPropertyChanging("Compile", value)) { _Compile = value; OnPropertyChanged("Compile"); } } }

private Int32 _Period;
/// <summary>采样周期。默认60秒</summary>
/// <summary>采样周期。应用定期采样并上报性能数据,默认60秒</summary>
[DisplayName("采样周期")]
[Description("采样周期。默认60秒")]
[Description("采样周期。应用定期采样并上报性能数据,默认60秒")]
[DataObjectField(false, false, false, 0)]
[BindColumn("Period", "采样周期。默认60秒", "")]
[BindColumn("Period", "采样周期。应用定期采样并上报性能数据,默认60秒", "")]
public Int32 Period { get => _Period; set { if (OnPropertyChanging("Period", value)) { _Period = value; OnPropertyChanged("Period"); } } }

private Boolean _Singleton;
Expand All @@ -121,6 +121,7 @@ public partial class App

private String _WhiteIPs;
/// <summary>IP白名单。符合条件的来源IP才允许访问,支持*通配符,多个逗号隔开</summary>
[Category("安全告警")]
[DisplayName("IP白名单")]
[Description("IP白名单。符合条件的来源IP才允许访问,支持*通配符,多个逗号隔开")]
[DataObjectField(false, false, true, 50)]
Expand All @@ -129,6 +130,7 @@ public partial class App

private String _BlackIPs;
/// <summary>IP黑名单。符合条件的来源IP禁止访问,支持*通配符,多个逗号隔开</summary>
[Category("安全告警")]
[DisplayName("IP黑名单")]
[Description("IP黑名单。符合条件的来源IP禁止访问,支持*通配符,多个逗号隔开")]
[DataObjectField(false, false, true, 50)]
Expand All @@ -137,6 +139,7 @@ public partial class App

private String _WebHook;
/// <summary>告警机器人。钉钉、企业微信等</summary>
[Category("安全告警")]
[DisplayName("告警机器人")]
[Description("告警机器人。钉钉、企业微信等")]
[DataObjectField(false, false, true, 500)]
Expand All @@ -145,6 +148,7 @@ public partial class App

private Boolean _AlarmOnOffline;
/// <summary>下线告警。节点下线时,发送告警</summary>
[Category("安全告警")]
[DisplayName("下线告警")]
[Description("下线告警。节点下线时,发送告警")]
[DataObjectField(false, false, false, 0)]
Expand All @@ -169,6 +173,7 @@ public partial class App

private String _AllowControlNodes;
/// <summary>节点控制。安全性设计,允许该应用发指令控制的目标节点编码或目标应用名称,多节点逗号分隔,*表示全部节点</summary>
[Category("安全告警")]
[DisplayName("节点控制")]
[Description("节点控制。安全性设计,允许该应用发指令控制的目标节点编码或目标应用名称,多节点逗号分隔,*表示全部节点")]
[DataObjectField(false, false, true, 50)]
Expand Down Expand Up @@ -369,16 +374,16 @@ public partial class _
/// <summary>启用</summary>
public static readonly Field Enable = FindByName("Enable");

/// <summary>自动激活。新登录应用是否自动激活,只有激活的应用,才提供服务</summary>
/// <summary>自动激活。自动激活启用该应用在注册中心提供的服务,供其它消费者使用</summary>
public static readonly Field AutoActive = FindByName("AutoActive");

/// <summary>版本。多版本实例使用时,仅记录最新版本</summary>
/// <summary>版本。多版本实例使用时,仅记录最大版本</summary>
public static readonly Field Version = FindByName("Version");

/// <summary>编译时间。客户端</summary>
/// <summary>编译时间。最大版本应用的编译时间</summary>
public static readonly Field Compile = FindByName("Compile");

/// <summary>采样周期。默认60秒</summary>
/// <summary>采样周期。应用定期采样并上报性能数据,默认60秒</summary>
public static readonly Field Period = FindByName("Period");

/// <summary>单例。每个节点只部署一个实例,多节点多实例,此时使用本地IP作为唯一标识,便于管理实例</summary>
Expand Down Expand Up @@ -459,16 +464,16 @@ public partial class __
/// <summary>启用</summary>
public const String Enable = "Enable";

/// <summary>自动激活。新登录应用是否自动激活,只有激活的应用,才提供服务</summary>
/// <summary>自动激活。自动激活启用该应用在注册中心提供的服务,供其它消费者使用</summary>
public const String AutoActive = "AutoActive";

/// <summary>版本。多版本实例使用时,仅记录最新版本</summary>
/// <summary>版本。多版本实例使用时,仅记录最大版本</summary>
public const String Version = "Version";

/// <summary>编译时间。客户端</summary>
/// <summary>编译时间。最大版本应用的编译时间</summary>
public const String Compile = "Compile";

/// <summary>采样周期。默认60秒</summary>
/// <summary>采样周期。应用定期采样并上报性能数据,默认60秒</summary>
public const String Period = "Period";

/// <summary>单例。每个节点只部署一个实例,多节点多实例,此时使用本地IP作为唯一标识,便于管理实例</summary>
Expand Down
2 changes: 2 additions & 0 deletions Stardust.Data/Stardust.Data.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
</ItemGroup>

<ItemGroup>
<Compile Remove="Configs\应用依赖.Biz.cs" />
<Compile Remove="Configs\应用依赖.cs" />
<Compile Remove="Configs\配置在线.Biz.cs" />
<Compile Remove="Configs\配置在线.cs" />
<Compile Remove="Deployment\部署在线.Biz.cs" />
Expand Down
10 changes: 5 additions & 5 deletions Stardust.Web/Areas/Deployment/Controllers/AppDeployController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ static AppDeployController()

{
var df = ListFields.GetField("ProjectName") as ListField;
df.Url = "/Platform/GalaxyProject?projectId={ProjectId}";
df.Url = "/Platform/GalaxyProject?Id={ProjectId}";
df.Target = "_frame";
}
{
Expand All @@ -42,25 +42,25 @@ static AppDeployController()
{
var df = ListFields.AddListField("NodeManage", null, "Nodes") as ListField;
df.DisplayName = "部署节点";
df.Url = "/Deployment/AppDeployNode?appId={Id}";
df.Url = "/Deployment/AppDeployNode?deployId={Id}";
}
{
var df = ListFields.GetField("Version") as ListField;
df.Header = "版本";
df.Title = "管理应用版本";
df.Url = "/Deployment/AppDeployVersion?appId={Id}";
df.Url = "/Deployment/AppDeployVersion?deployId={Id}";
}
{
var df = ListFields.AddListField("AddVersion", "FileName");
df.Header = "版本管理";
df.DisplayName = "版本管理";
df.Title = "管理所有版本文件";
df.Url = "/Deployment/AppDeployVersion?appId={Id}";
df.Url = "/Deployment/AppDeployVersion?deployId={Id}";
}
{
var df = ListFields.AddListField("History", "UpdateUserId");
df.DisplayName = "部署历史";
df.Url = "/Deployment/AppDeployHistory?appId={Id}";
df.Url = "/Deployment/AppDeployHistory?deployId={Id}";
}
{
var df = ListFields.AddListField("Log", "UpdateUserId");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using NewLife.Cube;
using Microsoft.AspNetCore.Mvc.Filters;
using NewLife.Cube;
using NewLife.Cube.Extensions;
using NewLife.Cube.ViewModels;
using NewLife.Web;
Expand All @@ -20,10 +21,35 @@ static AppDeployHistoryController()
{
var df = ListFields.GetField("NodeName") as ListField;
df.Url = "/Nodes/Node?Id={NodeID}";
df.Target = "frame";
df.Target = "_frame";
}
}

public override void OnActionExecuting(ActionExecutingContext filterContext)
{
base.OnActionExecuting(filterContext);

var deployId = GetRequest("deployId").ToInt(-1);
if (deployId > 0)
{
PageSetting.NavView = "_App_Nav";
PageSetting.EnableNavbar = false;
}
}

protected override FieldCollection OnGetFields(ViewKinds kind, Object model)
{
var fields = base.OnGetFields(kind, model);

if (kind == ViewKinds.List)
{
var deployId = GetRequest("deployId").ToInt(-1);
if (deployId > 0) fields.RemoveField("AppName");
}

return fields;
}

protected override IEnumerable<AppDeployHistory> Search(Pager p)
{
var id = p["id"].ToInt(-1);
Expand All @@ -33,7 +59,8 @@ protected override IEnumerable<AppDeployHistory> Search(Pager p)
if (entity != null) return new List<AppDeployHistory> { entity };
}

var appId = p["appId"].ToInt(-1);
var appId = p["deployId"].ToInt(-1);
if (appId <= 0) appId = p["appId"].ToInt(-1);
var nodeId = p["nodeId"].ToInt(-1);

var start = p["dtStart"].ToDateTime();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ public override void OnActionExecuting(ActionExecutingContext filterContext)
{
base.OnActionExecuting(filterContext);

var appId = GetRequest("appId").ToInt(-1);
if (appId > 0)
var deployId = GetRequest("deployId").ToInt(-1);
if (deployId > 0)
{
PageSetting.NavView = "_App_Nav";
PageSetting.EnableNavbar = false;
Expand All @@ -55,8 +55,8 @@ protected override FieldCollection OnGetFields(ViewKinds kind, Object model)

if (kind == ViewKinds.List)
{
var appId = GetRequest("appId").ToInt(-1);
if (appId > 0) fields.RemoveField("AppName");
var deployId = GetRequest("deployId").ToInt(-1);
if (deployId > 0) fields.RemoveField("AppName");

var nodeId = GetRequest("nodeId").ToInt(-1);
if (nodeId > 0) fields.RemoveField("NodeName");
Expand All @@ -74,7 +74,8 @@ protected override IEnumerable<AppDeployNode> Search(Pager p)
if (entity != null) return new List<AppDeployNode> { entity };
}

var appId = p["appId"].ToInt(-1);
var appId = p["deployId"].ToInt(-1);
if (appId <= 0) appId = p["appId"].ToInt(-1);
var nodeId = p["nodeId"].ToInt(-1);
var enable = p["enable"]?.ToBoolean();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,12 @@ public override void OnActionExecuting(ActionExecutingContext filterContext)
{
base.OnActionExecuting(filterContext);

var appId = GetRequest("appId").ToInt(-1);
if (appId > 0)
var deployId = GetRequest("deployId").ToInt(-1);
if (deployId > 0)
{
PageSetting.NavView = "_App_Nav";
PageSetting.EnableNavbar = false;
}

//PageSetting.EnableAdd = false;
}

protected override FieldCollection OnGetFields(ViewKinds kind, Object model)
Expand All @@ -74,8 +72,8 @@ protected override FieldCollection OnGetFields(ViewKinds kind, Object model)

if (kind == ViewKinds.List)
{
var appId = GetRequest("appId").ToInt(-1);
if (appId > 0) fields.RemoveField("AppName");
var deployId = GetRequest("deployId").ToInt(-1);
if (deployId > 0) fields.RemoveField("AppName");
}

return fields;
Expand All @@ -90,7 +88,8 @@ protected override IEnumerable<AppDeployVersion> Search(Pager p)
if (entity != null) return new List<AppDeployVersion> { entity };
}

var appId = p["appId"].ToInt(-1);
var appId = p["deployId"].ToInt(-1);
if (appId <= 0) appId = p["appId"].ToInt(-1);
var start = p["dtStart"].ToDateTime();
var end = p["dtEnd"].ToDateTime();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ static AppTracerController()

{
var df = ListFields.GetField("ProjectName") as ListField;
df.Url = "/Platform/GalaxyProject?projectId={ProjectId}";
df.Url = "/Platform/GalaxyProject?Id={ProjectId}";
df.Target = "_frame";
}
{
Expand Down
Loading

0 comments on commit e99b8a5

Please sign in to comment.