@tachybase/module-backup 0.23.18 → 0.23.22
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/Configuration.d.ts +1 -2
- package/dist/client/DuplicatorProvider.d.ts +1 -2
- package/dist/client/index.js +1 -1
- package/dist/externalVersion.js +6 -6
- package/dist/locale/zh-CN.json +3 -0
- package/dist/node_modules/@hapi/topo/package.json +1 -1
- package/dist/node_modules/archiver/package.json +1 -1
- package/dist/node_modules/decompress/package.json +1 -1
- package/dist/node_modules/mkdirp/package.json +1 -1
- package/dist/node_modules/semver/package.json +1 -1
- package/dist/server/dumper.js +1 -1
- package/dist/server/resourcers/backup-files.d.ts +1 -1
- package/dist/server/resourcers/backup-files.js +20 -10
- package/package.json +9 -9
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const BackupAndRestoreList: () => React.JSX.Element;
|
|
1
|
+
export declare const BackupAndRestoreList: () => import("react/jsx-runtime").JSX.Element;
|
package/dist/client/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(d,l){typeof exports=="object"&&typeof module!="undefined"?l(exports,require("@tachybase/client"),require("react/jsx-runtime"),require("react"),require("@tachybase/components"),require("@ant-design/icons"),require("antd"),require("react-i18next")):typeof define=="function"&&define.amd?define(["exports","@tachybase/client","react/jsx-runtime","react","@tachybase/components","@ant-design/icons","antd","react-i18next"],l):(d=typeof globalThis!="undefined"?globalThis:d||self,l(d["@tachybase/module-backup"]={},d["@tachybase/client"],d.jsxRuntime,d.react,d["@tachybase/components"],d["@ant-design/icons"],d.antd,d["react-i18next"]))})(this,function(d,l,e,y,L,T,f,P){"use strict";var Z=Object.defineProperty,R=Object.defineProperties;var ee=Object.getOwnPropertyDescriptors;var z=Object.getOwnPropertySymbols;var te=Object.prototype.hasOwnProperty,oe=Object.prototype.propertyIsEnumerable;var W=(d,l,e)=>l in d?Z(d,l,{enumerable:!0,configurable:!0,writable:!0,value:e}):d[l]=e,q=(d,l)=>{for(var e in l||(l={}))te.call(l,e)&&W(d,e,l[e]);if(z)for(var e of z(l))oe.call(l,e)&&W(d,e,l[e]);return d},D=(d,l)=>R(d,ee(l));var O=(d,l,e)=>new Promise((y,L)=>{var T=S=>{try{P(e.next(S))}catch(M){L(M)}},f=S=>{try{P(e.throw(S))}catch(M){L(M)}},P=S=>S.done?y(S.value):Promise.resolve(S.value).then(T,f);P((e=e.apply(d,l)).next())});var S=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},M={exports:{}};(function(a,k){(function(u,r){r()})(S,function(){function u(t,o){return typeof o=="undefined"?o={autoBom:!1}:typeof o!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),o={autoBom:!o}),o.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob(["\uFEFF",t],{type:t.type}):t}function r(t,o,b){var n=new XMLHttpRequest;n.open("GET",t),n.responseType="blob",n.onload=function(){m(n.response,o,b)},n.onerror=function(){console.error("could not download file")},n.send()}function c(t){var o=new XMLHttpRequest;o.open("HEAD",t,!1);try{o.send()}catch(b){}return 200<=o.status&&299>=o.status}function h(t){try{t.dispatchEvent(new MouseEvent("click"))}catch(b){var o=document.createEvent("MouseEvents");o.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(o)}}var p=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof S=="object"&&S.global===S?S:void 0,w=p.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),m=p.saveAs||(typeof window!="object"||window!==p?function(){}:"download"in HTMLAnchorElement.prototype&&!w?function(t,o,b){var n=p.URL||p.webkitURL,i=document.createElement("a");o=o||t.name||"download",i.download=o,i.rel="noopener",typeof t=="string"?(i.href=t,i.origin===location.origin?h(i):c(i.href)?r(t,o,b):h(i,i.target="_blank")):(i.href=n.createObjectURL(t),setTimeout(function(){n.revokeObjectURL(i.href)},4e4),setTimeout(function(){h(i)},0))}:"msSaveOrOpenBlob"in navigator?function(t,o,b){if(o=o||t.name||"download",typeof t!="string")navigator.msSaveOrOpenBlob(u(t,b),o);else if(c(t))r(t,o,b);else{var n=document.createElement("a");n.href=t,n.target="_blank",setTimeout(function(){h(n)})}}:function(t,o,b,n){if(n=n||open("","_blank"),n&&(n.document.title=n.document.body.innerText="downloading..."),typeof t=="string")return r(t,o,b);var i=t.type==="application/octet-stream",v=/constructor/i.test(p.HTMLElement)||p.safari,s=/CriOS\/[\d]+/.test(navigator.userAgent);if((s||i&&v||w)&&typeof FileReader!="undefined"){var g=new FileReader;g.onloadend=function(){var x=g.result;x=s?x:x.replace(/^data:[^;]*;/,"data:attachment/file;"),n?n.location.href=x:location=x,n=null},g.readAsDataURL(t)}else{var C=p.URL||p.webkitURL,A=C.createObjectURL(t);n?n.location=A:location.href=A,n=null,setTimeout(function(){C.revokeObjectURL(A)},4e4)}});p.saveAs=m.saveAs=m,a.exports=m})})(M);var K=M.exports;const I="backup";function E(){return P.useTranslation(I,{nsMode:"fallback"})}const{Dragger:X}=f.Upload;function J(a){const k=r=>{var c;(c=a.onChange)==null||c.call(a,r)},u=l.useAPIClient();return D(q({},a),{customRequest({action:r,data:c,file:h,filename:p,headers:w,onError:m,onProgress:t,onSuccess:o,withCredentials:b}){const n=new FormData;return c&&Object.keys(c).forEach(i=>{n.append(i,c[i])}),n.append(p,h),u.axios.post(r,n,{withCredentials:b,headers:w,onUploadProgress:({total:i,loaded:v})=>{t({percent:Math.round(v/i*100).toFixed(2)},h)}}).then(({data:i})=>{o(i,h)}).catch(m).finally(()=>{}),{abort(){console.log("upload progress is aborted.")}}},onChange:k})}const U=a=>{const{collectionsData:k}=a,{t:u}=E(),[r,c]=y.useState(!1),[h,p]=y.useState(k);y.useEffect(()=>{p(k)},[k]);const w=l.useAPIClient(),m=l.useCompile(),t=y.useMemo(()=>w.resource("backupFiles"),[w]),o=()=>O(this,null,function*(){if(a.isBackup){const s=yield t.dumpableCollections();p(s==null?void 0:s.data),c(!0)}c(!0)}),b=()=>{c(!1)},n=()=>{c(!1)},i=[{title:u("Collection"),dataIndex:"collection",key:"collection",render:(s,g)=>{const C=m(g.title);return g.name===C?C:e.jsxs("div",{children:[g.name," ",e.jsxs("span",{style:{color:"rgba(0, 0, 0, 0.3)",fontSize:"0.9em"},children:["(",m(g.title),")"]})]})}},{title:u("Origin"),dataIndex:"origin",key:"origin",width:"50%"}],v=Object.keys(h||{}).map(s=>({key:s,label:u(`${s}.title`),children:e.jsxs(e.Fragment,{children:[e.jsx(f.Alert,{style:{marginBottom:16},message:u(`${s}.description`)}),e.jsx(f.Table,{pagination:{pageSize:100},bordered:!0,size:"small",dataSource:h[s],columns:i,scroll:{y:400}})]})}));return e.jsxs(e.Fragment,{children:[e.jsx("a",{onClick:o,children:u("Learn more")}),e.jsx(f.Modal,{title:u("Backup instructions"),width:"80vw",open:r,footer:null,onOk:b,onCancel:n,children:e.jsx(f.Tabs,{defaultActiveKey:"required",items:v})})]})},G=({ButtonComponent:a=f.Button,title:k,upload:u=!1,fileData:r})=>{const{t:c}=E(),[h,p]=y.useState(["required"]),[w,m]=y.useState(!1),[t,o]=y.useState(null),[b,n]=y.useState(!1),i=l.useAPIClient(),v=y.useMemo(()=>i.resource("backupFiles"),[i]),[s,g]=y.useState([]);y.useEffect(()=>{g(Object.keys((t==null?void 0:t.dumpableCollectionsGroupByGroup)||[]).map(B=>({value:B,label:c(`${B}.title`),disabled:["required","skipped"].includes(B)})))},[t]);const C=()=>O(this,null,function*(){var B,H,$;if(m(!0),!u){n(!0);const{data:F}=yield v.get({filterByTk:r.name});g(Object.keys(((H=(B=F==null?void 0:F.data)==null?void 0:B.meta)==null?void 0:H.dumpableCollectionsGroupByGroup)||[]).map(j=>({value:j,label:c(`${j}.title`),disabled:["required","skipped"].includes(j)}))),o(($=F==null?void 0:F.data)==null?void 0:$.meta),n(!1)}}),A=()=>{v.restore({values:{dataTypes:h,filterByTk:r==null?void 0:r.name,key:t==null?void 0:t.key}}),m(!1)},x=()=>{m(!1),o(null),p(["required"])};return e.jsxs(e.Fragment,{children:[e.jsx(a,{onClick:C,children:k}),e.jsx(f.Modal,{title:c("Restore"),width:800,footer:u&&!t?null:void 0,open:w,onOk:A,onCancel:x,children:e.jsxs(f.Spin,{spinning:b,children:[u&&!t&&e.jsx(V,{setRestoreData:o}),(!u||t)&&[e.jsxs("strong",{style:{fontWeight:600,display:"block",margin:"16px 0 8px"},children:[c("Select the data to be restored")," (",e.jsx(U,{collectionsData:t==null?void 0:t.dumpableCollectionsGroupByGroup}),"):"]},"info"),e.jsx("div",{style:{lineHeight:2,marginBottom:8},children:e.jsx(L.FormItem,{children:e.jsx(l.Checkbox.Group,{options:s,style:{flexDirection:"column"},value:h,onChange:B=>p(B)})})},"dataType")]]})})]})},Q=({ButtonComponent:a=f.Button,refresh:k})=>{const{t:u}=E(),[r,c]=y.useState(!1),[h,p]=y.useState(["required"]),w=l.useAPIClient(),{notification:m}=f.App.useApp(),[t,o]=y.useState([]),b=()=>O(this,null,function*(){const{data:v}=yield w.resource("backupFiles").dumpableCollections();o(Object.keys(v||[]).map(s=>({value:s,label:u(`${s}.title`),disabled:["required","skipped"].includes(s)}))),c(!0)}),n=()=>{w.request({url:"backupFiles:create",method:"post",data:{dataTypes:h}}),m.info({key:"backup",message:e.jsxs("span",{children:[u("Processing...")," ",e.jsx(f.Spin,{indicator:e.jsx(T.LoadingOutlined,{style:{fontSize:24},spin:!0})})]}),duration:0}),c(!1),p(["required"]),setTimeout(()=>{k()},500)},i=()=>{c(!1),p(["required"])};return e.jsxs(e.Fragment,{children:[e.jsx(a,{icon:e.jsx(T.PlusOutlined,{}),type:"primary",onClick:b,children:u("New backup")}),e.jsxs(f.Modal,{title:u("New backup"),width:800,open:r,onOk:n,onCancel:i,children:[e.jsxs("strong",{style:{fontWeight:600,display:"block",margin:"16px 0 8px"},children:[u("Select the data to be backed up")," (",e.jsx(U,{isBackup:!0}),"):"]}),e.jsx("div",{style:{lineHeight:2,marginBottom:8},children:e.jsx(l.Checkbox.Group,{options:t,style:{flexDirection:"column"},onChange:v=>p(v),value:h})})]})]})},V=a=>{const{t:k}=E(),u={multiple:!1,action:"/backupFiles:upload",onChange(r){var h,p,w;r.fileList.length>1&&r.fileList.splice(0,r.fileList.length-1);const{status:c}=r.file;c==="done"?(f.message.success(`${r.file.name} `+k("file uploaded successfully")),a.setRestoreData(D(q({},(p=(h=r.file.response)==null?void 0:h.data)==null?void 0:p.meta),{key:(w=r.file.response)==null?void 0:w.data.key}))):c==="error"&&f.message.error(`${r.file.name} `+k("file upload failed"))},onDrop(r){console.log("Dropped files",r.dataTransfer.files)}};return e.jsxs(X,D(q({},J(u)),{children:[e.jsx("p",{className:"ant-upload-drag-icon",children:e.jsx(T.InboxOutlined,{})}),e.jsxs("p",{className:"ant-upload-text",children:[" ",k("Click or drag file to this area to upload")]})]}))},Y=()=>{const{t:a}=E(),k=l.useAPIClient(),[u,r]=y.useState([]),[c,h]=y.useState(!1),[p,w]=y.useState(!1),{modal:m,notification:t}=f.App.useApp(),o=y.useMemo(()=>k.resource("backupFiles"),[k]),b=y.useCallback(()=>O(this,null,function*(){yield n()}),[]);l.useNoticeSub("backup",()=>{t.info({key:"backup",message:a("Done")}),b()}),y.useEffect(()=>{n()},[]);const n=()=>O(this,null,function*(){h(!0);const{data:s}=yield o.list();r(s.data),h(!1)}),i=s=>O(this,null,function*(){w(s.name);const g=yield k.request({url:"backupFiles:download",method:"get",params:{filterByTk:s.name},responseType:"blob"});w(!1);const C=new Blob([g.data]);K.saveAs(C,s.name)}),v=s=>{m.confirm({title:a("Delete record",{ns:"core"}),content:a("Are you sure you want to delete it?",{ns:"core"}),onOk:()=>O(this,null,function*(){yield o.destroy({filterByTk:s.name}),yield n(),f.message.success(a("Deleted successfully"))})})};return e.jsx("div",{children:e.jsxs(f.Card,{bordered:!1,children:[e.jsxs(f.Space,{style:{float:"right",marginBottom:16},children:[e.jsx(f.Button,{onClick:b,icon:e.jsx(T.ReloadOutlined,{}),children:a("Refresh")}),e.jsx(G,{upload:!0,title:e.jsxs(e.Fragment,{children:[e.jsx(T.UploadOutlined,{})," ",a("Restore backup from local")]})}),e.jsx(Q,{refresh:b})]}),e.jsx(f.Table,{dataSource:u,loading:c,columns:[{title:a("Backup file"),dataIndex:"name",width:400,onCell:s=>s.inProgress?{colSpan:4}:{},render:(s,g)=>g.inProgress?e.jsxs("div",{style:{color:"rgba(0, 0, 0, 0.88)"},children:[s,"(",a("Backing up"),"...)"]}):e.jsx("div",{children:s})},{title:a("File size"),dataIndex:"fileSize",onCell:s=>s.inProgress?{colSpan:0}:{}},{title:a("Created at",{ns:"core"}),dataIndex:"createdAt",onCell:s=>s.inProgress?{colSpan:0}:{},render:s=>e.jsx(l.DatePicker.ReadPretty,{value:s,showTime:!0})},{title:a("Actions",{ns:"core"}),dataIndex:"actions",onCell:s=>s.inProgress?{colSpan:0}:{},render:(s,g)=>e.jsxs(f.Space,{split:e.jsx(f.Divider,{type:"vertical"}),children:[e.jsx(G,{ButtonComponent:"a",title:a("Restore"),fileData:g}),e.jsx("a",{type:"link",onClick:()=>i(g),children:a("Download")}),e.jsx("a",{onClick:()=>v(g),children:a("Delete")})]})}]})]})})},_=function(a){return e.jsx(l.SchemaComponentOptions,{children:a.children})};_.displayName="DuplicatorProvider";class N extends l.Plugin{load(){return O(this,null,function*(){this.app.use(_),this.app.systemSettingsManager.add("system-services."+I,{title:this.t("Backup & Restore"),icon:"CloudServerOutlined",Component:Y,aclSnippet:"pm.backup.restore"})})}}d.PluginBackupRestoreClient=N,d.default=N,Object.defineProperties(d,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(p,l){typeof exports=="object"&&typeof module!="undefined"?l(exports,require("@tachybase/client"),require("react/jsx-runtime"),require("react"),require("@tachybase/components"),require("@ant-design/icons"),require("antd"),require("react-i18next")):typeof define=="function"&&define.amd?define(["exports","@tachybase/client","react/jsx-runtime","react","@tachybase/components","@ant-design/icons","antd","react-i18next"],l):(p=typeof globalThis!="undefined"?globalThis:p||self,l(p["@tachybase/module-backup"]={},p["@tachybase/client"],p.jsxRuntime,p.react,p["@tachybase/components"],p["@ant-design/icons"],p.antd,p["react-i18next"]))})(this,function(p,l,e,y,L,T,u,P){"use strict";var Z=Object.defineProperty,R=Object.defineProperties;var ee=Object.getOwnPropertyDescriptors;var z=Object.getOwnPropertySymbols;var te=Object.prototype.hasOwnProperty,oe=Object.prototype.propertyIsEnumerable;var W=(p,l,e)=>l in p?Z(p,l,{enumerable:!0,configurable:!0,writable:!0,value:e}):p[l]=e,q=(p,l)=>{for(var e in l||(l={}))te.call(l,e)&&W(p,e,l[e]);if(z)for(var e of z(l))oe.call(l,e)&&W(p,e,l[e]);return p},D=(p,l)=>R(p,ee(l));var B=(p,l,e)=>new Promise((y,L)=>{var T=C=>{try{P(e.next(C))}catch(M){L(M)}},u=C=>{try{P(e.throw(C))}catch(M){L(M)}},P=C=>C.done?y(C.value):Promise.resolve(C.value).then(T,u);P((e=e.apply(p,l)).next())});var C=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},M={exports:{}};(function(a,g){(function(i,r){r()})(C,function(){function i(t,n){return typeof n=="undefined"?n={autoBom:!1}:typeof n!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),n={autoBom:!n}),n.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob(["\uFEFF",t],{type:t.type}):t}function r(t,n,b){var s=new XMLHttpRequest;s.open("GET",t),s.responseType="blob",s.onload=function(){v(s.response,n,b)},s.onerror=function(){console.error("could not download file")},s.send()}function d(t){var n=new XMLHttpRequest;n.open("HEAD",t,!1);try{n.send()}catch(b){}return 200<=n.status&&299>=n.status}function h(t){try{t.dispatchEvent(new MouseEvent("click"))}catch(b){var n=document.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(n)}}var f=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof C=="object"&&C.global===C?C:void 0,w=f.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),v=f.saveAs||(typeof window!="object"||window!==f?function(){}:"download"in HTMLAnchorElement.prototype&&!w?function(t,n,b){var s=f.URL||f.webkitURL,c=document.createElement("a");n=n||t.name||"download",c.download=n,c.rel="noopener",typeof t=="string"?(c.href=t,c.origin===location.origin?h(c):d(c.href)?r(t,n,b):h(c,c.target="_blank")):(c.href=s.createObjectURL(t),setTimeout(function(){s.revokeObjectURL(c.href)},4e4),setTimeout(function(){h(c)},0))}:"msSaveOrOpenBlob"in navigator?function(t,n,b){if(n=n||t.name||"download",typeof t!="string")navigator.msSaveOrOpenBlob(i(t,b),n);else if(d(t))r(t,n,b);else{var s=document.createElement("a");s.href=t,s.target="_blank",setTimeout(function(){h(s)})}}:function(t,n,b,s){if(s=s||open("","_blank"),s&&(s.document.title=s.document.body.innerText="downloading..."),typeof t=="string")return r(t,n,b);var c=t.type==="application/octet-stream",m=/constructor/i.test(f.HTMLElement)||f.safari,o=/CriOS\/[\d]+/.test(navigator.userAgent);if((o||c&&m||w)&&typeof FileReader!="undefined"){var k=new FileReader;k.onloadend=function(){var x=k.result;x=o?x:x.replace(/^data:[^;]*;/,"data:attachment/file;"),s?s.location.href=x:location=x,s=null},k.readAsDataURL(t)}else{var S=f.URL||f.webkitURL,A=S.createObjectURL(t);s?s.location=A:location.href=A,s=null,setTimeout(function(){S.revokeObjectURL(A)},4e4)}});f.saveAs=v.saveAs=v,a.exports=v})})(M);var K=M.exports;const I="backup";function E(){return P.useTranslation(I,{nsMode:"fallback"})}const{Dragger:X}=u.Upload;function J(a){const g=r=>{var d;(d=a.onChange)==null||d.call(a,r)},i=l.useAPIClient();return D(q({},a),{customRequest({action:r,data:d,file:h,filename:f,headers:w,onError:v,onProgress:t,onSuccess:n,withCredentials:b}){const s=new FormData;return d&&Object.keys(d).forEach(c=>{s.append(c,d[c])}),s.append(f,h),i.axios.post(r,s,{withCredentials:b,headers:w,onUploadProgress:({total:c,loaded:m})=>{t({percent:Math.round(m/c*100).toFixed(2)},h)}}).then(({data:c})=>{n(c,h)}).catch(v).finally(()=>{}),{abort(){console.log("upload progress is aborted.")}}},onChange:g})}const U=a=>{const{collectionsData:g}=a,{t:i}=E(),[r,d]=y.useState(!1),[h,f]=y.useState(g);y.useEffect(()=>{f(g)},[g]);const w=l.useAPIClient(),v=l.useCompile(),t=y.useMemo(()=>w.resource("backupFiles"),[w]),n=()=>B(this,null,function*(){if(a.isBackup){const o=yield t.dumpableCollections();f(o==null?void 0:o.data),d(!0)}d(!0)}),b=()=>{d(!1)},s=()=>{d(!1)},c=[{title:i("Collection"),dataIndex:"collection",key:"collection",render:(o,k)=>{const S=v(k.title);return k.name===S?S:e.jsxs("div",{children:[k.name," ",e.jsxs("span",{style:{color:"rgba(0, 0, 0, 0.3)",fontSize:"0.9em"},children:["(",v(k.title),")"]})]})}},{title:i("Origin"),dataIndex:"origin",key:"origin",width:"50%"}],m=Object.keys(h||{}).map(o=>({key:o,label:i(`${o}.title`),children:e.jsxs(e.Fragment,{children:[e.jsx(u.Alert,{style:{marginBottom:16},message:i(`${o}.description`)}),e.jsx(u.Table,{pagination:{pageSize:100},bordered:!0,size:"small",dataSource:h[o],columns:c,scroll:{y:400}})]})}));return e.jsxs(e.Fragment,{children:[e.jsx("a",{onClick:n,children:i("Learn more")}),e.jsx(u.Modal,{title:i("Backup instructions"),width:"80vw",open:r,footer:null,onOk:b,onCancel:s,children:e.jsx(u.Tabs,{defaultActiveKey:"required",items:m})})]})},G=({ButtonComponent:a=u.Button,title:g,upload:i=!1,fileData:r})=>{const{t:d}=E(),[h,f]=y.useState(["required"]),[w,v]=y.useState(!1),[t,n]=y.useState(null),[b,s]=y.useState(!1),c=l.useAPIClient(),m=y.useMemo(()=>c.resource("backupFiles"),[c]),[o,k]=y.useState([]);y.useEffect(()=>{k(Object.keys((t==null?void 0:t.dumpableCollectionsGroupByGroup)||[]).map(O=>({value:O,label:d(`${O}.title`),disabled:["required","skipped"].includes(O)})))},[t]);const S=()=>B(this,null,function*(){var O,H,$;if(v(!0),!i){s(!0);const{data:F}=yield m.get({filterByTk:r.name});k(Object.keys(((H=(O=F==null?void 0:F.data)==null?void 0:O.meta)==null?void 0:H.dumpableCollectionsGroupByGroup)||[]).map(j=>({value:j,label:d(`${j}.title`),disabled:["required","skipped"].includes(j)}))),n(($=F==null?void 0:F.data)==null?void 0:$.meta),s(!1)}}),A=()=>{m.restore({values:{dataTypes:h,filterByTk:r==null?void 0:r.name,key:t==null?void 0:t.key}}),v(!1)},x=()=>{v(!1),n(null),f(["required"])};return e.jsxs(e.Fragment,{children:[e.jsx(a,{onClick:S,children:g}),e.jsx(u.Modal,{title:d("Restore"),width:800,footer:i&&!t?null:void 0,open:w,onOk:A,onCancel:x,children:e.jsxs(u.Spin,{spinning:b,children:[i&&!t&&e.jsx(V,{setRestoreData:n}),(!i||t)&&[e.jsxs("strong",{style:{fontWeight:600,display:"block",margin:"16px 0 8px"},children:[d("Select the data to be restored")," (",e.jsx(U,{collectionsData:t==null?void 0:t.dumpableCollectionsGroupByGroup}),"):"]},"info"),e.jsx("div",{style:{lineHeight:2,marginBottom:8},children:e.jsx(L.FormItem,{children:e.jsx(l.Checkbox.Group,{options:o,style:{flexDirection:"column"},value:h,onChange:O=>f(O)})})},"dataType")]]})})]})},Q=({ButtonComponent:a=u.Button,refresh:g})=>{const{t:i}=E(),[r,d]=y.useState(!1),[h,f]=y.useState(["required"]),w=l.useAPIClient(),{notification:v}=u.App.useApp(),[t,n]=y.useState([]),b=()=>B(this,null,function*(){const{data:m}=yield w.resource("backupFiles").dumpableCollections();n(Object.keys(m||[]).map(o=>({value:o,label:i(`${o}.title`),disabled:["required","skipped"].includes(o)}))),d(!0)}),s=m=>{w.request({url:"backupFiles:create",method:"post",data:{dataTypes:h,method:m}}).finally(()=>{v.destroy("backup")}),v.info({key:"backup",message:e.jsxs("span",{children:[i("Processing...")," ",e.jsx(u.Spin,{indicator:e.jsx(T.LoadingOutlined,{style:{fontSize:24},spin:!0})})]}),duration:0}),d(!1),f(["required"]),setTimeout(()=>{g()},500)},c=()=>{d(!1),f(["required"])};return e.jsxs(e.Fragment,{children:[e.jsx(a,{icon:e.jsx(T.PlusOutlined,{}),type:"primary",onClick:b,children:i("New backup")}),e.jsxs(u.Modal,{title:i("New backup"),width:800,open:r,onCancel:c,footer:[e.jsx(u.Button,{onClick:c,children:i("Cancel")},"cancel"),e.jsx(u.Button,{type:"primary",onClick:()=>s("worker"),children:i("Worker backup")},"custom"),e.jsx(u.Button,{onClick:()=>s("main"),children:i("Self backup")},"ok")],children:[e.jsxs("strong",{style:{fontWeight:600,display:"block",margin:"16px 0 8px"},children:[i("Select the data to be backed up")," (",e.jsx(U,{isBackup:!0}),"):"]}),e.jsx("div",{style:{lineHeight:2,marginBottom:8},children:e.jsx(l.Checkbox.Group,{options:t,style:{flexDirection:"column"},onChange:m=>f(m),value:h})})]})]})},V=a=>{const{t:g}=E(),i={multiple:!1,action:"/backupFiles:upload",onChange(r){var h,f,w;r.fileList.length>1&&r.fileList.splice(0,r.fileList.length-1);const{status:d}=r.file;d==="done"?(u.message.success(`${r.file.name} `+g("file uploaded successfully")),a.setRestoreData(D(q({},(f=(h=r.file.response)==null?void 0:h.data)==null?void 0:f.meta),{key:(w=r.file.response)==null?void 0:w.data.key}))):d==="error"&&u.message.error(`${r.file.name} `+g("file upload failed"))},onDrop(r){console.log("Dropped files",r.dataTransfer.files)}};return e.jsxs(X,D(q({},J(i)),{children:[e.jsx("p",{className:"ant-upload-drag-icon",children:e.jsx(T.InboxOutlined,{})}),e.jsxs("p",{className:"ant-upload-text",children:[" ",g("Click or drag file to this area to upload")]})]}))},Y=()=>{const{t:a}=E(),g=l.useAPIClient(),[i,r]=y.useState([]),[d,h]=y.useState(!1),[f,w]=y.useState(!1),{modal:v,notification:t}=u.App.useApp(),n=y.useMemo(()=>g.resource("backupFiles"),[g]),b=y.useCallback(()=>B(this,null,function*(){yield s()}),[]);l.useNoticeSub("backup",o=>{(t[o.level]||t.info)({key:"backup",message:o.msg}),b()}),y.useEffect(()=>{s()},[]);const s=()=>B(this,null,function*(){h(!0);const{data:o}=yield n.list();r(o.data),h(!1)}),c=o=>B(this,null,function*(){w(o.name);const k=yield g.request({url:"backupFiles:download",method:"get",params:{filterByTk:o.name},responseType:"blob"});w(!1);const S=new Blob([k.data]);K.saveAs(S,o.name)}),m=o=>{v.confirm({title:a("Delete record",{ns:"core"}),content:a("Are you sure you want to delete it?",{ns:"core"}),onOk:()=>B(this,null,function*(){yield n.destroy({filterByTk:o.name}),yield s(),u.message.success(a("Deleted successfully"))})})};return e.jsx("div",{children:e.jsxs(u.Card,{bordered:!1,children:[e.jsxs(u.Space,{style:{float:"right",marginBottom:16},children:[e.jsx(u.Button,{onClick:b,icon:e.jsx(T.ReloadOutlined,{}),children:a("Refresh")}),e.jsx(G,{upload:!0,title:e.jsxs(e.Fragment,{children:[e.jsx(T.UploadOutlined,{})," ",a("Restore backup from local")]})}),e.jsx(Q,{refresh:b})]}),e.jsx(u.Table,{dataSource:i,loading:d,columns:[{title:a("Backup file"),dataIndex:"name",width:400,onCell:o=>o.inProgress?{colSpan:4}:{},render:(o,k)=>k.inProgress?e.jsxs("div",{style:{color:"rgba(0, 0, 0, 0.88)"},children:[o,"(",a("Backing up"),"...)"]}):e.jsx("div",{children:o})},{title:a("File size"),dataIndex:"fileSize",onCell:o=>o.inProgress?{colSpan:0}:{}},{title:a("Created at",{ns:"core"}),dataIndex:"createdAt",onCell:o=>o.inProgress?{colSpan:0}:{},render:o=>e.jsx(l.DatePicker.ReadPretty,{value:o,showTime:!0})},{title:a("Actions",{ns:"core"}),dataIndex:"actions",onCell:o=>o.inProgress?{colSpan:0}:{},render:(o,k)=>e.jsxs(u.Space,{split:e.jsx(u.Divider,{type:"vertical"}),children:[e.jsx(G,{ButtonComponent:"a",title:a("Restore"),fileData:k}),e.jsx("a",{type:"link",onClick:()=>c(k),children:a("Download")}),e.jsx("a",{onClick:()=>m(k),children:a("Delete")})]})}]})]})})},_=function(a){return e.jsx(l.SchemaComponentOptions,{children:a.children})};_.displayName="DuplicatorProvider";class N extends l.Plugin{load(){return B(this,null,function*(){this.app.use(_),this.app.systemSettingsManager.add("system-services."+I,{title:this.t("Backup & Restore"),icon:"CloudServerOutlined",Component:Y,aclSnippet:"pm.backup.restore"})})}}p.PluginBackupRestoreClient=N,p.default=N,Object.defineProperties(p,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/dist/externalVersion.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
"react": "18.3.1",
|
|
3
|
-
"@tachybase/client": "0.23.
|
|
4
|
-
"@tachybase/components": "0.23.
|
|
3
|
+
"@tachybase/client": "0.23.22",
|
|
4
|
+
"@tachybase/components": "0.23.22",
|
|
5
5
|
"@ant-design/icons": "5.5.2",
|
|
6
6
|
"antd": "5.22.5",
|
|
7
|
-
"@tachybase/server": "0.23.
|
|
8
|
-
"@tachybase/utils": "0.23.
|
|
9
|
-
"@tachybase/database": "0.23.
|
|
7
|
+
"@tachybase/server": "0.23.22",
|
|
8
|
+
"@tachybase/utils": "0.23.22",
|
|
9
|
+
"@tachybase/database": "0.23.22",
|
|
10
10
|
"dayjs": "1.11.13",
|
|
11
11
|
"lodash": "4.17.21",
|
|
12
12
|
"react-i18next": "15.2.0",
|
|
13
|
-
"@tachybase/actions": "0.23.
|
|
13
|
+
"@tachybase/actions": "0.23.22"
|
|
14
14
|
};
|
package/dist/locale/zh-CN.json
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
"Backup instructions": "备份说明",
|
|
8
8
|
"Basic Data": "基础数据",
|
|
9
9
|
"Business data": "业务数据",
|
|
10
|
+
"Cancel": "取消",
|
|
10
11
|
"Click or drag file to this area to upload": "点击或拖拽文件至此区域即可上传",
|
|
11
12
|
"Configuration": "配置",
|
|
12
13
|
"Delete": "删除",
|
|
@@ -26,11 +27,13 @@
|
|
|
26
27
|
"Select User Collections": "请选择用户数据",
|
|
27
28
|
"Select the data to be backed up": "选择备份的数据",
|
|
28
29
|
"Select the data to be restored": "选择还原的数据",
|
|
30
|
+
"Self backup": "本线程备份",
|
|
29
31
|
"Start backup": "开始备份",
|
|
30
32
|
"Start restore": "开始还原",
|
|
31
33
|
"System config": "系统配置",
|
|
32
34
|
"System metadata": "系统元数据",
|
|
33
35
|
"User Data": "用户数据",
|
|
36
|
+
"Worker backup": "工作线程备份",
|
|
34
37
|
"custom.description": "自建表数据",
|
|
35
38
|
"custom.title": "自建表数据",
|
|
36
39
|
"file upload failed": "文件上传失败",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@hapi/topo","description":"Topological sorting with grouping support","version":"6.0.2","repository":"git://github.com/hapijs/topo","main":"lib/index.js","types":"lib/index.d.ts","files":["lib"],"keywords":["topological","sort","toposort","topsort"],"eslintConfig":{"extends":["plugin:@hapi/module"]},"dependencies":{"@hapi/hoek":"^11.0.2"},"devDependencies":{"@hapi/code":"^9.0.3","@hapi/eslint-plugin":"*","@hapi/lab":"^25.1.2","@types/node":"^17.0.31","typescript":"~4.6.4"},"scripts":{"test":"lab -a @hapi/code -t 100 -L -Y","test-cov-html":"lab -a @hapi/code -t 100 -L -r html -o coverage.html"},"license":"BSD-3-Clause","_lastModified":"2024-12-
|
|
1
|
+
{"name":"@hapi/topo","description":"Topological sorting with grouping support","version":"6.0.2","repository":"git://github.com/hapijs/topo","main":"lib/index.js","types":"lib/index.d.ts","files":["lib"],"keywords":["topological","sort","toposort","topsort"],"eslintConfig":{"extends":["plugin:@hapi/module"]},"dependencies":{"@hapi/hoek":"^11.0.2"},"devDependencies":{"@hapi/code":"^9.0.3","@hapi/eslint-plugin":"*","@hapi/lab":"^25.1.2","@types/node":"^17.0.31","typescript":"~4.6.4"},"scripts":{"test":"lab -a @hapi/code -t 100 -L -Y","test-cov-html":"lab -a @hapi/code -t 100 -L -r html -o coverage.html"},"license":"BSD-3-Clause","_lastModified":"2024-12-30T04:21:49.061Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"archiver","version":"5.3.2","description":"a streaming interface for archive generation","homepage":"https://github.com/archiverjs/node-archiver","author":{"name":"Chris Talkington","url":"http://christalkington.com/"},"repository":{"type":"git","url":"https://github.com/archiverjs/node-archiver.git"},"bugs":{"url":"https://github.com/archiverjs/node-archiver/issues"},"license":"MIT","main":"index.js","files":["index.js","lib"],"engines":{"node":">= 10"},"scripts":{"test":"mocha --reporter dot","bench":"node benchmark/simple/pack-zip.js"},"dependencies":{"archiver-utils":"^2.1.0","async":"^3.2.4","buffer-crc32":"^0.2.1","readable-stream":"^3.6.0","readdir-glob":"^1.1.2","tar-stream":"^2.2.0","zip-stream":"^4.1.0"},"devDependencies":{"archiver-jsdoc-theme":"^1.1.3","chai":"^4.3.7","jsdoc":"^3.6.4","mkdirp":"^2.1.5","mocha":"^9.0.2","rimraf":"^4.3.1","stream-bench":"^0.1.2","tar":"^6.1.13","yauzl":"^2.9.0"},"keywords":["archive","archiver","stream","zip","tar"],"publishConfig":{"registry":"https://registry.npmjs.org/"},"_lastModified":"2024-12-
|
|
1
|
+
{"name":"archiver","version":"5.3.2","description":"a streaming interface for archive generation","homepage":"https://github.com/archiverjs/node-archiver","author":{"name":"Chris Talkington","url":"http://christalkington.com/"},"repository":{"type":"git","url":"https://github.com/archiverjs/node-archiver.git"},"bugs":{"url":"https://github.com/archiverjs/node-archiver/issues"},"license":"MIT","main":"index.js","files":["index.js","lib"],"engines":{"node":">= 10"},"scripts":{"test":"mocha --reporter dot","bench":"node benchmark/simple/pack-zip.js"},"dependencies":{"archiver-utils":"^2.1.0","async":"^3.2.4","buffer-crc32":"^0.2.1","readable-stream":"^3.6.0","readdir-glob":"^1.1.2","tar-stream":"^2.2.0","zip-stream":"^4.1.0"},"devDependencies":{"archiver-jsdoc-theme":"^1.1.3","chai":"^4.3.7","jsdoc":"^3.6.4","mkdirp":"^2.1.5","mocha":"^9.0.2","rimraf":"^4.3.1","stream-bench":"^0.1.2","tar":"^6.1.13","yauzl":"^2.9.0"},"keywords":["archive","archiver","stream","zip","tar"],"publishConfig":{"registry":"https://registry.npmjs.org/"},"_lastModified":"2024-12-30T04:21:48.776Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"decompress","version":"4.2.1","description":"Extracting archives made easy","license":"MIT","repository":"kevva/decompress","author":{"name":"Kevin Mårtensson","email":"kevinmartensson@gmail.com","url":"github.com/kevva"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["bz2","bzip2","decompress","extract","tar","tar.bz","tar.gz","zip","unzip"],"dependencies":{"decompress-tar":"^4.0.0","decompress-tarbz2":"^4.0.0","decompress-targz":"^4.0.0","decompress-unzip":"^4.0.1","graceful-fs":"^4.1.10","make-dir":"^1.0.0","pify":"^2.3.0","strip-dirs":"^2.0.0"},"devDependencies":{"ava":"*","esm":"^3.2.25","is-jpg":"^1.0.0","path-exists":"^3.0.0","pify":"^2.3.0","rimraf":"^3.0.2","xo":"*"},"ava":{"require":["esm"]},"xo":{"rules":{"promise/prefer-await-to-then":"off"}},"_lastModified":"2024-12-
|
|
1
|
+
{"name":"decompress","version":"4.2.1","description":"Extracting archives made easy","license":"MIT","repository":"kevva/decompress","author":{"name":"Kevin Mårtensson","email":"kevinmartensson@gmail.com","url":"github.com/kevva"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["bz2","bzip2","decompress","extract","tar","tar.bz","tar.gz","zip","unzip"],"dependencies":{"decompress-tar":"^4.0.0","decompress-tarbz2":"^4.0.0","decompress-targz":"^4.0.0","decompress-unzip":"^4.0.1","graceful-fs":"^4.1.10","make-dir":"^1.0.0","pify":"^2.3.0","strip-dirs":"^2.0.0"},"devDependencies":{"ava":"*","esm":"^3.2.25","is-jpg":"^1.0.0","path-exists":"^3.0.0","pify":"^2.3.0","rimraf":"^3.0.2","xo":"*"},"ava":{"require":["esm"]},"xo":{"rules":{"promise/prefer-await-to-then":"off"}},"_lastModified":"2024-12-30T04:21:49.778Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"mkdirp","description":"Recursively mkdir, like `mkdir -p`","version":"1.0.4","main":"index.js","keywords":["mkdir","directory","make dir","make","dir","recursive","native"],"repository":{"type":"git","url":"https://github.com/isaacs/node-mkdirp.git"},"scripts":{"test":"tap","snap":"tap","preversion":"npm test","postversion":"npm publish","postpublish":"git push origin --follow-tags"},"tap":{"check-coverage":true,"coverage-map":"map.js"},"devDependencies":{"require-inject":"^1.4.4","tap":"^14.10.7"},"bin":"bin/cmd.js","license":"MIT","engines":{"node":">=10"},"files":["bin","lib","index.js"],"_lastModified":"2024-12-
|
|
1
|
+
{"name":"mkdirp","description":"Recursively mkdir, like `mkdir -p`","version":"1.0.4","main":"index.js","keywords":["mkdir","directory","make dir","make","dir","recursive","native"],"repository":{"type":"git","url":"https://github.com/isaacs/node-mkdirp.git"},"scripts":{"test":"tap","snap":"tap","preversion":"npm test","postversion":"npm publish","postpublish":"git push origin --follow-tags"},"tap":{"check-coverage":true,"coverage-map":"map.js"},"devDependencies":{"require-inject":"^1.4.4","tap":"^14.10.7"},"bin":"bin/cmd.js","license":"MIT","engines":{"node":">=10"},"files":["bin","lib","index.js"],"_lastModified":"2024-12-30T04:21:48.869Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"semver","version":"7.6.3","description":"The semantic version parser used by npm.","main":"index.js","scripts":{"test":"tap","snap":"tap","lint":"eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"","postlint":"template-oss-check","lintfix":"npm run lint -- --fix","posttest":"npm run lint","template-oss-apply":"template-oss-apply --force"},"devDependencies":{"@npmcli/eslint-config":"^4.0.0","@npmcli/template-oss":"4.22.0","benchmark":"^2.1.4","tap":"^16.0.0"},"license":"ISC","repository":{"type":"git","url":"git+https://github.com/npm/node-semver.git"},"bin":{"semver":"bin/semver.js"},"files":["bin/","lib/","classes/","functions/","internal/","ranges/","index.js","preload.js","range.bnf"],"tap":{"timeout":30,"coverage-map":"map.js","nyc-arg":["--exclude","tap-snapshots/**"]},"engines":{"node":">=10"},"author":"GitHub Inc.","templateOSS":{"//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten.","version":"4.22.0","engines":">=10","distPaths":["classes/","functions/","internal/","ranges/","index.js","preload.js","range.bnf"],"allowPaths":["/classes/","/functions/","/internal/","/ranges/","/index.js","/preload.js","/range.bnf","/benchmarks"],"publish":"true"},"_lastModified":"2024-12-
|
|
1
|
+
{"name":"semver","version":"7.6.3","description":"The semantic version parser used by npm.","main":"index.js","scripts":{"test":"tap","snap":"tap","lint":"eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"","postlint":"template-oss-check","lintfix":"npm run lint -- --fix","posttest":"npm run lint","template-oss-apply":"template-oss-apply --force"},"devDependencies":{"@npmcli/eslint-config":"^4.0.0","@npmcli/template-oss":"4.22.0","benchmark":"^2.1.4","tap":"^16.0.0"},"license":"ISC","repository":{"type":"git","url":"git+https://github.com/npm/node-semver.git"},"bin":{"semver":"bin/semver.js"},"files":["bin/","lib/","classes/","functions/","internal/","ranges/","index.js","preload.js","range.bnf"],"tap":{"timeout":30,"coverage-map":"map.js","nyc-arg":["--exclude","tap-snapshots/**"]},"engines":{"node":">=10"},"author":"GitHub Inc.","templateOSS":{"//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten.","version":"4.22.0","engines":">=10","distPaths":["classes/","functions/","internal/","ranges/","index.js","preload.js","range.bnf"],"allowPaths":["/classes/","/functions/","/internal/","/ranges/","/index.js","/preload.js","/range.bnf","/benchmarks"],"publish":"true"},"_lastModified":"2024-12-30T04:21:50.247Z"}
|
package/dist/server/dumper.js
CHANGED
|
@@ -192,7 +192,7 @@ class Dumper extends import_app_migrator.AppMigrator {
|
|
|
192
192
|
}).finally(() => {
|
|
193
193
|
this.cleanLockFile(backupFileName);
|
|
194
194
|
Dumper.dumpTasks.delete(backupFileName);
|
|
195
|
-
this.app.noticeManager.notify("backup", { msg: "
|
|
195
|
+
this.app.noticeManager.notify("backup", { msg: "Done" });
|
|
196
196
|
});
|
|
197
197
|
Dumper.dumpTasks.set(backupFileName, promise);
|
|
198
198
|
} else {
|
|
@@ -112,19 +112,29 @@ var backup_files_default = {
|
|
|
112
112
|
* @param next
|
|
113
113
|
*/
|
|
114
114
|
async create(ctx, next) {
|
|
115
|
-
var _a;
|
|
116
115
|
const data = ctx.request.body;
|
|
117
116
|
let taskId;
|
|
118
117
|
const app = ctx.app;
|
|
119
|
-
if (
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
118
|
+
if (data.method === "worker") {
|
|
119
|
+
if (!app.worker.available) {
|
|
120
|
+
ctx.throw(500, ctx.t("No worker thread", { ns: "worker-thread" }));
|
|
121
|
+
return next();
|
|
122
|
+
}
|
|
123
|
+
try {
|
|
124
|
+
taskId = await app.worker.callPluginMethod({
|
|
125
|
+
plugin: import_server2.default,
|
|
126
|
+
method: "workerCreateBackUp",
|
|
127
|
+
params: {
|
|
128
|
+
dataTypes: data.dataTypes
|
|
129
|
+
},
|
|
130
|
+
// 目前限制方法并发为1
|
|
131
|
+
concurrency: 1
|
|
132
|
+
});
|
|
133
|
+
app.noticeManager.notify("backup", { level: "info", msg: ctx.t("Done") });
|
|
134
|
+
} catch (error) {
|
|
135
|
+
ctx.logger.warn(error);
|
|
136
|
+
ctx.throw(500, ctx.t(error.message, { ns: "worker-thread" }));
|
|
137
|
+
}
|
|
128
138
|
} else {
|
|
129
139
|
const plugin = app.pm.get(import_server2.default);
|
|
130
140
|
taskId = await plugin.workerCreateBackUp(data);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tachybase/module-backup",
|
|
3
3
|
"displayName": "App backup & restore",
|
|
4
|
-
"version": "0.23.
|
|
4
|
+
"version": "0.23.22",
|
|
5
5
|
"description": "Backup and restore applications for scenarios such as application replication, migration, and upgrades.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"System management"
|
|
@@ -30,16 +30,16 @@
|
|
|
30
30
|
"react-i18next": "^15.2.0",
|
|
31
31
|
"semver": "^7.6.3",
|
|
32
32
|
"tar": "^6.2.1",
|
|
33
|
-
"@tachybase/components": "0.23.
|
|
34
|
-
"@tachybase/module-worker-thread": "0.23.
|
|
33
|
+
"@tachybase/components": "0.23.22",
|
|
34
|
+
"@tachybase/module-worker-thread": "0.23.22"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"@tachybase/actions": "0.23.
|
|
38
|
-
"@tachybase/client": "0.23.
|
|
39
|
-
"@tachybase/database": "0.23.
|
|
40
|
-
"@tachybase/
|
|
41
|
-
"@tachybase/
|
|
42
|
-
"@tachybase/utils": "0.23.
|
|
37
|
+
"@tachybase/actions": "0.23.22",
|
|
38
|
+
"@tachybase/client": "0.23.22",
|
|
39
|
+
"@tachybase/database": "0.23.22",
|
|
40
|
+
"@tachybase/server": "0.23.22",
|
|
41
|
+
"@tachybase/test": "0.23.22",
|
|
42
|
+
"@tachybase/utils": "0.23.22"
|
|
43
43
|
},
|
|
44
44
|
"description.zh-CN": "备份和还原应用,可用于应用的复制、迁移、升级等场景。",
|
|
45
45
|
"displayName.zh-CN": "应用的备份与还原",
|