51948469c2
- Stop ignoring web/app/index.html and web/app/assets/ - Bundle index-DBKIQT7H.js from current vite build (~101MB assets) Co-authored-by: Cursor <cursoragent@cursor.com>
3 lines
20 KiB
JavaScript
3 lines
20 KiB
JavaScript
import{A as e,Ar as t,Er as n,F as r,It as i,Jn as a,Kn as o,L as s,M as c,N as l,Nt as u,O as d,P as f,Qn as p,Un as m,Vn as ee,Y as h,Yn as g,Zn as _,br as v,dr as y,er as b,gr as x,j as S,k as C,lr as w,q as te,qn as T,sr as ne,t as E,w as D}from"./index-BCQTIDw4.js";import{a as re}from"./VSelectionControl-68hkvpet.js";import{n as O,t as k}from"./VRow-C8w9Wz5w.js";import{t as A}from"./VSpacer-CLz5vknL.js";import{t as ie}from"./useSnackbar-D7YOfKok.js";import{t as ae}from"./VChip-B452RkaL.js";import{t as j}from"./VDialog-CSMRlmzX.js";import{i as M,n as oe,r as N,t as se}from"./validation-DMwOxx4a.js";import{t as P}from"./VTextarea-mzoBd41h.js";import{t as F}from"./VSwitch-CQvAScYf.js";import{n as I,r as L}from"./useTerminalQuickCommands-D67rSh-2.js";var R={key:1,class:`text-medium-emphasis text-body-2 mb-4`},z={class:`text-caption text-medium-emphasis mr-2`,style:{"min-width":`1.5rem`}},B={class:`d-flex flex-wrap ga-2`},V=b({__name:`TerminalQuickCommandsSettings`,setup(i){let u=ie(),{commands:ee,loading:b,load:re,create:O,update:k,remove:M,reorder:oe,customCommands:N,builtinCommands:se}=I(),P=v(!1),F=v(null),V=v(``),H=v(``),U=v(!1),W=v(!1),G=v(!1),ce=v(null),le=v(``);function ue(){F.value=null,V.value=``,H.value=``,P.value=!0}function de(e){F.value=e.id,V.value=e.name,H.value=e.cmd.replace(/\r$/,``),P.value=!0}async function K(){if(!V.value.trim()||!H.value.trim()){u(`名称和命令不能为空`,`warning`);return}let e=H.value.trim();e.endsWith(`\r`)||(e+=`\r`),U.value=!0;try{F.value?await k(F.value,V.value,e):await O(V.value,e),P.value=!1,u(`已保存`)}catch(e){u(e instanceof Error?e.message:`保存失败`,`error`)}finally{U.value=!1}}function fe(e){ce.value=e.id,le.value=e.name,G.value=!0}async function q(){if(ce.value){U.value=!0;try{await M(ce.value),G.value=!1,u(`已删除`)}catch(e){u(e instanceof Error?e.message:`删除失败`,`error`)}finally{U.value=!1}}}async function J(e){let t=N();if(e<=0)return;let n=t.map(e=>e.id),r=n[e-1];n[e-1]=n[e],n[e]=r,await X(n)}async function Y(e){let t=N();if(e>=t.length-1)return;let n=t.map(e=>e.id),r=n[e+1];n[e+1]=n[e],n[e]=r,await X(n)}async function X(e){W.value=!0;try{await oe(e)}catch(e){u(e instanceof Error?e.message:`排序失败`,`error`)}finally{W.value=!1}}return ne(()=>{re().catch(e=>u(e.message,`error`))}),(i,u)=>(w(),T(c,{id:`terminal-quick-commands`,elevation:`0`,border:``,rounded:`lg`,class:`mb-4`},{default:x(()=>[p(f,{class:`d-flex align-center flex-wrap ga-2`},{default:x(()=>[p(h,{class:`mr-1`},{default:x(()=>[...u[6]||=[_(`mdi-flash`,-1)]]),_:1}),u[8]||=_(` 终端快捷命令 `,-1),p(A),p(s,{size:`small`,color:`primary`,variant:`flat`,"prepend-icon":`mdi-plus`,onClick:ue},{default:x(()=>[...u[7]||=[_(` 添加命令 `,-1)]]),_:1})]),_:1}),p(S),p(l,null,{default:x(()=>[u[9]||=o(`div`,{class:`text-body-2 text-medium-emphasis mb-4`},` 自定义命令显示在终端栏最前(优先级最高)。终端页仅可点击执行;在此添加、编辑、删除与调整顺序。 `,-1),n(b)?(w(),T(te,{key:0,indeterminate:``,color:`primary`,class:`mb-3`})):a(``,!0),n(N)().length===0&&!n(b)?(w(),g(`div`,R,` 暂无自定义命令,点击「添加命令」创建。 `)):a(``,!0),n(N)().length?(w(),T(D,{key:2,density:`compact`,class:`mb-4 pa-0`},{default:x(()=>[(w(!0),g(m,null,y(n(N)(),(r,i)=>(w(),T(d,{key:r.id,border:``,rounded:`lg`,class:`mb-2`},{prepend:x(()=>[o(`span`,z,t(i+1),1)]),append:x(()=>[p(s,{icon:`mdi-arrow-up`,size:`x-small`,variant:`text`,disabled:i===0||W.value,onClick:e=>J(i)},null,8,[`disabled`,`onClick`]),p(s,{icon:`mdi-arrow-down`,size:`x-small`,variant:`text`,disabled:i===n(N)().length-1||W.value,onClick:e=>Y(i)},null,8,[`disabled`,`onClick`]),p(s,{icon:`mdi-pencil`,size:`x-small`,variant:`text`,onClick:e=>de(r)},null,8,[`onClick`]),p(s,{icon:`mdi-delete`,size:`x-small`,variant:`text`,color:`error`,onClick:e=>fe(r)},null,8,[`onClick`])]),default:x(()=>[p(C,null,{default:x(()=>[_(t(r.name),1)]),_:2},1024),p(e,{class:`font-mono text-truncate`},{default:x(()=>[_(t(r.cmd),1)]),_:2},1024)]),_:2},1024))),128))]),_:1})):a(``,!0),u[10]||=o(`div`,{class:`text-subtitle-2 mb-2`},`系统内置(不可编辑)`,-1),o(`div`,B,[(w(!0),g(m,null,y(n(se)(),e=>(w(),T(ae,{key:e.id,size:`small`,variant:`outlined`,label:``},{default:x(()=>[_(t(e.name),1)]),_:2},1024))),128))])]),_:1}),p(j,{modelValue:P.value,"onUpdate:modelValue":u[3]||=e=>P.value=e,"max-width":`520`},{default:x(()=>[p(c,{border:``},{default:x(()=>[p(f,null,{default:x(()=>[_(t(F.value?`编辑命令`:`添加快捷命令`),1)]),_:1}),p(l,null,{default:x(()=>[p(E,{modelValue:V.value,"onUpdate:modelValue":u[0]||=e=>V.value=e,label:`显示名称`,variant:`outlined`,density:`compact`,class:`mb-3`},null,8,[`modelValue`]),u[11]||=o(`div`,{class:`text-body-2 text-medium-emphasis mb-2`},`命令内容(发送时自动追加回车)`,-1),p(L,{modelValue:H.value,"onUpdate:modelValue":u[1]||=e=>H.value=e,multiline:``,rows:4,placeholder:`systemctl status nginx`},null,8,[`modelValue`])]),_:1}),p(r,null,{default:x(()=>[p(A),p(s,{variant:`text`,onClick:u[2]||=e=>P.value=!1},{default:x(()=>[...u[12]||=[_(`取消`,-1)]]),_:1}),p(s,{color:`primary`,variant:`flat`,loading:U.value,onClick:K},{default:x(()=>[...u[13]||=[_(`保存`,-1)]]),_:1},8,[`loading`])]),_:1})]),_:1})]),_:1},8,[`modelValue`]),p(j,{modelValue:G.value,"onUpdate:modelValue":u[5]||=e=>G.value=e,"max-width":`400`},{default:x(()=>[p(c,{border:``},{default:x(()=>[p(f,null,{default:x(()=>[...u[14]||=[_(`删除命令`,-1)]]),_:1}),p(l,null,{default:x(()=>[_(`确定删除「`+t(le.value)+`」?`,1)]),_:1}),p(r,null,{default:x(()=>[p(A),p(s,{variant:`text`,onClick:u[4]||=e=>G.value=!1},{default:x(()=>[...u[15]||=[_(`取消`,-1)]]),_:1}),p(s,{color:`error`,variant:`flat`,loading:U.value,onClick:q},{default:x(()=>[...u[16]||=[_(`删除`,-1)]]),_:1},8,[`loading`])]),_:1})]),_:1})]),_:1},8,[`modelValue`])]),_:1}))}}),H={class:`d-flex align-center mb-3`},U={key:0,class:`text-center mb-3`},W=[`src`],G={key:0,class:`d-flex align-center justify-center ga-2 mt-2`},ce={class:`text-caption pa-1 bg-grey-lighten-4 rounded`,style:{"user-select":`all`}},le={key:1},ue={key:1,class:`d-flex ga-2 align-center`},de={class:`d-flex align-center ga-2`},K=b({__name:`SettingsPage`,setup(e){let d=ie(),m=u(),y=v(!1),b=v({system_name:``,system_title:``,cpu_alert_threshold:80,mem_alert_threshold:80,disk_alert_threshold:80,db_pool_size:10,db_max_overflow:20,telegram_bot_token:``,telegram_chat_id:``}),C=v(!1),D=v(!1),I=v(!1),L=v({current:``,new_pw:``,confirm:``,totp_code:``}),R=v(!1),z=v(``),B=v(``),K=v(``),fe=v(!1),q=v(!1),J=v(``),Y=v(``),X=v(!1),Z=v(!1),pe=v(``),Q=v(!1),$=v(``),me=v(!1),he=v(!1),ge=v(``),_e=v(!1);async function ve(){y.value=!0;try{let e=await i.get(`/settings/`),t=Array.isArray(e)?e:[],n=Object.keys(b.value);for(let e of t){let t=e.key;if(t&&n.includes(t)){let n=e.value;typeof n==`string`&&/^\d+(\.\d+)?$/.test(n)?b.value[t]=Number(n):b.value[t]=n}}}catch{d(`加载设置失败`,`error`)}finally{y.value=!1}}async function ye(){try{let e=await i.get(`/settings/ip-allowlist`);he.value=e.enabled||!1,ge.value=[...e.manual_ips||[],...e.subscription_ips||[]].join(`
|
|
`)}catch{d(`加载白名单失败`,`error`)}}async function be(){C.value=!0;try{let e=Object.entries(b.value).filter(([e])=>[`system_name`,`system_title`,`cpu_alert_threshold`,`mem_alert_threshold`,`disk_alert_threshold`,`db_pool_size`,`db_max_overflow`,`telegram_bot_token`,`telegram_chat_id`].includes(e));for(let[t,n]of e)await i.put(`/settings/${t}`,{value:n});d(`设置已保存`)}catch(e){d(e instanceof Error?e.message:`保存失败`,`error`)}finally{C.value=!1}}async function xe(){D.value=!0;try{await i.post(`/settings/telegram/test`),d(`测试消息已发送`)}catch(e){d(e.message||`发送失败`,`error`)}finally{D.value=!1}}async function Se(){if(L.value.new_pw!==L.value.confirm){d(`两次密码不一致`,`error`);return}R.value=!0;try{let e={current_password:L.value.current,new_password:L.value.new_pw};m.admin?.totp_enabled&&L.value.totp_code&&(e.totp_code=L.value.totp_code),await i.put(`/auth/password`,e),L.value={current:``,new_pw:``,confirm:``,totp_code:``},d(`密码已修改`)}catch(e){d(e instanceof Error?e.message:`修改失败`,`error`)}finally{R.value=!1}}async function Ce(){try{let e=await i.post(`/auth/totp/setup`);z.value=e.qr_code,B.value=e.secret||``}catch(e){d(e instanceof Error?e.message:`生成失败`,`error`)}}async function we(){fe.value=!0;try{await i.post(`/auth/totp/enable`,{code:K.value}),await m.fetchProfile(),z.value=``,K.value=``,d(`TOTP 已启用`)}catch(e){d(e.message||`启用失败`,`error`)}finally{fe.value=!1}}function Te(){q.value=!0}async function Ee(){X.value=!0;try{await i.post(`/auth/totp/disable`,{admin_id:m.admin?.id,current_password:J.value,totp_code:Y.value}),await m.fetchProfile(),q.value=!1,J.value=``,Y.value=``,d(`TOTP 已禁用`)}catch(e){d(e.message||`禁用失败`,`error`)}finally{X.value=!1}}function De(){B.value&&(navigator.clipboard.writeText(B.value),d(`密钥已复制`))}async function Oe(){if(Z.value){Z.value=!1;return}Q.value=!0,$.value=``}async function ke(){if(!$.value){d(`请输入密码`,`error`);return}me.value=!0;try{pe.value=(await i.post(`/settings/api-key/reveal`,{current_password:$.value})).api_key,Z.value=!0,Q.value=!1,$.value=``}catch(e){d(e.message||`验证失败`,`error`)}finally{me.value=!1}}function Ae(){pe.value&&(navigator.clipboard.writeText(pe.value),d(`已复制到剪贴板`))}async function je(){try{await i.post(`/settings/ip-allowlist/toggle`,{enabled:he.value})}catch(e){d(e.message||`操作失败`,`error`)}}async function Me(){_e.value=!0;try{let e=ge.value.split(`
|
|
`).map(e=>e.trim()).filter(Boolean);await i.post(`/settings/ip-allowlist`,{ips:e}),d(`白名单已保存`)}catch(e){d(e.message||`保存失败`,`error`)}finally{_e.value=!1}}return ne(()=>{ve(),ye(),m.fetchProfile()}),(e,i)=>(w(),T(re,{fluid:``,class:`pa-6`},{default:x(()=>[p(k,null,{default:x(()=>[p(O,{cols:`12`,lg:`6`},{default:x(()=>[p(c,{elevation:`0`,border:``,rounded:`lg`,class:`mb-4`},{default:x(()=>[p(f,{class:`d-flex align-center`},{default:x(()=>[p(h,{class:`mr-2`},{default:x(()=>[...i[24]||=[_(`mdi-cog`,-1)]]),_:1}),i[25]||=_(` 系统设置 `,-1)]),_:1}),y.value?(w(),T(te,{key:0,indeterminate:``,color:`primary`})):a(``,!0),p(S),p(l,null,{default:x(()=>[p(E,{modelValue:b.value.system_name,"onUpdate:modelValue":i[0]||=e=>b.value.system_name=e,label:`系统名称`,variant:`outlined`,density:`compact`,class:`mb-3`,rules:[n(M)(`系统名称`)]},null,8,[`modelValue`,`rules`]),p(E,{modelValue:b.value.system_title,"onUpdate:modelValue":i[1]||=e=>b.value.system_title=e,label:`系统标题`,variant:`outlined`,density:`compact`,class:`mb-3`,rules:[n(M)(`系统标题`)]},null,8,[`modelValue`,`rules`]),p(S,{class:`my-4`}),i[26]||=o(`div`,{class:`text-subtitle-2 mb-3`},`告警阈值`,-1),p(k,{dense:``},{default:x(()=>[p(O,{cols:`4`},{default:x(()=>[p(E,{modelValue:b.value.cpu_alert_threshold,"onUpdate:modelValue":i[2]||=e=>b.value.cpu_alert_threshold=e,label:`CPU %`,variant:`outlined`,density:`compact`,type:`number`,rules:[n(M)(`阈值`),n(N)(1,100,`阈值`)]},null,8,[`modelValue`,`rules`])]),_:1}),p(O,{cols:`4`},{default:x(()=>[p(E,{modelValue:b.value.mem_alert_threshold,"onUpdate:modelValue":i[3]||=e=>b.value.mem_alert_threshold=e,label:`内存 %`,variant:`outlined`,density:`compact`,type:`number`,rules:[n(M)(`阈值`),n(N)(1,100,`阈值`)]},null,8,[`modelValue`,`rules`])]),_:1}),p(O,{cols:`4`},{default:x(()=>[p(E,{modelValue:b.value.disk_alert_threshold,"onUpdate:modelValue":i[4]||=e=>b.value.disk_alert_threshold=e,label:`磁盘 %`,variant:`outlined`,density:`compact`,type:`number`,rules:[n(M)(`阈值`),n(N)(1,100,`阈值`)]},null,8,[`modelValue`,`rules`])]),_:1})]),_:1}),p(S,{class:`my-4`}),i[27]||=o(`div`,{class:`text-subtitle-2 mb-3`},`连接池`,-1),p(k,{dense:``},{default:x(()=>[p(O,{cols:`6`},{default:x(()=>[p(E,{modelValue:b.value.db_pool_size,"onUpdate:modelValue":i[5]||=e=>b.value.db_pool_size=e,label:`连接池大小`,variant:`outlined`,density:`compact`,type:`number`,rules:[n(M)(),n(se)()]},null,8,[`modelValue`,`rules`])]),_:1}),p(O,{cols:`6`},{default:x(()=>[p(E,{modelValue:b.value.db_max_overflow,"onUpdate:modelValue":i[6]||=e=>b.value.db_max_overflow=e,label:`溢出连接数`,variant:`outlined`,density:`compact`,type:`number`,rules:[n(M)(),n(se)()]},null,8,[`modelValue`,`rules`])]),_:1})]),_:1})]),_:1}),p(r,{class:`px-4 pb-4`},{default:x(()=>[p(A),p(s,{color:`primary`,variant:`flat`,onClick:be,loading:C.value},{default:x(()=>[...i[28]||=[_(`保存设置`,-1)]]),_:1},8,[`loading`])]),_:1})]),_:1}),p(V),p(c,{elevation:`0`,border:``,rounded:`lg`},{default:x(()=>[p(f,{class:`d-flex align-center`},{default:x(()=>[p(h,{class:`mr-2`},{default:x(()=>[...i[29]||=[_(`mdi-send`,-1)]]),_:1}),i[30]||=_(` Telegram 推送 `,-1)]),_:1}),p(S),p(l,null,{default:x(()=>[p(E,{modelValue:b.value.telegram_bot_token,"onUpdate:modelValue":i[7]||=e=>b.value.telegram_bot_token=e,label:`Bot Token`,variant:`outlined`,density:`compact`,class:`mb-3`,type:I.value?`text`:`password`,"append-inner-icon":I.value?`mdi-eye`:`mdi-eye-off`,"onClick:appendInner":i[8]||=e=>I.value=!I.value},null,8,[`modelValue`,`type`,`append-inner-icon`]),p(E,{modelValue:b.value.telegram_chat_id,"onUpdate:modelValue":i[9]||=e=>b.value.telegram_chat_id=e,label:`Chat ID`,variant:`outlined`,density:`compact`,class:`mb-3`},null,8,[`modelValue`]),p(s,{size:`small`,variant:`tonal`,"prepend-icon":`mdi-message-text`,onClick:xe,loading:D.value},{default:x(()=>[...i[31]||=[_(`发送测试消息`,-1)]]),_:1},8,[`loading`])]),_:1})]),_:1})]),_:1}),p(O,{cols:`12`,lg:`6`},{default:x(()=>[p(c,{elevation:`0`,border:``,rounded:`lg`,class:`mb-4`},{default:x(()=>[p(f,{class:`d-flex align-center`},{default:x(()=>[p(h,{class:`mr-2`},{default:x(()=>[...i[32]||=[_(`mdi-lock`,-1)]]),_:1}),i[33]||=_(` 修改密码 `,-1)]),_:1}),p(S),p(l,null,{default:x(()=>[p(E,{modelValue:L.value.current,"onUpdate:modelValue":i[10]||=e=>L.value.current=e,label:`当前密码`,variant:`outlined`,density:`compact`,type:`password`,class:`mb-3`,rules:[n(M)(`密码`)]},null,8,[`modelValue`,`rules`]),p(E,{modelValue:L.value.new_pw,"onUpdate:modelValue":i[11]||=e=>L.value.new_pw=e,label:`新密码`,variant:`outlined`,density:`compact`,type:`password`,class:`mb-3`,rules:[n(M)(`密码`)]},null,8,[`modelValue`,`rules`]),p(E,{modelValue:L.value.confirm,"onUpdate:modelValue":i[12]||=e=>L.value.confirm=e,label:`确认新密码`,variant:`outlined`,density:`compact`,type:`password`,class:`mb-3`,rules:[n(M)(`确认密码`),n(oe)(()=>L.value.new_pw)]},null,8,[`modelValue`,`rules`]),n(m).admin?.totp_enabled?(w(),T(E,{key:0,modelValue:L.value.totp_code,"onUpdate:modelValue":i[13]||=e=>L.value.totp_code=e,label:`TOTP 验证码`,variant:`outlined`,density:`compact`,type:`text`,inputmode:`numeric`,maxlength:`6`,class:`mb-3`,rules:n(m).admin?.totp_enabled?[n(M)(`验证码`)]:[]},null,8,[`modelValue`,`rules`])):a(``,!0)]),_:1}),p(r,{class:`px-4 pb-4`},{default:x(()=>[p(A),p(s,{color:`primary`,variant:`flat`,onClick:Se,loading:R.value},{default:x(()=>[...i[34]||=[_(`修改密码`,-1)]]),_:1},8,[`loading`])]),_:1})]),_:1}),p(c,{elevation:`0`,border:``,rounded:`lg`,class:`mb-4`},{default:x(()=>[p(f,{class:`d-flex align-center`},{default:x(()=>[p(h,{class:`mr-2`},{default:x(()=>[...i[35]||=[_(`mdi-shield-key`,-1)]]),_:1}),i[36]||=_(` 双因素认证 (TOTP) `,-1)]),_:1}),p(S),p(l,null,{default:x(()=>[o(`div`,H,[i[37]||=o(`span`,{class:`text-body-2`},`状态:`,-1),p(ae,{color:n(m).admin?.totp_enabled?`success`:`grey`,size:`small`,variant:`tonal`,label:``,class:`ml-2`},{default:x(()=>[_(t(n(m).admin?.totp_enabled?`已启用`:`未启用`),1)]),_:1},8,[`color`])]),z.value?(w(),g(`div`,U,[o(`img`,{src:z.value,alt:`TOTP QR`,style:{"max-width":`200px`}},null,8,W),B.value?(w(),g(`div`,G,[o(`code`,ce,t(B.value),1),p(s,{size:`x-small`,variant:`text`,icon:`mdi-content-copy`,onClick:De})])):a(``,!0),i[38]||=o(`div`,{class:`text-caption text-medium-emphasis mt-1`},`用认证器 App 扫描二维码或手动输入密钥`,-1)])):a(``,!0),n(m).admin?.totp_enabled?(w(),T(s,{key:2,size:`small`,variant:`tonal`,color:`error`,"prepend-icon":`mdi-shield-off`,onClick:Te},{default:x(()=>[...i[41]||=[_(`禁用 TOTP`,-1)]]),_:1})):(w(),g(`div`,le,[z.value?(w(),g(`div`,ue,[p(E,{modelValue:K.value,"onUpdate:modelValue":i[14]||=e=>K.value=e,label:`验证码`,variant:`outlined`,density:`compact`,style:{"max-width":`160px`}},null,8,[`modelValue`]),p(s,{color:`primary`,variant:`flat`,size:`small`,onClick:we,loading:fe.value},{default:x(()=>[...i[40]||=[_(`启用`,-1)]]),_:1},8,[`loading`])])):(w(),T(s,{key:0,size:`small`,variant:`tonal`,"prepend-icon":`mdi-qrcode`,onClick:Ce},{default:x(()=>[...i[39]||=[_(`生成二维码`,-1)]]),_:1}))]))]),_:1})]),_:1}),p(c,{elevation:`0`,border:``,rounded:`lg`,class:`mb-4`},{default:x(()=>[p(f,{class:`d-flex align-center`},{default:x(()=>[p(h,{class:`mr-2`},{default:x(()=>[...i[42]||=[_(`mdi-key`,-1)]]),_:1}),i[43]||=_(` API Key `,-1)]),_:1}),p(S),p(l,null,{default:x(()=>[o(`div`,de,[p(E,{"model-value":Z.value?pe.value:`••••••••`,label:`API Key`,variant:`outlined`,density:`compact`,readonly:``,type:Z.value?`text`:`password`,style:{"max-width":`320px`}},null,8,[`model-value`,`type`]),p(s,{variant:`text`,size:`small`,icon:Z.value?`mdi-eye-off`:`mdi-eye`,onClick:Oe},null,8,[`icon`]),p(s,{variant:`text`,size:`small`,icon:`mdi-content-copy`,onClick:Ae})])]),_:1})]),_:1}),p(c,{elevation:`0`,border:``,rounded:`lg`},{default:x(()=>[p(f,{class:`d-flex align-center`},{default:x(()=>[p(h,{class:`mr-2`},{default:x(()=>[...i[44]||=[_(`mdi-ip-network`,-1)]]),_:1}),i[45]||=_(` IP 白名单 `,-1)]),_:1}),p(S),p(l,null,{default:x(()=>[p(F,{modelValue:he.value,"onUpdate:modelValue":[i[15]||=e=>he.value=e,je],label:`启用 IP 白名单`,color:`primary`,density:`compact`,"hide-details":``,class:`mb-3`},null,8,[`modelValue`]),p(P,{modelValue:ge.value,"onUpdate:modelValue":i[16]||=e=>ge.value=e,label:`IP 列表(每行一个)`,variant:`outlined`,density:`compact`,rows:`4`,class:`mb-2`},null,8,[`modelValue`]),p(s,{size:`small`,variant:`tonal`,onClick:Me,loading:_e.value},{default:x(()=>[...i[46]||=[_(`保存`,-1)]]),_:1},8,[`loading`])]),_:1})]),_:1})]),_:1})]),_:1}),p(j,{modelValue:Q.value,"onUpdate:modelValue":i[19]||=e=>Q.value=e,"max-width":`400`},{default:x(()=>[p(c,{border:``},{default:x(()=>[p(f,null,{default:x(()=>[...i[47]||=[_(`验证身份`,-1)]]),_:1}),p(l,null,{default:x(()=>[i[48]||=o(`div`,{class:`text-body-2 text-medium-emphasis mb-3`},`请输入当前密码以查看 API Key`,-1),p(E,{modelValue:$.value,"onUpdate:modelValue":i[17]||=e=>$.value=e,label:`当前密码`,variant:`outlined`,density:`compact`,type:`password`,autofocus:``,onKeydown:ee(ke,[`enter`]),rules:[n(M)(`密码`)]},null,8,[`modelValue`,`rules`])]),_:1}),p(r,null,{default:x(()=>[p(A),p(s,{variant:`text`,onClick:i[18]||=e=>Q.value=!1},{default:x(()=>[...i[49]||=[_(`取消`,-1)]]),_:1}),p(s,{color:`primary`,variant:`flat`,onClick:ke,loading:me.value},{default:x(()=>[...i[50]||=[_(`确认`,-1)]]),_:1},8,[`loading`])]),_:1})]),_:1})]),_:1},8,[`modelValue`]),p(j,{modelValue:q.value,"onUpdate:modelValue":i[23]||=e=>q.value=e,"max-width":`400`},{default:x(()=>[p(c,{border:``},{default:x(()=>[p(f,null,{default:x(()=>[...i[51]||=[_(`禁用 TOTP`,-1)]]),_:1}),p(l,null,{default:x(()=>[p(E,{modelValue:J.value,"onUpdate:modelValue":i[20]||=e=>J.value=e,label:`当前密码`,variant:`outlined`,density:`compact`,type:`password`,class:`mb-2`,rules:[n(M)()]},null,8,[`modelValue`,`rules`]),p(E,{modelValue:Y.value,"onUpdate:modelValue":i[21]||=e=>Y.value=e,label:`验证码`,variant:`outlined`,density:`compact`,rules:[n(M)()]},null,8,[`modelValue`,`rules`])]),_:1}),p(r,null,{default:x(()=>[p(A),p(s,{variant:`text`,onClick:i[22]||=e=>q.value=!1},{default:x(()=>[...i[52]||=[_(`取消`,-1)]]),_:1}),p(s,{color:`error`,variant:`flat`,onClick:Ee,loading:X.value},{default:x(()=>[...i[53]||=[_(`禁用`,-1)]]),_:1},8,[`loading`])]),_:1})]),_:1})]),_:1},8,[`modelValue`])]),_:1}))}});export{K as default}; |