@tachybase/module-multi-app 0.23.8
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/.turbo/turbo-build.log +14 -0
- package/README.md +34 -0
- package/README.zh-CN.md +34 -0
- package/client.d.ts +1 -0
- package/client.js +1 -0
- package/dist/client/AppManager.d.ts +2 -0
- package/dist/client/AppNameInput.d.ts +2 -0
- package/dist/client/MultiAppBlockInitializer.d.ts +2 -0
- package/dist/client/MultiAppManagerProvider.d.ts +2 -0
- package/dist/client/MultiAppManagerProvider.style.d.ts +5 -0
- package/dist/client/Settings.d.ts +2 -0
- package/dist/client/index.d.ts +6 -0
- package/dist/client/index.js +1 -0
- package/dist/client/settings/schemas/applications.d.ts +13 -0
- package/dist/client/utils.d.ts +4 -0
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +27 -0
- package/dist/externalVersion.js +16 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +39 -0
- package/dist/locale/en-US.json +27 -0
- package/dist/locale/es-ES.json +9 -0
- package/dist/locale/ko_KR.json +11 -0
- package/dist/locale/pt-BR.json +9 -0
- package/dist/locale/zh-CN.json +27 -0
- package/dist/node_modules/mariadb/LICENSE +502 -0
- package/dist/node_modules/mariadb/callback.js +41 -0
- package/dist/node_modules/mariadb/lib/cmd/batch-bulk.js +278 -0
- package/dist/node_modules/mariadb/lib/cmd/batch-rewrite.js +372 -0
- package/dist/node_modules/mariadb/lib/cmd/change-user.js +149 -0
- package/dist/node_modules/mariadb/lib/cmd/class/ok-packet.js +17 -0
- package/dist/node_modules/mariadb/lib/cmd/column-definition.js +102 -0
- package/dist/node_modules/mariadb/lib/cmd/command.js +168 -0
- package/dist/node_modules/mariadb/lib/cmd/common-binary-cmd.js +327 -0
- package/dist/node_modules/mariadb/lib/cmd/common-text-cmd.js +427 -0
- package/dist/node_modules/mariadb/lib/cmd/handshake/auth/caching-sha2-password-auth.js +168 -0
- package/dist/node_modules/mariadb/lib/cmd/handshake/auth/clear-password-auth.js +23 -0
- package/dist/node_modules/mariadb/lib/cmd/handshake/auth/ed25519-password-auth.js +761 -0
- package/dist/node_modules/mariadb/lib/cmd/handshake/auth/native-password-auth.js +55 -0
- package/dist/node_modules/mariadb/lib/cmd/handshake/auth/pam-password-auth.js +58 -0
- package/dist/node_modules/mariadb/lib/cmd/handshake/auth/plugin-auth.js +19 -0
- package/dist/node_modules/mariadb/lib/cmd/handshake/auth/sha256-password-auth.js +142 -0
- package/dist/node_modules/mariadb/lib/cmd/handshake/client-capabilities.js +74 -0
- package/dist/node_modules/mariadb/lib/cmd/handshake/client-handshake-response.js +126 -0
- package/dist/node_modules/mariadb/lib/cmd/handshake/handshake.js +292 -0
- package/dist/node_modules/mariadb/lib/cmd/handshake/initial-handshake.js +74 -0
- package/dist/node_modules/mariadb/lib/cmd/handshake/ssl-request.js +29 -0
- package/dist/node_modules/mariadb/lib/cmd/ping.js +52 -0
- package/dist/node_modules/mariadb/lib/cmd/query.js +255 -0
- package/dist/node_modules/mariadb/lib/cmd/quit.js +28 -0
- package/dist/node_modules/mariadb/lib/cmd/reset.js +54 -0
- package/dist/node_modules/mariadb/lib/cmd/resultset.js +607 -0
- package/dist/node_modules/mariadb/lib/cmd/stream.js +45 -0
- package/dist/node_modules/mariadb/lib/config/connection-options.js +258 -0
- package/dist/node_modules/mariadb/lib/config/pool-cluster-options.js +19 -0
- package/dist/node_modules/mariadb/lib/config/pool-options.js +47 -0
- package/dist/node_modules/mariadb/lib/connection-callback.js +160 -0
- package/dist/node_modules/mariadb/lib/connection.js +1460 -0
- package/dist/node_modules/mariadb/lib/const/capabilities.js +64 -0
- package/dist/node_modules/mariadb/lib/const/collations.js +473 -0
- package/dist/node_modules/mariadb/lib/const/connection_status.js +13 -0
- package/dist/node_modules/mariadb/lib/const/error-code.js +1282 -0
- package/dist/node_modules/mariadb/lib/const/field-detail.js +35 -0
- package/dist/node_modules/mariadb/lib/const/field-type.js +71 -0
- package/dist/node_modules/mariadb/lib/const/server-status.js +30 -0
- package/dist/node_modules/mariadb/lib/const/state-change.js +12 -0
- package/dist/node_modules/mariadb/lib/filtered-pool-cluster.js +81 -0
- package/dist/node_modules/mariadb/lib/io/bulk-packet.js +590 -0
- package/dist/node_modules/mariadb/lib/io/compression-input-stream.js +141 -0
- package/dist/node_modules/mariadb/lib/io/compression-output-stream.js +171 -0
- package/dist/node_modules/mariadb/lib/io/packet-input-stream.js +193 -0
- package/dist/node_modules/mariadb/lib/io/packet-node-encoded.js +36 -0
- package/dist/node_modules/mariadb/lib/io/packet-node-iconv.js +37 -0
- package/dist/node_modules/mariadb/lib/io/packet-output-stream.js +502 -0
- package/dist/node_modules/mariadb/lib/io/packet.js +515 -0
- package/dist/node_modules/mariadb/lib/io/rewrite-packet.js +481 -0
- package/dist/node_modules/mariadb/lib/misc/connection-information.js +96 -0
- package/dist/node_modules/mariadb/lib/misc/errors.js +123 -0
- package/dist/node_modules/mariadb/lib/misc/parse.js +1033 -0
- package/dist/node_modules/mariadb/lib/misc/utils.js +298 -0
- package/dist/node_modules/mariadb/lib/pool-base.js +611 -0
- package/dist/node_modules/mariadb/lib/pool-callback.js +202 -0
- package/dist/node_modules/mariadb/lib/pool-cluster-callback.js +66 -0
- package/dist/node_modules/mariadb/lib/pool-cluster.js +407 -0
- package/dist/node_modules/mariadb/lib/pool-promise.js +108 -0
- package/dist/node_modules/mariadb/package.json +1 -0
- package/dist/node_modules/mariadb/promise.js +34 -0
- package/dist/node_modules/mariadb/types/index.d.ts +870 -0
- package/dist/server/actions/apps.d.ts +5 -0
- package/dist/server/actions/apps.js +117 -0
- package/dist/server/app-lifecycle.d.ts +8 -0
- package/dist/server/app-lifecycle.js +99 -0
- package/dist/server/app-start-env.d.ts +2 -0
- package/dist/server/app-start-env.js +105 -0
- package/dist/server/collections/applications.d.ts +2 -0
- package/dist/server/collections/applications.js +82 -0
- package/dist/server/index.d.ts +4 -0
- package/dist/server/index.js +29 -0
- package/dist/server/middlewares/app-selector.d.ts +1 -0
- package/dist/server/middlewares/app-selector.js +47 -0
- package/dist/server/middlewares/index.d.ts +2 -0
- package/dist/server/middlewares/index.js +23 -0
- package/dist/server/middlewares/inject-app-list.d.ts +1 -0
- package/dist/server/middlewares/inject-app-list.js +48 -0
- package/dist/server/migrations/20240820153000-add-apps-tmpl.d.ts +6 -0
- package/dist/server/migrations/20240820153000-add-apps-tmpl.js +47 -0
- package/dist/server/migrations/20241126124904-add-createdBy.d.ts +6 -0
- package/dist/server/migrations/20241126124904-add-createdBy.js +41 -0
- package/dist/server/models/application.d.ts +10 -0
- package/dist/server/models/application.js +57 -0
- package/dist/server/server.d.ts +19 -0
- package/dist/server/server.js +246 -0
- package/dist/swagger/index.d.ts +197 -0
- package/dist/swagger/index.js +227 -0
- package/package.json +38 -0
- package/server.d.ts +2 -0
- package/server.js +1 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
> @tachybase/module-multi-app@0.23.2 build /Users/seal/Documents/projects/tachybase/packages/module-multi-app
|
|
4
|
+
> tachybase-build --no-dts @tachybase/module-multi-app
|
|
5
|
+
|
|
6
|
+
[33m[33mThe CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.[39m[39m
|
|
7
|
+
[4m[95m@tachybase/module-multi-app[39m[24m: [1mmodule-multi-app[22m build start
|
|
8
|
+
[4m[95m@tachybase/module-multi-app[39m[24m: build plugin client
|
|
9
|
+
[4m[95m@tachybase/module-multi-app[39m[24m: build plugin server source
|
|
10
|
+
[4m[95m@tachybase/module-multi-app[39m[24m: delete server files
|
|
11
|
+
[4m[95m@tachybase/module-multi-app[39m[24m: build plugin server dependencies
|
|
12
|
+
[4m[95m@tachybase/module-multi-app[39m[24m: These packages [33mmariadb[39m will be [3mbundled[23m to dist/node_modules. These packages [33m@tachybase/server, @tachybase/database, lodash, mysql2, pg, @tachybase/actions, @tachybase/utils[39m will be [3mexclude[23m.
|
|
13
|
+
[4m[95m@tachybase/module-multi-app[39m[24m: write external version
|
|
14
|
+
|
package/README.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# multi-app-manager
|
|
2
|
+
|
|
3
|
+
English | [中文](./README.zh-CN.md)
|
|
4
|
+
|
|
5
|
+
多应用管理插件。
|
|
6
|
+
|
|
7
|
+
## 安装激活
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
yarn pm enable multi-app-manager
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## 使用方法
|
|
14
|
+
|
|
15
|
+
注意目前仅支持部分在应用启动时传入的环境变量,具体列表如下:
|
|
16
|
+
|
|
17
|
+
```ini
|
|
18
|
+
APP_KEY=test-key
|
|
19
|
+
API_BASE_PATH=/api/
|
|
20
|
+
DB_DIALECT=sqlite
|
|
21
|
+
DB_STORAGE=storage/db/tachybase.sqlite
|
|
22
|
+
DB_TABLE_PREFIX=
|
|
23
|
+
DB_HOST=localhost
|
|
24
|
+
DB_PORT=5432
|
|
25
|
+
DB_DATABASE=postgres
|
|
26
|
+
DB_USER=tachybase
|
|
27
|
+
DB_PASSWORD=tachybase
|
|
28
|
+
DB_UNDERSCORED=false
|
|
29
|
+
DB_TIMEZONE=+08:00
|
|
30
|
+
DB_SCHEMA=
|
|
31
|
+
CACHE_DEFAULT_STORE=memory
|
|
32
|
+
CACHE_MEMORY_MAX=2000
|
|
33
|
+
```
|
|
34
|
+
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# multi-app-manager
|
|
2
|
+
|
|
3
|
+
[English](./README.md) | 中文
|
|
4
|
+
|
|
5
|
+
多应用管理插件。
|
|
6
|
+
|
|
7
|
+
## 安装激活
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
yarn pm enable multi-app-manager
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## 使用方法
|
|
14
|
+
|
|
15
|
+
注意目前仅支持部分在应用启动时传入的环境变量,具体列表如下:
|
|
16
|
+
|
|
17
|
+
```ini
|
|
18
|
+
APP_KEY=test-key
|
|
19
|
+
API_BASE_PATH=/api/
|
|
20
|
+
DB_DIALECT=sqlite
|
|
21
|
+
DB_STORAGE=storage/db/tachybase.sqlite
|
|
22
|
+
DB_TABLE_PREFIX=
|
|
23
|
+
DB_HOST=localhost
|
|
24
|
+
DB_PORT=5432
|
|
25
|
+
DB_DATABASE=postgres
|
|
26
|
+
DB_USER=tachybase
|
|
27
|
+
DB_PASSWORD=tachybase
|
|
28
|
+
DB_UNDERSCORED=false
|
|
29
|
+
DB_TIMEZONE=+08:00
|
|
30
|
+
DB_SCHEMA=
|
|
31
|
+
CACHE_DEFAULT_STORE=memory
|
|
32
|
+
CACHE_MEMORY_MAX=2000
|
|
33
|
+
```
|
|
34
|
+
|
package/client.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dist/client/index';
|
package/client.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./dist/client/index.js');
|
|
@@ -0,0 +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"}})});
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
export declare const formSchema: ISchema;
|
|
12
|
+
export declare const tableActionColumnSchema: ISchema;
|
|
13
|
+
export declare const schema: ISchema;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const NAMESPACE = "multi-app";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var constants_exports = {};
|
|
19
|
+
__export(constants_exports, {
|
|
20
|
+
NAMESPACE: () => NAMESPACE
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(constants_exports);
|
|
23
|
+
const NAMESPACE = "multi-app";
|
|
24
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
25
|
+
0 && (module.exports = {
|
|
26
|
+
NAMESPACE
|
|
27
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
"react": "18.3.1",
|
|
3
|
+
"@tachybase/client": "0.23.8",
|
|
4
|
+
"antd": "5.22.5",
|
|
5
|
+
"@tachybase/schema": "0.23.8",
|
|
6
|
+
"@ant-design/icons": "5.5.2",
|
|
7
|
+
"react-router-dom": "6.28.1",
|
|
8
|
+
"react-i18next": "15.2.0",
|
|
9
|
+
"@tachybase/server": "0.23.8",
|
|
10
|
+
"@tachybase/database": "0.23.8",
|
|
11
|
+
"lodash": "4.17.21",
|
|
12
|
+
"mysql2": "3.11.5",
|
|
13
|
+
"pg": "8.13.1",
|
|
14
|
+
"@tachybase/actions": "0.23.8",
|
|
15
|
+
"@tachybase/utils": "0.23.8"
|
|
16
|
+
};
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var src_exports = {};
|
|
30
|
+
__export(src_exports, {
|
|
31
|
+
default: () => import_server.default
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(src_exports);
|
|
34
|
+
__reExport(src_exports, require("./server"), module.exports);
|
|
35
|
+
var import_server = __toESM(require("./server"));
|
|
36
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
37
|
+
0 && (module.exports = {
|
|
38
|
+
...require("./server")
|
|
39
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"App ID": "App ID",
|
|
3
|
+
"App display name": "App display name",
|
|
4
|
+
"App status": "App status",
|
|
5
|
+
"Applications": "Applications",
|
|
6
|
+
"Auto start": "Auto start",
|
|
7
|
+
"Custom domain": "Custom domain",
|
|
8
|
+
"Custom domain prefix": "Custom domain prefix",
|
|
9
|
+
"Is template": "Is template",
|
|
10
|
+
"Manage applications": "Manage applications",
|
|
11
|
+
"Multi-app manager": "Multi-app manager",
|
|
12
|
+
"Pin to menu": "Pin to menu",
|
|
13
|
+
"Preset": "Preset",
|
|
14
|
+
"Refresh": "Refresh",
|
|
15
|
+
"Standalone deployment": "Standalone deployment",
|
|
16
|
+
"Start": "Start",
|
|
17
|
+
"Start environment variables": "Start environment variables",
|
|
18
|
+
"Start mode": "Start mode",
|
|
19
|
+
"Start on first visit": "Start on first visit",
|
|
20
|
+
"Start with main application": "Start with main application",
|
|
21
|
+
"Stop": "Stop",
|
|
22
|
+
"Template": "Template",
|
|
23
|
+
"Template is in use": "Template is in use",
|
|
24
|
+
"Template not exists": "模板不存在",
|
|
25
|
+
"This database does not support to create application using template": "This database does not support to create application using template",
|
|
26
|
+
"View": "View"
|
|
27
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"App ID": "ID de aplicación",
|
|
3
|
+
"App display name": "Mostrar nombre de aplicación",
|
|
4
|
+
"Applications": "Aplicaciones",
|
|
5
|
+
"Custom domain": "Dominio personalizado",
|
|
6
|
+
"Manage applications": "Gestionar aplicaciones",
|
|
7
|
+
"Multi-app manager": "Gestor de aplicaciones múltiples",
|
|
8
|
+
"Pin to menu": " Fijar al menú"
|
|
9
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"App ID": "앱 식별자",
|
|
3
|
+
"App display name": "앱 표시 이름",
|
|
4
|
+
"Applications": "앱",
|
|
5
|
+
"Auto start": "자동 시작",
|
|
6
|
+
"Custom domain": "사용자 정의 도메인",
|
|
7
|
+
"Manage applications": "앱 관리",
|
|
8
|
+
"Multi-app manager": "다중 앱 관리",
|
|
9
|
+
"Pin to menu": "메뉴에 고정",
|
|
10
|
+
"Standalone deployment": "독립형 배포"
|
|
11
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"App ID": "ID do aplicativo",
|
|
3
|
+
"App display name": "Nome de exibição do aplicativo",
|
|
4
|
+
"Applications": "Aplicativos",
|
|
5
|
+
"Custom domain": "Domínio personalizado",
|
|
6
|
+
"Manage applications": "Gerenciar aplicativos",
|
|
7
|
+
"Multi-app manager": "Gerenciador de aplicativos múltiplos",
|
|
8
|
+
"Pin to menu": "Fixar no menu"
|
|
9
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"App ID": "应用标识",
|
|
3
|
+
"App display name": "应用名称",
|
|
4
|
+
"App status": "应用状态",
|
|
5
|
+
"Applications": "应用",
|
|
6
|
+
"Auto start": "自动启动",
|
|
7
|
+
"Custom domain": "自定义域名",
|
|
8
|
+
"Custom domain prefix": "自定义域名前缀",
|
|
9
|
+
"Is template": "是否模板",
|
|
10
|
+
"Manage applications": "管理应用",
|
|
11
|
+
"Multi-app manager": "多应用管理",
|
|
12
|
+
"Pin to menu": "在菜单上显示",
|
|
13
|
+
"Preset": "预设",
|
|
14
|
+
"Refresh": "刷新",
|
|
15
|
+
"Standalone deployment": "独立部署",
|
|
16
|
+
"Start": "启动",
|
|
17
|
+
"Start environment variables": "启动环境变量",
|
|
18
|
+
"Start mode": "启动方式",
|
|
19
|
+
"Start on first visit": "首次访问时启动",
|
|
20
|
+
"Start with main application": "随主应用一同启动",
|
|
21
|
+
"Stop": "停止",
|
|
22
|
+
"Template": "模板",
|
|
23
|
+
"Template is in use": "模板正在使用",
|
|
24
|
+
"Template not exists": "模板不存在",
|
|
25
|
+
"This database does not support to create application using template": "该数据库不支持使用模板创建应用程序",
|
|
26
|
+
"View": "查看"
|
|
27
|
+
}
|