ux(ui): beginner-friendly guidance across trainee/admin flows + fix AdminUsers to username

- Chat: add 'How to practice' guide card; render revealed persona as readable
  label:value grid instead of JSON.
- AdminUsers: switch create form to username (matches username login), add step guide,
  role explanation (user=ฝึก, admin=ดูแลระบบ).
- Analytics (admin overview) + MyBoard (personal): add plain-Thai explainer subtitle.
- Rebuild dist. Verified user create with username -> 201.
This commit is contained in:
Macky
2026-08-08 10:34:24 +07:00
parent 39d1aa04e4
commit 22d3e51980
29 changed files with 103 additions and 38 deletions

View File

@@ -0,0 +1 @@
import{_ as f,k as x,q as v,c as r,a as t,t as s,u as e,i as a,e as _,w as b,x as k,F as B,p as S,r as m,y as u,o as i,z as D}from"./index-BhdfH8-z.js";const M={style:{margin:"0"}},N={key:0,class:"row stat-row"},T={class:"card stat"},z={class:"card stat won"},C={class:"card stat lost"},F={class:"card stat"},V={key:1,class:"card"},j={key:2,class:"card empty-state"},q={class:"card",style:{"margin-top":"20px"}},E={style:{"margin-top":"0"}},G={__name:"MyBoard",setup(I){const o=m([]),c=m([]),p=m(!0),y=u(()=>o.value.length),g=u(()=>o.value.filter(n=>n.my_outcome==="won").length),h=u(()=>o.value.filter(n=>n.my_outcome==="lost").length),w=u(()=>o.value.filter(n=>n.my_outcome==="not_tried").length);return x(async()=>{try{o.value=(await v.myBoard()).board||[],c.value=(await v.mySessions()).sessions||[]}finally{p.value=!1}}),(n,l)=>(i(),r("div",null,[t("div",null,[t("h2",M,"📈 "+s(e(a).t("myDashboard")),1),l[0]||(l[0]=t("div",{class:"muted",style:{"margin-top":"4px","margin-bottom":"16px"}},"สรุปผลการฝึกของตัวคุณเอง — ดูว่าปิดการขายได้กี่ครั้ง ยังฝึกกับใครบ้าง",-1))]),p.value?_("",!0):(i(),r("div",N,[t("div",T,[t("span",null,s(e(a).t("total")),1),t("strong",null,s(y.value),1)]),t("div",z,[t("span",null,s(e(a).t("won")),1),t("strong",null,s(g.value),1)]),t("div",C,[t("span",null,s(e(a).t("lost")),1),t("strong",null,s(h.value),1)]),t("div",F,[t("span",null,s(e(a).t("notTried")),1),t("strong",null,s(w.value),1)])])),p.value?(i(),r("div",V,[...l[1]||(l[1]=[t("div",{class:"skeleton",style:{height:"50px"}},null,-1)])])):o.value.length===0?(i(),r("div",j,[...l[2]||(l[2]=[t("strong",null,"No practice yet",-1),t("span",null,"Go to Training and try closing a sale with a persona.",-1)])])):_("",!0),b(t("div",q,[t("h3",E,s(e(a).t("mySessions")),1),(i(!0),r(B,null,S(c.value,d=>(i(),r("div",{key:d.id,style:{display:"flex","justify-content":"space-between",padding:"8px 0","border-bottom":"1px solid var(--border)"}},[t("span",null,s(d.persona_name),1),t("span",{class:D(["badge",d.outcome])},s(d.outcome==="won"?e(a).t("won"):e(a).t("lost")),3)]))),128))],512),[[k,c.value.length]])]))}},A=f(G,[["__scopeId","data-v-b92138a0"]]);export{A as default};