-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
347 additions
and
56 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
Samples/IoTZero/Areas/IoT/Views/NodeOnline/_List_Search.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
@using Stardust.Data.Nodes; | ||
@using NewLife; | ||
@using NewLife.Web; | ||
@using XCode; | ||
@{ | ||
var fact = ViewBag.Factory as IEntityFactory; | ||
var page = ViewBag.Page as Pager; | ||
} | ||
<div class="form-group"> | ||
<label for="category" class="control-label">类别:</label> | ||
@Html.ForDropDownList("category", Node.FindAllCategory(), page["category"], "全部", true) | ||
</div> | ||
@await Html.PartialAsync("_Area2", "") |
27 changes: 27 additions & 0 deletions
27
Samples/IoTZero/Areas/IoT/Views/NodeOnline/_List_Toolbar_Batch.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
@using NewLife.Common; | ||
@using System.Collections.Generic; | ||
@{ | ||
var set = ViewBag.PageSetting as PageSetting; | ||
var page = ViewBag.Page as Pager; | ||
} | ||
@if (set.EnableSelect) | ||
{ | ||
<button type="button" class="btn btn-success btn-sm" data-action="action" data-url="@Url.Action("CheckUpgrade")" data-fields="keys" disabled> | ||
检查更新 | ||
</button> | ||
<button type="button" class="btn btn-success btn-sm" data-action="action" data-url="@Url.Action("Restart")" data-fields="keys" disabled> | ||
重启服务 | ||
</button> | ||
<button type="button" class="btn btn-success btn-sm" data-action="action" data-url="@Url.Action("Reboot")" data-fields="keys" disabled> | ||
重启系统 | ||
</button> | ||
<div class="form-group"> | ||
<label for="command" class="control-label">命令:</label> | ||
@Html.TextBox("command", page["command"]) | ||
<label for="argument" class="control-label">参数:</label> | ||
@Html.TextBox("argument", page["argument"]) | ||
</div> | ||
<button type="button" class="btn btn-purple btn-sm" data-action="action" data-url="@Url.Action("Execute")" data-fields="keys,command,argument"> | ||
执行命令 | ||
</button> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,45 @@ | ||
using System.ComponentModel; | ||
using Microsoft.AspNetCore.Mvc.Filters; | ||
using NewLife; | ||
using NewLife.Cube; | ||
using NewLife.Cube.ViewModels; | ||
using XCode; | ||
|
||
namespace ZeroServer.Areas.Nodes; | ||
|
||
[DisplayName("节点管理")] | ||
public class NodesArea : AreaBase | ||
{ | ||
public NodesArea() : base(nameof(NodesArea).TrimEnd("Area")) { } | ||
} | ||
|
||
/// <summary>节点管理控制器基类。抽象共性能力</summary> | ||
/// <typeparam name="TEntity"></typeparam> | ||
public abstract class NodeEntityController<TEntity> : EntityController<TEntity> where TEntity : Entity<TEntity>, new() | ||
{ | ||
public override void OnActionExecuting(ActionExecutingContext filterContext) | ||
{ | ||
base.OnActionExecuting(filterContext); | ||
|
||
var nodeId = GetRequest("Id").ToInt(-1); | ||
if (nodeId <= 0) nodeId = GetRequest("nodeId").ToInt(-1); | ||
if (nodeId > 0) | ||
{ | ||
PageSetting.NavView = "_Node_Nav"; | ||
PageSetting.EnableNavbar = false; | ||
} | ||
} | ||
|
||
protected override FieldCollection OnGetFields(ViewKinds kind, Object model) | ||
{ | ||
var fields = base.OnGetFields(kind, model); | ||
|
||
if (kind == ViewKinds.List) | ||
{ | ||
var nodeId = GetRequest("nodeId").ToInt(-1); | ||
if (nodeId > 0) fields.RemoveField("NodeName"); | ||
} | ||
|
||
return fields; | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
Samples/ZeroServer/Areas/Nodes/Views/Node/_List_Search.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
@using NewLife; | ||
@using NewLife.Web; | ||
@using NewLife.Cube; | ||
@using XCode; | ||
@{ | ||
var fact = ViewBag.Factory as IEntityFactory; | ||
var page = ViewBag.Page as Pager; | ||
} | ||
<div class="form-group"> | ||
<label for="category" class="control-label">类别:</label> | ||
@Html.ForDropDownList("category", Node.FindAllCategory(), page["category"], "全部", true) | ||
</div> | ||
<div class="form-group"> | ||
<label for="product" class="control-label">产品:</label> | ||
@Html.ForDropDownList("product", Node.FindAllProduct(), page["product"], "全部", true) | ||
</div> | ||
<div class="form-group"> | ||
<label for="version" class="control-label">版本:</label> | ||
@Html.ForDropDownList("version", Node.FindAllVersion(), page["version"], "全部", true) | ||
</div> | ||
@await Html.PartialAsync("_Area2", "") | ||
@await Html.PartialAsync("_DateRange") |
18 changes: 18 additions & 0 deletions
18
Samples/ZeroServer/Areas/Nodes/Views/NodeHistory/_List_Search.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
@using NewLife; | ||
@using NewLife.Web; | ||
@using NewLife.Cube; | ||
@using XCode; | ||
@{ | ||
var fact = ViewBag.Factory as IEntityFactory; | ||
var page = ViewBag.Page as Pager; | ||
|
||
var dic = new Dictionary<Int32, String>(); | ||
dic.Add(1, "成功"); | ||
dic.Add(0, "失败"); | ||
} | ||
<div class="form-group"> | ||
<label for="success" class="control-label">状态:</label> | ||
@Html.ForDropDownList("success", dic, page["success"], "全部", true) | ||
</div> | ||
@await Html.PartialAsync("_SelectNode", new SelectNodeModel { Id = "nodeId" }) | ||
@await Html.PartialAsync("_DateRange") |
12 changes: 12 additions & 0 deletions
12
Samples/ZeroServer/Areas/Nodes/Views/NodeOnline/_List_Search.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
@using NewLife; | ||
@using NewLife.Web; | ||
@using XCode; | ||
@{ | ||
var fact = ViewBag.Factory as IEntityFactory; | ||
var page = ViewBag.Page as Pager; | ||
} | ||
<div class="form-group"> | ||
<label for="category" class="control-label">类别:</label> | ||
@Html.ForDropDownList("category", Node.FindAllCategory(), page["category"], "全部", true) | ||
</div> | ||
@await Html.PartialAsync("_Area2", "") |
21 changes: 21 additions & 0 deletions
21
Samples/ZeroServer/Areas/Nodes/Views/NodeOnline/_List_Toolbar_Batch.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
@using NewLife.Common; | ||
@using System.Collections.Generic; | ||
@{ | ||
var set = ViewBag.PageSetting as PageSetting; | ||
var page = ViewBag.Page as Pager; | ||
} | ||
@if (set.EnableSelect) | ||
{ | ||
<button type="button" class="btn btn-success btn-sm" data-action="action" data-url="@Url.Action("CheckUpgrade")" data-fields="keys" disabled> | ||
检查更新 | ||
</button> | ||
<div class="form-group"> | ||
<label for="command" class="control-label">命令:</label> | ||
@Html.TextBox("command", page["command"]) | ||
<label for="argument" class="control-label">参数:</label> | ||
@Html.TextBox("argument", page["argument"]) | ||
</div> | ||
<button type="button" class="btn btn-purple btn-sm" data-action="action" data-url="@Url.Action("Execute")" data-fields="keys,command,argument"> | ||
执行命令 | ||
</button> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers | ||
@using NewLife | ||
@using NewLife.Cube | ||
@using NewLife.Reflection | ||
@using NewLife.Web | ||
@using XCode | ||
@using XCode.Membership | ||
@using Zero.Data.Nodes | ||
@using ZeroServer.Models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
namespace ZeroServer.Models; | ||
|
||
public class SelectNodeModel | ||
{ | ||
public String Id { get; set; } | ||
|
||
public String Category { get; set; } | ||
|
||
public String Product { get; set; } | ||
|
||
public Int32 NodeId { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.