@tachybase/module-multi-app 1.3.15 → 1.3.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,7 +5,7 @@
5
5
  if (!/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/.test(value)) {
6
6
  return t("Custom domain prefix must be 1-63 characters, lowercase letters, numbers, or hyphens (-), and cannot start or end with a hyphen (-)");
7
7
  }
8
- }}}`,"x-component-props":{addonAfter:`.${window.location.hostname}`},"x-reactions":[{dependencies:["cname"],fulfill:{state:{value:'{{ ($deps[0] && $deps[0].replace(new RegExp("\\."+window.location.hostname+"$"), "")) || "" }}'}}}]},cname:{"x-hidden":!0,"x-component":"Input","x-decorator":"FormItem","x-read-pretty":!0,"x-reactions":{dependencies:["cnamePrefix"],fulfill:{state:{value:`{{$deps[0] ? $deps[0] + ".${window.location.hostname}" : null}}`}}}},tmpl:{title:c("Template"),"x-component":"RemoteSelect","x-component-props":{placeholder:c("Can be empty, or selected from the template library or personal applications"),fieldNames:{label:"displayName",value:"name"},service:{resource:"applications",params:{filter:{$or:[{isTemplate:!0},{createdById:"{{ userId }}"}]}}}},"x-decorator":"FormItem","x-disabled":"{{ !createOnly }}"},"options.startEnvs":{type:"string",title:c("Start environment variables"),"x-component":"Input.TextArea","x-decorator":"FormItem","x-hidden":!0},pinned:{"x-component":"CollectionField","x-decorator":"FormItem","x-hidden":"{{ !admin }}"},isTemplate:{"x-component":"CollectionField","x-decorator":"FormItem","x-hidden":"{{ !admin }}"},icon:{type:"string",title:'{{ t("Icon") }}',"x-component":"IconPicker","x-decorator":"FormItem"},color:{type:"string",title:'{{ t("Color") }}',"x-component":"ColorPicker","x-decorator":"FormItem",default:"#e5e5e5"}}},B={properties:{view:{type:"void","x-component":"AppVisitor","x-component-props":{admin:"{{ admin }}"}},update:{type:"void",title:'{{t("Edit")}}',"x-component":"Action.Link",properties:{drawer:{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{useValues:"{{ cm.useValuesFromRecord }}"},title:'{{t("Edit")}}',properties:{formSchema:w,footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{t("Cancel")}}',"x-component":"Action","x-use-component-props":"useCancelActionProps"},submit:{title:'{{t("Submit")}}',"x-action":"submit","x-component":"Action","x-use-component-props":"useMultiAppUpdateAction","x-component-props":{type:"primary"}}}}}}}},delete:{type:"void",title:'{{ t("Delete") }}',"x-component":"Action.Link","x-use-component-props":"useDestroyActionProps","x-component-props":{confirm:{title:"{{t('Delete')}}",content:"{{t('Are you sure you want to delete it?')}}"}}}}},J={type:"void",properties:{applicationsTable:{type:"void","x-decorator":"TableBlockProvider","x-decorator-props":{collection:M,action:"list",params:{pageSize:20,sort:["-createdAt"],appends:[],filter:{createdById:"{{ admin ? undefined : userId }}"}},rowKey:"name"},properties:{GlobalNotificationHandler:{type:"void","x-component":"GlobalNotificationHandler"},actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:16}},properties:{fuzzySearch:{type:"void","x-component":"FuzzySearchInput","x-align":"left"},refresh:{type:"void",title:'{{ t("Refresh") }}',"x-component":"Action","x-use-component-props":"useRefreshActionProps","x-component-props":{icon:"ReloadOutlined"}},delete:{type:"void",title:'{{ t("Delete") }}',"x-action":"destroy","x-component":"Action","x-decorator":"ACLActionProvider","x-use-component-props":"useBulkDestroyActionProps","x-component-props":{icon:"DeleteOutlined",confirm:{title:"{{t('Delete')}}",content:"{{t('Are you sure you want to delete it?')}}"}},"x-hidden":"{{ !admin }}"},startAll:{type:"void",title:'{{ t("Start all") }}',"x-component":"Action","x-use-component-props":"useStartAllAction","x-component-props":{icon:"FastForwardOutlined",danger:!0,confirm:{title:c("Start all"),content:c("Starting all sub-applications may cause lag. The more applications you have, the longer the waiting time")}},"x-hidden":"{{ !admin }}"},stopAll:{type:"void",title:'{{ t("Stop all") }}',"x-component":"Action","x-use-component-props":"useStopAllAction","x-component-props":{icon:"StopOutlined",danger:!0,confirm:{title:c("Stop all"),content:c("All sub-applications have stopped serving, unless you restart them")}},"x-hidden":"{{ !admin }}"},create:{type:"void",title:'{{t("Add new")}}',"x-decorator":e=>b.createElement(t.SchemaComponentOptions,v(A({},e),{scope:{createOnly:!0}})),"x-component":"Action","x-component-props":{type:"primary",icon:"PlusOutlined"},properties:{drawer:{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{useValues(e){const o=t.useActionContext();return t.useRequest(()=>Promise.resolve({data:{name:`a_${y.uid()}`}}),v(A({},e),{refreshDeps:[o.visible]}))}},title:'{{t("Add new")}}',properties:{formSchema:w,footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{t("Cancel")}}',"x-component":"Action","x-use-component-props":"useCancelActionProps"},submit:{title:'{{ t("Submit") }}',"x-component":"Action","x-use-component-props":"useCreateDatabaseConnectionAction","x-component-props":{type:"primary"}}}}}}}}}},table:{type:"array","x-uid":"input","x-component":"TableV2","x-use-component-props":"useTableBlockProps","x-component-props":{rowKey:"name",rowSelection:{type:"checkbox"}},properties:{displayName:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{displayName:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},name:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{name:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},pinned:{type:"void",title:c("Pin to menu"),"x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{pinned:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},isTemplate:{type:"void",title:c("Is template"),"x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{isTemplate:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},status:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{status:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},actions:{type:"void",title:'{{t("Actions")}}',"x-component":"TableV2.Column",properties:{actions:A({type:"void","x-component":"Space","x-component-props":{split:"|"}},B)}}}}}}}},Q=()=>{const e=y.useForm(),o=y.useField(),a=t.useActionContext(),s=t.useDataBlockRequest(),r=t.useDataBlockResource();return{onClick(){return g(this,null,function*(){try{yield e.submit(),o.data=o.data||{},o.data.loading=!0,yield r.create({values:e.values}),a.setVisible(!1),yield e.reset(),o.data.loading=!1,s.refresh()}catch(p){o.data&&(o.data.loading=!1)}})}}},z=e=>{const{t:o}=C(),a=t.useAPIClient(),s=b.useMemo(()=>a.resource("applications"),[a]);return{handleStart:()=>g(this,null,function*(){try{l.notification.info({key:h,message:n.jsxs("span",{children:[o("Processing..."),"    ",n.jsx(l.Spin,{indicator:n.jsx(m.LoadingOutlined,{style:{fontSize:24},spin:!0})})]}),duration:0});const p=yield s.start({filterByTk:e.name});(p==null?void 0:p.status)===205&&l.notification.info({key:h,message:o("App is already running")})}catch(p){l.notification.error({key:h,message:o("Failed to start app")})}}),handleStop:()=>{s.stop({filterByTk:e.name}).then(()=>{l.notification.info({key:h,message:n.jsxs("span",{children:[o("Processing..."),"    ",n.jsx(l.Spin,{indicator:n.jsx(m.LoadingOutlined,{style:{fontSize:24},spin:!0})})]}),duration:0})})}}},V=e=>{const o=y.useField(),a=y.useForm(),s=t.useActionContext(),r=t.useDataBlockRequest(),d=t.useDataBlockResource(),p=t.useCollectionRecordData(),{record:u}=t.useRecord(),x=(p==null?void 0:p.name)||(u==null?void 0:u.name);return{onClick(){return g(this,null,function*(){var D;yield a.submit(),o.data=o.data||{},o.data.loading=!0;try{const k=yield d.update({filterByTk:x,values:a.values});s.setVisible(!1),yield a.reset(),r.refresh(),e==null||e(x,(D=k==null?void 0:k.data)==null?void 0:D.data)}catch(k){console.error(k)}finally{o.data.loading=!1}})}}};function O({name:e,cname:o}){const a=t.useApp();return o?`//${o}`:a.getRouteUrl(`/apps/${e}/admin/`)}const N=()=>{const e=t.useDataBlockResource(),{t:o}=C();return{onClick(){return g(this,null,function*(){var r,d;const s=yield e.startAll();l.notification.info({key:h,message:n.jsxs("span",{children:[o("Processing..."),"    ",n.jsx(l.Spin,{indicator:n.jsx(m.LoadingOutlined,{style:{fontSize:24},spin:!0})})]}),duration:0}),((d=(r=s==null?void 0:s.data)==null?void 0:r.data)==null?void 0:d.all)===0&&l.notification.info({key:h,message:`${o("Start count")}: 0/0!`})})}}},$=()=>{const e=t.useDataBlockResource(),{t:o}=C();return{onClick(){return g(this,null,function*(){var r,d;const s=yield e.stopAll();if(((d=(r=s==null?void 0:s.data)==null?void 0:r.data)==null?void 0:d.all)===0){l.notification.info({key:h,message:`${o("Stop count")}: 0/0!`});return}l.notification.info({key:h,message:n.jsxs("span",{children:[o("Processing..."),"    ",n.jsx(l.Spin,{indicator:n.jsx(m.LoadingOutlined,{style:{fontSize:24},spin:!0})})]}),duration:0})})}}},X=()=>{const e=t.useCollectionRecordData();return O({name:e.name,cname:e.cname})},Z=()=>{const{t:e}=C(),o=X(),a=t.useCollectionRecordData(),{handleStart:s,handleStop:r}=z(a);return n.jsxs(l.Space,{split:n.jsx(l.Divider,{type:"horizontal"}),children:[n.jsx(t.TrackingLink,{href:o,target:"_blank",rel:"noreferrer",trackingKey:"multiapp_linkView",children:e("View",{ns:S})}),a.status!=="running"&&n.jsx("a",{onClick:()=>s(),children:e("Start",{ns:S})}),a.status!=="stopped"&&n.jsx("a",{onClick:()=>r(),children:e("Stop",{ns:S})})]})},R=e=>{const{data:o,mutate:a,refresh:s}=t.useDataBlockRequest();return t.useNoticeSub(_,r=>{const d=l.notification[r.level]||l.notification.info;if(r.message?d({key:h,message:r.message}):r.status!=="commanding"&&r.status!=="initializing"&&l.notification.destroy(h),!(o!=null&&o.data)||r.refresh){s();return}if(!r.app&&!r.status||!o.data.some(x=>x.name===r.app))return;const u=[...o.data];u.find(x=>x.name===r.app).status=r.status,a(v(A({},o),{data:u}))}),null},q=e=>{var d,p;const{admin:o=!0}=e,a=t.useCurrentUserContext(),s=(p=(d=a==null?void 0:a.data)==null?void 0:d.data)==null?void 0:p.id,{t:r}=P.useTranslation([S,"core"],{nsMode:"fallback"});return n.jsx(l.Card,{bordered:!1,children:n.jsx(t.SchemaComponent,{schema:J,scope:{admin:o,userId:s,useCreateDatabaseConnectionAction:Q,useMultiAppUpdateAction:V,useStartAllAction:N,useStopAllAction:$,t:r,uid:f.uid},components:{AppVisitor:Z,GlobalNotificationHandler:R}})})};class ee extends t.Plugin{load(){return g(this,null,function*(){this.app.systemSettingsManager.add(`system-services.${S}`,{title:c("Multi-app manager"),icon:"AppstoreOutlined",Component:q,aclSnippet:"pm.multi-app.applications"})})}}const te={type:"void","x-component":"CardItem","x-toolbar":"BlockSchemaToolbar","x-settings":"blockSettings:table",properties:{app:{type:"void","x-component":"ViewMultiAppPane","x-component-props":{admin:!1}}}},oe=()=>{const{insert:e}=t.useSchemaInitializer(),o=t.useSchemaInitializerItem(),a=b.useCallback(()=>e(te),[e]);return n.jsx(t.SchemaInitializerItem,v(A({},o),{onClick:a}))},ne={type:"void",properties:{update:{type:"void","x-component":"Action","x-component-props":{icon:"editoutlined"},properties:{drawer:{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{useValues:"{{ cm.useValuesFromRecord }}"},title:'{{t("Edit")}}',properties:{formSchema:w,footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{t("Cancel")}}',"x-component":"Action","x-use-component-props":"useCancelActionProps"},submit:{title:'{{t("Submit")}}',"x-action":"submit","x-component":"Action","x-use-component-props":"useMultiAppUpdateAction","x-component-props":{type:"primary"}}}}}}}},delete:{type:"void","x-component":"Action","x-use-component-props":"useDestroyActionProps","x-component-props":{icon:"deleteoutlined",confirm:{title:"{{t('Delete')}}",content:"{{t('Are you sure you want to delete it?')}}"}}}}},ae={type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:16}},properties:{create:{type:"void",title:'{{t("Add new")}}',"x-decorator":e=>b.createElement(t.SchemaComponentOptions,v(A({},e),{scope:{createOnly:!0}})),"x-component":"Action","x-component-props":{type:"primary",icon:"PlusOutlined"},properties:{drawer:{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{useValues(e){const o=t.useActionContext();return t.useRequest(()=>Promise.resolve({data:{name:`a_${f.uid()}`}}),v(A({},e),{refreshDeps:[o.visible]}))}},title:'{{t("Add new")}}',properties:{formSchema:w,footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{t("Cancel")}}',"x-component":"Action","x-use-component-props":"useCancelActionProps"},submit:{title:'{{ t("Submit") }}',"x-component":"Action","x-use-component-props":"useCreateDatabaseConnectionAction","x-component-props":{type:"primary"}}}}}}}}}},re=t.createStyles(({css:e,token:o})=>({appAction:e`
8
+ }}}`,"x-component-props":{addonAfter:`.${window.location.hostname}`},"x-reactions":[{dependencies:["cname"],fulfill:{state:{value:'{{ ($deps[0] && $deps[0].replace(new RegExp("\\."+window.location.hostname+"$"), "")) || "" }}'}}}]},cname:{"x-hidden":!0,"x-component":"Input","x-decorator":"FormItem","x-read-pretty":!0,"x-reactions":{dependencies:["cnamePrefix"],fulfill:{state:{value:`{{$deps[0] ? $deps[0] + ".${window.location.hostname}" : null}}`}}}},tmpl:{title:c("Template"),"x-component":"RemoteSelect","x-component-props":{placeholder:c("Can be empty, or selected from the template library or personal applications"),fieldNames:{label:"displayName",value:"name"},service:{resource:"applications",params:{filter:{$or:[{isTemplate:!0},{createdById:"{{ userId }}"}]}}}},"x-decorator":"FormItem","x-disabled":"{{ !createOnly }}"},"options.startEnvs":{type:"string",title:c("Start environment variables"),"x-component":"Input.TextArea","x-decorator":"FormItem","x-hidden":!0},pinned:{"x-component":"CollectionField","x-decorator":"FormItem","x-hidden":"{{ !admin }}"},isTemplate:{"x-component":"CollectionField","x-decorator":"FormItem","x-hidden":"{{ !admin }}"},icon:{type:"string",title:'{{ t("Icon") }}',"x-component":"IconPicker","x-decorator":"FormItem"},color:{type:"string",title:'{{ t("Color") }}',"x-component":"ColorPicker","x-decorator":"FormItem",default:"#e5e5e5"}}},B={properties:{view:{type:"void","x-component":"AppVisitor","x-component-props":{admin:"{{ admin }}"}},update:{type:"void",title:'{{t("Edit")}}',"x-component":"Action.Link",properties:{drawer:{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{useValues:"{{ cm.useValuesFromRecord }}"},title:'{{t("Edit")}}',properties:{formSchema:w,footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{t("Cancel")}}',"x-component":"Action","x-use-component-props":"useCancelActionProps"},submit:{title:'{{t("Submit")}}',"x-action":"submit","x-component":"Action","x-use-component-props":"useMultiAppUpdateAction","x-component-props":{type:"primary"}}}}}}}},delete:{type:"void",title:'{{ t("Delete") }}',"x-component":"Action.Link","x-use-component-props":"useDestroyActionProps","x-component-props":{confirm:{title:"{{t('Delete')}}",content:"{{t('Are you sure you want to delete it?')}}"}}}}},J={type:"void",properties:{applicationsTable:{type:"void","x-decorator":"TableBlockProvider","x-decorator-props":{collection:M,action:"list",params:{pageSize:20,sort:["-createdAt"],appends:[],filter:{createdById:"{{ admin ? undefined : userId }}"}},rowKey:"name"},properties:{GlobalNotificationHandler:{type:"void","x-component":"GlobalNotificationHandler"},actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:16}},properties:{fuzzySearch:{type:"void","x-component":"FuzzySearchInput","x-align":"left"},refresh:{type:"void",title:'{{ t("Refresh") }}',"x-component":"Action","x-use-component-props":"useRefreshActionProps","x-component-props":{icon:"ReloadOutlined"}},delete:{type:"void",title:'{{ t("Delete") }}',"x-action":"destroy","x-component":"Action","x-decorator":"ACLActionProvider","x-use-component-props":"useBulkDestroyActionProps","x-component-props":{icon:"DeleteOutlined",confirm:{title:"{{t('Delete')}}",content:"{{t('Are you sure you want to delete it?')}}"}},"x-hidden":"{{ !admin }}"},startAll:{type:"void",title:'{{ t("Start all") }}',"x-component":"Action","x-use-component-props":"useStartAllAction","x-component-props":{icon:"FastForwardOutlined",danger:!0,confirm:{title:c("Start all"),content:c("Starting all sub-applications may cause lag. The more applications you have, the longer the waiting time")}},"x-hidden":"{{ !admin }}"},stopAll:{type:"void",title:'{{ t("Stop all") }}',"x-component":"Action","x-use-component-props":"useStopAllAction","x-component-props":{icon:"StopOutlined",danger:!0,confirm:{title:c("Stop all"),content:c("All sub-applications have stopped serving, unless you restart them")}},"x-hidden":"{{ !admin }}"},create:{type:"void",title:'{{t("Add new")}}',"x-decorator":e=>b.createElement(t.SchemaComponentOptions,v(A({},e),{scope:{createOnly:!0}})),"x-component":"Action","x-component-props":{type:"primary",icon:"PlusOutlined"},properties:{drawer:{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{useValues(e){const o=t.useActionContext();return t.useRequest(()=>Promise.resolve({data:{name:`a_${y.uid()}`}}),v(A({},e),{refreshDeps:[o.visible]}))}},title:'{{t("Add new")}}',properties:{formSchema:w,footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{t("Cancel")}}',"x-component":"Action","x-use-component-props":"useCancelActionProps"},submit:{title:'{{ t("Submit") }}',"x-component":"Action","x-use-component-props":"useCreateDatabaseConnectionAction","x-component-props":{type:"primary"}}}}}}}}}},table:{type:"array","x-uid":"input","x-component":"TableV2","x-use-component-props":"useTableBlockProps","x-component-props":{rowKey:"name",rowSelection:{type:"checkbox"}},properties:{displayName:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{displayName:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},name:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{name:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},pinned:{type:"void",title:c("Pin to menu"),"x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{pinned:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},isTemplate:{type:"void",title:c("Is template"),"x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{isTemplate:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},status:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{status:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},actions:{type:"void",title:'{{t("Actions")}}',"x-component":"TableV2.Column",properties:{actions:A({type:"void","x-component":"Space","x-component-props":{split:"|"}},B)}}}}}}}},Q=()=>{const e=y.useForm(),o=y.useField(),a=t.useActionContext(),s=t.useDataBlockRequest(),r=t.useDataBlockResource();return{onClick(){return g(this,null,function*(){try{yield e.submit(),o.data=o.data||{},o.data.loading=!0,yield r.create({values:e.values}),a.setVisible(!1),yield e.reset(),o.data.loading=!1,s.refresh()}catch(p){o.data&&(o.data.loading=!1)}})}}},z=e=>{const{t:o}=C(),a=t.useAPIClient(),s=b.useMemo(()=>a.resource("applications"),[a]);return{handleStart:()=>g(null,null,function*(){try{l.notification.info({key:h,message:n.jsxs("span",{children:[o("Processing..."),"    ",n.jsx(l.Spin,{indicator:n.jsx(m.LoadingOutlined,{style:{fontSize:24},spin:!0})})]}),duration:0});const p=yield s.start({filterByTk:e.name});(p==null?void 0:p.status)===205&&l.notification.info({key:h,message:o("App is already running")})}catch(p){l.notification.error({key:h,message:o("Failed to start app")})}}),handleStop:()=>{s.stop({filterByTk:e.name}).then(()=>{l.notification.info({key:h,message:n.jsxs("span",{children:[o("Processing..."),"    ",n.jsx(l.Spin,{indicator:n.jsx(m.LoadingOutlined,{style:{fontSize:24},spin:!0})})]}),duration:0})})}}},V=e=>{const o=y.useField(),a=y.useForm(),s=t.useActionContext(),r=t.useDataBlockRequest(),d=t.useDataBlockResource(),p=t.useCollectionRecordData(),{record:u}=t.useRecord(),x=(p==null?void 0:p.name)||(u==null?void 0:u.name);return{onClick(){return g(this,null,function*(){var D;yield a.submit(),o.data=o.data||{},o.data.loading=!0;try{const k=yield d.update({filterByTk:x,values:a.values});s.setVisible(!1),yield a.reset(),r.refresh(),e==null||e(x,(D=k==null?void 0:k.data)==null?void 0:D.data)}catch(k){console.error(k)}finally{o.data.loading=!1}})}}};function O({name:e,cname:o}){const a=t.useApp();return o?`//${o}`:a.getRouteUrl(`/apps/${e}/admin/`)}const N=()=>{const e=t.useDataBlockResource(),{t:o}=C();return{onClick(){return g(this,null,function*(){var r,d;const s=yield e.startAll();l.notification.info({key:h,message:n.jsxs("span",{children:[o("Processing..."),"    ",n.jsx(l.Spin,{indicator:n.jsx(m.LoadingOutlined,{style:{fontSize:24},spin:!0})})]}),duration:0}),((d=(r=s==null?void 0:s.data)==null?void 0:r.data)==null?void 0:d.all)===0&&l.notification.info({key:h,message:`${o("Start count")}: 0/0!`})})}}},$=()=>{const e=t.useDataBlockResource(),{t:o}=C();return{onClick(){return g(this,null,function*(){var r,d;const s=yield e.stopAll();if(((d=(r=s==null?void 0:s.data)==null?void 0:r.data)==null?void 0:d.all)===0){l.notification.info({key:h,message:`${o("Stop count")}: 0/0!`});return}l.notification.info({key:h,message:n.jsxs("span",{children:[o("Processing..."),"    ",n.jsx(l.Spin,{indicator:n.jsx(m.LoadingOutlined,{style:{fontSize:24},spin:!0})})]}),duration:0})})}}},X=()=>{const e=t.useCollectionRecordData();return O({name:e.name,cname:e.cname})},Z=()=>{const{t:e}=C(),o=X(),a=t.useCollectionRecordData(),{handleStart:s,handleStop:r}=z(a);return n.jsxs(l.Space,{split:n.jsx(l.Divider,{type:"horizontal"}),children:[n.jsx(t.TrackingLink,{href:o,target:"_blank",rel:"noreferrer",trackingKey:"multiapp_linkView",children:e("View",{ns:S})}),a.status!=="running"&&n.jsx("a",{onClick:()=>s(),children:e("Start",{ns:S})}),a.status!=="stopped"&&n.jsx("a",{onClick:()=>r(),children:e("Stop",{ns:S})})]})},R=e=>{const{data:o,mutate:a,refresh:s}=t.useDataBlockRequest();return t.useNoticeSub(_,r=>{const d=l.notification[r.level]||l.notification.info;if(r.message?d({key:h,message:r.message}):r.status!=="commanding"&&r.status!=="initializing"&&l.notification.destroy(h),!(o!=null&&o.data)||r.refresh){s();return}if(!r.app&&!r.status||!o.data.some(x=>x.name===r.app))return;const u=[...o.data];u.find(x=>x.name===r.app).status=r.status,a(v(A({},o),{data:u}))}),null},q=e=>{var d,p;const{admin:o=!0}=e,a=t.useCurrentUserContext(),s=(p=(d=a==null?void 0:a.data)==null?void 0:d.data)==null?void 0:p.id,{t:r}=P.useTranslation([S,"core"],{nsMode:"fallback"});return n.jsx(l.Card,{bordered:!1,children:n.jsx(t.SchemaComponent,{schema:J,scope:{admin:o,userId:s,useCreateDatabaseConnectionAction:Q,useMultiAppUpdateAction:V,useStartAllAction:N,useStopAllAction:$,t:r,uid:f.uid},components:{AppVisitor:Z,GlobalNotificationHandler:R}})})};class ee extends t.Plugin{load(){return g(this,null,function*(){this.app.systemSettingsManager.add(`system-services.${S}`,{title:c("Multi-app manager"),icon:"AppstoreOutlined",Component:q,aclSnippet:"pm.multi-app.applications"})})}}const te={type:"void","x-component":"CardItem","x-toolbar":"BlockSchemaToolbar","x-settings":"blockSettings:table",properties:{app:{type:"void","x-component":"ViewMultiAppPane","x-component-props":{admin:!1}}}},oe=()=>{const{insert:e}=t.useSchemaInitializer(),o=t.useSchemaInitializerItem(),a=b.useCallback(()=>e(te),[e]);return n.jsx(t.SchemaInitializerItem,v(A({},o),{onClick:a}))},ne={type:"void",properties:{update:{type:"void","x-component":"Action","x-component-props":{icon:"editoutlined"},properties:{drawer:{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{useValues:"{{ cm.useValuesFromRecord }}"},title:'{{t("Edit")}}',properties:{formSchema:w,footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{t("Cancel")}}',"x-component":"Action","x-use-component-props":"useCancelActionProps"},submit:{title:'{{t("Submit")}}',"x-action":"submit","x-component":"Action","x-use-component-props":"useMultiAppUpdateAction","x-component-props":{type:"primary"}}}}}}}},delete:{type:"void","x-component":"Action","x-use-component-props":"useDestroyActionProps","x-component-props":{icon:"deleteoutlined",confirm:{title:"{{t('Delete')}}",content:"{{t('Are you sure you want to delete it?')}}"}}}}},ae={type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:16}},properties:{create:{type:"void",title:'{{t("Add new")}}',"x-decorator":e=>b.createElement(t.SchemaComponentOptions,v(A({},e),{scope:{createOnly:!0}})),"x-component":"Action","x-component-props":{type:"primary",icon:"PlusOutlined"},properties:{drawer:{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{useValues(e){const o=t.useActionContext();return t.useRequest(()=>Promise.resolve({data:{name:`a_${f.uid()}`}}),v(A({},e),{refreshDeps:[o.visible]}))}},title:'{{t("Add new")}}',properties:{formSchema:w,footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{t("Cancel")}}',"x-component":"Action","x-use-component-props":"useCancelActionProps"},submit:{title:'{{ t("Submit") }}',"x-component":"Action","x-use-component-props":"useCreateDatabaseConnectionAction","x-component-props":{type:"primary"}}}}}}}}}},re=t.createStyles(({css:e,token:o})=>({appAction:e`
9
9
  width: 100%;
