修正网页链接
This commit is contained in:
parent
fd268cef30
commit
88f28b5682
|
@ -25,3 +25,4 @@ bld/
|
|||
/AntJob.Web/Config
|
||||
/AntJob.Web/Content
|
||||
/AntJob.Web/Plugins
|
||||
/AntJob.Data/Config
|
||||
|
|
|
@ -13,8 +13,11 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="Config\**" />
|
||||
<Compile Remove="Log\**" />
|
||||
<EmbeddedResource Remove="Config\**" />
|
||||
<EmbeddedResource Remove="Log\**" />
|
||||
<None Remove="Config\**" />
|
||||
<None Remove="Log\**" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
@ -43,13 +43,13 @@ namespace AntJob.Data.Entity
|
|||
[BindColumn("JobID", "作业", "")]
|
||||
public Int32 JobID { get { return _JobID; } set { if (OnPropertyChanging(__.JobID, value)) { _JobID = value; OnPropertyChanged(__.JobID); } } }
|
||||
|
||||
private Int32 _JobLogID;
|
||||
private Int32 _TaskID;
|
||||
/// <summary>作业项</summary>
|
||||
[DisplayName("作业项")]
|
||||
[Description("作业项")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("JobLogID", "作业项", "")]
|
||||
public Int32 JobLogID { get { return _JobLogID; } set { if (OnPropertyChanging(__.JobLogID, value)) { _JobLogID = value; OnPropertyChanged(__.JobLogID); } } }
|
||||
[BindColumn("TaskID", "作业项", "")]
|
||||
public Int32 TaskID { get { return _TaskID; } set { if (OnPropertyChanging(__.TaskID, value)) { _TaskID = value; OnPropertyChanged(__.TaskID); } } }
|
||||
|
||||
private String _Client;
|
||||
/// <summary>客户端。IP加进程</summary>
|
||||
|
@ -169,7 +169,7 @@ namespace AntJob.Data.Entity
|
|||
case __.ID : return _ID;
|
||||
case __.AppID : return _AppID;
|
||||
case __.JobID : return _JobID;
|
||||
case __.JobLogID : return _JobLogID;
|
||||
case __.TaskID : return _TaskID;
|
||||
case __.Client : return _Client;
|
||||
case __.Start : return _Start;
|
||||
case __.End : return _End;
|
||||
|
@ -193,7 +193,7 @@ namespace AntJob.Data.Entity
|
|||
case __.ID : _ID = value.ToInt(); break;
|
||||
case __.AppID : _AppID = value.ToInt(); break;
|
||||
case __.JobID : _JobID = value.ToInt(); break;
|
||||
case __.JobLogID : _JobLogID = value.ToInt(); break;
|
||||
case __.TaskID : _TaskID = value.ToInt(); break;
|
||||
case __.Client : _Client = Convert.ToString(value); break;
|
||||
case __.Start : _Start = value.ToDateTime(); break;
|
||||
case __.End : _End = value.ToDateTime(); break;
|
||||
|
@ -227,7 +227,7 @@ namespace AntJob.Data.Entity
|
|||
public static readonly Field JobID = FindByName(__.JobID);
|
||||
|
||||
/// <summary>作业项</summary>
|
||||
public static readonly Field JobLogID = FindByName(__.JobLogID);
|
||||
public static readonly Field TaskID = FindByName(__.TaskID);
|
||||
|
||||
/// <summary>客户端。IP加进程</summary>
|
||||
public static readonly Field Client = FindByName(__.Client);
|
||||
|
@ -284,7 +284,7 @@ namespace AntJob.Data.Entity
|
|||
public const String JobID = "JobID";
|
||||
|
||||
/// <summary>作业项</summary>
|
||||
public const String JobLogID = "JobLogID";
|
||||
public const String TaskID = "TaskID";
|
||||
|
||||
/// <summary>客户端。IP加进程</summary>
|
||||
public const String Client = "Client";
|
||||
|
@ -342,7 +342,7 @@ namespace AntJob.Data.Entity
|
|||
Int32 JobID { get; set; }
|
||||
|
||||
/// <summary>作业项</summary>
|
||||
Int32 JobLogID { get; set; }
|
||||
Int32 TaskID { get; set; }
|
||||
|
||||
/// <summary>客户端。IP加进程</summary>
|
||||
String Client { get; set; }
|
||||
|
|
|
@ -74,13 +74,13 @@ namespace AntJob.Data.Entity
|
|||
[BindColumn("Server", "服务端。客户端登录到哪个服务端,IP加端口", "")]
|
||||
public String Server { get { return _Server; } set { if (OnPropertyChanging(__.Server, value)) { _Server = value; OnPropertyChanged(__.Server); } } }
|
||||
|
||||
private Int32 _Logs;
|
||||
private Int32 _Tasks;
|
||||
/// <summary>任务数</summary>
|
||||
[DisplayName("任务数")]
|
||||
[Description("任务数")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("Logs", "任务数", "")]
|
||||
public Int32 Logs { get { return _Logs; } set { if (OnPropertyChanging(__.Logs, value)) { _Logs = value; OnPropertyChanged(__.Logs); } } }
|
||||
[BindColumn("Tasks", "任务数", "")]
|
||||
public Int32 Tasks { get { return _Tasks; } set { if (OnPropertyChanging(__.Tasks, value)) { _Tasks = value; OnPropertyChanged(__.Tasks); } } }
|
||||
|
||||
private Int64 _Total;
|
||||
/// <summary>总数</summary>
|
||||
|
@ -180,7 +180,7 @@ namespace AntJob.Data.Entity
|
|||
case __.Name : return _Name;
|
||||
case __.Version : return _Version;
|
||||
case __.Server : return _Server;
|
||||
case __.Logs : return _Logs;
|
||||
case __.Tasks : return _Tasks;
|
||||
case __.Total : return _Total;
|
||||
case __.Success : return _Success;
|
||||
case __.Error : return _Error;
|
||||
|
@ -205,7 +205,7 @@ namespace AntJob.Data.Entity
|
|||
case __.Name : _Name = Convert.ToString(value); break;
|
||||
case __.Version : _Version = Convert.ToString(value); break;
|
||||
case __.Server : _Server = Convert.ToString(value); break;
|
||||
case __.Logs : _Logs = value.ToInt(); break;
|
||||
case __.Tasks : _Tasks = value.ToInt(); break;
|
||||
case __.Total : _Total = value.ToLong(); break;
|
||||
case __.Success : _Success = value.ToLong(); break;
|
||||
case __.Error : _Error = value.ToLong(); break;
|
||||
|
@ -248,7 +248,7 @@ namespace AntJob.Data.Entity
|
|||
public static readonly Field Server = FindByName(__.Server);
|
||||
|
||||
/// <summary>任务数</summary>
|
||||
public static readonly Field Logs = FindByName(__.Logs);
|
||||
public static readonly Field Tasks = FindByName(__.Tasks);
|
||||
|
||||
/// <summary>总数</summary>
|
||||
public static readonly Field Total = FindByName(__.Total);
|
||||
|
@ -308,7 +308,7 @@ namespace AntJob.Data.Entity
|
|||
public const String Server = "Server";
|
||||
|
||||
/// <summary>任务数</summary>
|
||||
public const String Logs = "Logs";
|
||||
public const String Tasks = "Tasks";
|
||||
|
||||
/// <summary>总数</summary>
|
||||
public const String Total = "Total";
|
||||
|
@ -369,7 +369,7 @@ namespace AntJob.Data.Entity
|
|||
String Server { get; set; }
|
||||
|
||||
/// <summary>任务数</summary>
|
||||
Int32 Logs { get; set; }
|
||||
Int32 Tasks { get; set; }
|
||||
|
||||
/// <summary>总数</summary>
|
||||
Int64 Total { get; set; }
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
<Column Name="Name" DataType="String" Master="True" Description="名称。机器名称" />
|
||||
<Column Name="Version" DataType="String" Description="版本。客户端" />
|
||||
<Column Name="Server" DataType="String" Description="服务端。客户端登录到哪个服务端,IP加端口" />
|
||||
<Column Name="Logs" DataType="Int32" Description="任务数" />
|
||||
<Column Name="Tasks" DataType="Int32" Description="任务数" />
|
||||
<Column Name="Total" DataType="Int64" Description="总数" />
|
||||
<Column Name="Success" DataType="Int64" Description="成功" />
|
||||
<Column Name="Error" DataType="Int64" Description="错误" />
|
||||
|
@ -136,7 +136,7 @@
|
|||
<Column Name="ID" DataType="Int32" Identity="True" PrimaryKey="True" Description="编号" />
|
||||
<Column Name="AppID" DataType="Int32" Description="应用" />
|
||||
<Column Name="JobID" DataType="Int32" Description="作业" />
|
||||
<Column Name="JobLogID" DataType="Int32" Description="作业项" />
|
||||
<Column Name="TaskID" DataType="Int32" Description="作业项" />
|
||||
<Column Name="Client" DataType="String" Description="客户端。IP加进程" />
|
||||
<Column Name="Start" DataType="DateTime" Description="开始。大于等于" />
|
||||
<Column Name="End" DataType="DateTime" Description="结束。小于,不等于" />
|
||||
|
|
|
@ -283,7 +283,7 @@ namespace AntJob.Server
|
|||
|
||||
// 记录状态
|
||||
var online = GetOnline(app, Session as INetSession);
|
||||
online.Logs += list.Count;
|
||||
online.Tasks += list.Count;
|
||||
online.SaveAsync();
|
||||
|
||||
return list.ToArray();
|
||||
|
@ -321,14 +321,14 @@ namespace AntJob.Server
|
|||
}
|
||||
|
||||
/// <summary>生产消息</summary>
|
||||
/// <param name="jobitemid">任务</param>
|
||||
/// <param name="jobid">作业</param>
|
||||
/// <param name="topic">主体</param>
|
||||
/// <param name="messages">消息集合</param>
|
||||
/// <param name="delayTime">延迟执行间隔(实际执行时间=延迟+生产时间),单位秒</param>
|
||||
/// <param name="unique">消息去重。避免单个消息被重复生产</param>
|
||||
/// <returns></returns>
|
||||
[Api(nameof(Produce))]
|
||||
public Int32 Produce(Int32 jobitemid, String topic, String[] messages, Int32 delayTime = 0, Boolean unique = false)
|
||||
public Int32 Produce(Int32 jobid, String topic, String[] messages, Int32 delayTime = 0, Boolean unique = false)
|
||||
{
|
||||
if (messages == null) return 0;
|
||||
messages = messages.Distinct().ToArray();
|
||||
|
@ -336,10 +336,6 @@ namespace AntJob.Server
|
|||
|
||||
var app = Session["App"] as App;
|
||||
|
||||
var ji = JobTask.FindByID(jobitemid);
|
||||
var job = ji?.Job;
|
||||
//if (job == null) throw new Exception($"无效作业编号[jobIten={jobitemid}]无效");
|
||||
|
||||
// 去重过滤
|
||||
if (unique)
|
||||
{
|
||||
|
@ -353,9 +349,7 @@ namespace AntJob.Server
|
|||
var now = DateTime.Now;
|
||||
// 延迟需要基于任务开始时间,而不能用使用当前时间,防止回头跑数据时无法快速执行
|
||||
var dTime = delayTime.ToDateTime();
|
||||
if (ji != null)
|
||||
dTime = ji.Start.AddSeconds(delayTime);
|
||||
else if (dTime.Year < 2000)
|
||||
if (dTime.Year < 2000)
|
||||
dTime = now.AddSeconds(delayTime);
|
||||
|
||||
foreach (var item in messages)
|
||||
|
@ -363,11 +357,10 @@ namespace AntJob.Server
|
|||
var jm = new AppMessage
|
||||
{
|
||||
AppID = app.ID,
|
||||
//JobID = job.ID,
|
||||
JobID = jobid,
|
||||
Topic = topic,
|
||||
Data = item,
|
||||
};
|
||||
if (job != null) jm.JobID = job.ID;
|
||||
|
||||
jm.CreateTime = jm.UpdateTime = now;
|
||||
if (delayTime > 0) jm.UpdateTime = dTime;
|
||||
|
@ -404,7 +397,7 @@ namespace AntJob.Server
|
|||
[Api(nameof(Report))]
|
||||
public Boolean Report(JobTask task)
|
||||
{
|
||||
if (task == null || task.ID == 0) throw new InvalidOperationException("无效操作 JobItemID=" + task?.ID);
|
||||
if (task == null || task.ID == 0) throw new InvalidOperationException("无效操作 TaskID=" + task?.ID);
|
||||
|
||||
// 判断是否有权
|
||||
var app = Session["App"] as App;
|
||||
|
|
|
@ -54,9 +54,9 @@
|
|||
<td class="text-center">
|
||||
<a href="App/Set/@entity.ID?enable=@(entity.Enable?"false":"true")" data-action="action"><i class="glyphicon glyphicon-@(entity.Enable ? "ok" : "remove")" style="color: @(entity.Enable ? "green" : "red");"></i></a>
|
||||
</td>
|
||||
<td class="text-center"><a href="@Url.Action("Index","JobMessage",new {appid=entity.ID})">消息</a></td>
|
||||
<td class="text-center"><a href="@Url.Action("Index","AppMessage",new {appid=entity.ID})">消息</a></td>
|
||||
<td class="text-center"><a href="@Url.Action("Index","AppOnline",new {appid=entity.ID})">在线</a></td>
|
||||
<td class="text-center"><a href="@Url.Action("Index","JobItem",new {appid=entity.ID})">任务</a></td>
|
||||
<td class="text-center"><a href="@Url.Action("Index","JobTask",new {appid=entity.ID})">任务</a></td>
|
||||
<td class="text-center"><a href="@Url.Action("Index","JobError",new {appid=entity.ID})">错误</a></td>
|
||||
<td>@entity.UpdateTime.ToFullString("")</td>
|
||||
@if (this.Has(PermissionFlags.Detail, PermissionFlags.Update, PermissionFlags.Delete))
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
<td title="@entity.Name">@entity.Client</td>
|
||||
<td>@entity.Version</td>
|
||||
<td>@entity.Server</td>
|
||||
<td class="text-right"><a href="@Url.Action("Index","JobItem",new {appid=entity.AppID,client=entity.Client})">@entity.Logs.ToString("n0")</a></td>
|
||||
<td class="text-right"><a href="@Url.Action("Index","JobTask",new {appid=entity.AppID,client=entity.Client})">@entity.Logs.ToString("n0")</a></td>
|
||||
<td class="text-right">@entity.Total.ToString("n0")</td>
|
||||
<td class="text-right">@entity.Success.ToString("n0")</td>
|
||||
<td class="text-right"><a href="@Url.Action("Index","JobError",new {appid=entity.AppID,client=entity.Client})">@entity.Error.ToString("n0")</a></td>
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
@using System.Web.Mvc.Html;
|
||||
@using System.Web.Routing;
|
||||
@using AntJob.Data.Entity;
|
||||
@using AntJob.Data;
|
||||
@{
|
||||
var fact = ViewBag.Factory as IEntityOperate;
|
||||
var page = ViewBag.Page as Pager;
|
||||
|
@ -59,7 +60,7 @@
|
|||
{
|
||||
var st = entity.Start.ToFullString("");
|
||||
if (entity.Start.Date == DateTime.Now.Date) { st = entity.Start.ToString("HH:mm:ss"); }
|
||||
if (entity.Mode == AntJob.JobModes.Message) { st = "{0}/{1}".F(entity.Topic, entity.MessageCount); }
|
||||
if (entity.Mode == JobModes.Message) { st = "{0}/{1}".F(entity.Topic, entity.MessageCount); }
|
||||
|
||||
var ut = entity.UpdateTime.ToFullString("");
|
||||
if (entity.UpdateTime.Date == DateTime.Now.Date) { ut = entity.UpdateTime.ToString("HH:mm:ss"); }
|
||||
|
@ -69,14 +70,14 @@
|
|||
<td class="text-center"><input type="checkbox" name="keys" value="@entity[fk.Name]" /></td>
|
||||
}
|
||||
<td class="text-center hidden-md hidden-sm hidden-xs">@entity.ID</td>
|
||||
<td><a href="JobItem?JobID=@entity.ID">@entity.Name</a></td>
|
||||
<td><a href="JobTask?JobID=@entity.ID">@entity.Name</a></td>
|
||||
<td title="@entity.Description">@entity.DisplayName</td>
|
||||
@if (appid == 0)
|
||||
{
|
||||
<td>@entity.AppName</td>
|
||||
}
|
||||
<td class="text-center" title="@entity.Mode.GetDescription()">
|
||||
@if (entity.Mode == AntJob.JobModes.Alarm)
|
||||
@if (entity.Mode == JobModes.Alarm)
|
||||
{
|
||||
<b>@st</b>
|
||||
}
|
||||
|
@ -87,7 +88,7 @@
|
|||
</td>
|
||||
<td class="text-center">@entity.End.ToFullString("")</td>
|
||||
<td class="text-right">
|
||||
@if (entity.Mode != AntJob.JobModes.Message)
|
||||
@if (entity.Mode != JobModes.Message)
|
||||
{
|
||||
if (entity.StepRate > 0)
|
||||
{
|
||||
|
@ -104,7 +105,7 @@
|
|||
</td>
|
||||
<td class="text-right">@entity.BatchSize.ToString("n0")</td>
|
||||
<td class="text-right">
|
||||
@if (entity.Mode != AntJob.JobModes.Message)
|
||||
@if (entity.Mode != JobModes.Message)
|
||||
{
|
||||
@TimeSpan.FromSeconds(entity.Offset)
|
||||
}
|
||||
|
@ -119,8 +120,8 @@
|
|||
<a href="Job/Set/@entity.ID?enable=@(entity.Enable?"false":"true")" data-action="action"><i class="glyphicon glyphicon-@(entity.Enable ? "ok" : "remove")" style="color: @(entity.Enable ? "green" : "red");"></i></a>
|
||||
</td>
|
||||
<td class="text-center">@ut</td>
|
||||
<td class="text-center"><a href="JobMessage?JobID=@entity.ID">消息</a></td>
|
||||
<td class="text-center"><a href="JobItem?JobID=@entity.ID">任务</a></td>
|
||||
<td class="text-center"><a href="AppMessage?JobID=@entity.ID">消息</a></td>
|
||||
<td class="text-center"><a href="JobTask?JobID=@entity.ID">任务</a></td>
|
||||
<td class="text-center"><a href="JobStat?JobID=@entity.ID">统计</a></td>
|
||||
<td class="text-center"><a href="JobError?JobID=@entity.ID">错误</a></td>
|
||||
@if (this.Has(PermissionFlags.Detail, PermissionFlags.Update, PermissionFlags.Delete))
|
||||
|
|
|
@ -37,7 +37,4 @@
|
|||
<button type="button" class="btn btn-success btn-sm" data-action="action" data-url="@Url.Action("ClearError")" data-fields="keys" disabled>
|
||||
清空错误数
|
||||
</button>
|
||||
<button type="button" class="btn btn-success btn-sm" data-action="action" data-url="@Url.Action("ClearStepRate")" data-fields="keys" disabled title="将步进率置为0">
|
||||
清空步进率
|
||||
</button>
|
||||
}
|
|
@ -45,7 +45,7 @@
|
|||
<tr>
|
||||
<td class="text-center hidden-md hidden-sm hidden-xs">@entity.ID</td>
|
||||
<td><a href="Job?AppID=@entity.AppID">@entity.AppName</a></td>
|
||||
<td><a href="JobLog?JobID=@entity.JobID">@entity.JobName</a></td>
|
||||
<td><a href="JobTask?JobID=@entity.JobID">@entity.JobName</a></td>
|
||||
<td class="text-right">@entity.Step.ToString("n0")</td>
|
||||
<td class="text-right">@entity.BatchSize.ToString("n0")</td>
|
||||
<td>@entity.Key</td>
|
||||
|
|
Loading…
Reference in New Issue