fix(Docker): ship prebuilt frontend/dist, drop npm from image (removes 'vite not found')

The Vue SPA is now built locally and its frontend/dist/ committed (force-added).
Dockerfile is a single-stage runtime: copy prebuilt dist + python:3.11 + Flask.
No node/npm inside the image -> deterministic, no npm/esbuild postinstall flakiness.
To update UI: edit src, npm run build, commit frontend/dist/.
This commit is contained in:
Macky
2026-08-07 19:46:20 +07:00
parent 4827481da3
commit c19b23d44d
30 changed files with 80 additions and 13 deletions

View File

@@ -0,0 +1 @@
import{k as x,p as f,c as i,a as e,t,u as s,i as o,f as l,l as c,m as p,e as _,F as v,n as k,r as h,q as b,o as n,x as w,y as B}from"./index-B1lw4PRH.js";import{_ as N}from"./_plugin-vue_export-helper-DlAUqK2U.js";const A={class:"row",style:{"margin-bottom":"16px","align-items":"center"}},z={style:{margin:"0"}},C={class:"muted",style:{margin:"4px 0 0","font-size":"13px"}},$={key:0,style:{"margin-left":"auto"}},P={class:"primary"},T={key:0,class:"card",style:{"min-height":"120px"}},V={key:1,class:"card empty-state"},F={key:0},j={key:1},q={class:"grid"},D={class:"row",style:{"justify-content":"space-between","align-items":"center"}},E={key:0,class:"row",style:{gap:"6px"}},G={style:{padding:"6px 12px","min-height":"38px"}},I={style:{padding:"6px 12px","min-height":"38px"}},L={style:{margin:"10px 0 4px","font-weight":"700","font-size":"15px"}},M={class:"muted",style:{"font-size":"13px","margin-bottom":"12px"}},S={key:0,class:"row",style:{gap:"8px","flex-wrap":"wrap","margin-top":"8px"}},H={class:"primary"},J={class:"primary"},K={key:2,class:"muted",style:{"font-size":"12px","margin-top":"8px"}},O={__name:"Training",setup(Q){const u=h([]),m=h(!0);function g(r){return r.sales_kit&&r.sales_kit.productName||r.input&&r.input.product||""}return x(async()=>{try{u.value=(await f.listGroups()).groups}finally{m.value=!1}}),(r,y)=>{const d=b("router-link");return n(),i("div",null,[e("div",A,[e("div",null,[e("h2",z,t(s(o).t("tabTraining")),1),e("p",C,t(s(o).t("selectPersona")),1)]),s(l).isAdmin?(n(),i("div",$,[c(d,{to:"/admin/new-group"},{default:p(()=>[e("button",P,"+ "+t(s(o).t("groupBuilder"))+" / "+t(s(o).t("groupBuilder"))+" "+t(s(o).t("create")),1)]),_:1})])):_("",!0)]),m.value?(n(),i("div",T,[...y[0]||(y[0]=[e("div",{class:"skeleton",style:{height:"60px"}},null,-1),e("div",{class:"skeleton",style:{height:"60px","margin-top":"10px"}},null,-1)])])):u.value.length===0?(n(),i("div",V,[e("strong",null,t(s(l).isAdmin?"No products yet":"No training products available"),1),s(l).isAdmin?(n(),i("span",F,t(s(o).t("groupBuilder"))+" to add a "+t(s(o).t("product"))+" + personas.",1)):(n(),i("span",j,"Ask an admin to add a "+t(s(o).t("product"))+".",1))])):_("",!0),e("div",q,[(n(!0),i(v,null,k(u.value,a=>(n(),i("div",{key:a.id,class:"card group-card lift"},[e("div",D,[e("span",{class:w(["badge",a.status])},t(a.status),3),s(l).isAdmin?(n(),i("span",E,[c(d,{to:`/groups/${a.id}/personas`},{default:p(()=>[e("button",G,t(s(o).t("personas"))+" ("+t((a.personas||[]).length)+")",1)]),_:2},1032,["to"]),c(d,{to:`/admin/groups/${a.id}/edit`},{default:p(()=>[e("button",I,t(s(o).t("edit")),1)]),_:1},8,["to"])])):_("",!0)]),e("div",L,t(a.title),1),e("div",M,t(g(a)),1),s(l).isAdmin?(n(),i("div",S,[c(d,{to:`/groups/${a.id}/personas`},{default:p(()=>[e("button",H,t(s(o).t("selectPersona")),1)]),_:1},8,["to"])])):a.status==="ready"?(n(),B(d,{key:1,to:`/groups/${a.id}/personas`},{default:p(()=>[e("button",J,t(s(o).t("selectPersona")),1)]),_:1},8,["to"])):(n(),i("div",K,"⏳ "+t(s(o).t("status"))+": "+t(a.status),1))]))),128))])])}}},W=N(O,[["__scopeId","data-v-d28970f8"]]);export{W as default};