10
10
  display: flex;
11
11
  justify-content: flex-end;
@@ -1,16 +1,16 @@
1
1
  module.exports = {
2
2
  "react-i18next": "15.2.0",
3
- "@tachybase/client": "1.3.15",
4
- "@tachybase/server": "1.3.15",
5
- "@tachybase/database": "1.3.15",
3
+ "@tachybase/client": "1.3.17",
4
+ "@tachybase/server": "1.3.17",
5
+ "@tachybase/database": "1.3.17",
6
6
  "lodash": "4.17.21",
7
7
  "mysql2": "3.14.1",
8
8
  "pg": "8.13.1",
9
9
  "react": "18.3.1",
10
- "@tachybase/schema": "1.3.15",
10
+ "@tachybase/schema": "1.3.17",
11
11
  "antd": "5.22.5",
12
12
  "react-router-dom": "6.28.1",
13
- "@tachybase/utils": "1.3.15",
13
+ "@tachybase/utils": "1.3.17",
14
14
  "@ant-design/icons": "5.5.2",
15
- "@tachybase/actions": "1.3.15"
15
+ "@tachybase/actions": "1.3.17"
16
16
  };
package/dist/index.js CHANGED
@@ -26,12 +26,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var src_exports = {};
30
- __export(src_exports, {
29
+ var index_exports = {};
30
+ __export(index_exports, {
31
31
  default: () => import_server.default
32
32
  });
33
- module.exports = __toCommonJS(src_exports);
34
- __reExport(src_exports, require("./server"), module.exports);
33
+ module.exports = __toCommonJS(index_exports);
34
+ __reExport(index_exports, require("./server"), module.exports);
35
35
  var import_server = __toESM(require("./server"));
36
36
  // Annotate the CommonJS export names for ESM import in node:
37
37
  0 && (module.exports = {
@@ -1 +1 @@
1
- {"name":"mariadb","version":"2.5.6","description":"fast mariadb/mysql connector.","main":"promise.js","types":"types/index.d.ts","directories":{"lib":"lib","test":"test"},"private":false,"scripts":{"test":"npm run test:types-prettier && npm run test:prettier && npm run test:types && npm run test:lint && npm run test:base","test:base":"mocha --no-parallel --timeout 5000 \"test/**/*.js\" ","test:lint":"eslint \"{lib,test}/**/*.js\" ","test:types":"eslint \"types/*.ts\" ","test:types-prettier":"prettier --write \"types/*.ts\"","test:prettier":"prettier --write \"{tools,lib,test,benchmarks}/**/*.js\"","coverage":"npm run coverage:test && npm run coverage:report","coverage:test":"nyc mocha --no-parallel --timeout 5000 \"test/**/*.js\"","coverage:report":"nyc report --reporter=text-lcov > coverage.lcov && codecov","benchmark":"node ./benchmarks/benchmarks.js","generate":"node ./tools/generate-mariadb.js"},"repository":{"type":"git","url":"git+https://github.com/mariadb-corporation/mariadb-connector-nodejs.git"},"keywords":["mariadb","mysql","client","driver","connector"],"files":["lib","types/index.d.ts","promise.js","callback.js"],"engines":{"node":">= 10.13"},"author":"Diego Dupin <diego.dupin@mariadb.com>","license":"LGPL-2.1-or-later","dependencies":{"@types/geojson":"^7946.0.8","@types/node":"^17.0.10","denque":"^2.0.1","iconv-lite":"^0.6.3","long":"^5.2.0","moment-timezone":"^0.5.34","please-upgrade-node":"^3.2.0"},"devDependencies":{"@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","benchmark":"^2.1.4","chai":"^4.3.4","codecov":"^3.8.2","chalk":"^4.1.2","dom-parser":"^0.1.6","error-stack-parser":"^2.0.6","eslint":"^8.7.0","eslint-config-prettier":"^8.3.0","eslint-plugin-markdown":"^2.2.1","eslint-plugin-prettier":"^4.0.0","mocha":"^9.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^15.1.0","prettier":"^2.5.1","typescript":"^4.5.5"},"bugs":{"url":"https://jira.mariadb.org/projects/CONJS/"},"homepage":"https://github.com/mariadb-corporation/mariadb-connector-nodejs#readme","_lastModified":"2025-07-01T07:56:27.110Z"}
1
+ {"name":"mariadb","version":"2.5.6","description":"fast mariadb/mysql connector.","main":"promise.js","types":"types/index.d.ts","directories":{"lib":"lib","test":"test"},"private":false,"scripts":{"test":"npm run test:types-prettier && npm run test:prettier && npm run test:types && npm run test:lint && npm run test:base","test:base":"mocha --no-parallel --timeout 5000 \"test/**/*.js\" ","test:lint":"eslint \"{lib,test}/**/*.js\" ","test:types":"eslint \"types/*.ts\" ","test:types-prettier":"prettier --write \"types/*.ts\"","test:prettier":"prettier --write \"{tools,lib,test,benchmarks}/**/*.js\"","coverage":"npm run coverage:test && npm run coverage:report","coverage:test":"nyc mocha --no-parallel --timeout 5000 \"test/**/*.js\"","coverage:report":"nyc report --reporter=text-lcov > coverage.lcov && codecov","benchmark":"node ./benchmarks/benchmarks.js","generate":"node ./tools/generate-mariadb.js"},"repository":{"type":"git","url":"git+https://github.com/mariadb-corporation/mariadb-connector-nodejs.git"},"keywords":["mariadb","mysql","client","driver","connector"],"files":["lib","types/index.d.ts","promise.js","callback.js"],"engines":{"node":">= 10.13"},"author":"Diego Dupin <diego.dupin@mariadb.com>","license":"LGPL-2.1-or-later","dependencies":{"@types/geojson":"^7946.0.8","@types/node":"^17.0.10","denque":"^2.0.1","iconv-lite":"^0.6.3","long":"^5.2.0","moment-timezone":"^0.5.34","please-upgrade-node":"^3.2.0"},"devDependencies":{"@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","benchmark":"^2.1.4","chai":"^4.3.4","codecov":"^3.8.2","chalk":"^4.1.2","dom-parser":"^0.1.6","error-stack-parser":"^2.0.6","eslint":"^8.7.0","eslint-config-prettier":"^8.3.0","eslint-plugin-markdown":"^2.2.1","eslint-plugin-prettier":"^4.0.0","mocha":"^9.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^15.1.0","prettier":"^2.5.1","typescript":"^4.5.5"},"bugs":{"url":"https://jira.mariadb.org/projects/CONJS/"},"homepage":"https://github.com/mariadb-corporation/mariadb-connector-nodejs#readme","_lastModified":"2025-07-04T03:58:08.603Z"}
@@ -1 +1 @@
1
- {"name":"qs","description":"A querystring parser that supports nesting and arrays, with a depth limit","homepage":"https://github.com/ljharb/qs","version":"6.14.0","repository":{"type":"git","url":"https://github.com/ljharb/qs.git"},"funding":{"url":"https://github.com/sponsors/ljharb"},"main":"lib/index.js","sideEffects":false,"contributors":[{"name":"Jordan Harband","email":"ljharb@gmail.com","url":"http://ljharb.codes"}],"keywords":["querystring","qs","query","url","parse","stringify"],"engines":{"node":">=0.6"},"dependencies":{"side-channel":"^1.1.0"},"devDependencies":{"@browserify/envify":"^6.0.0","@browserify/uglifyify":"^6.0.0","@ljharb/eslint-config":"^21.1.1","browserify":"^16.5.2","bundle-collapser":"^1.4.0","common-shakeify":"~1.0.0","eclint":"^2.8.1","es-value-fixtures":"^1.7.0","eslint":"=8.8.0","evalmd":"^0.0.19","for-each":"^0.3.3","glob":"=10.3.7","has-bigints":"^1.1.0","has-override-mistake":"^1.0.1","has-property-descriptors":"^1.0.2","has-proto":"^1.2.0","has-symbols":"^1.1.0","iconv-lite":"^0.5.1","in-publish":"^2.0.1","jackspeak":"=2.1.1","mkdirp":"^0.5.5","mock-property":"^1.1.0","module-deps":"^6.2.3","npmignore":"^0.3.1","nyc":"^10.3.2","object-inspect":"^1.13.3","qs-iconv":"^1.0.4","safe-publish-latest":"^2.0.0","safer-buffer":"^2.1.2","tape":"^5.9.0","unassertify":"^3.0.1"},"scripts":{"prepack":"npmignore --auto --commentLines=autogenerated && npm run dist","prepublishOnly":"safe-publish-latest","prepublish":"not-in-publish || npm run prepublishOnly","pretest":"npm run --silent readme && npm run --silent lint","test":"npm run tests-only","tests-only":"nyc tape 'test/**/*.js'","posttest":"npx npm@'>=10.2' audit --production","readme":"evalmd README.md","postlint":"eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git' | grep -v dist/)","lint":"eslint --ext=js,mjs .","dist":"mkdirp dist && browserify --standalone Qs -g unassertify -g @browserify/envify -g [@browserify/uglifyify --mangle.keep_fnames --compress.keep_fnames --format.indent_level=1 --compress.arrows=false --compress.passes=4 --compress.typeofs=false] -p common-shakeify -p bundle-collapser/plugin lib/index.js > dist/qs.js"},"license":"BSD-3-Clause","publishConfig":{"ignore":["!dist/*","bower.json","component.json",".github/workflows","logos","tea.yaml"]},"_lastModified":"2025-07-01T07:56:27.437Z"}
1
+ {"name":"qs","description":"A querystring parser that supports nesting and arrays, with a depth limit","homepage":"https://github.com/ljharb/qs","version":"6.14.0","repository":{"type":"git","url":"https://github.com/ljharb/qs.git"},"funding":{"url":"https://github.com/sponsors/ljharb"},"main":"lib/index.js","sideEffects":false,"contributors":[{"name":"Jordan Harband","email":"ljharb@gmail.com","url":"http://ljharb.codes"}],"keywords":["querystring","qs","query","url","parse","stringify"],"engines":{"node":">=0.6"},"dependencies":{"side-channel":"^1.1.0"},"devDependencies":{"@browserify/envify":"^6.0.0","@browserify/uglifyify":"^6.0.0","@ljharb/eslint-config":"^21.1.1","browserify":"^16.5.2","bundle-collapser":"^1.4.0","common-shakeify":"~1.0.0","eclint":"^2.8.1","es-value-fixtures":"^1.7.0","eslint":"=8.8.0","evalmd":"^0.0.19","for-each":"^0.3.3","glob":"=10.3.7","has-bigints":"^1.1.0","has-override-mistake":"^1.0.1","has-property-descriptors":"^1.0.2","has-proto":"^1.2.0","has-symbols":"^1.1.0","iconv-lite":"^0.5.1","in-publish":"^2.0.1","jackspeak":"=2.1.1","mkdirp":"^0.5.5","mock-property":"^1.1.0","module-deps":"^6.2.3","npmignore":"^0.3.1","nyc":"^10.3.2","object-inspect":"^1.13.3","qs-iconv":"^1.0.4","safe-publish-latest":"^2.0.0","safer-buffer":"^2.1.2","tape":"^5.9.0","unassertify":"^3.0.1"},"scripts":{"prepack":"npmignore --auto --commentLines=autogenerated && npm run dist","prepublishOnly":"safe-publish-latest","prepublish":"not-in-publish || npm run prepublishOnly","pretest":"npm run --silent readme && npm run --silent lint","test":"npm run tests-only","tests-only":"nyc tape 'test/**/*.js'","posttest":"npx npm@'>=10.2' audit --production","readme":"evalmd README.md","postlint":"eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git' | grep -v dist/)","lint":"eslint --ext=js,mjs .","dist":"mkdirp dist && browserify --standalone Qs -g unassertify -g @browserify/envify -g [@browserify/uglifyify --mangle.keep_fnames --compress.keep_fnames --format.indent_level=1 --compress.arrows=false --compress.passes=4 --compress.typeofs=false] -p common-shakeify -p bundle-collapser/plugin lib/index.js > dist/qs.js"},"license":"BSD-3-Clause","publishConfig":{"ignore":["!dist/*","bower.json","component.json",".github/workflows","logos","tea.yaml"]},"_lastModified":"2025-07-04T03:58:08.917Z"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tachybase/module-multi-app",
3
3
  "displayName": "Multi-app manager",
4
- "version": "1.3.15",
4
+ "version": "1.3.17",
5
5
  "description": "Dynamically create multiple apps without separate deployments.",
6
6
  "keywords": [
7
7
  "System management"
@@ -20,15 +20,15 @@
20
20
  "react": "~18.3.1",
21
21
  "react-i18next": "^15.2.0",
22
22
  "react-router-dom": "6.28.1",
23
- "@tachybase/schema": "1.3.15"
23
+ "@tachybase/schema": "1.3.17"
24
24
  },
25
25
  "peerDependencies": {
26
- "@tachybase/actions": "1.3.15",
27
- "@tachybase/client": "1.3.15",
28
- "@tachybase/database": "1.3.15",
29
- "@tachybase/server": "1.3.15",
30
- "@tachybase/test": "1.3.15",
31
- "@tachybase/utils": "1.3.15"
26
+ "@tachybase/actions": "1.3.17",
27
+ "@tachybase/database": "1.3.17",
28
+ "@tachybase/server": "1.3.17",
29
+ "@tachybase/test": "1.3.17",
30
+ "@tachybase/utils": "1.3.17",
31
+ "@tachybase/client": "1.3.17"
32
32
  },
33
33
  "description.zh-CN": "无需单独部署即可动态创建多个应用。",
34
34
  "displayName.zh-CN": "多应用管理器",