@tachybase/module-multi-app 0.23.20 → 0.23.35
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.
package/dist/client/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(n,o){typeof exports=="object"&&typeof module!="undefined"?o(exports,require("react/jsx-runtime"),require("@tachybase/client"),require("@ant-design/icons"),require("react"),require("antd"),require("@tachybase/schema"),require("react-i18next"),require("react-router-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@tachybase/client","@ant-design/icons","react","antd","@tachybase/schema","react-i18next","react-router-dom"],o):(n=typeof globalThis!="undefined"?globalThis:n||self,o(n["@tachybase/module-multi-app"]={},n.jsxRuntime,n["@tachybase/client"],n["@ant-design/icons"],n.react,n.antd,n["@tachybase/schema"],n["react-i18next"],n["react-router-dom"]))})(this,function(n,o,t,b,y,d,x,h,s){"use strict";var j=Object.defineProperty,K=Object.defineProperties;var L=Object.getOwnPropertyDescriptors;var M=Object.getOwnPropertySymbols;var U=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable;var P=(n,o,t)=>o in n?j(n,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[o]=t,f=(n,o)=>{for(var t in o||(o={}))U.call(o,t)&&P(n,t,o[t]);if(M)for(var t of M(o))G.call(o,t)&&P(n,t,o[t]);return n},v=(n,o)=>K(n,L(o));var S=(n,o,t)=>new Promise((b,y)=>{var d=s=>{try{h(t.next(s))}catch(p){y(p)}},x=s=>{try{h(t.throw(s))}catch(p){y(p)}},h=s=>s.done?b(s.value):Promise.resolve(s.value).then(d,x);h((t=t.apply(n,o)).next())});const p="multi-app",g=()=>{const{t:e}=h.useTranslation([p,"core"]);return{t:e}},i=e=>`{{t("${e}", { ns: ["${p}", "client"] })}}`,I={name:"applications",targetKey:"name",fields:[{type:"uid",name:"name",primaryKey:!0,prefix:"a",interface:"input",uiSchema:{type:"string",title:i("App ID"),required:!0,"x-component":"Input","x-validator":"uid"}},{type:"string",name:"displayName",interface:"input",uiSchema:{type:"string",title:i("App display name"),required:!0,"x-component":"Input"}},{type:"string",name:"pinned",interface:"checkbox",uiSchema:{type:"boolean","x-content":i("Pin to menu"),"x-component":"Checkbox"}},{type:"string",name:"status",interface:"radioGroup",defaultValue:"pending",uiSchema:{type:"string",title:i("App status"),enum:[{label:"Initializing",value:"initializing"},{label:"Initialized",value:"initialized"},{label:"Running",value:"running"},{label:"Commanding",value:"commanding"},{label:"Stopped",value:"stopped"},{label:"Error",value:"error"},{label:"Not found",value:"not_found"}],"x-component":"Radio.Group"}},{type:"string",name:"isTemplate",interface:"checkbox",uiSchema:{type:"boolean","x-content":i("Is template"),"x-component":"Checkbox"}}]},D=()=>{const{refresh:e}=t.useResourceActionContext();return{run(){e()}}},$=()=>{const{state:e,setState:r,refresh:a}=t.useResourceActionContext(),{resource:m}=t.useResourceContext();return{run(){return S(this,null,function*(){yield m.destroy({filterByTk:(e==null?void 0:e.selectedRowKeys)||[]}),r==null||r({selectedRowKeys:[]}),a()})}}},C={type:"void","x-component":"div",properties:{displayName:{"x-component":"CollectionField","x-decorator":"FormItem"},name:{"x-component":"CollectionField","x-decorator":"FormItem","x-disabled":"{{ !createOnly }}","x-hidden":"{{ !admin }}"},"options.autoStart":{title:i("Start mode"),"x-component":"Radio.Group","x-decorator":"FormItem",default:!1,enum:[{label:i("Start on first visit"),value:!1},{label:i("Start with main application"),value:!0}],"x-hidden":"{{ !admin }}"},cnamePrefix:{title:i("Custom domain prefix"),"x-component":"Input","x-decorator":"FormItem","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:i("Template"),"x-component":"RemoteSelect","x-component-props":{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:i("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 }}"}}},k={properties:{view:{type:"void","x-component":"AppVisitor","x-component-props":{admin:"{{ admin }}"}},update:{type:"void",title:'{{t("Edit")}}',"x-component":"Action.Link","x-component-props":{},properties:{drawer:{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{useValues:"{{ cm.useValuesFromRecord }}"},title:'{{t("Edit")}}',properties:{formSchema:C,footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{t("Cancel")}}',"x-component":"Action","x-component-props":{useAction:"{{ cm.useCancelAction }}"}},submit:{title:'{{t("Submit")}}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ cm.useUpdateAction }}"}}}}}}}},delete:{type:"void",title:'{{ t("Delete") }}',"x-component":"Action.Link","x-component-props":{confirm:{title:"{{t('Delete')}}",content:"{{t('Are you sure you want to delete it?')}}"},useAction:"{{cm.useDestroyAction}}"}}}},q={type:"object",properties:{[x.uid()]:{type:"void","x-decorator":"ResourceActionProvider","x-decorator-props":{collection:I,resourceName:"applications",request:{resource:"applications",action:"list",params:{pageSize:50,sort:["-createdAt"],appends:[],filter:{createdById:"{{ admin ? undefined : userId }}"}}}},"x-component":"CollectionProvider_deprecated","x-component-props":{collection:I},properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:16}},properties:{refresh:{type:"void",title:'{{t("Refresh")}}',"x-component":"Action","x-component-props":{icon:"ReloadOutlined",useAction:D}},delete:{type:"void",title:'{{ t("Delete") }}',"x-component":"Action","x-component-props":{icon:"DeleteOutlined",useAction:$,confirm:{title:"{{t('Delete')}}",content:"{{t('Are you sure you want to delete it?')}}"}},"x-hidden":"{{ !admin }}"},create:{type:"void",title:'{{t("Add new")}}',"x-decorator":e=>y.createElement(t.SchemaComponentOptions,v(f({},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 r=t.useActionContext();return t.useRequest(()=>Promise.resolve({data:{name:`a_${x.uid()}`}}),v(f({},e),{refreshDeps:[r.visible]}))}},title:'{{t("Add new")}}',properties:{formSchema:C,footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{t("Cancel")}}',"x-component":"Action","x-component-props":{useAction:"{{ cm.useCancelAction }}"}},submit:{title:'{{t("Submit")}}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ cm.useCreateAction }}"}}}}}}}}}},table:{type:"void","x-uid":"input","x-component":"Table.Void","x-component-props":{rowKey:"name",rowSelection:{type:"checkbox"},useDataSource:"{{ cm.useDataSourceFromRAC }}"},properties:{displayName:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{displayName:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},name:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{name:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},pinned:{type:"void",title:i("Pin to menu"),"x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{pinned:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},isTemplate:{type:"void",title:i("Is template"),"x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{isTemplate:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},status:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{status:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},actions:{type:"void",title:'{{t("Actions")}}',"x-component":"Table.Column",properties:{actions:f({type:"void","x-component":"Space","x-component-props":{split:"|"}},k)}}}}}}}},z=()=>{const e=t.useRecord(),r=t.useApp();return e.cname?`//${e.cname}`:r.getRouteUrl(`/apps/${e.name}/admin/`)},B=()=>{const{t:e}=g(),r=z(),a=t.useRecord(),m=t.useAPIClient(),{refresh:c}=t.useResourceActionContext(),u=y.useMemo(()=>m.resource("applications"),[m]),l=()=>{u.start({filterByTk:a.name}).then(()=>{c()}).catch(_=>{c()})},A=()=>{u.stop({filterByTk:a.name}).then(()=>{c()}).catch(_=>{c()})};return o.jsxs(d.Space,{split:o.jsx(d.Divider,{type:"horizontal"}),children:[o.jsx("a",{href:r,target:"_blank",rel:"noreferrer",children:e("View",{ns:p})}),o.jsx("a",{onClick:()=>l(),children:e("Start",{ns:p})}),o.jsx("a",{onClick:()=>A(),children:e("Stop",{ns:p})})]})},T=e=>{var c,u;const{admin:r=!0}=e,a=t.useCurrentUserContext(),m=(u=(c=a==null?void 0:a.data)==null?void 0:c.data)==null?void 0:u.id;return o.jsx(d.Card,{bordered:!1,children:o.jsx(t.SchemaComponent,{schema:q,scope:{admin:r,userId:m},components:{AppVisitor:B}})})},w=()=>{const{insert:e}=t.useSchemaInitializer();g();const r=t.useSchemaInitializerItem();return o.jsx(t.SchemaInitializerItem,v(f({},r),{onClick:()=>{e({type:"void","x-decorator-props":{},"x-component":"CardItem","x-toolbar":"BlockSchemaToolbar","x-settings":"blockSettings:table",properties:{app:{type:"void","x-component":"AppManager","x-component-props":{admin:!1}}}})}}))},O=e=>{const r=t.useApp(),a=e.value&&o.jsx("a",{target:"_blank",href:r.getRouteUrl(`/apps/${e.value}/admin`),rel:"noreferrer",children:e.value});return o.jsxs("div",{style:e.style,children:[e.addonBefore,e.prefix,a,e.suffix,e.addonAfter]})},N=x.connect(d.Input,x.mapReadPretty(O)),R=t.createStyles(({token:e})=>({button:{color:e.colorTextHeaderMenu+" !important"}})),E=()=>{const{styles:e}=R(),{data:r,run:a}=t.useRequest({resource:"applications",action:"listPinned"},{manual:!0}),{t:m}=g(),c=t.useApp(),u=[...((r==null?void 0:r.data)||[]).map(l=>{let A=c.getRouteUrl(`/apps/${l.name}/admin/`);return l.cname&&(A=`//${l.cname}`),{key:l.name,label:o.jsx("a",{href:A,target:"_blank",rel:"noopener noreferrer",children:l.displayName||l.name})}}),{key:".manager",label:o.jsx(s.Link,{to:c.systemSettingsManager.getRoutePath("system-services."+p),children:m("Manage applications")})}];return o.jsx(d.Dropdown,{onOpenChange:l=>{a()},menu:{items:u},children:o.jsx(d.Button,{className:e.button,title:"Apps",icon:o.jsx(t.Icon,{type:"AppstoreOutlined"})})})},V=e=>o.jsx(t.PinnedPluginListProvider,{items:{am:{order:201,component:"MultiAppManager",pin:!0,snippet:"pm.*"}},children:o.jsx(t.SchemaComponentOptions,{components:{MultiAppManager:E,AppNameInput:N,MultiAppBlockInitializer:w},children:e.children})});class F extends t.Plugin{load(){return S(this,null,function*(){this.app.addComponents({AppManager:T}),this.app.use(V),this.app.systemSettingsManager.add(`system-services.${p}`,{title:i("Multi-app manager"),icon:"AppstoreOutlined",Component:T,aclSnippet:"pm.multi-app-manager.applications"}),this.app.schemaInitializerManager.get("page:addBlock").add("otherBlocks.multiApp",{name:"multiApp",title:i("Multi-app manager"),icon:o.jsx(b.AppstoreOutlined,{}),Component:w})})}}n.MultiAppManagerPlugin=F,n.default=F,n.formSchema=C,n.tableActionColumnSchema=k,Object.defineProperties(n,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(n,o){typeof exports=="object"&&typeof module!="undefined"?o(exports,require("react/jsx-runtime"),require("@tachybase/client"),require("@ant-design/icons"),require("react"),require("antd"),require("@tachybase/schema"),require("react-i18next"),require("react-router-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@tachybase/client","@ant-design/icons","react","antd","@tachybase/schema","react-i18next","react-router-dom"],o):(n=typeof globalThis!="undefined"?globalThis:n||self,o(n["@tachybase/module-multi-app"]={},n.jsxRuntime,n["@tachybase/client"],n["@ant-design/icons"],n.react,n.antd,n["@tachybase/schema"],n["react-i18next"],n["react-router-dom"]))})(this,function(n,o,e,C,f,x,d,h,m){"use strict";var U=Object.defineProperty,K=Object.defineProperties;var G=Object.getOwnPropertyDescriptors;var F=Object.getOwnPropertySymbols;var H=Object.prototype.hasOwnProperty,J=Object.prototype.propertyIsEnumerable;var M=(n,o,e)=>o in n?U(n,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[o]=e,v=(n,o)=>{for(var e in o||(o={}))H.call(o,e)&&M(n,e,o[e]);if(F)for(var e of F(o))J.call(o,e)&&M(n,e,o[e]);return n},b=(n,o)=>K(n,G(o));var g=(n,o,e)=>new Promise((C,f)=>{var x=m=>{try{h(e.next(m))}catch(c){f(c)}},d=m=>{try{h(e.throw(m))}catch(c){f(c)}},h=m=>m.done?C(m.value):Promise.resolve(m.value).then(x,d);h((e=e.apply(n,o)).next())});const c="multi-app",V=()=>{const t=d.useForm(),r=d.useField(),a=e.useActionContext(),l=e.useDataBlockRequest(),p=e.useDataBlockResource();return{onClick(){return g(this,null,function*(){try{yield t.submit(),r.data=r.data||{},r.data.loading=!0,yield p.create({values:t.values}),a.setVisible(!1),yield t.reset(),r.data.loading=!1,l.refresh()}catch(s){r.data&&(r.data.loading=!1)}})}}},B=t=>{const r=d.useField(),a=d.useForm(),l=e.useActionContext(),p=e.useDataBlockRequest(),u=e.useDataBlockResource(),s=e.useCollectionRecordData(),y=s==null?void 0:s.name;return{onClick(){return g(this,null,function*(){var P;yield a.submit(),r.data=r.data||{},r.data.loading=!0;try{const A=yield u.update({filterByTk:y,values:a.values});l.setVisible(!1),yield a.reset(),p.refresh(),t==null||t(y,(P=A==null?void 0:A.data)==null?void 0:P.data)}catch(A){console.error(A)}finally{r.data.loading=!1}})}}},S=()=>{const{t}=h.useTranslation([c,"core"]);return{t}},i=t=>`{{t("${t}", { ns: ["${c}", "client"] })}}`,q={name:"applications",targetKey:"name",fields:[{type:"uid",name:"name",primaryKey:!0,prefix:"a",interface:"input",uiSchema:{type:"string",title:i("App ID"),required:!0,"x-component":"Input","x-validator":"uid"}},{type:"string",name:"displayName",interface:"input",uiSchema:{type:"string",title:i("App display name"),required:!0,"x-component":"Input"}},{type:"string",name:"pinned",interface:"checkbox",uiSchema:{type:"boolean","x-content":i("Pin to menu"),"x-component":"Checkbox"}},{type:"string",name:"status",interface:"radioGroup",defaultValue:"pending",uiSchema:{type:"string",title:i("App status"),enum:[{label:"Initializing",value:"initializing"},{label:"Initialized",value:"initialized"},{label:"Running",value:"running"},{label:"Commanding",value:"commanding"},{label:"Stopped",value:"stopped"},{label:"Error",value:"error"},{label:"Not found",value:"not_found"}],"x-component":"Radio.Group"}},{type:"string",name:"isTemplate",interface:"checkbox",uiSchema:{type:"boolean","x-content":i("Is template"),"x-component":"Checkbox"}}]},I={type:"void","x-component":"div",properties:{displayName:{"x-component":"CollectionField","x-decorator":"FormItem"},name:{"x-component":"CollectionField","x-decorator":"FormItem","x-disabled":"{{ !createOnly }}","x-hidden":"{{ !admin }}"},"options.autoStart":{title:i("Start mode"),"x-component":"Radio.Group","x-decorator":"FormItem",default:!1,enum:[{label:i("Start on first visit"),value:!1},{label:i("Start with main application"),value:!0}],"x-hidden":"{{ !admin }}"},cnamePrefix:{title:i("Custom domain prefix"),"x-component":"Input","x-decorator":"FormItem","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:i("Template"),"x-component":"RemoteSelect","x-component-props":{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:i("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 }}"}}},k={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:I,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-decorator":"ACLActionProvider","x-use-component-props":"useDestroyActionProps","x-component-props":{confirm:{title:"{{t('Delete')}}",content:"{{t('Are you sure you want to delete it?')}}"}}}}},z={type:"void",properties:{provider:{type:"void","x-decorator":"TableBlockProvider","x-decorator-props":{collection:q,action:"list",params:{pageSize:50,sort:["-createdAt"],appends:[],filter:{createdById:"{{ admin ? undefined : userId }}"}},rowKey:"name"},properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:16}},properties:{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":"useDestroyActionProps","x-component-props":{icon:"DeleteOutlined",confirm:{title:"{{t('Delete')}}",content:"{{t('Are you sure you want to delete it?')}}"}},"x-hidden":"{{ !admin }}"},create:{type:"void",title:'{{t("Add new")}}',"x-decorator":t=>f.createElement(e.SchemaComponentOptions,b(v({},t),{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(t){const r=e.useActionContext();return e.useRequest(()=>Promise.resolve({data:{name:`a_${d.uid()}`}}),b(v({},t),{refreshDeps:[r.visible]}))}},title:'{{t("Add new")}}',properties:{formSchema:I,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:i("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:i("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:v({type:"void","x-component":"Space","x-component-props":{split:"|"}},k)}}}}}}}},O=()=>{const t=e.useCollectionRecordData(),r=e.useApp();return t.cname?`//${t.cname}`:r.getRouteUrl(`/apps/${t.name}/admin/`)},N=()=>{const{t}=S(),r=O(),a=e.useCollectionRecordData(),l=e.useAPIClient(),{refresh:p}=e.useDataBlockRequest(),u=f.useMemo(()=>l.resource("applications"),[l]),s=()=>{u.start({filterByTk:a.name}).then(()=>{p()}).catch(j=>{p()})},y=()=>{u.stop({filterByTk:a.name}).then(()=>{p()}).catch(j=>{p()})};return o.jsxs(x.Space,{split:o.jsx(x.Divider,{type:"horizontal"}),children:[o.jsx("a",{href:r,target:"_blank",rel:"noreferrer",children:t("View",{ns:c})}),o.jsx("a",{onClick:()=>s(),children:t("Start",{ns:c})}),o.jsx("a",{onClick:()=>y(),children:t("Stop",{ns:c})})]})},T=t=>{var p,u;const{admin:r=!0}=t,a=e.useCurrentUserContext(),l=(u=(p=a==null?void 0:a.data)==null?void 0:p.data)==null?void 0:u.id;return o.jsx(x.Card,{bordered:!1,children:o.jsx(e.SchemaComponent,{schema:z,scope:{admin:r,userId:l,useCreateDatabaseConnectionAction:V,useMultiAppUpdateAction:B},components:{AppVisitor:N}})})},w=()=>{const{insert:t}=e.useSchemaInitializer();S();const r=e.useSchemaInitializerItem();return o.jsx(e.SchemaInitializerItem,b(v({},r),{onClick:()=>{t({type:"void","x-decorator-props":{},"x-component":"CardItem","x-toolbar":"BlockSchemaToolbar","x-settings":"blockSettings:table",properties:{app:{type:"void","x-component":"AppManager","x-component-props":{admin:!1}}}})}}))},$=t=>{const r=e.useApp(),a=t.value&&o.jsx("a",{target:"_blank",href:r.getRouteUrl(`/apps/${t.value}/admin`),rel:"noreferrer",children:t.value});return o.jsxs("div",{style:t.style,children:[t.addonBefore,t.prefix,a,t.suffix,t.addonAfter]})},E=d.connect(x.Input,d.mapReadPretty($)),R=e.createStyles(({token:t})=>({button:{color:t.colorTextHeaderMenu+" !important"}})),L=()=>{const{styles:t}=R(),{data:r,run:a}=e.useRequest({resource:"applications",action:"listPinned"},{manual:!0}),{t:l}=S(),p=e.useApp(),u=[...((r==null?void 0:r.data)||[]).map(s=>{let y=p.getRouteUrl(`/apps/${s.name}/admin/`);return s.cname&&(y=`//${s.cname}`),{key:s.name,label:o.jsx("a",{href:y,target:"_blank",rel:"noopener noreferrer",children:s.displayName||s.name})}}),{key:".manager",label:o.jsx(m.Link,{to:p.systemSettingsManager.getRoutePath("system-services."+c),children:l("Manage applications")})}];return o.jsx(x.Dropdown,{onOpenChange:s=>{a()},menu:{items:u},children:o.jsx(x.Button,{className:t.button,title:"Apps",icon:o.jsx(e.Icon,{type:"AppstoreOutlined"})})})},_=t=>o.jsx(e.PinnedPluginListProvider,{items:{am:{order:201,component:"MultiAppManager",pin:!0,snippet:"pm.*",belongTo:"pinnedmenu"}},children:o.jsx(e.SchemaComponentOptions,{components:{MultiAppManager:L,AppNameInput:E,MultiAppBlockInitializer:w},children:t.children})});class D extends e.Plugin{load(){return g(this,null,function*(){this.app.addComponents({AppManager:T}),this.app.use(_),this.app.systemSettingsManager.add(`system-services.${c}`,{title:i("Multi-app manager"),icon:"AppstoreOutlined",Component:T,aclSnippet:"pm.multi-app-manager.applications"}),this.app.schemaInitializerManager.get("page:addBlock").add("otherBlocks.multiApp",{name:"multiApp",title:i("Multi-app manager"),icon:o.jsx(C.AppstoreOutlined,{}),Component:w})})}}n.MultiAppManagerPlugin=D,n.default=D,n.formSchema=I,n.tableActionColumnSchema=k,Object.defineProperties(n,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
import { ISchema } from '@tachybase/schema';
|
|
2
|
-
export declare const useDestroy: () => {
|
|
3
|
-
run(): Promise<void>;
|
|
4
|
-
};
|
|
5
|
-
export declare const useRefresh: () => {
|
|
6
|
-
run(): void;
|
|
7
|
-
};
|
|
8
|
-
export declare const useDestroyAll: () => {
|
|
9
|
-
run(): Promise<void>;
|
|
10
|
-
};
|
|
11
2
|
export declare const formSchema: ISchema;
|
|
12
3
|
export declare const tableActionColumnSchema: ISchema;
|
|
13
4
|
export declare const schema: ISchema;
|
package/dist/externalVersion.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
"react": "18.3.1",
|
|
3
|
-
"@tachybase/client": "0.23.
|
|
3
|
+
"@tachybase/client": "0.23.35",
|
|
4
4
|
"antd": "5.22.5",
|
|
5
|
-
"@tachybase/schema": "0.23.
|
|
5
|
+
"@tachybase/schema": "0.23.35",
|
|
6
6
|
"@ant-design/icons": "5.5.2",
|
|
7
7
|
"react-router-dom": "6.28.1",
|
|
8
8
|
"react-i18next": "15.2.0",
|
|
9
|
-
"@tachybase/server": "0.23.
|
|
10
|
-
"@tachybase/database": "0.23.
|
|
9
|
+
"@tachybase/server": "0.23.35",
|
|
10
|
+
"@tachybase/database": "0.23.35",
|
|
11
11
|
"lodash": "4.17.21",
|
|
12
12
|
"mysql2": "3.11.5",
|
|
13
13
|
"pg": "8.13.1",
|
|
14
|
-
"@tachybase/actions": "0.23.
|
|
15
|
-
"@tachybase/utils": "0.23.
|
|
14
|
+
"@tachybase/actions": "0.23.35",
|
|
15
|
+
"@tachybase/utils": "0.23.35"
|
|
16
16
|
};
|
|
@@ -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":"
|
|
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-01-16T06:23:27.348Z"}
|
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": "0.23.
|
|
4
|
+
"version": "0.23.35",
|
|
5
5
|
"description": "Dynamically create multiple apps without separate deployments.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"System management"
|
|
@@ -19,15 +19,15 @@
|
|
|
19
19
|
"react": "~18.3.1",
|
|
20
20
|
"react-i18next": "^15.2.0",
|
|
21
21
|
"react-router-dom": "6.28.1",
|
|
22
|
-
"@tachybase/schema": "0.23.
|
|
22
|
+
"@tachybase/schema": "0.23.35"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"@tachybase/actions": "0.23.
|
|
26
|
-
"@tachybase/
|
|
27
|
-
"@tachybase/
|
|
28
|
-
"@tachybase/
|
|
29
|
-
"@tachybase/
|
|
30
|
-
"@tachybase/
|
|
25
|
+
"@tachybase/actions": "0.23.35",
|
|
26
|
+
"@tachybase/server": "0.23.35",
|
|
27
|
+
"@tachybase/test": "0.23.35",
|
|
28
|
+
"@tachybase/utils": "0.23.35",
|
|
29
|
+
"@tachybase/client": "0.23.35",
|
|
30
|
+
"@tachybase/database": "0.23.35"
|
|
31
31
|
},
|
|
32
32
|
"description.zh-CN": "无需单独部署即可动态创建多个应用。",
|
|
33
33
|
"displayName.zh-CN": "多应用管理器",
|