Files
senmesh-zc/deployment/ow/web/assets/upload-config-DRtEZBe2.js
KodouWZF d39b3b035d feat(部署): 新增 deployment/ 内外网两套按侧部署包
按 demo/ 的写法把交付包改成「角色由目录决定」:iw/ 拷内网机、ow/ 拷外网机,
各自含镜像 tar、SQL、配置与 install.sh,install.sh 不再收 iw/ow 参数。

前端不再打进镜像,改为静态包放在 <侧>/web/ 只读挂进 nginx:1.27-alpine,
现场临时改页面直接替换文件 + restart web 即可。数据仍全部挂宿主机,
子目录命名与 deploy/offline 一致(pgdata/redis/mq/upload/logs/gate),
默认根改为包内 ./volumes,放数据盘只改 .env 的 SFILE_DATA_ROOT。

后端镜像 sfile-app:1.0.1 含传输优化那一批(实测组包 11.4×、解包 9.9×)。
出包脚本 deployment/scripts/build-package.sh 负责 jar→镜像→前端双包→sql→tar→VERSION。
2026-11-04 21:44:56 +08:00

2 lines
10 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.
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dist-CPAz9rrj.js","assets/index-CjPx3lfT.js","assets/index-BbZGMJ6u.css"])))=>i.map(i=>d[i]);
import{n as e,t}from"./radio-group-rg4nj-El.js";import{t as n}from"./x-CASPj4fT.js";import{A as r,J as i,N as a,Qt as o,R as s,V as c,Vn as l,Y as u,Zt as d,en as f,k as p,ln as m,nt as h,qn as g,r as _,sn as v,u as y,y as b,yn as x,z as S,zn as C}from"./index-CjPx3lfT.js";import{a as w,r as T}from"./use-upload-config-D-wQpkWo.js";var E=g(l(),1),D=g(C(),1),O=Object.defineProperty,k=(e,t)=>O(e,`name`,{value:t,configurable:!0}),A=`Switch`,[j,M]=p(A),[N,P]=j(A);function F(e){let{__scopeSwitch:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=y({prop:n,defaultProp:i??!1,onChange:c,caller:A}),[m,h]=E.useState(null),[g,_]=E.useState(null),[v,b]=E.useState(null),x={checked:f,setChecked:p,disabled:a,control:m,setControl:h,name:s,form:o,value:u,userClick:v,onUserClick:b,required:l,defaultChecked:i,isFormControl:m?!!o||!!m.closest(`form`):!0,bubbleInput:g,setBubbleInput:_};return(0,D.jsx)(N,{scope:t,...x,children:U(d)?d(x):r})}k(F,`SwitchProvider`);var I=`SwitchTrigger`,L=E.forwardRef(k(function({__scopeSwitch:e,onClick:t,...n},i){let{control:a,form:o,value:s,disabled:c,checked:l,required:d,setControl:f,setChecked:p,onUserClick:m,isFormControl:h,bubbleInput:g}=P(I,e),_=v(i,f),y=E.useRef(l);return E.useEffect(()=>{let e=o?a==null?void 0:a.ownerDocument.getElementById(o):a==null?void 0:a.form;if(e instanceof HTMLFormElement){let t=k(()=>p(y.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[a,o,p]),(0,D.jsx)(u.button,{type:`button`,role:`switch`,"aria-checked":l,"aria-required":d,"data-state":W(l),"data-disabled":c?``:void 0,disabled:c,value:s,...n,ref:_,onClick:r(t,e=>{let t=e.isPropagationStopped();m({requestedChecked:!l,hasConsumerStoppedPropagation:t}),p(e=>!e),g&&h&&(t||e.stopPropagation())})})},`SwitchTrigger`)),R=E.forwardRef(k(function(e,t){let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,D.jsx)(F,{__scopeSwitch:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(L,{...d,ref:t,__scopeSwitch:n}),e&&(0,D.jsx)(H,{__scopeSwitch:n})]})})},`Switch`)),z=`SwitchThumb`,B=E.forwardRef(k(function(e,t){let{__scopeSwitch:n,...r}=e,i=P(z,n);return(0,D.jsx)(u.span,{"data-state":W(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})},`SwitchThumb`)),V=`SwitchBubbleInput`,H=E.forwardRef(k(function({__scopeSwitch:e,onClick:t,...n},i){let{control:a,userClick:o,checked:s,defaultChecked:c,required:l,disabled:d,name:f,value:p,form:m,bubbleInput:h,setBubbleInput:g}=P(V,e),_=v(i,g),y=b(a),x=E.useRef(!1),S=E.useRef(s),C=E.useRef(o),w=E.useRef(null);E.useEffect(()=>{let e=h;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set;if(!n)return;let r=S.current!==s;S.current=s;let i=o!==null&&o!==C.current;if(C.current=o,i)w.current=r?null:o,r&&n.call(e,s),e.dispatchEvent(new Event(`click`,{bubbles:!o.hasConsumerStoppedPropagation}));else if(r){let t=w.current;w.current=null;let r=(t==null?void 0:t.requestedChecked)===s;x.current=!0,n.call(e,s),e.dispatchEvent(new Event(`click`,{bubbles:!(r&&t.hasConsumerStoppedPropagation)})),x.current=!1}},[h,s,o]);let T=E.useRef(s);return(0,D.jsx)(u.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:c??T.current,required:l,disabled:d,name:f,value:p,form:m,...n,tabIndex:-1,ref:_,onClick:r(t,e=>{x.current&&e.stopPropagation()}),style:{...n.style,...y,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`SwitchBubbleInput`));function U(e){return typeof e==`function`}k(U,`isFunction`);function W(e){return e?`checked`:`unchecked`}k(W,`getState`);function G({className:e,...t}){return(0,D.jsx)(R,{"data-slot":`switch`,className:f(`peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50`,e),...t,children:(0,D.jsx)(B,{"data-slot":`switch-thumb`,className:f(`bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0`)})})}var K=[`doc`,`docx`,`xls`,`xlsx`,`ppt`,`pptx`,`pdf`,`jpg`,`jpeg`,`png`,`gif`,`mp4`,`mp3`,`zip`];function q({value:e,onChange:t,placeholder:r=`输入后缀后回车,如:docx`,className:i,disabled:o}){let[s,c]=E.useState(``),l=e=>e.trim().replace(/^\.+/,``).toLowerCase(),u=n=>{let r=l(n);if(r){if(e.includes(r)){X(r);return}t==null||t([...e,r])}},d=n=>{t==null||t(e.filter(e=>e!==n))},p=t=>{e.includes(t)?d(t):u(t)};return(0,D.jsxs)(`div`,{className:`space-y-2`,children:[(0,D.jsxs)(`div`,{className:f(`flex min-h-9 w-full flex-wrap items-center gap-1.5 rounded-md border border-input bg-transparent px-3 py-1.5 text-sm`,`focus-within:ring-ring/50 focus-within:border-ring focus-within:ring-[3px]`,i),children:[e.map(e=>(0,D.jsxs)(a,{variant:`secondary`,className:`gap-1 font-normal`,children:[e,!o&&(0,D.jsx)(`button`,{type:`button`,title:`删除`,className:`rounded-full outline-none hover:text-red-500`,onClick:()=>d(e),children:(0,D.jsx)(n,{className:`size-3`})})]},e)),(0,D.jsx)(`input`,{className:`min-w-[120px] flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground`,value:s,placeholder:e.length>0?``:r,disabled:o,onChange:e=>c(e.target.value),onKeyDown:t=>{if(t.key===`Enter`){t.preventDefault(),u(s),c(``);return}if(/[,,、;;\s]$/.test(t.key)){t.preventDefault(),u(s),c(``);return}t.key===`Backspace`&&s===``&&e.length>0&&d(e[e.length-1])},onBlur:()=>{s.trim()&&(u(s),c(``))}})]}),(0,D.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,D.jsx)(`span`,{className:`text-xs text-black/50`,children:`常用:`}),K.map(t=>(0,D.jsx)(a,{variant:e.includes(t)?`default`:`outline`,className:f(`cursor-pointer font-normal select-none`,o&&`pointer-events-none opacity-50`),onClick:()=>p(t),children:t},t))]})]})}var J=``,Y=0;function X(e){let t=Date.now();(e!==J||t-Y>2e3)&&h(async()=>{let{toast:e}=await import(`./dist-CPAz9rrj.js`);return{toast:e}},__vite__mapDeps([0,1,2])).then(({toast:t})=>t.info(`后缀 ${e} 已添加`)),J=e,Y=t}function Z(){let{data:n,isLoading:r,isError:a,refetch:l}=T(),[u,f]=(0,E.useState)(!0),[p,h]=(0,E.useState)(!0),[g,v]=(0,E.useState)([]),[y,b]=(0,E.useState)(``);(0,E.useEffect)(()=>{n&&(f(n.uploadEnabled!==!1),h(n.allowAllType!==!1),v(n.allowedSuffixes||[]),b(n.maxFileSize&&n.maxFileSize>0?String(n.maxFileSize):``))},[n?JSON.stringify(n):``]);let{mutateAsync:C,isPending:O}=x({mutationFn:w,onSuccess:()=>l()});return(0,D.jsxs)(`div`,{className:`p-4 box-border min-h-full space-y-4`,children:[(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`div`,{className:`text-lg`,children:`上传配置`}),(0,D.jsx)(`div`,{className:`text-xs text-black/50`,children:`配置本机构网盘上传策略:上传开关、允许的文件类型、单文件大小上限`})]}),(0,D.jsx)(`div`,{className:`p-4 rounded-lg border bg-white space-y-6 max-w-[640px]`,children:r?(0,D.jsx)(`div`,{className:`flex justify-center p-8`,children:(0,D.jsx)(d,{className:`text-primary h-6 w-6`})}):a?(0,D.jsxs)(`div`,{className:`flex flex-col justify-center items-center p-8 gap-2`,children:[(0,D.jsx)(`span`,{className:`text-red-500 text-sm`,children:`加载上传配置失败`}),(0,D.jsx)(o,{variant:`outline`,size:`sm`,onClick:()=>l(),children:`重新加载`})]}):(0,D.jsxs)(D.Fragment,{children:[(n==null?void 0:n.configured)===!1&&(0,D.jsx)(s,{children:(0,D.jsx)(S,{children:`当前机构尚未配置上传策略,以下为默认策略(允许上传全部类型、不限大小),保存后正式生效`})}),(0,D.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`div`,{children:`允许上传文件`}),(0,D.jsx)(`div`,{className:`text-xs text-black/50 mt-1`,children:`关闭后,本机构用户将不能上传任何文件到网盘`})]}),(0,D.jsx)(G,{checked:u,onCheckedChange:e=>f(e)})]}),(0,D.jsx)(_,{}),(0,D.jsxs)(`div`,{className:`space-y-3`,children:[(0,D.jsx)(`div`,{children:`文件类型限制`}),(0,D.jsxs)(t,{value:p?`all`:`custom`,onValueChange:e=>h(e===`all`),className:`space-y-2`,children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,D.jsx)(e,{value:`all`,id:`allow-all-type`}),(0,D.jsx)(i,{htmlFor:`allow-all-type`,className:`font-normal`,children:`允许全部类型`})]}),(0,D.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,D.jsx)(e,{value:`custom`,id:`allow-custom-type`}),(0,D.jsx)(i,{htmlFor:`allow-custom-type`,className:`font-normal`,children:`仅允许指定后缀`})]})]}),!p&&(0,D.jsxs)(`div`,{className:`space-y-1`,children:[(0,D.jsx)(q,{value:g,onChange:v}),(0,D.jsx)(`div`,{className:`text-xs text-black/50`,children:`输入后缀后回车添加,可点击下方常用后缀快捷增删;可不带点、不区分大小写,自动去重`})]})]}),(0,D.jsx)(_,{}),(0,D.jsxs)(`div`,{className:`space-y-3`,children:[(0,D.jsx)(`div`,{children:`单文件大小上限(MB)`}),(0,D.jsx)(c,{type:`number`,min:1,placeholder:`不限制`,className:`w-[200px]`,value:y,onChange:e=>b(e.target.value)}),(0,D.jsx)(`div`,{className:`text-xs text-black/50`,children:`留空表示不限制;超过上限的文件将被拒绝上传`})]}),(0,D.jsx)(_,{}),(0,D.jsx)(`div`,{className:`flex justify-end`,children:(0,D.jsxs)(o,{onClick:()=>{if(!p&&g.length===0){m.error(`未允许全部类型时,允许的文件后缀不能为空`);return}let e;if(y.trim()!==``&&(e=Number(y),!Number.isInteger(e)||e<=0)){m.error(`单文件大小上限必须大于0的整数`);return}m.promise(C({uploadEnabled:u,allowAllType:p,allowedSuffixes:p?void 0:g,maxFileSize:e}),{loading:`保存中...`,success:`保存成功`})},disabled:O,children:[O&&(0,D.jsx)(d,{}),`保存`]})})]})})]})}export{Z as component};