Files
YG_FT/frontend/dist/assets/InferenceListView-B74C2RPL.js
wuyongtao 836343b29e feat: 新增 compute_gateway、compute_poller、agent 模块,重构前端 dist
- 新增 backend/app/modules/compute_gateway(client/sync)计算网关模块
- 新增 backend/app/workers/compute_poller 计算轮询 worker
- 新增 compute/agent/process_manager 进程管理器
- 新增 scripts/ 脚本目录
- 更新 Docker 部署配置(app/compute/nginx)
- 更新后端平台 API、数据库 SQL、core 配置
- 更新前端多个视图组件及 API 模块
- 重构 frontend/dist 构建产物(新 hash)
- 更新多项文档

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-22 20:26:16 +08:00

2 lines
5.0 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{E as D}from"./index-BNsCyG4A.js";import{E as L}from"./index-ByhS8A1d.js";import{E as A}from"./el-table-C7Zx0Bmo.js";import{d as S,G as $,ah as w,e as d,w as i,y as x,o as n,q as c,x as l,c as P,s as o,M as R,aa as f,A as h,v as V}from"./index-Ds9AETjS.js";import{E as J}from"./index-DqJTjrY3.js";/* empty css */import"./el-checkbox-pV3o_8iy.js";import{D as O}from"./DataTablePage-DzEUb2tf.js";import{u as U}from"./usePolling-Bx2QCw4O.js";import{g as j,l as q,u as F,a as G,s as I,d as H}from"./compare-fmy9bbtE.js";import"./el-scrollbar-CF42LNzg.js";import"./index-BSbCLbaz.js";import"./el-popper-D1tByNLb.js";import"./index-sWKLi7bH.js";import"./_baseClone-CZxxnGCv.js";import"./_baseIteratee-82gB5Yov.js";import"./castArray-BWI4UxBy.js";import"./debounce-D6mJVDYC.js";import"./toNumber-DrayciwT.js";import"./raf-zQ00nuMI.js";import"./validator-D1MwuZXj.js";import"./index-jBnYrPdD.js";import"./clamp-CyhADbdq.js";import"./index-RtwaMutE.js";import"./scroll-DVmMv0d9.js";import"./index-h5FkzAP_.js";import"./index-B0if-AHo.js";import"./omit-BzI1MV_K.js";import"./el-card-D86TXgMv.js";import"./el-pagination-C9R_oTJ1.js";import"./el-select-BD70by95.js";import"./vnode-CBiWHFw7.js";import"./index-CQlF36Lk.js";import"./directive-B1cwmVOz.js";import"./el-tooltip-l0sNRNKZ.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";const K={class:"action-buttons"},Ae=S({__name:"InferenceListView",setup(Q){const E=V(),g=x(!1),y=x([]);let u=null;async function r(t=!1){t||(g.value=!0);try{y.value=await j()||[]}catch{}finally{t||(g.value=!1)}}function _(t){const e=k(t);return e.length>0&&e.some(s=>s.status==="starting")}function v(t){const e=k(t);return e.length===0?t.status==="loaded"||t.status==="ready":e.every(s=>s.status==="ready"||s.status==="running")&&!_(t)}function k(t){if(!t.load_status)return[];try{return(typeof t.load_status=="string"?JSON.parse(t.load_status):t.load_status).loaded_models||[]}catch{return[]}}function z(t){if(!t.models)return[];if(Array.isArray(t.models))return t.models.map(e=>e.model_name||e.name).filter(Boolean);try{const e=JSON.parse(t.models);if(Array.isArray(e))return e.map(s=>s.model_name||s.name).filter(Boolean)}catch{}return[]}async function B(t){await q(t.id),h.info("正在加载模型,请稍候..."),u&&clearTimeout(u),u=setTimeout(r,1e3)}async function T(t){await J.confirm("确定要停止模型服务吗?","确认停止",{type:"warning"}),await F(t.id),h.success("已停止模型服务"),r()}async function b(t){const e=await G(t.id).catch(()=>null);if(e!=null&&e.load_status){const s=k(e);for(const m of s)m.pid&&await I(m.pid).catch(()=>{})}await H(t.id),y.value=y.value.filter(s=>s.id!==t.id),await r(!0),h.success("删除成功")}function M(t){E.push(`/model-inference/chat/${t.id}`)}const{start:N}=U(()=>r(!0),3e3,{immediate:!1});return $(async()=>{await r(),N()}),w(()=>{u&&clearTimeout(u)}),(t,e)=>{const s=A,m=L,p=D;return n(),d(O,{title:"模型推理",data:y.value,loading:g.value,searchable:"","search-fields":["name","model_name","description"],"create-text":"新建推理","create-to":"/model-inference/create","delete-fn":b,"row-key":"id",onRefresh:r},{columns:i(()=>[o(s,{label:"推理名称",align:"center"},{default:i(({row:a})=>[l(f(a.model_name||a.name||"-"),1)]),_:1}),o(s,{label:"描述",align:"center","show-overflow-tooltip":""},{default:i(({row:a})=>[l(f(a.description||"-"),1)]),_:1}),o(s,{label:"状态",align:"center",width:"120"},{default:i(({row:a})=>[_(a)?(n(),d(m,{key:0,type:"warning",size:"small"},{default:i(()=>[...e[0]||(e[0]=[l("启动中",-1)])]),_:1})):v(a)?(n(),d(m,{key:1,type:"success",size:"small"},{default:i(()=>[...e[1]||(e[1]=[l("已就绪",-1)])]),_:1})):(n(),d(m,{key:2,type:"info",size:"small"},{default:i(()=>[l(f(a.status||"未启动"),1)]),_:2},1024))]),_:1}),o(s,{label:"相关模型",align:"center","show-overflow-tooltip":""},{default:i(({row:a})=>[l(f(z(a).join("")||"-"),1)]),_:1}),o(s,{label:"创建时间",align:"center",width:"180"},{default:i(({row:a})=>[l(f(a.create_time?new Date(a.create_time).toLocaleString("zh-CN"):"-"),1)]),_:1})]),actions:i(({row:a})=>[c("div",K,[_(a)?(n(),d(p,{key:0,type:"warning",link:"",size:"small",loading:!0,disabled:""},{default:i(()=>[...e[2]||(e[2]=[l(" 加载中 ",-1)])]),_:1})):v(a)?(n(),P(R,{key:1},[o(p,{type:"success",link:"",size:"small",onClick:C=>M(a)},{default:i(()=>[...e[3]||(e[3]=[c("i",{class:"fa fa-comments-o",style:{"margin-right":"4px"}},null,-1),l("对话 ",-1)])]),_:1},8,["onClick"]),o(p,{type:"warning",link:"",size:"small",onClick:C=>T(a)},{default:i(()=>[...e[4]||(e[4]=[c("i",{class:"fa fa-stop-circle-o",style:{"margin-right":"4px"}},null,-1),l("停止 ",-1)])]),_:1},8,["onClick"])],64)):(n(),d(p,{key:2,type:"primary",link:"",size:"small",onClick:C=>B(a)},{default:i(()=>[...e[5]||(e[5]=[c("i",{class:"fa fa-play-circle-o",style:{"margin-right":"4px"}},null,-1),l("加载 ",-1)])]),_:1},8,["onClick"])),o(p,{type:"danger",link:"",size:"small",onClick:C=>b(a)},{default:i(()=>[...e[6]||(e[6]=[c("i",{class:"fa fa-trash-o",style:{"margin-right":"4px"}},null,-1),l("删除 ",-1)])]),_:1},8,["onClick"])])]),_:1},8,["data","loading"])}}});export{Ae as default};