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

data.static.js.main.5470a03b.chunk.js Maven / Gradle / Ivy

(this.webpackJsonpdata=this.webpackJsonpdata||[]).push([[0],{172:function(e,t,a){"use strict";a.r(t);var r=a(0),n=a.n(r),o=a(14),l=a.n(o),s=(a(97),a(98),a(99),a(17)),i=a(18),c=a(24),u=a(20),h=a(19),p=a(82),d=a.n(p),m=a(181),f=a(173),b=a(174),y=a(175),g=a(176),v=a(177),w=a(178),E=function(e){Object(u.a)(a,e);var t=Object(h.a)(a);function a(){return Object(s.a)(this,a),t.apply(this,arguments)}return Object(i.a)(a,[{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,a=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(f.a,{pullRight:!0},n.a.createElement(b.a,{title:"Tools"},n.a.createElement(y.a,{href:"/",target:"ProjectExplorer"},"Project explorer"),n.a.createElement(y.a,{href:"/stores/index.page",target:"StoreExplorer"},"Store explorer"),n.a.createElement(y.a,{href:"/logs/index.page",target:"LogsExplorer"},"Logs explorer")),n.a.createElement(b.a,{title:"Help"},n.a.createElement(y.a,{href:"http://www.prompto.org/?section=tutorials",target:"PromptoTutorials"},"Tutorials"),n.a.createElement(y.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(v.a,{id:"store-type-label"},"Store:\xa0"),n.a.createElement(w.a,{id:"store-type",title:a},["Data","Apps","Login"].map((function(a){return n.a.createElement(y.a,{key:a,eventKey:a,active:t===a.toUpperCase(),onSelect:e.storeSelected.bind(e)},a)}),this)))))}}]),a}(n.a.Component),j=a(182),x=a(43),O=a(183),k=a(179),P=function(e){Object(u.a)(a,e);var t=Object(h.a)(a);function a(){return Object(s.a)(this,a),t.apply(this,arguments)}return Object(i.a)(a,[{key:"render",value:function(){var e=this,t=this.props.root.state,a=1+(t.page-1)*t.rowsPerPage,r=a+t.rowsPerPage-1;r>t.totalRows&&(r=t.totalRows);var o=1+Math.trunc((t.totalRows-1)/t.rowsPerPage),l=o>7&&t.page>4,s=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(v.a,null,"Query:"),n.a.createElement(j.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(x.a,{onClick:function(){return e.props.root.fetchPage(1)}},"Fetch")),o>1&&n.a.createElement(m.a.Form,{pullLeft:!0},n.a.createElement(O.a,{style:{margin:0},activePage:t.page,items:o,maxButtons:7,first:l,last:s,ellipsis:!1,onSelect:function(t){return e.props.root.fetchPage(t)}})),t.totalRows>0&&n.a.createElement(m.a.Text,null,"Records "+a+" to "+r+" of "+t.totalRows),n.a.createElement(m.a.Form,{pullRight:!0},n.a.createElement(k.a,{style:{marginTop:"7px"},checked:t.showDbId,onChange:function(t){return e.props.root.showHideDbId(t.currentTarget.checked)},inline:!0},"Show dbId")))}}]),a}(n.a.Component),I=a(86),D=function(e){Object(u.a)(a,e);var t=Object(h.a)(a);function a(){return Object(s.a)(this,a),t.apply(this,arguments)}return Object(i.a)(a,[{key:"render",value:function(){return n.a.createElement(I.a,{style:{marginLeft:"10px"}},n.a.createElement("h3",null,this.props.message))}}]),a}(n.a.Component),S=a(180),C=function(e){Object(u.a)(a,e);var t=Object(h.a)(a);function a(){return Object(s.a)(this,a),t.apply(this,arguments)}return Object(i.a)(a,[{key:"render",value:function(){this.row=0;var e=this.props.root.state,t=Object.getOwnPropertyNames(e.headers);return n.a.createElement(S.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)})))}}]),a}(n.a.Component),R=function(e){Object(u.a)(a,e);var t=Object(h.a)(a);function a(e){var r;return Object(s.a)(this,a),(r=t.call(this,e)).state={query:"",store:"DATA",headers:null,rows:null,totalRows:0,page:1,rowsPerPage:25,showDbId:!1,error:"No data"},r.fetchPage=r.fetchPage.bind(Object(c.a)(r)),r.fetchFailed=r.fetchFailed.bind(Object(c.a)(r)),r.dataFetched=r.dataFetched.bind(Object(c.a)(r)),r.showHideDbIdColumn=r.showHideDbIdColumn.bind(Object(c.a)(r)),r.showHideDbId=r.showHideDbId.bind(Object(c.a)(r)),r.extractValue=r.extractValue.bind(Object(c.a)(r)),r}return Object(i.a)(a,[{key:"fetchPage",value:function(e){var t=this,a=1+(e-1)*this.state.rowsPerPage,r=a+this.state.rowsPerPage-1;if("NaN"!==a.toString()&&"NaN"!==r.toString()){var n=new URLSearchParams;n.append("format","list"),n.append("store",this.state.store),n.append("first",a),n.append("last",r),n.append("query",this.state.query),d.a.get("/ws/data/fetch",{params:n,responseType:"json"}).then((function(a){return t.dataFetched(a.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 a=e.data.value;if(0===a.length)this.setState({error:"No data",headers:null,rows:null});else{var r={category:"Text",dbId:this.extractType(a[0].value.dbId)},n=this.extractRows(r,a);this.setState({error:null,headers:r,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 a=t.getElementsByTagName("tr");Array.from(a).forEach((function(t){return t.children[1].style.display=e}))}}},{key:"extractRows",value:function(e,t){var a=this;return t.map((function(t){var r=[t.type];for(var n in e)if("category"!==n){var o=t.value[n];delete t.value[n],"Any"===e[n]&&(e[n]=a.extractType(o)),o=a.extractValue(e[n],o),r.push(o)}for(var l in t.value){var s=t.value[l];e[l]=a.extractType(s),s=a.extractValue(e[l],s),r.push(s)}return r}),this)}},{key:"extractValue",value:function(e,t){var a=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 a.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(E,{root:this}),n.a.createElement(P,{id:"data-container",root:this}),this.state.error&&n.a.createElement(D,{message:this.state.error}),null===this.state.error&&n.a.createElement(C,{root:this}))}}]),a}(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}$/));l.a.render(n.a.createElement(R,null),document.getElementById("root")),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((function(e){e.unregister()}))},92:function(e,t,a){e.exports=a(172)},99:function(e,t,a){}},[[92,1,2]]]);
//# sourceMappingURL=main.5470a03b.chunk.js.map




© 2015 - 2025 Weber Informatics LLC | Privacy Policy