@nocobase/plugin-logger 1.0.0-alpha.1 → 1.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.
@@ -1,2 +1,10 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
1
9
  import React from 'react';
2
10
  export declare const LogsDownloader: React.NamedExoticComponent<object>;
@@ -1,3 +1,11 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
1
9
  import { Plugin } from '@nocobase/client';
2
10
  export declare class PluginLoggerClient extends Plugin {
3
11
  afterAdd(): Promise<void>;
@@ -1 +1,10 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
1
10
  (function(e,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("@nocobase/client"),require("react-i18next"),require("react/jsx-runtime"),require("react"),require("antd"),require("@ant-design/icons"),require("ahooks")):typeof define=="function"&&define.amd?define(["exports","@nocobase/client","react-i18next","react/jsx-runtime","react","antd","@ant-design/icons","ahooks"],t):(e=typeof globalThis!="undefined"?globalThis:e||self,t(e["@nocobase/plugin-logger"]={},e["@nocobase/client"],e["react-i18next"],e.jsxRuntime,e.react,e.antd,e["@ant-design/icons"],e.ahooks))})(this,function(e,t,s,r,a,d,k,y){"use strict";var Y=Object.defineProperty,Z=Object.defineProperties;var R=Object.getOwnPropertyDescriptors;var $=Object.getOwnPropertySymbols;var ee=Object.prototype.hasOwnProperty,te=Object.prototype.propertyIsEnumerable;var V=(e,t,s)=>t in e?Y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,A=(e,t)=>{for(var s in t||(t={}))ee.call(t,s)&&V(e,s,t[s]);if($)for(var s of $(t))te.call(t,s)&&V(e,s,t[s]);return e},C=(e,t)=>Z(e,R(t));var S=(e,t,s)=>new Promise((r,a)=>{var d=h=>{try{y(s.next(h))}catch(f){a(f)}},k=h=>{try{y(s.throw(h))}catch(f){a(f)}},y=h=>h.done?r(h.value):Promise.resolve(h.value).then(d,k);y((s=s.apply(e,t)).next())});const h="logger";function f(g){return t.i18n.t(g,{ns:h})}function L(){return s.useTranslation(h)}const{Paragraph:E,Text:b}=d.Typography,M=a.memo(()=>{const{t:g}=L();return r.jsxs(d.Typography,{children:[r.jsxs(E,{children:[r.jsx(b,{code:!0,children:"[app]/request_*.log"})," - ",g("API request and response logs")]}),r.jsxs(E,{children:[r.jsx(b,{code:!0,children:"[app]/system_*.log"})," -"," ",g("Application, database, plugins and other system logs, the error level logs will be sent to")," ",r.jsx(b,{code:!0,children:"[app]/system_error_*.log"})]}),r.jsxs(E,{children:[r.jsx(b,{code:!0,children:"[app]/sql_*.log"})," -"," ",g("SQL execution logs, printed by Sequelize when the db logging is enabled")]})]})});M.displayName="Tips";const _=a.memo(g=>{const{token:P}=d.theme.useToken(),{t:H}=L(),T=y.useMemoizedFn(H),v=t.useAPIClient(),[U,I]=a.useState(["0"]),[x,G]=a.useState(""),[Q,D]=a.useState(!0),[O,z]=a.useState([]),{data:K}=t.useRequest(()=>v.resource("logger").list().then(o=>{var u;return(u=o.data)==null?void 0:u.data})),q=a.useCallback((o,u)=>o.map((i,c)=>{const n=`${u}-${c}`;return typeof i=="string"?{title:i,key:n,icon:r.jsx(k.FileOutlined,{})}:{title:i.name,key:n,icon:r.jsx(k.FolderOutlined,{}),children:q(i.files,n)}}),[]),m=a.useMemo(()=>{const o=K||[];return[{title:T("All"),key:"0",children:q(o,"0")}]},[K,q,T]),J=o=>{I(o),D(!1)},W=o=>{const{value:u}=o.target,i=n=>n.reduce((l,p)=>{var w;return(w=p.title)!=null&&w.includes(u)&&l.push(p),p.children?[...l,...i(p.children)]:l},[]),c=i(m).map(n=>n.key);I(c),G(u),D(!0),z([])},B=a.useMemo(()=>{if(!x)return m;const o=u=>{const i=[];for(const c of u){const n=c.title,l=n.indexOf(x),p=n.substring(0,l),w=n.substring(l+x.length),F=l>-1?r.jsxs("span",{children:[p,r.jsx("span",{style:{color:P.colorPrimary},children:x}),w]}):r.jsx("span",{children:n});if(l>-1)i.push(C(A({},c),{title:F}));else if(c.children){const N=o(c.children);N.length&&i.push(C(A({},c),{title:F,children:N}))}}return i};return o(m)},[x,m,P.colorPrimary]),X=()=>{const o=(i,c)=>i.reduce((n,l)=>{let p=l.title;return p=l.key==="0"?p:`${c}/${p}`,l.children?[...n,...o(l.children,l.key==="0"?"":p)]:(O.includes(l.key)&&l.key!=="0"&&n.push(p),n)},[]),u=o(m,"");u.length&&v.request({url:"logger:download",method:"post",responseType:"blob",data:{files:u}}).then(i=>{const c=window.URL.createObjectURL(new Blob([i.data],{type:"application/gzip"})),n=document.createElement("a");n.setAttribute("href",c),n.setAttribute("download","logs.tar.gz"),n.click(),n.remove()}).catch(i=>{console.log(i)})};return r.jsxs(d.Card,{style:{minHeight:"700px"},children:[r.jsx(d.Alert,{message:"",description:r.jsx(M,{}),type:"info",showIcon:!0}),r.jsx(d.Input.Search,{style:{marginTop:16,width:"450px"},placeholder:T("Search"),onChange:W}),r.jsx("div",{style:{maxHeight:"400px",width:"450px",overflow:"auto",border:"1px solid",marginTop:"6px",marginBottom:"10px",borderColor:P.colorBorder},children:B.length?r.jsx(d.Tree,{checkable:!0,showIcon:!0,showLine:!0,checkedKeys:O,expandedKeys:U,autoExpandParent:Q,onExpand:J,onCheck:o=>z(o),treeData:B}):r.jsx(d.Empty,{image:d.Empty.PRESENTED_IMAGE_SIMPLE})}),r.jsxs(d.Button,{type:"primary",onClick:X,children:[T("Download")," (.tar.gz)"]})]})});_.displayName="LogsDownloader";class j extends t.Plugin{afterAdd(){return S(this,null,function*(){})}beforeLoad(){return S(this,null,function*(){})}load(){return S(this,null,function*(){this.app.pluginSettingsManager.add("logger",{title:f("Logger"),icon:"FileTextOutlined",Component:_})})}}e.PluginLoggerClient=j,e.default=j,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
@@ -1,3 +1,11 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
1
9
  export declare const NAMESPACE = "logger";
2
10
  export declare function lang(key: string): string;
3
11
  export declare function useLoggerTranslation(): import("react-i18next").UseTranslationResponse<"logger", undefined>;
@@ -1,11 +1,20 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
1
10
  module.exports = {
2
- "@nocobase/client": "1.0.0-alpha.1",
11
+ "@nocobase/client": "1.0.0-alpha.3",
3
12
  "react": "18.2.0",
4
13
  "antd": "5.12.8",
5
14
  "@ant-design/icons": "5.2.6",
6
15
  "ahooks": "3.7.8",
7
- "@nocobase/server": "1.0.0-alpha.1",
16
+ "@nocobase/server": "1.0.0-alpha.3",
8
17
  "react-i18next": "11.18.6",
9
- "@nocobase/actions": "1.0.0-alpha.1",
10
- "@nocobase/logger": "1.0.0-alpha.1"
18
+ "@nocobase/actions": "1.0.0-alpha.3",
19
+ "@nocobase/logger": "1.0.0-alpha.3"
11
20
  };
package/dist/index.d.ts CHANGED
@@ -1,2 +1,10 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
1
9
  export * from './server';
2
10
  export { default } from './server';
package/dist/index.js CHANGED
@@ -1,3 +1,12 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
1
10
  var __create = Object.create;
2
11
  var __defProp = Object.defineProperty;
3
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1,3 +1,11 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
1
9
  declare const _default: {
2
10
  Logger: string;
3
11
  Search: string;
@@ -1,3 +1,12 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
1
10
  var __defProp = Object.defineProperty;
2
11
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
12
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -1,3 +1,11 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
1
9
  declare const _default: {
2
10
  Logger: string;
3
11
  Search: string;
@@ -1,3 +1,12 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
1
10
  var __defProp = Object.defineProperty;
2
11
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
12
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -1,3 +1,11 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
1
9
  declare const _default: {
2
10
  Logger: string;
3
11
  Search: string;
@@ -1,3 +1,12 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
1
10
  var __defProp = Object.defineProperty;
2
11
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
12
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -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":"2024-04-28T17:06:31.445Z"}
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":"2024-04-30T08:28:53.738Z"}
@@ -1 +1,9 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
1
9
  export { default } from './plugin';
@@ -1,3 +1,12 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
1
10
  var __create = Object.create;
2
11
  var __defProp = Object.defineProperty;
3
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1,3 +1,11 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
1
9
  import { InstallOptions, Plugin } from '@nocobase/server';
2
10
  export declare class PluginLoggerServer extends Plugin {
3
11
  afterAdd(): void;
@@ -1,3 +1,12 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
1
10
  var __create = Object.create;
2
11
  var __defProp = Object.defineProperty;
3
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1,3 +1,11 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
1
9
  import { Context, Next } from '@nocobase/actions';
2
10
  declare const _default: {
3
11
  name: string;
@@ -1,3 +1,12 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
1
10
  var __create = Object.create;
2
11
  var __defProp = Object.defineProperty;
3
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
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": "1.0.0-alpha.1",
7
+ "version": "1.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",
@@ -19,7 +19,7 @@
19
19
  "@nocobase/server": "1.x",
20
20
  "@nocobase/test": "1.x"
21
21
  },
22
- "gitHead": "c73b6d2032a6151fdfeebeb0ec923d766578c53c",
22
+ "gitHead": "7ccb137c7616cba5d238f87368239640e1d9ace1",
23
23
  "keywords": [
24
24
  "Logging and monitoring"
25
25
  ]