LangGraphAdmin.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649
  1. <template>
  2. <div class="langgraph-admin page-container">
  3. <!-- 顶部状态栏 -->
  4. <el-row :gutter="16" class="status-row">
  5. <el-col :span="6">
  6. <el-card :class="['status-card', statusClass]" shadow="hover">
  7. <div class="status-icon">{{ statusIcon }}</div>
  8. <div class="status-info">
  9. <div class="status-label">服务状态</div>
  10. <div class="status-value">{{ statusText }}</div>
  11. <div class="status-sub">{{ statusTime }}</div>
  12. </div>
  13. </el-card>
  14. </el-col>
  15. <el-col :span="6">
  16. <el-card shadow="hover">
  17. <div class="status-icon" style="background:linear-gradient(135deg,#667eea,#764ba2)">🔗</div>
  18. <div class="status-info">
  19. <div class="status-label">服务地址</div>
  20. <div class="status-value" style="font-size:13px">{{ langgraphUrl }}</div>
  21. <div class="status-sub">端口 9000 · v{{ serviceVersion }}</div>
  22. </div>
  23. </el-card>
  24. </el-col>
  25. <el-col :span="6">
  26. <el-card shadow="hover">
  27. <div class="status-icon" style="background:linear-gradient(135deg,#11998e,#38ef7d)">📊</div>
  28. <div class="status-info">
  29. <div class="status-label">API 端点数</div>
  30. <div class="status-value">{{ apiCount }}</div>
  31. <div class="status-sub">个可用接口</div>
  32. </div>
  33. </el-card>
  34. </el-col>
  35. <el-col :span="6">
  36. <el-card shadow="hover">
  37. <div class="status-icon" style="background:linear-gradient(135deg,#fc4a1a,#f7b733)">⚡</div>
  38. <div class="status-info">
  39. <div class="status-label">刷新操作</div>
  40. <div style="margin-top:6px">
  41. <el-button size="mini" type="primary" @click="refreshAll" :loading="refreshing">刷新</el-button>
  42. <el-button size="mini" @click="testAllHealth">全部检测</el-button>
  43. </div>
  44. </div>
  45. </el-card>
  46. </el-col>
  47. </el-row>
  48. <!-- 组件健康状态 -->
  49. <el-card class="component-card" shadow="never">
  50. <div slot="header" class="card-header">
  51. <span>🧩 组件健康状态</span>
  52. <el-button size="mini" @click="fetchDetailedHealth">重新检测</el-button>
  53. </div>
  54. <el-table :data="componentList" border stripe size="small">
  55. <el-table-column prop="name" label="组件" width="160" />
  56. <el-table-column prop="status" label="状态" width="100">
  57. <template slot-scope="{ row }">
  58. <el-tag :type="row.status === 'ok' ? 'success' : row.status === 'error' ? 'danger' : 'info'" size="small">
  59. {{ row.status === 'ok' ? '正常' : row.status === 'error' ? '异常' : '未知' }}
  60. </el-tag>
  61. </template>
  62. </el-table-column>
  63. <el-table-column prop="detail" label="详情" />
  64. </el-table>
  65. </el-card>
  66. <!-- API 端点列表 -->
  67. <el-card class="api-card" shadow="never">
  68. <div slot="header" class="card-header">
  69. <span>📡 API 端点列表 ({{ apiEndpoints.length }})</span>
  70. <el-input v-model="apiFilter" placeholder="筛选端点..." size="mini" prefix-icon="el-icon-search" style="width:200px" clearable />
  71. </div>
  72. <el-table :data="filteredApiEndpoints" border stripe size="small" max-height="500">
  73. <el-table-column prop="method" label="方法" width="80">
  74. <template slot-scope="{ row }">
  75. <el-tag :type="row.method === 'GET' ? 'info' : 'primary'" size="mini">{{ row.method }}</el-tag>
  76. </template>
  77. </el-table-column>
  78. <el-table-column prop="path" label="路径" min-width="280" show-overflow-tooltip />
  79. <el-table-column prop="summary" label="说明" min-width="200" show-overflow-tooltip />
  80. <el-table-column label="操作" width="100" fixed="right">
  81. <template slot-scope="{ row }">
  82. <el-button v-if="row.method === 'POST'" type="text" size="small" @click="openTestDialog(row)">测试</el-button>
  83. </template>
  84. </el-table-column>
  85. </el-table>
  86. </el-card>
  87. <!-- 快速测试面板 -->
  88. <el-card class="test-card" shadow="never">
  89. <div slot="header" class="card-header">
  90. <span>🧪 功能测试</span>
  91. <el-button size="mini" type="success" @click="runQuickTests" :loading="quickTesting">一键测试</el-button>
  92. </div>
  93. <el-row :gutter="12">
  94. <el-col :span="6" v-for="t in quickTests" :key="t.key">
  95. <el-card shadow="hover" class="test-item" :class="'test-' + t.result">
  96. <div class="test-item-header">
  97. <span class="test-name">{{ t.name }}</span>
  98. <el-tag :type="t.result === 'success' ? 'success' : t.result === 'error' ? 'danger' : 'info'" size="mini">
  99. {{ t.result === 'success' ? '✓' : t.result === 'error' ? '✗' : '—' }}
  100. </el-tag>
  101. </div>
  102. <div class="test-item-desc">{{ t.desc }}</div>
  103. <div v-if="t.result === 'error'" class="test-item-error">{{ t.errorMsg }}</div>
  104. <div v-if="t.result === 'success'" class="test-item-time">{{ t.time }}ms</div>
  105. </el-card>
  106. </el-col>
  107. </el-row>
  108. </el-card>
  109. <!-- 配置面板 -->
  110. <el-card class="config-card" shadow="never">
  111. <div slot="header" class="card-header">
  112. <span>⚙️ 服务配置</span>
  113. <el-button size="mini" type="primary" @click="fetchConfig">刷新配置</el-button>
  114. </div>
  115. <el-descriptions :column="2" border size="small">
  116. <el-descriptions-item label="LLM 模型" :span="1">
  117. <el-tag size="mini">{{ config.LLM_MODEL || '-' }}</el-tag>
  118. </el-descriptions-item>
  119. <el-descriptions-item label="LLM 基础 URL" :span="1">
  120. {{ config.LLM_BASE_URL || '-' }}
  121. </el-descriptions-item>
  122. <el-descriptions-item label="Embedding 模型" :span="1">
  123. <el-tag size="mini">{{ config.EMBEDDING_MODEL || '-' }}</el-tag>
  124. </el-descriptions-item>
  125. <el-descriptions-item label="Embedding URL" :span="1">
  126. {{ config.EMBEDDING_BASE_URL || '-' }}
  127. </el-descriptions-item>
  128. <el-descriptions-item label="Java 后端地址" :span="1">
  129. {{ config.JAVA_BASE_URL || '-' }}
  130. </el-descriptions-item>
  131. <el-descriptions-item label="Chroma DB 路径" :span="1">
  132. {{ config.CHROMA_DB_PATH || '-' }}
  133. </el-descriptions-item>
  134. <el-descriptions-item label="LangSmith 追踪" :span="1">
  135. <el-tag :type="config.LANGCHAIN_TRACING_V2 === 'true' ? 'success' : 'info'" size="mini">
  136. {{ config.LANGCHAIN_TRACING_V2 === 'true' ? '已启用' : '未启用' }}
  137. </el-tag>
  138. </el-descriptions-item>
  139. <el-descriptions-item label="日志级别" :span="1">
  140. <el-tag size="mini">{{ config.LOG_LEVEL || 'info' }}</el-tag>
  141. </el-descriptions-item>
  142. </el-descriptions>
  143. </el-card>
  144. <!-- API 测试对话框 -->
  145. <el-dialog :visible.sync="testDialogVisible" :title="'测试: ' + testingEndpoint.path" width="700px" :close-on-click-modal="false">
  146. <el-form size="small">
  147. <el-form-item label="请求参数">
  148. <el-input
  149. v-model="testParams"
  150. type="textarea"
  151. :rows="8"
  152. placeholder='请输入 JSON 参数,例如: {"user_id": 1, "query": "你好"}'
  153. />
  154. </el-form-item>
  155. <el-form-item>
  156. <el-button type="primary" @click="runTest" :loading="testing">发送请求</el-button>
  157. <el-button @click="testDialogVisible = false">关闭</el-button>
  158. </el-form-item>
  159. </el-form>
  160. <el-divider>响应结果</el-divider>
  161. <pre class="response-pre" v-if="testResponse">{{ testResponse }}</pre>
  162. <el-alert v-else type="info" :closable="false" description="点击"发送请求"查看响应结果" />
  163. </el-dialog>
  164. <!-- 日志面板 -->
  165. <el-card class="log-card" shadow="never">
  166. <div slot="header" class="card-header">
  167. <span>📋 最近日志</span>
  168. <div>
  169. <el-button size="mini" @click="fetchLogs" :loading="logLoading">刷新</el-button>
  170. <el-button size="mini" type="danger" @click="clearLogs">清空</el-button>
  171. </div>
  172. </div>
  173. <div class="log-container" ref="logContainer">
  174. <div v-for="(log, i) in logList" :key="i" class="log-line" :class="'log-' + getLogLevel(log)">
  175. <span class="log-time">{{ log.time }}</span>
  176. <span class="log-level">{{ log.level }}</span>
  177. <span class="log-msg">{{ log.msg }}</span>
  178. </div>
  179. <div v-if="logList.length === 0" class="log-empty">暂无日志</div>
  180. </div>
  181. </el-card>
  182. </div>
  183. </template>
  184. <script>
  185. const BASE = 'https://ai.etotem.com.cn'
  186. function fetchJSON(url, options = {}) {
  187. return fetch(url, {
  188. ...options,
  189. headers: {
  190. 'Content-Type': 'application/json',
  191. ...options.headers
  192. }
  193. }).then(function(res) {
  194. if (!res.ok) throw new Error('HTTP ' + res.status)
  195. return res.json()
  196. })
  197. }
  198. function fetchText(url, options = {}) {
  199. return fetch(url, {
  200. ...options,
  201. headers: {
  202. 'Content-Type': 'application/json',
  203. ...options.headers
  204. }
  205. }).then(function(res) {
  206. if (!res.ok) throw new Error('HTTP ' + res.status)
  207. return res.text()
  208. })
  209. }
  210. export default {
  211. name: 'LangGraphAdmin',
  212. data() {
  213. return {
  214. langgraphUrl: 'https://ai.etotem.com.cn',
  215. serviceVersion: '0.3.0',
  216. statusText: '检测中...',
  217. statusClass: 'status-checking',
  218. statusIcon: '🔄',
  219. statusTime: '',
  220. apiCount: 0,
  221. apiEndpoints: [],
  222. apiFilter: '',
  223. componentList: [],
  224. refreshing: false,
  225. quickTesting: false,
  226. config: {
  227. LLM_MODEL: 'deepseek',
  228. LLM_BASE_URL: 'http://axonhub.iwintrue.com/v1',
  229. EMBEDDING_MODEL: 'BAAI/bge-large-zh-v1.5',
  230. EMBEDDING_BASE_URL: 'https://api.siliconflow.cn/v1',
  231. JAVA_BASE_URL: 'http://111.227.6.214:9082',
  232. CHROMA_DB_PATH: '/data/chroma_db',
  233. LANGCHAIN_TRACING_V2: 'true',
  234. LOG_LEVEL: 'info'
  235. },
  236. testDialogVisible: false,
  237. testingEndpoint: {},
  238. testParams: '{}',
  239. testing: false,
  240. testResponse: '',
  241. logList: [],
  242. logLoading: false,
  243. _interval: null
  244. }
  245. },
  246. computed: {
  247. filteredApiEndpoints: function() {
  248. var self = this
  249. if (!self.apiFilter) return self.apiEndpoints
  250. var kw = self.apiFilter.toLowerCase()
  251. return self.apiEndpoints.filter(function(e) {
  252. return e.path.toLowerCase().indexOf(kw) >= 0 || (e.summary && e.summary.toLowerCase().indexOf(kw) >= 0)
  253. })
  254. },
  255. quickTests: function() {
  256. return [
  257. { key: 'food', name: '食材识别', desc: 'POST /api/v1/food/recognize', result: 'pending', time: 0, errorMsg: '' },
  258. { key: 'menu', name: '菜单生成', desc: 'POST /api/v1/menu/generate', result: 'pending', time: 0, errorMsg: '' },
  259. { key: 'chat', name: 'AI 对话', desc: 'POST /api/v1/chat', result: 'pending', time: 0, errorMsg: '' },
  260. { key: 'questionnaire', name: '问卷生成', desc: 'POST /api/v1/questionnaire/generate', result: 'pending', time: 0, errorMsg: '' }
  261. ]
  262. }
  263. },
  264. created: function() {
  265. this.refreshAll()
  266. this.fetchLogs()
  267. this._interval = setInterval(this.refreshAll, 30000)
  268. },
  269. beforeDestroy: function() {
  270. if (this._interval) clearInterval(this._interval)
  271. },
  272. methods: {
  273. async refreshAll() {
  274. this.refreshing = true
  275. try {
  276. await Promise.all([this.fetchHealth(), this.fetchSpec()])
  277. } finally {
  278. this.refreshing = false
  279. }
  280. },
  281. async fetchHealth() {
  282. try {
  283. var img = new Image()
  284. var healthy = await new Promise(function(resolve) {
  285. img.onload = function() { resolve(true) }
  286. img.onerror = function() { resolve(false) }
  287. img.src = BASE + '/health?t=' + Date.now()
  288. })
  289. if (healthy) {
  290. this.statusText = '运行中'
  291. this.statusClass = 'status-healthy'
  292. this.statusIcon = '✅'
  293. } else {
  294. this.statusText = '未响应'
  295. this.statusClass = 'status-unhealthy'
  296. this.statusIcon = '❌'
  297. }
  298. } catch (e) {
  299. this.statusText = '异常'
  300. this.statusClass = 'status-unhealthy'
  301. this.statusIcon = '❌'
  302. }
  303. this.statusTime = new Date().toLocaleTimeString()
  304. },
  305. async fetchSpec() {
  306. try {
  307. var res = await fetchJSON(BASE + '/openapi.json')
  308. var paths = res.paths || {}
  309. var endpoints = []
  310. var self = this
  311. Object.keys(paths).forEach(function(path) {
  312. var methods = paths[path]
  313. Object.keys(methods).forEach(function(method) {
  314. var info = methods[method]
  315. endpoints.push({
  316. method: method.toUpperCase(),
  317. path: path,
  318. summary: info.summary || info.description || ''
  319. })
  320. })
  321. })
  322. endpoints.sort(function(a, b) {
  323. if (a.method !== b.method) return a.method.localeCompare(b.method)
  324. return a.path.localeCompare(b.path)
  325. })
  326. this.apiEndpoints = endpoints
  327. this.apiCount = endpoints.length
  328. this.fetchDetailedHealth()
  329. } catch (e) {
  330. console.error('获取 API 规范失败', e)
  331. }
  332. },
  333. async fetchDetailedHealth() {
  334. try {
  335. var res = await fetchJSON(BASE + '/api/v1/health')
  336. var data = res || {}
  337. var comps = []
  338. var c = data.components || {}
  339. if (c.chromadb) {
  340. comps.push({ name: 'ChromaDB', status: c.chromadb.status || 'unknown', detail: c.chromadb.path || '' })
  341. }
  342. if (c.llm) {
  343. comps.push({ name: 'LLM', status: c.llm.status || 'unknown', detail: c.llm.message || '' })
  344. }
  345. if (c.java_backend) {
  346. comps.push({ name: 'Java 后端', status: c.java_backend.status || 'unknown', detail: c.java_backend.code ? 'HTTP ' + c.java_backend.code : '' })
  347. }
  348. this.componentList = comps
  349. var allOk = comps.every(function(x) { return x.status === 'ok' })
  350. var hasError = comps.some(function(x) { return x.status === 'error' })
  351. if (allOk) {
  352. this.statusText = '运行中'
  353. this.statusClass = 'status-healthy'
  354. this.statusIcon = '✅'
  355. } else if (hasError) {
  356. this.statusText = '部分异常'
  357. this.statusClass = 'status-degraded'
  358. this.statusIcon = '⚠️'
  359. } else {
  360. this.statusText = '检测中'
  361. this.statusClass = 'status-checking'
  362. this.statusIcon = '🔄'
  363. }
  364. this.statusTime = new Date().toLocaleTimeString()
  365. } catch (e) {
  366. this.componentList = [{ name: '健康检查', status: 'error', detail: e.message }]
  367. }
  368. },
  369. fetchConfig: function() {
  370. this.config = {
  371. LLM_MODEL: 'deepseek',
  372. LLM_BASE_URL: 'http://axonhub.iwintrue.com/v1',
  373. EMBEDDING_MODEL: 'BAAI/bge-large-zh-v1.5',
  374. EMBEDDING_BASE_URL: 'https://api.siliconflow.cn/v1',
  375. JAVA_BASE_URL: 'http://111.227.6.214:9082',
  376. CHROMA_DB_PATH: '/data/chroma_db',
  377. LANGCHAIN_TRACING_V2: 'true',
  378. LOG_LEVEL: 'info'
  379. }
  380. },
  381. openTestDialog: function(endpoint) {
  382. this.testingEndpoint = endpoint
  383. var defaults = {
  384. '/api/v1/food/recognize': JSON.stringify({ image_url: 'https://example.com/food.jpg' }, null, 2),
  385. '/api/v1/menu/generate': JSON.stringify({ selected_foods: '[{"name":"鸡肉"}]', participants: '[]', date: '2026-08-08' }, null, 2),
  386. '/api/v1/chat': JSON.stringify({ query: '你好', user_id: 1 }, null, 2),
  387. '/api/v1/recommend': JSON.stringify({ user_id: 1, query: '推荐早餐', limit: 5 }, null, 2),
  388. '/api/v1/questionnaire/generate': JSON.stringify({ member_name: '小明', relationship_type: 'parent' }, null, 2)
  389. }
  390. this.testParams = defaults[endpoint.path] || '{}'
  391. this.testResponse = ''
  392. this.testDialogVisible = true
  393. },
  394. async runTest() {
  395. var self = this
  396. self.testing = true
  397. self.testResponse = ''
  398. try {
  399. var payload = {}
  400. if (self.testParams && self.testParams !== '请上传舌苔图片 (MIME 类型表单)') {
  401. payload = JSON.parse(self.testParams)
  402. }
  403. var path = self.testingEndpoint.path
  404. var res = await fetch(BASE + path, {
  405. method: 'POST',
  406. headers: { 'Content-Type': 'application/json' },
  407. body: JSON.stringify(payload),
  408. signal: AbortSignal.timeout(60000)
  409. })
  410. var data = await res.json()
  411. self.testResponse = JSON.stringify(data, null, 2)
  412. } catch (e) {
  413. self.testResponse = '错误: ' + e.message
  414. } finally {
  415. self.testing = false
  416. }
  417. },
  418. async runQuickTests() {
  419. var self = this
  420. self.quickTesting = true
  421. var tests = self.quickTests.slice()
  422. var results = { food: tests[0], menu: tests[1], chat: tests[2], questionnaire: tests[3] }
  423. var t0 = Date.now()
  424. try {
  425. var r1 = await fetch(BASE + '/api/v1/food/recognize', {
  426. method: 'POST',
  427. headers: { 'Content-Type': 'application/json' },
  428. body: JSON.stringify({ image_url: 'https://example.com/food.jpg' })
  429. })
  430. await r1.json()
  431. results.food.result = 'success'
  432. results.food.time = Date.now() - t0
  433. } catch (e) {
  434. results.food.result = 'error'
  435. results.food.errorMsg = e.message
  436. }
  437. t0 = Date.now()
  438. try {
  439. var r2 = await fetch(BASE + '/api/v1/menu/generate', {
  440. method: 'POST',
  441. headers: { 'Content-Type': 'application/json' },
  442. body: JSON.stringify({ selected_foods: '[{"name":"鸡肉"}]', participants: '[]', date: '2026-08-08' })
  443. })
  444. await r2.json()
  445. results.menu.result = 'success'
  446. results.menu.time = Date.now() - t0
  447. } catch (e) {
  448. results.menu.result = 'error'
  449. results.menu.errorMsg = e.message
  450. }
  451. t0 = Date.now()
  452. try {
  453. var r3 = await fetch(BASE + '/api/v1/chat', {
  454. method: 'POST',
  455. headers: { 'Content-Type': 'application/json' },
  456. body: JSON.stringify({ query: '你好', user_id: 1 })
  457. })
  458. await r3.json()
  459. results.chat.result = 'success'
  460. results.chat.time = Date.now() - t0
  461. } catch (e) {
  462. results.chat.result = 'error'
  463. results.chat.errorMsg = e.message
  464. }
  465. t0 = Date.now()
  466. try {
  467. var r4 = await fetch(BASE + '/api/v1/questionnaire/generate', {
  468. method: 'POST',
  469. headers: { 'Content-Type': 'application/json' },
  470. body: JSON.stringify({ member_name: '小明', relationship_type: 'parent' })
  471. })
  472. await r4.json()
  473. results.questionnaire.result = 'success'
  474. results.questionnaire.time = Date.now() - t0
  475. } catch (e) {
  476. results.questionnaire.result = 'error'
  477. results.questionnaire.errorMsg = e.message
  478. }
  479. tests[0] = results.food
  480. tests[1] = results.menu
  481. tests[2] = results.chat
  482. tests[3] = results.questionnaire
  483. self.quickTesting = false
  484. },
  485. async fetchLogs() {
  486. this.logLoading = true
  487. try {
  488. var res = await fetch(BASE + '/openapi.json')
  489. var data = await res.json()
  490. this.logList = [{
  491. time: new Date().toLocaleTimeString(),
  492. level: 'INFO',
  493. msg: '服务连接正常,API 端点数: ' + Object.keys(data.paths || {}).length
  494. }]
  495. } catch (e) {
  496. this.logList = [{
  497. time: new Date().toLocaleTimeString(),
  498. level: 'ERROR',
  499. msg: '无法连接到 LangGraph 服务: ' + e.message
  500. }]
  501. } finally {
  502. this.logLoading = false
  503. }
  504. },
  505. clearLogs: function() {
  506. this.logList = []
  507. },
  508. testAllHealth: function() {
  509. this.fetchHealth()
  510. this.fetchDetailedHealth()
  511. },
  512. getLogLevel: function(log) {
  513. if (log.level === 'ERROR' || log.level === 'error') return 'error'
  514. if (log.level === 'WARNING' || log.level === 'WARN') return 'warning'
  515. return 'info'
  516. }
  517. }
  518. }
  519. </script>
  520. <style scoped>
  521. .page-container {
  522. padding: 16px;
  523. }
  524. .status-row {
  525. margin-bottom: 16px;
  526. }
  527. .status-card {
  528. display: flex;
  529. align-items: center;
  530. padding: 12px 16px;
  531. cursor: default;
  532. transition: all 0.3s;
  533. }
  534. .status-card:hover {
  535. transform: translateY(-2px);
  536. }
  537. .status-healthy { border-left: 4px solid #67c23a; }
  538. .status-unhealthy { border-left: 4px solid #f56c6c; }
  539. .status-degraded { border-left: 4px solid #e6a23c; }
  540. .status-checking { border-left: 4px solid #409eff; }
  541. .status-icon {
  542. font-size: 32px;
  543. margin-right: 16px;
  544. }
  545. .status-info {
  546. flex: 1;
  547. }
  548. .status-label {
  549. font-size: 12px;
  550. color: #909399;
  551. margin-bottom: 4px;
  552. }
  553. .status-value {
  554. font-size: 18px;
  555. font-weight: bold;
  556. color: #303133;
  557. }
  558. .status-sub {
  559. font-size: 12px;
  560. color: #909399;
  561. margin-top: 2px;
  562. }
  563. .card-header {
  564. display: flex;
  565. justify-content: space-between;
  566. align-items: center;
  567. }
  568. .test-item {
  569. cursor: default;
  570. transition: all 0.3s;
  571. }
  572. .test-item:hover {
  573. transform: translateY(-2px);
  574. }
  575. .test-item-header {
  576. display: flex;
  577. justify-content: space-between;
  578. align-items: center;
  579. margin-bottom: 8px;
  580. }
  581. .test-name {
  582. font-weight: 600;
  583. font-size: 14px;
  584. color: #303133;
  585. }
  586. .test-item-desc {
  587. font-size: 12px;
  588. color: #909399;
  589. margin-bottom: 6px;
  590. }
  591. .test-item-error {
  592. font-size: 11px;
  593. color: #f56c6c;
  594. margin-top: 4px;
  595. }
  596. .test-item-time {
  597. font-size: 11px;
  598. color: #67c23a;
  599. margin-top: 4px;
  600. }
  601. .response-pre {
  602. background: #f5f7fa;
  603. padding: 12px;
  604. border-radius: 4px;
  605. font-size: 12px;
  606. max-height: 400px;
  607. overflow-y: auto;
  608. white-space: pre-wrap;
  609. word-break: break-all;
  610. }
  611. .log-container {
  612. max-height: 250px;
  613. overflow-y: auto;
  614. background: #1e1e1e;
  615. border-radius: 4px;
  616. padding: 12px;
  617. font-family: 'Courier New', monospace;
  618. font-size: 12px;
  619. }
  620. .log-line {
  621. display: flex;
  622. gap: 12px;
  623. padding: 2px 0;
  624. line-height: 1.6;
  625. }
  626. .log-time { color: #888; min-width: 80px; }
  627. .log-level { min-width: 60px; font-weight: bold; }
  628. .log-level.ERROR { color: #f56c6c; }
  629. .log-level.WARNING { color: #e6a23c; }
  630. .log-level.INFO { color: #67c23a; }
  631. .log-msg { color: #d4d4d4; flex: 1; }
  632. .log-empty { color: #666; text-align: center; padding: 20px; }
  633. </style>