@nocobase/plugin-logger 1.9.0-beta.9 → 2.0.0-alpha.3
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.
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
"use strict";(self.webpackChunk_nocobase_plugin_logger=self.webpackChunk_nocobase_plugin_logger||[]).push([["
|
|
10
|
+
"use strict";(self.webpackChunk_nocobase_plugin_logger=self.webpackChunk_nocobase_plugin_logger||[]).push([["726"],{117:function(e,t,r){r.r(t),r.d(t,{LogsDownloader:function(){return v}});var n=r(772),o=r(156),l=r.n(o),a=r(721),i=r(482),c=r(551),u=r(749);function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function f(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}function y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var l=[],a=!0,i=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(l.push(r.value),!t||l.length!==t);a=!0);}catch(e){i=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(i)throw n}}return l}}(e,t)||m(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||m(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,t){if(e){if("string"==typeof e)return s(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return s(e,t)}}var h=a.Typography.Paragraph,g=a.Typography.Text,b=l().memo(function(){var e=(0,c.vP)().t;return l().createElement(a.Typography,null,l().createElement(h,null,l().createElement(g,{code:!0},"request_*.log")," - ",e("API request and response logs")),l().createElement(h,null,l().createElement(g,{code:!0},"system_*.log")," -"," ",e("Application, database, plugins and other system logs, the error level logs will be sent to")," ",l().createElement(g,{code:!0},"system_error_*.log")),l().createElement(h,null,l().createElement(g,{code:!0},"sql_*.log")," - ",e("SQL execution logs, printed by Sequelize when the db logging is enabled")))});b.displayName="Tips";var v=l().memo(function(e){var t=a.theme.useToken().token,r=(0,c.vP)().t,s=(0,u.useMemoizedFn)(r),m=(0,n.useAPIClient)(),h=y(l().useState(["0"]),2),g=h[0],v=h[1],E=y(l().useState(""),2),w=E[0],O=E[1],S=y(l().useState(!0),2),k=S[0],P=S[1],j=y(l().useState([]),2),A=j[0],x=j[1],T=(0,n.useRequest)(function(){return m.resource("logger").list().then(function(e){var t;return null==(t=e.data)?void 0:t.data})}).data,_=(0,o.useCallback)(function(e,t){return e.map(function(e,r){var n="".concat(t,"-").concat(r);return"string"==typeof e?{title:e,key:n,icon:l().createElement(i.FileOutlined,null)}:{title:e.name,key:n,icon:l().createElement(i.FolderOutlined,null),children:_(e.files,n)}})},[]),I=(0,o.useMemo)(function(){var e=T||[];return[{title:s("All"),key:"0",children:_(e,"0")}]},[T,_,s]),C=l().useMemo(function(){if(!w)return I;var e=function(r){var n=[],o=!0,a=!1,i=void 0;try{for(var c,u=r[Symbol.iterator]();!(o=(c=u.next()).done);o=!0){var s=c.value,y=s.title,d=y.indexOf(w),m=y.substring(0,d),h=y.substring(d+w.length),g=d>-1?l().createElement("span",null,m,l().createElement("span",{style:{color:t.colorPrimary}},w),h):l().createElement("span",null,y);if(d>-1)n.push(f(p({},s),{title:g}));else if(s.children){var b=e(s.children);b.length&&n.push(f(p({},s),{title:g,children:b}))}}}catch(e){a=!0,i=e}finally{try{o||null==u.return||u.return()}finally{if(a)throw i}}return n};return e(I)},[w,I,t.colorPrimary]);return l().createElement(a.Card,{style:{minHeight:"700px"}},l().createElement(a.Alert,{message:"",description:l().createElement(b,null),type:"info",showIcon:!0}),l().createElement(a.Input.Search,{style:{marginTop:16,width:"450px"},placeholder:s("Search"),onChange:function(e){var t=e.target.value,r=function(e){return e.reduce(function(e,n){var o;return((null==(o=n.title)?void 0:o.includes(t))&&e.push(n),n.children)?d(e).concat(d(r(n.children))):e},[])};v(r(I).map(function(e){return e.key})),O(t),P(!0),x([])}}),l().createElement("div",{style:{maxHeight:"400px",width:"450px",overflow:"auto",border:"1px solid",marginTop:"6px",marginBottom:"10px",borderColor:t.colorBorder}},C.length?l().createElement(a.Tree,{checkable:!0,showIcon:!0,showLine:!0,checkedKeys:A,expandedKeys:g,autoExpandParent:k,onExpand:function(e){v(e),P(!1)},onCheck:function(e){return x(e)},treeData:C}):l().createElement(a.Empty,{image:a.Empty.PRESENTED_IMAGE_SIMPLE})),l().createElement(a.Button,{type:"primary",onClick:function(){var e=function(t,r){return t.reduce(function(t,n){var o=n.title;return(o="0"===n.key?o:"".concat(r,"/").concat(o),n.children)?d(t).concat(d(e(n.children,"0"===n.key?"":o))):(A.includes(n.key)&&"0"!==n.key&&t.push(o),t)},[])},t=e(I,"");t.length&&m.request({url:"logger:download",method:"post",responseType:"blob",data:{files:t}}).then(function(e){var t=window.URL.createObjectURL(new Blob([e.data],{type:"application/gzip"})),r=document.createElement("a");r.setAttribute("href",t),r.setAttribute("download","logs.tar.gz"),r.click(),r.remove()}).catch(function(e){console.log(e)})}},s("Download")," (.tar.gz)"))});v.displayName="LogsDownloader"}}]);
|
package/dist/client/index.js
CHANGED
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("ahooks"),require("@nocobase/client"),require("react"),require("@ant-design/icons"),require("antd")
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react-i18next"),require("ahooks"),require("@nocobase/client"),require("react"),require("@ant-design/icons"),require("antd")):"function"==typeof define&&define.amd?define("@nocobase/plugin-logger",["react-i18next","ahooks","@nocobase/client","react","@ant-design/icons","antd"],t):"object"==typeof exports?exports["@nocobase/plugin-logger"]=t(require("react-i18next"),require("ahooks"),require("@nocobase/client"),require("react"),require("@ant-design/icons"),require("antd")):e["@nocobase/plugin-logger"]=t(e["react-i18next"],e.ahooks,e["@nocobase/client"],e.react,e["@ant-design/icons"],e.antd)}(self,function(e,t,n,r,o,i){return function(){var u,c,a,f,l,s,p={551:function(e,t,n){"use strict";n.d(t,{KQ:function(){return u},vP:function(){return c}});var r=n(772),o=n(238),i="logger";function u(e){return r.i18n.t(e,{ns:i})}function c(){return(0,o.useTranslation)(i)}},581:function(e){e.exports=function(e,t){return"undefined"!=typeof __deoptimization_sideEffect__&&__deoptimization_sideEffect__(e,t),t}},482:function(e){"use strict";e.exports=o},772:function(e){"use strict";e.exports=n},749:function(e){"use strict";e.exports=t},721:function(e){"use strict";e.exports=i},156:function(e){"use strict";e.exports=r},238:function(t){"use strict";t.exports=e}},d={};function b(e){var t=d[e];if(void 0!==t)return t.exports;var n=d[e]={exports:{}};return p[e](n,n.exports,b),n.exports}b.m=p,b.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return b.d(t,{a:t}),t},b.d=function(e,t){for(var n in t)b.o(t,n)&&!b.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},b.f={},b.e=function(e){return Promise.all(Object.keys(b.f).reduce(function(t,n){return b.f[n](e,t),t},[]))},b.u=function(e){return"cadb8b365e6b852a.js"},b.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),b.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},u={},c="@nocobase/plugin-logger:",b.l=function(e,t,n,r){if(u[e])return void u[e].push(t);if(void 0!==n)for(var o,i,a=document.getElementsByTagName("script"),f=0;f<a.length;f++){var l=a[f];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")==c+n){o=l;break}}o||(i=!0,(o=document.createElement("script")).charset="utf-8",o.timeout=120,b.nc&&o.setAttribute("nonce",b.nc),o.setAttribute("data-webpack",c+n),o.src=e),u[e]=[t];var s=function(t,n){o.onerror=o.onload=null,clearTimeout(p);var r=u[e];if(delete u[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},p=setTimeout(s.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=s.bind(null,o.onerror),o.onload=s.bind(null,o.onload),i&&document.head.appendChild(o)},b.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(a=window.__nocobase_public_path__||"/").endsWith("/")||(a+="/"),b.p=a+"static/plugins/@nocobase/plugin-logger/dist/client/",f={909:0},b.f.j=function(e,t){var n=b.o(f,e)?f[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=f[e]=[t,r]});t.push(n[2]=r);var o=b.p+b.u(e),i=Error();b.l(o,function(t){if(b.o(f,e)&&(0!==(n=f[e])&&(f[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",i.name="ChunkLoadError",i.type=r,i.request=o,n[1](i)}},"chunk-"+e,e)}},l=function(e,t){var n,r,o=t[0],i=t[1],u=t[2],c=0;if(o.some(function(e){return 0!==f[e]})){for(n in i)b.o(i,n)&&(b.m[n]=i[n]);u&&u(b)}for(e&&e(t);c<o.length;c++)r=o[c],b.o(f,r)&&f[r]&&f[r][0](),f[r]=0},(s=self.webpackChunk_nocobase_plugin_logger=self.webpackChunk_nocobase_plugin_logger||[]).forEach(l.bind(null,0)),s.push=l.bind(null,s.push.bind(s));var g={};return!function(){"use strict";b.r(g),b.d(g,{PluginLoggerClient:function(){return p}});var e=b(772),t=b(551),n=b(581);function r(e,t,n,r,o,i,u){try{var c=e[i](u),a=c.value}catch(e){n(e);return}c.done?t(a):Promise.resolve(a).then(r,o)}function o(e){return function(){var t=this,n=arguments;return new Promise(function(o,i){var u=e.apply(t,n);function c(e){r(u,o,i,c,a,"next",e)}function a(e){r(u,o,i,c,a,"throw",e)}c(void 0)})}}function i(e,t,n){return(i=f()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&c(o,n.prototype),o}).apply(null,arguments)}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function a(e){var t="function"==typeof Map?new Map:void 0;return(a=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return i(e,arguments,u(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),c(n,e)})(e)}function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(f=function(){return!!e})()}function l(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){var a=[i,c];if(n)throw TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,r=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){u=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){u.label=a[1];break}if(6===a[0]&&u.label<o[1]){u.label=o[1],o=a;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(a);break}o[2]&&u.ops.pop(),u.trys.pop();continue}a=t.call(e,u)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}}}var s=(0,e.lazy)(function(){return n("imported_-12gq08n_component",b.e("726").then(b.bind(b,117)))},"LogsDownloader").LogsDownloader,p=function(e){var n;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function r(){var e,t;if(!(this instanceof r))throw TypeError("Cannot call a class as a function");return e=r,t=arguments,e=u(e),function(e,t){var n;if(t&&("object"==((n=t)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,f()?Reflect.construct(e,t||[],u(this).constructor):e.apply(this,t))}return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&c(r,e),n=[{key:"afterAdd",value:function(){return o(function(){return l(this,function(e){return[2]})})()}},{key:"beforeLoad",value:function(){return o(function(){return l(this,function(e){return[2]})})()}},{key:"load",value:function(){var e=this;return o(function(){return l(this,function(n){return e.app.pluginSettingsManager.add("logger",{title:(0,t.KQ)("Logger"),icon:"FileTextOutlined",Component:s}),[2]})})()}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(r.prototype,n),r}(a(e.Plugin));g.default=p}(),g}()});
|
package/dist/externalVersion.js
CHANGED
|
@@ -8,14 +8,14 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/client": "
|
|
11
|
+
"@nocobase/client": "2.0.0-alpha.3",
|
|
12
12
|
"react": "18.2.0",
|
|
13
13
|
"antd": "5.24.2",
|
|
14
14
|
"@ant-design/icons": "5.6.1",
|
|
15
15
|
"ahooks": "3.7.8",
|
|
16
|
-
"@nocobase/server": "
|
|
16
|
+
"@nocobase/server": "2.0.0-alpha.3",
|
|
17
17
|
"react-i18next": "11.18.6",
|
|
18
|
-
"@nocobase/actions": "
|
|
19
|
-
"@nocobase/logger": "
|
|
18
|
+
"@nocobase/actions": "2.0.0-alpha.3",
|
|
19
|
+
"@nocobase/logger": "2.0.0-alpha.3",
|
|
20
20
|
"lodash": "4.17.21"
|
|
21
21
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"tar-fs","version":"3.0.4","description":"filesystem bindings for tar-stream","dependencies":{"mkdirp-classic":"^0.5.2","pump":"^3.0.0","tar-stream":"^3.1.5"},"files":["index.js"],"standard":{"ignore":["test/fixtures/**"]},"keywords":["tar","fs","file","tarball","directory","stream"],"devDependencies":{"brittle":"^3.1.3","rimraf":"^2.6.3","standard":"^17.0.1"},"scripts":{"test":"standard && brittle test/index.js"},"bugs":{"url":"https://github.com/mafintosh/tar-fs/issues"},"homepage":"https://github.com/mafintosh/tar-fs","main":"index.js","directories":{"test":"test"},"author":"Mathias Buus","license":"MIT","repository":{"type":"git","url":"https://github.com/mafintosh/tar-fs.git"},"_lastModified":"2025-09-
|
|
1
|
+
{"name":"tar-fs","version":"3.0.4","description":"filesystem bindings for tar-stream","dependencies":{"mkdirp-classic":"^0.5.2","pump":"^3.0.0","tar-stream":"^3.1.5"},"files":["index.js"],"standard":{"ignore":["test/fixtures/**"]},"keywords":["tar","fs","file","tarball","directory","stream"],"devDependencies":{"brittle":"^3.1.3","rimraf":"^2.6.3","standard":"^17.0.1"},"scripts":{"test":"standard && brittle test/index.js"},"bugs":{"url":"https://github.com/mafintosh/tar-fs/issues"},"homepage":"https://github.com/mafintosh/tar-fs","main":"index.js","directories":{"test":"test"},"author":"Mathias Buus","license":"MIT","repository":{"type":"git","url":"https://github.com/mafintosh/tar-fs.git"},"_lastModified":"2025-09-30T15:48:17.279Z"}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"displayName.zh-CN": "日志",
|
|
5
5
|
"description": "Server-side logs, mainly including API request logs and system runtime logs, and allows to package and download log files.",
|
|
6
6
|
"description.zh-CN": "服务端日志,主要包括接口请求日志和系统运行日志,并支持打包和下载日志文件。",
|
|
7
|
-
"version": "
|
|
7
|
+
"version": "2.0.0-alpha.3",
|
|
8
8
|
"license": "AGPL-3.0",
|
|
9
9
|
"main": "dist/server/index.js",
|
|
10
10
|
"homepage": "https://docs.nocobase.com/handbook/logger",
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
"tar-fs": "^3.0.4"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
|
-
"@nocobase/actions": "
|
|
18
|
-
"@nocobase/client": "
|
|
19
|
-
"@nocobase/server": "
|
|
20
|
-
"@nocobase/test": "
|
|
17
|
+
"@nocobase/actions": "2.x",
|
|
18
|
+
"@nocobase/client": "2.x",
|
|
19
|
+
"@nocobase/server": "2.x",
|
|
20
|
+
"@nocobase/test": "2.x"
|
|
21
21
|
},
|
|
22
|
-
"gitHead": "
|
|
22
|
+
"gitHead": "8efc23aa78058d871e98a91419f3c4a61762cc15",
|
|
23
23
|
"keywords": [
|
|
24
24
|
"Logging and monitoring"
|
|
25
25
|
]
|