All Downloads are FREE. Search and download functionalities are using the official Maven repository.

data.static.js.main.1bf81063.chunk.js Maven / Gradle / Ivy

(this.webpackJsonpdata=this.webpackJsonpdata||[]).push([[0],{100:function(e,t,r){},173:function(e,t,r){"use strict";r.r(t);var a=r(0),n=r.n(a),o=r(15),c=r.n(o),l=(r(98),r(99),r(100),r(18)),i=r(19),u=r(25),s=r(20),f=r(21),p=r(12),h=r(83),d=r.n(h),m=r(182),y=r(174),b=r(175),v=r(176),g=r(177),w=r(178),E=r(179);var j=function(e){Object(s.a)(r,e);var t=function(e){function t(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var r,a=Object(p.a)(e);if(t()){var n=Object(p.a)(this).constructor;r=Reflect.construct(a,arguments,n)}else r=a.apply(this,arguments);return Object(f.a)(this,r)}}(r);function r(){return Object(l.a)(this,r),t.apply(this,arguments)}return Object(i.a)(r,[{key:"storeSelected",value:function(e){this.props.root.setState({store:e.toUpperCase()})}},{key:"render",value:function(){var e=this,t=this.props.root.state.store,r=t.substring(0,1)+t.substring(1).toLowerCase();return n.a.createElement(m.a,{inverse:!0,fluid:!0,fixedTop:!0},n.a.createElement(m.a.Header,null,n.a.createElement(m.a.Brand,{pullLeft:!0},n.a.createElement("a",{href:"/"},"Prompto Data Explorer"))),n.a.createElement(y.a,{pullRight:!0},n.a.createElement(b.a,{title:"Tools"},n.a.createElement(v.a,{href:"/",target:"ProjectExplorer"},"Project explorer"),n.a.createElement(v.a,{href:"/stores/index.page",target:"StoreExplorer"},"Store explorer"),n.a.createElement(v.a,{href:"/logs/index.page",target:"LogsExplorer"},"Logs explorer")),n.a.createElement(b.a,{title:"Help"},n.a.createElement(v.a,{href:"http://www.prompto.org/?section=tutorials",target:"PromptoTutorials"},"Tutorials"),n.a.createElement(v.a,{href:"http://www.prompto.org/?section=libraries",target:"PromptoReference"},"Reference"))),n.a.createElement(m.a.Form,{pullLeft:!0},n.a.createElement(g.a,null,n.a.createElement(w.a,{id:"store-type-label"},"Store:\xa0"),n.a.createElement(E.a,{id:"store-type",title:r},["Data","Apps","Login"].map((function(r){return n.a.createElement(v.a,{key:r,eventKey:r,active:t===r.toUpperCase(),onSelect:e.storeSelected.bind(e)},r)}),this)))))}}]),r}(n.a.Component),R=r(183),O=r(44),x=r(184),P=r(180);var D=function(e){Object(s.a)(r,e);var t=function(e){function t(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var r,a=Object(p.a)(e);if(t()){var n=Object(p.a)(this).constructor;r=Reflect.construct(a,arguments,n)}else r=a.apply(this,arguments);return Object(f.a)(this,r)}}(r);function r(){return Object(l.a)(this,r),t.apply(this,arguments)}return Object(i.a)(r,[{key:"render",value:function(){var e=this,t=this.props.root.state,r=1+(t.page-1)*t.rowsPerPage,a=r+t.rowsPerPage-1;a>t.totalRows&&(a=t.totalRows);var o=1+Math.trunc((t.totalRows-1)/t.rowsPerPage),c=o>7&&t.page>4,l=o>7&&o-t.page>3;return n.a.createElement(m.a,{id:"query-area",fluid:!0},n.a.createElement(g.a,null,n.a.createElement(w.a,null,"Query:"),n.a.createElement(R.a,{componentClass:"textarea",placeholder:"Input your query here",value:t.query,onChange:function(t){return e.props.root.setState({query:t.target.value})}})),n.a.createElement(m.a.Form,{pullLeft:!0},n.a.createElement(O.a,{onClick:function(){return e.props.root.fetchPage(1)}},"Fetch")),o>1&&n.a.createElement(m.a.Form,{pullLeft:!0},n.a.createElement(x.a,{style:{margin:0},activePage:t.page,items:o,maxButtons:7,first:c,last:l,ellipsis:!1,onSelect:function(t){return e.props.root.fetchPage(t)}})),t.totalRows>0&&n.a.createElement(m.a.Text,null,"Records "+r+" to "+a+" of "+t.totalRows),n.a.createElement(m.a.Form,{pullRight:!0},n.a.createElement(P.a,{style:{marginTop:"7px"},checked:t.showDbId,onChange:function(t){return e.props.root.showHideDbId(t.currentTarget.checked)},inline:!0},"Show dbId")))}}]),r}(n.a.Component),k=r(87);var S=function(e){Object(s.a)(r,e);var t=function(e){function t(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var r,a=Object(p.a)(e);if(t()){var n=Object(p.a)(this).constructor;r=Reflect.construct(a,arguments,n)}else r=a.apply(this,arguments);return Object(f.a)(this,r)}}(r);function r(){return Object(l.a)(this,r),t.apply(this,arguments)}return Object(i.a)(r,[{key:"render",value:function(){return n.a.createElement(k.a,{style:{marginLeft:"10px"}},n.a.createElement("h3",null,this.props.message))}}]),r}(n.a.Component),I=r(181);var C=function(e){Object(s.a)(r,e);var t=function(e){function t(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var r,a=Object(p.a)(e);if(t()){var n=Object(p.a)(this).constructor;r=Reflect.construct(a,arguments,n)}else r=a.apply(this,arguments);return Object(f.a)(this,r)}}(r);function r(){return Object(l.a)(this,r),t.apply(this,arguments)}return Object(i.a)(r,[{key:"render",value:function(){this.row=0;var e=this.props.root.state,t=Object.getOwnPropertyNames(e.headers);return n.a.createElement(I.a,{id:"rows-table",striped:!0},n.a.createElement("thead",null,n.a.createElement("tr",null,t.map((function(e){return n.a.createElement("th",{key:e},e)})))),n.a.createElement("tbody",null,e.rows.map(this.renderRow,this)))}},{key:"renderRow",value:function(e){var t=0;return n.a.createElement("tr",{key:this.row++},e.map((function(e){return n.a.createElement("td",{key:t++},e)})))}}]),r}(n.a.Component);var T=function(e){Object(s.a)(r,e);var t=function(e){function t(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var r,a=Object(p.a)(e);if(t()){var n=Object(p.a)(this).constructor;r=Reflect.construct(a,arguments,n)}else r=a.apply(this,arguments);return Object(f.a)(this,r)}}(r);function r(e){var a;return Object(l.a)(this,r),(a=t.call(this,e)).state={query:"",store:"DATA",headers:null,rows:null,totalRows:0,page:1,rowsPerPage:25,showDbId:!1,error:"No data"},a.fetchPage=a.fetchPage.bind(Object(u.a)(a)),a.fetchFailed=a.fetchFailed.bind(Object(u.a)(a)),a.dataFetched=a.dataFetched.bind(Object(u.a)(a)),a.showHideDbIdColumn=a.showHideDbIdColumn.bind(Object(u.a)(a)),a.showHideDbId=a.showHideDbId.bind(Object(u.a)(a)),a.extractValue=a.extractValue.bind(Object(u.a)(a)),a}return Object(i.a)(r,[{key:"fetchPage",value:function(e){var t=this,r=1+(e-1)*this.state.rowsPerPage,a=r+this.state.rowsPerPage-1;if("NaN"!==r.toString()&&"NaN"!==a.toString()){var n=new URLSearchParams;n.append("format","list"),n.append("store",this.state.store),n.append("first",r),n.append("last",a),n.append("query",this.state.query),d.a.get("/ws/data/fetch",{params:n,responseType:"json"}).then((function(r){return t.dataFetched(r.data,e)})).catch(this.fetchFailed)}else alert("Internal error")}},{key:"dataFetched",value:function(e,t){if(e.error)this.setState({error:e.error,headers:null,rows:null});else{var r=e.data.value;if(0===r.length)this.setState({error:"No data",headers:null,rows:null});else{var a={category:"Text",dbId:this.extractType(r[0].value.dbId)},n=this.extractRows(a,r);this.setState({error:null,headers:a,rows:n,totalRows:e.data.totalLength,page:t},this.showHideDbIdColumn)}}}},{key:"showHideDbId",value:function(e){this.setState({showDbId:e},this.showHideDbIdColumn)}},{key:"showHideDbIdColumn",value:function(){var e=this.state.showDbId?"table-cell":"None",t=document.getElementById("rows-table");if(t){var r=t.getElementsByTagName("tr");Array.from(r).forEach((function(t){return t.children[1].style.display=e}))}}},{key:"extractRows",value:function(e,t){var r=this;return t.map((function(t){var a=[t.type];for(var n in e)if("category"!==n){var o=t.value[n];delete t.value[n],"Any"===e[n]&&(e[n]=r.extractType(o)),o=r.extractValue(e[n],o),a.push(o)}for(var c in t.value){var l=t.value[c];e[c]=r.extractType(l),l=r.extractValue(e[c],l),a.push(l)}return a}),this)}},{key:"extractValue",value:function(e,t){var r=this;return void 0===t?"":null==t?"null":Array.isArray(t)?(e.endsWith("[]")&&(e=e.substring(0,e.length()-2)),"["+t.map((function(t){return r.extractValue(e,t)}))+"]"):t instanceof Object?t.name?t.name:void 0===(t=t.value)?"":t instanceof Object?JSON.stringify(t.value):t:"Decimal"===e?Number(t).toFixed(2):"Boolean"===e?t?"true":"false":t}},{key:"extractType",value:function(e){return e&&e.type?e.type:"string"===typeof e?"Text":"number"===typeof e?"Decimal":"number"===typeof e?"Integer":"boolean"===typeof e?"Boolean":"Any"}},{key:"fetchFailed",value:function(e){alert(e)}},{key:"render",value:function(){return n.a.createElement("div",null,n.a.createElement(j,{root:this}),n.a.createElement(D,{id:"data-container",root:this}),this.state.error&&n.a.createElement(S,{message:this.state.error}),null===this.state.error&&n.a.createElement(C,{root:this}))}}]),r}(n.a.Component);Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));c.a.render(n.a.createElement(T,null),document.getElementById("root")),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((function(e){e.unregister()}))},93:function(e,t,r){e.exports=r(173)}},[[93,1,2]]]);
//# sourceMappingURL=main.1bf81063.chunk.js.map




© 2015 - 2025 Weber Informatics LLC | Privacy Policy