Skip to content

Commit

Permalink
优化监控中心页面链接
Browse files Browse the repository at this point in the history
  • Loading branch information
nnhy committed Dec 7, 2024
1 parent 031b068 commit d846d30
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 9 deletions.
29 changes: 22 additions & 7 deletions Stardust.Web/Areas/Monitors/Views/AppDayStat/_List_Search.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,37 @@
var page = ViewBag.Page as Pager;

var dic = AppTracer.FindAllWithCache().ToDictionary(e => e.ID, e => e + "");

// 优先使用monitorId
var appId = page["appId"].ToInt(-1);
if(appId<=0)appId=page["monitorId"].ToInt(-1);
var monitorId = page["monitorId"].ToInt(-1);
// if (appId <= 0) appId = monitorId;
// if (monitorId > 0) page["appId"] = (appId = monitorId) + "";
// 星尘监控,子系统内部跳转到当前页,只有appId;外部跳转到当前页,有appId和monitorId
var app = AppTracer.FindByID(appId);
if (appId > 0 && monitorId <= 0)
{
monitorId = appId;
if (app != null) appId = app.AppId;
}
else if (appId > 0 && monitorId > 0)
{
app = AppTracer.FindByID(monitorId);
}
}
@if (appId > 0)
{
var app = AppTracer.FindByID(appId);
<div class="form-group" style="width:160px;">
<a href="appTracer?Id=@appId" class="btn btn-success btn-sm">@app</a>
<a href="appTracer?appId=@appId&monitorId=@monitorId" class="btn btn-success btn-sm">@app</a>
</div>
<div class="form-group">
@Html.ActionLink("每分钟", null, "appMinuteStat", new { appId })
@Html.ActionLink("每天", null, "appDayStat", new { monitorId=appId })
@Html.ActionLink("每分钟", null, "appMinuteStat", new { appId = monitorId })
@Html.ActionLink("每天", null, "appDayStat", new { appId, monitorId })
</div>
}
<div class="form-group">
<label for="appId" class="control-label">应用:</label>
@Html.ForDropDownList("appId", dic, page["appId"], "全部", true)
<label for="monitorId" class="control-label">应用:</label>
@Html.ForDropDownList("monitorId", dic, page["monitorId"], "全部", true)
</div>
@await Html.PartialAsync("_DateRange")
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ static AppConsumeController()
var df = ListFields.GetField("ServiceName") as ListField;
df.DisplayName = "{ServiceName}";
df.Url = "/Registry/Service?name={ServiceName}";
df.Target = "_blank";
}
{
var df = ListFields.GetField("NodeName") as ListField;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ static AppServiceController()
var df = ListFields.GetField("ServiceName") as ListField;
df.DisplayName = "{ServiceName}";
df.Url = "/Registry/Service?name={ServiceName}";
df.Target = "_blank";
}
{
var df = ListFields.GetField("NodeName") as ListField;
Expand Down
4 changes: 2 additions & 2 deletions Stardust.Web/Views/Shared/_App_Nav.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@
dic["发布中心"] = $"/Deployment/AppDeploy?appId={appId}&deployId={deploy?.Id}";
if (deploy != null)
{
dic["文件版本"] = $"/Deployment/AppDeployVersion?appId={appId}&deployId={deploy.Id}";
dic["节点发布"] = $"/Deployment/AppDeployNode?enable=1&appId={appId}&deployId={deploy.Id}";
dic["上传新版本"] = $"/Deployment/AppDeployVersion?appId={appId}&deployId={deploy.Id}";
dic["部署节点"] = $"/Deployment/AppDeployNode?enable=1&appId={appId}&deployId={deploy.Id}";
}

var monitor = AppTracer.FindByID(monitorId);
Expand Down

0 comments on commit d846d30

Please sign in to comment.