重构中间件结构,新增ws模块实现WebSocket流程执行实时推送 将SSE服务拆分为独立端口监听,默认8866 优化前端流式模式切换,支持WS/SSE协议选择 统一流式事件处理逻辑,完善错误处理与取消机制 更新Cargo.toml依赖,添加WebSocket相关库 调整代码组织结构,规范导入分组与注释
154 lines
2.9 KiB
Plaintext
154 lines
2.9 KiB
Plaintext
/**
|
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
.testrun-panel-form {
|
|
|
|
.testrun-panel-input {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
gap: 8px;
|
|
margin: 0 12px 8px 0;
|
|
flex-wrap: wrap; // 允许在小屏时换行,但尽量保持在一行
|
|
|
|
.title {
|
|
font-size: 15px;
|
|
font-weight: 500;
|
|
color: #333;
|
|
flex: 1;
|
|
}
|
|
|
|
.toggle {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
white-space: nowrap;
|
|
}
|
|
}
|
|
|
|
|
|
.error {
|
|
color: red;
|
|
font-size: 14px;
|
|
}
|
|
|
|
.code-editor-container {
|
|
min-height: 240px;
|
|
max-height: 520px;
|
|
background: #fff;
|
|
padding: 8px 8px 8px 4px;
|
|
border-radius: 4px;
|
|
border: 1px solid #52649a0f;
|
|
|
|
:global(.cm-editor) {
|
|
height: 100% !important;
|
|
overflow: auto !important;
|
|
}
|
|
|
|
:global(.cm-scroller) {
|
|
min-height: 240px !important;
|
|
max-height: 520px !important;
|
|
}
|
|
|
|
:global(.cm-content) {
|
|
min-height: 240px !important;
|
|
max-height: 520px !important;
|
|
}
|
|
}
|
|
}
|
|
|
|
.testrun-panel-running {
|
|
width: 100%;
|
|
height: 80%;
|
|
display: flex;
|
|
flex-direction: column;
|
|
justify-content: center;
|
|
align-items: center;
|
|
gap: 16px;
|
|
|
|
.text {
|
|
font-size: 18px;
|
|
}
|
|
}
|
|
|
|
.button {
|
|
border-radius: 8px;
|
|
width: 100%;
|
|
height: 40px;
|
|
margin: 0;
|
|
box-sizing: border-box;
|
|
|
|
&.running {
|
|
background-color: rgba(87, 104, 161, 0.08) !important; // override semi style
|
|
color: rgba(15, 21, 40, 0.82);
|
|
}
|
|
|
|
&.default {
|
|
background-color: rgba(0, 178, 60, 1) !important; // override semi style
|
|
color: #fff;
|
|
}
|
|
}
|
|
|
|
|
|
.testrun-panel-container {
|
|
background: rgb(255, 255, 255);
|
|
margin: 8px 8px 8px 0;
|
|
height: calc(100vh - 40px);
|
|
border-radius: 8px;
|
|
border: 1px solid rgba(82, 100, 154, 0.13);
|
|
padding: 8px 0 8px 0;
|
|
display: flex;
|
|
flex-direction: column;
|
|
overflow: hidden;
|
|
position: relative;
|
|
|
|
.testrun-panel-header {
|
|
background: var(#fcfcff);
|
|
border-bottom: 1px solid rgba(82, 100, 154, 0.13);
|
|
border-top-left-radius: 8px;
|
|
border-top-right-radius: 8px;
|
|
display: flex;
|
|
height: 40px;
|
|
justify-content: space-between;
|
|
min-height: 40px;
|
|
width: 100%;
|
|
align-items: center;
|
|
|
|
.testrun-panel-title {
|
|
font-size: 16px;
|
|
font-weight: 500;
|
|
margin: 8px 8px 8px 16px;
|
|
}
|
|
|
|
.testrun-panel-close {
|
|
margin: 8px 16px 8px 8px;
|
|
}
|
|
}
|
|
|
|
.testrun-panel-content {
|
|
height: calc(100% - 40px);
|
|
margin: 8px 8px 8px 16px;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 8px;
|
|
overflow: auto;
|
|
margin-bottom: 72px;
|
|
}
|
|
|
|
.testrun-panel-footer {
|
|
border-top: 1px solid rgba(82, 100, 154, 0.13);
|
|
position: absolute;
|
|
background: #fbfbfb;
|
|
height: 72px;
|
|
left: 0;
|
|
right: 0;
|
|
bottom: 0;
|
|
border-radius: 0 0 8px 8px;
|
|
padding: 8px 16px;
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
}
|