diff --git a/frontend/front-srv/assets/access.settings/res/dist/AdminLogs.min.js b/frontend/front-srv/assets/access.settings/res/dist/AdminLogs.min.js index 5e10a1d409..dad270635b 100644 --- a/frontend/front-srv/assets/access.settings/res/dist/AdminLogs.min.js +++ b/frontend/front-srv/assets/access.settings/res/dist/AdminLogs.min.js @@ -1 +1 @@ -(()=>{"use strict";var e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{Dashboard:()=>De,LogTools:()=>we});const n=require("react");var r=e.n(n);const o=require("material-ui"),i=require("prop-types");var a=e.n(i);const l=require("pydio/model/data-model");var s=e.n(l);const c=require("pydio");var u=e.n(c);const d=require("pydio/lang/observable");var p=e.n(d);const f=require("pydio/http/api");var m=e.n(f);const h=require("pydio/http/resources-manager");var y=e.n(h);const g=require("cells-sdk");function b(e){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},b(e)}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n6&&void 0!==arguments[6]?arguments[6]:void 0,l=[];if(e&&l.push('+Msg:"*'+e+'*"'),t&&l.push("+Logger:*"+t+"*"),n)if(0===n.indexOf("<")){var s=j.indexOf(n.replace("<","")),c=j.filter((function(e,t){return t<=s})).map((function(e){return"Level:"+e}));l.push.apply(l,function(e){return function(e){if(Array.isArray(e))return v(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return v(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?v(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(c))}else l.push("+Level:"+n);if(r&&l.push("+RemoteAddress:*"+r+"*"),o&&l.push("+UserName:*"+o+"*"),i){var u=i,d=new Date(u);a?d=a:d.setDate(u.getDate()+1),l.push("+Ts:>"+Math.floor(u/1e3)),l.push("+Ts:<"+Math.floor(d/1e3))}return l.join(" ")}},{key:"buildTsQuery",value:function(e,t){var n=[];return n.push("+Ts:>"+(e-60*t)),n.push("+Ts:<"+(e+60*t)),n.join(" ")}},{key:"loadLogs",value:function(e,t,n,r,o){var i=new g.LogListLogRequest;return i.Query=t,i.Page=n,i.Size=r,i.Format=g.ListLogRequestLogFormat.constructFromObject(o),"syslog"===e?new g.LogServiceApi(m().getRestClient()).syslog(i):"audit"===e?y().loadClass("EnterpriseSDK").then((function(e){return new e.EnterpriseLogServiceApi(m().getRestClient()).audit(i)})):Promise.reject("Unknown service name, must be 'syslog' or 'audit'")}},{key:"downloadLogs",value:function(e,t,n){var r=new g.LogListLogRequest;return r.Query=t,r.Page=0,r.Size=1e5,r.Format=g.ListLogRequestLogFormat.constructFromObject(n),a.auditExportWithHttpInfo(r,e).then((function(e){return e.response.body}))}},{key:"auditExportWithHttpInfo",value:function(e,t){var n=e;if(null==e)throw new Error("Missing the required parameter 'body' when calling auditExport");return m().getRestClient().callApi("/log/"+t+"/export","POST",{},{},{},{},n,[],["application/json"],["application/json"],"Blob")}}],null&&S(t.prototype,null),n&&S(t,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(p());const x=require("react-dom");var C=e.n(x);const P=require("clipboard");var k=e.n(P);function T(e){return T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},T(e)}function R(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function D(e){for(var t=1;t0&&r().createElement(n.Fragment,null,r().createElement(o.Divider,{style:b.divider}),Object.keys(O).map((function(e){return r().createElement(q,{iconClassName:"mdi mdi-tag",legend:e,data:O[e]})}))))}}]),i}(r().Component);function H(e){return H="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},H(e)}function J(){return J=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:null;t&&e.setHours(t.getHours(),t.getMinutes());var n=this.state,r=n.endDate;if(n.endDateShow&&!r&&void 0!==e){var o=new Date;o.setHours(23,59,59),this.setState({endDate:o})}this.setState({date:e,page:0},this.publishStateChange.bind(this))}},{key:"handleEndDateChange",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;t&&e.setHours(t.getHours(),t.getMinutes()),this.setState({endDate:e,page:0},this.publishStateChange.bind(this))}},{key:"handleExport",value:function(e){var t=this,n=this.state,r=n.filter,o=n.serviceFilter,i=n.level,a=n.remoteAddress,l=n.userName,s=n.date,c=n.endDate,u=this.props.service,d=s?s.getFullYear()+"-"+(s.getMonth()+1)+"-"+s.getDate():"",p=E.buildQuery(r,o,i,a,l,s,c);E.downloadLogs(u||"sys",p,e).then((function(n){var r=window.URL.createObjectURL(n),o="cells-logs-";if(o+=d||"filtered",o+="."+e.toLowerCase(),navigator.userAgent.toLowerCase().indexOf("firefox")>-1)t.setState({exportUrl:r,exportFilename:o,exportOnClick:function(){setTimeout((function(){window.URL.revokeObjectURL(r)}),100),t.setState({exportUrl:null,exportFilename:null})}});else{var i=document.createElement("a");i.href=r,i.download=o,i.click(),setTimeout((function(){window.URL.revokeObjectURL(r)}),100)}}))}},{key:"render",value:function(){var e=this,t=this.props,n=t.pydio,i=t.disableExport,a=t.muiTheme,l=t.focus,s=AdminComponents.AdminStyles(a.palette),c=Se(a),u=this.state,d=u.filter,p=u.date,f=u.dateShow,m=u.endDate,h=u.endDateShow,y=u.serviceFilter,g=u.serviceFilterShow,b=u.level,v=void 0===b?"":b,S=u.levelShow,O=u.userName,w=u.userNameShow,j=u.remoteAddress,E=u.remoteAddressShow,x=u.exportUrl,C=u.exportFilename,P=u.exportOnClick,k=u.serverOffset,T=u.timeOffset,R=n.MessageHash,D=d||y||p||m||v||O||j,_=r().createElement(o.FontIcon,{style:{top:0,fontSize:20},className:"mdi mdi-check"}),I=R["ajxp_admin.logs.level.exact"],L=R["ajxp_admin.logs.level.greaterthan"];return r().createElement("div",{style:{display:"flex",alignItems:"center",width:"100%"}},l&&r().createElement("div",{style:{backgroundColor:"#FBE9E7",height:35,lineHeight:"35px",fontSize:15,padding:"0 10px",marginRight:5,color:"#FF5722",borderRadius:3}},"Focus on +/- 5 minutes at ",Oe(new Date(1e3*(l+T))).format("HH:mm:ss")),r().createElement("div",{style:{marginRight:5,width:170}},r().createElement(be,{hintText:R["ajxp_admin.logs.3"],onChange:function(t,n){return e.handleFilterChange(n,"filter")},fullWidth:!0})),S&&r().createElement("div",{style:{marginRight:5,marginTop:-2,width:200}},r().createElement(ve,{hintText:R["ajxp_admin.logs.level"],fullWidth:!0,value:v,onChange:function(t,n,r){return e.handleFilterChange(r,"level")}},r().createElement(o.MenuItem,{primaryText:""}),r().createElement(o.MenuItem,{primaryText:"ERROR",value:"ERROR",innerDivStyle:{color:"#E53935",fontWeight:500,fontSize:14}}),r().createElement(o.MenuItem,{primaryText:"WARN "+I,value:"WARN",innerDivStyle:{color:"#FB8C00",fontWeight:500,fontSize:14}}),r().createElement(o.MenuItem,{primaryText:"WARN "+L,value:"{"use strict";var e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{Dashboard:()=>De,LogTools:()=>we});const n=require("react");var r=e.n(n);const o=require("material-ui"),i=require("prop-types");var a=e.n(i);const l=require("pydio/model/data-model");var s=e.n(l);const c=require("pydio");var u=e.n(c);const d=require("pydio/lang/observable");var p=e.n(d);const f=require("pydio/http/api");var m=e.n(f);const h=require("pydio/http/resources-manager");var y=e.n(h);const g=require("cells-sdk");function b(e){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},b(e)}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n6&&void 0!==arguments[6]?arguments[6]:void 0,l=[];if(e&&l.push('+Msg:"*'+e+'*"'),t&&l.push("+Logger:*"+t+"*"),n)if(0===n.indexOf("<")){var s=j.indexOf(n.replace("<","")),c=j.filter((function(e,t){return t<=s})).map((function(e){return"Level:"+e}));l.push.apply(l,function(e){return function(e){if(Array.isArray(e))return v(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return v(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?v(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(c))}else l.push("+Level:"+n);if(r&&l.push("+RemoteAddress:*"+r+"*"),o&&l.push("+UserName:*"+o+"*"),i){var u=i,d=new Date(u);a?d=a:d.setDate(u.getDate()+1),l.push("+Ts:>"+Math.floor(u/1e3)),l.push("+Ts:<"+Math.floor(d/1e3))}return l.join(" ")}},{key:"buildTsQuery",value:function(e,t){var n=[];return n.push("+Ts:>"+(e-60*t)),n.push("+Ts:<"+(e+60*t)),n.join(" ")}},{key:"loadLogs",value:function(e,t,n,r,o){var i=new g.LogListLogRequest;return i.Query=t,i.Page=n,i.Size=r,i.Format=g.ListLogRequestLogFormat.constructFromObject(o),"syslog"===e?new g.LogServiceApi(m().getRestClient()).syslog(i):"audit"===e?y().loadClass("EnterpriseSDK").then((function(e){return new e.EnterpriseLogServiceApi(m().getRestClient()).audit(i)})):Promise.reject("Unknown service name, must be 'syslog' or 'audit'")}},{key:"downloadLogs",value:function(e,t,n){var r=new g.LogListLogRequest;return r.Query=t,r.Page=0,r.Size=1e5,r.Format=g.ListLogRequestLogFormat.constructFromObject(n),a.auditExportWithHttpInfo(r,e).then((function(e){return e.response.body}))}},{key:"auditExportWithHttpInfo",value:function(e,t){var n=e;if(null==e)throw new Error("Missing the required parameter 'body' when calling auditExport");return m().getRestClient().callApi("/log/"+t+"/export","POST",{},{},{},{},n,[],["application/json"],["application/json"],"Blob")}}],null&&S(t.prototype,null),n&&S(t,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(p());const x=require("react-dom");var C=e.n(x);const P=require("clipboard");var k=e.n(P);function T(e){return T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},T(e)}function R(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function D(e){for(var t=1;t0&&r().createElement(n.Fragment,null,r().createElement(o.Divider,{style:b.divider}),Object.keys(O).map((function(e){return r().createElement(q,{iconClassName:"mdi mdi-tag",legend:e,data:O[e]})}))))}}]),i}(r().Component);function H(e){return H="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},H(e)}function J(){return J=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:null;t&&e.setHours(t.getHours(),t.getMinutes());var n=this.state,r=n.endDate;if(n.endDateShow&&!r&&void 0!==e){var o=new Date;o.setHours(23,59,59),this.setState({endDate:o})}this.setState({date:e,page:0},this.publishStateChange.bind(this))}},{key:"handleEndDateChange",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;t&&e.setHours(t.getHours(),t.getMinutes()),this.setState({endDate:e,page:0},this.publishStateChange.bind(this))}},{key:"handleExport",value:function(e){var t=this,n=this.state,r=n.filter,o=n.serviceFilter,i=n.level,a=n.remoteAddress,l=n.userName,s=n.date,c=n.endDate,u=this.props.service,d=s?s.getFullYear()+"-"+(s.getMonth()+1)+"-"+s.getDate():"",p=E.buildQuery(r,o,i,a,l,s,c);E.downloadLogs(u||"sys",p,e).then((function(n){var r=window.URL.createObjectURL(n),o="cells-logs-";if(o+=d||"filtered",o+="."+e.toLowerCase(),navigator.userAgent.toLowerCase().indexOf("firefox")>-1)t.setState({exportUrl:r,exportFilename:o,exportOnClick:function(){setTimeout((function(){window.URL.revokeObjectURL(r)}),100),t.setState({exportUrl:null,exportFilename:null})}});else{var i=document.createElement("a");i.href=r,i.download=o,i.click(),setTimeout((function(){window.URL.revokeObjectURL(r)}),100)}}))}},{key:"render",value:function(){var e=this,t=this.props,n=t.pydio,i=t.disableExport,a=t.muiTheme,l=t.focus,s=AdminComponents.AdminStyles(a.palette),c=Se(a),u=this.state,d=u.filter,p=u.date,f=u.dateShow,m=u.endDate,h=u.endDateShow,y=u.serviceFilter,g=u.serviceFilterShow,b=u.level,v=void 0===b?"":b,S=u.levelShow,O=u.userName,w=u.userNameShow,j=u.remoteAddress,E=u.remoteAddressShow,x=u.exportUrl,C=u.exportFilename,P=u.exportOnClick,k=u.serverOffset,T=u.timeOffset,R=n.MessageHash,D=d||y||p||m||v||O||j,_=r().createElement(o.FontIcon,{style:{top:0,fontSize:20},className:"mdi mdi-check"}),I=R["ajxp_admin.logs.level.exact"],L=R["ajxp_admin.logs.level.greaterthan"];return r().createElement("div",{style:{display:"flex",alignItems:"center",width:"100%"}},l&&r().createElement("div",{style:{backgroundColor:"#FBE9E7",height:35,lineHeight:"35px",fontSize:15,padding:"0 10px",marginRight:5,color:"#FF5722",borderRadius:3}},"Focus on +/- 5 minutes at ",Oe(new Date(1e3*(l+T))).format("HH:mm:ss")),r().createElement("div",{style:{marginRight:5,width:170}},r().createElement(be,{hintText:R["ajxp_admin.logs.3"],onChange:function(t,n){return e.handleFilterChange(n,"filter")},fullWidth:!0})),S&&r().createElement("div",{style:{marginRight:5,marginTop:-2,width:200}},r().createElement(ve,{hintText:R["ajxp_admin.logs.level"],fullWidth:!0,value:v,onChange:function(t,n,r){return e.handleFilterChange(r,"level")}},r().createElement(o.MenuItem,{primaryText:""}),r().createElement(o.MenuItem,{primaryText:"ERROR",value:"ERROR",innerDivStyle:{color:"#E53935",fontWeight:500,fontSize:14}}),r().createElement(o.MenuItem,{primaryText:"WARN "+I,value:"WARN",innerDivStyle:{color:"#FB8C00",fontWeight:500,fontSize:14}}),r().createElement(o.MenuItem,{primaryText:"WARN "+L,value:" { - console.log(data); Pydio.endLoading(); const {logs, rootSpans} = this.initRootSpans(data.Logs); this.setState({logs, rootSpans, loading: false}, () => {