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