支持启动测试时弹框提示点击跳转到指定报告
This commit is contained in:
parent
1cf33f08a2
commit
d012393c94
|
@ -80,10 +80,10 @@ class AbstractDispatcher(ABC):
|
|||
self.dispatcher_logger = DispatcherLogger(use_memory_string_handler=True,
|
||||
use_dispatcher_log_db_handler=True,
|
||||
dispatcher_id=self.dispatcher.id)
|
||||
# 发送调度执行开始信息
|
||||
emit_dispatcher_start(id=self.dispatcher.id, type=self.trigger_element_type)
|
||||
# 调度报告
|
||||
Report.add(name=element.name, result=REPORT_RESULT.RUNNING, dispatcher_id=self.dispatcher.id)
|
||||
report = Report.add(name=element.name, result=REPORT_RESULT.RUNNING, dispatcher_id=self.dispatcher.id)
|
||||
# 发送调度执行开始信息
|
||||
emit_dispatcher_start(id=self.dispatcher.id, type=self.trigger_element_type, report_id=report.id)
|
||||
elif logger is not None:
|
||||
self.dispatcher_logger = logger
|
||||
# 创建一条调度子数据
|
||||
|
|
|
@ -31,17 +31,19 @@ def emit_dispatcher_result(id, type, result):
|
|||
)
|
||||
|
||||
|
||||
def emit_dispatcher_start(id, type):
|
||||
def emit_dispatcher_start(id, type, report_id):
|
||||
"""
|
||||
调度执行开始
|
||||
:param id:调度id
|
||||
:param type:调度类型 project/module
|
||||
:param report_id: 报告id
|
||||
"""
|
||||
socketio.emit(
|
||||
SocketIOEvent.DISPATCHER_BEGIN,
|
||||
dict(
|
||||
id=str(id),
|
||||
type=str(type).lower(),
|
||||
report_id=str(report_id),
|
||||
),
|
||||
namespace='/user/' + str(current_user.id),
|
||||
)
|
||||
|
|
|
@ -37,8 +37,9 @@ let dispatcher_id = null; // 项目调度id 打开模块页面时查询返回调
|
|||
user_socket.on('DISPATCHER_BEGIN', function (data) {
|
||||
dispatcher_id = data.id;
|
||||
if (data.type === 'project'){
|
||||
message("项目测试启动成功", "success");
|
||||
projectDispatcherRunning();
|
||||
// message("项目测试启动成功", "success");
|
||||
message(`<a class="text-left" target="_blank" href='/report/detail/${data.report_id}' style="text-decoration:underline;">项目测试启动成功,点击跳转到编号${data.report_id}报告</a>`, "success");
|
||||
}
|
||||
});
|
||||
// 调度结束
|
||||
|
|
|
@ -97,8 +97,9 @@ user_socket.on('DISPATCHER_RESULT', function (data) {
|
|||
user_socket.on('DISPATCHER_BEGIN', function (data) {
|
||||
dispatcher_id = data.id;
|
||||
if (data.type === 'module'){
|
||||
message("模块测试启动成功", "success");
|
||||
moduleDispatcherRunning();
|
||||
// message("模块测试启动成功", "success");
|
||||
message(`<a class="text-left" target="_blank" href='/report/detail/${data.report_id}' style="text-decoration:underline;">模块测试启动成功,点击跳转到编号${data.report_id}报告</a>`, "success");
|
||||
}
|
||||
});
|
||||
// 调度结束
|
||||
|
|
Loading…
Reference in New Issue