feat(timer): 新增定时器配置、日志和主机的后台管理界面

T10: TimerConfig CURD - task management with run_type/status editing,
     manual trigger button, task_name read-only, no add/delete
T11: TimerLog CURD - read-only log viewer with filters and color badges
T12: Host list enhanced - is_master column, setMaster button
This commit is contained in:
augushong
2026-05-26 02:50:40 +08:00
parent 25fab093fa
commit 90e584f5a1
23 changed files with 943 additions and 18 deletions

View File

@@ -2,11 +2,36 @@
namespace app\admin\model;
use think\Model;
use app\common\model\TimeModel;
class SystemTimerConfig extends Model
/**
* @property int $id
* @property string $task_name 任务名称
* @property string $run_type 运行类型:main/auto/all/manual main:main,auto:auto,all:all,manual:manual
* @property int $status 状态:0=停用,1=启用 0:停用,1:启用
* @property int $is_synced 是否已同步:0=未同步,1=已同步 0:未同步,1:已同步
* @property string $last_execute_node 最后执行节点ID
* @property int $last_execute_time 最后执行时间戳
* @property int $manual_trigger 手动触发标记:0=未触发,1=已触发 0:未触发,1:已触发
* @property int $create_time 创建时间
*/
class SystemTimerConfig extends TimeModel
{
protected $name = 'system_timer_config';
protected $autoWriteTimestamp = true;
protected $name = "system_timer_config";
protected $deleteTime = false;
public const SELECT_LIST_RUN_TYPE = ['main' => 'main', 'auto' => 'auto', 'all' => 'all', 'manual' => 'manual'];
public const SELECT_LIST_STATUS = ['0' => '停用', '1' => '启用'];
public const SELECT_LIST_IS_SYNCED = ['0' => '未同步', '1' => '已同步'];
public const SELECT_LIST_MANUAL_TRIGGER = ['0' => '未触发', '1' => '已触发'];
}

View File

@@ -2,11 +2,30 @@
namespace app\admin\model;
use think\Model;
use app\common\model\TimeModel;
class SystemTimerLog extends Model
/**
* @property int $id
* @property string $task_name 任务名称
* @property string $node_id 执行节点ID
* @property string $run_type 运行类型
* @property int $start_time 开始时间戳
* @property int $end_time 结束时间戳
* @property int $duration 耗时
* @property string $status 状态:running/success/error
* @property string $error_message 错误信息
* @property int $concurrency_id 并发分片ID
* @property int $create_time 创建时间
*/
class SystemTimerLog extends TimeModel
{
protected $name = 'system_timer_log';
protected $autoWriteTimestamp = true;
protected $name = "system_timer_log";
protected $deleteTime = false;
}