csudijo/web/admin/static/js/main.8eee9a34.chunk.js.map
2023-10-03 07:57:37 +02:00

1 line
12 KiB
Plaintext

{"version":3,"sources":["ResultRow.js","App.js","serviceWorker.js","index.js"],"names":["ValueTable","props","data","fields","Object","keys","react_default","a","createElement","className","map","field","key","row","index","ResultRow","Row","Col","xs","title","ResultRow_ValueTable","value","App","state","lekerdezes","forgalom","etelNev","stat","sqlTasks","errors","_this2","this","axios","get","then","res","setState","fetchStat","catch","err","concat","toConsumableArray","description","console","error","_this3","forEach","task","adminPage","id","log","sort","b","JSON","stringify","Container","src_ResultRow","Component","Boolean","window","location","hostname","match","ReactDOM","render","src_App","document","getElementById","navigator","serviceWorker","ready","registration","unregister"],"mappings":"mSAgBMA,SAAa,SAAAC,GACjB,IAAMC,EAAOD,EAAMC,KACbC,EAASC,OAAOC,KAAKH,EAAK,IAChC,OACEI,EAAAC,EAAAC,cAAA,SAAOC,UAAU,uBACfH,EAAAC,EAAAC,cAAA,aACEF,EAAAC,EAAAC,cAAA,UACGL,EAAOO,IAAI,SAACC,EAAOC,GAAR,OACVN,EAAAC,EAAAC,cAAA,MAAII,IAAKA,GAAMD,OAIrBL,EAAAC,EAAAC,cAAA,aACGN,EAAKQ,IAAI,SAACG,EAAKC,GAAN,OACRR,EAAAC,EAAAC,cAAA,MAAII,IAAKE,GACNX,EAAOO,IAAI,SAACC,EAAOC,GAAR,OACVN,EAAAC,EAAAC,cAAA,MAAII,IAAKA,GAAMV,EAAKY,GAAOH,aAS1BI,EAtCG,SAAAd,GAChB,OACEK,EAAAC,EAAAC,cAACQ,EAAA,EAAD,CAAKP,UAAU,OACbH,EAAAC,EAAAC,cAACS,EAAA,EAAD,CAAKC,GAAG,KAAKT,UAAU,+BACpBR,EAAMkB,OAETb,EAAAC,EAAAC,cAACS,EAAA,EAAD,CAAKC,GAAG,KAAKT,UAAU,gBACrBH,EAAAC,EAAAC,cAACY,EAAD,CAAYT,MAAOV,EAAMU,MAAOU,MAAOpB,EAAMoB,MAAO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cAAC+C,EAAA,EAAD,CAAW9C,UAAU,QACnBH,EAAAC,EAAAC,cAACQ,EAAA,EAAD,KACEV,EAAAC,EAAAC,cAACS,EAAA,EAAD,KACEX,EAAAC,EAAAC,cAAA,MAAIC,UAAU,eAAd,yDAIFsB,KAAKR,MAAMI,KAAKjB,IAAI,SAACiB,EAAMf,GACzB,OACEN,EAAAC,EAAAC,cAACgD,EAAD,CACErC,MAAOQ,EAAKsB,GAAK,KAAOtB,EAAKe,YAC7B/B,MAAOP,OAAOC,KAAKsB,EAAKzB,KAAK,IAAI,GACjCmB,MAAOM,EAAKzB,KAAK,GAAGE,OAAOC,KAAKsB,EAAKzB,KAAK,IAAI,IAC9CA,KAAMyB,EAAKzB,KACXU,IAAKA,eA7DL6C,aCMEC,QACW,cAA7BC,OAAOC,SAASC,UAEe,UAA7BF,OAAOC,SAASC,UAEhBF,OAAOC,SAASC,SAASC,MACvB,2DCXNC,IAASC,OAAO1D,EAAAC,EAAAC,cAACyD,EAAD,MAASC,SAASC,eAAe,SD0H3C,kBAAmBC,WACrBA,UAAUC,cAAcC,MAAMpC,KAAK,SAAAqC,GACjCA,EAAaC","file":"static/js/main.8eee9a34.chunk.js","sourcesContent":["import React from 'react'\r\nimport { Row, Col } from 'reactstrap'\r\n\r\nconst ResultRow = props => {\r\n return (\r\n <Row className='m-1'>\r\n <Col xs='12' className='text-white bg-secondary p-2'>\r\n {props.title}\r\n </Col>\r\n <Col xs='12' className='bg-light p-2'>\r\n <ValueTable field={props.field} value={props.value} data={props.data} />\r\n </Col>\r\n </Row>\r\n )\r\n}\r\n\r\nconst ValueTable = props => {\r\n const data = props.data\r\n const fields = Object.keys(data[0])\r\n return (\r\n <table className='table table-striped'>\r\n <thead>\r\n <tr>\r\n {fields.map((field, key) => (\r\n <th key={key}>{field}</th>\r\n ))}\r\n </tr>\r\n </thead>\r\n <tbody>\r\n {data.map((row, index) => (\r\n <tr key={index}>\r\n {fields.map((field, key) => (\r\n <td key={key}>{data[index][field]}</td>\r\n ))}\r\n </tr>\r\n ))}\r\n </tbody>\r\n </table>\r\n )\r\n}\r\n\r\nexport default ResultRow\r\n\r\n// <NumberFormat value={props.value} displayType=\"text\" thousandSeparator=\" \"></NumberFormat>{\" Ft\"}\r\n\r\n/* field={Object.keys(stat.data[0])[0]}\r\nvalue={stat.data[0][Object.keys(stat.data[0])[0]]}\r\ndata={stat.data}\r\nkey={key}\r\n{data[0].map((value, key) =>\r\n\t<td>{value}</td>\r\n)} */\r\n","import React, { Component } from 'react'\nimport { Container, Row, Col } from 'reactstrap'\nimport axios from 'axios'\nimport NumberFormat from 'react-number-format'\nimport ResultRow from './ResultRow'\n\nclass App extends Component {\n \n state = {\n lekerdezes: [],\n forgalom: \"\",\n etelNev: \"\",\n stat: [],\n sqlTasks: [],\n errors: []\n }\n \n componentDidMount() {\n axios.get(`http://localhost:8000/api/sqltasks`)\n .then(res => {\n const sqlTasks = res.data\n this.setState({sqlTasks}, () => {\n this.fetchStat()\n })\n })\n .catch(err => {\n const errors = [...this.state.errors, {description: \"Hiba: a lekérdezések definícióját nem sikerült lekérni a szerverről!\"}]\n this.setState({errors})\n console.error(this.state.errors)\n })\n\n }\n \n fetchStat() {\n const gets = this.state.sqlTasks.forEach(task => {\n if (task.adminPage) {\n axios.get(`http://localhost:8000/api/lekerdezes/`+task.id)\n .then(res => {\n console.log(task.id)\n const stat = [...this.state.stat, {id: task.id, description: task.description, data: res.data}]\n this.setState({stat: stat.sort((a, b) => a.id - b.id)}, () => console.log(JSON.stringify(this.state.stat)))\n })\n .catch(err => {\n const stat = [...this.state.stat, {id: task.id, description: task.description, data: [{error: \"Hiba: A lekérdezés nem hajtható végre!\"}]}]\n this.setState({stat})\n })\n }\n })\n }\n\n render() {\n return (\n <div className=\"App\">\n <Container className=\"mt-5\">\n <Row>\n <Col>\n <h1 className=\"text-center\">Csudijó Étterem - Adminisztrációs oldal</h1>\n </Col>\n </Row> \n {\n this.state.stat.map((stat, key) => {\n return (\n <ResultRow \n title={stat.id + \". \" + stat.description} \n field={Object.keys(stat.data[0])[0]}\n value={stat.data[0][Object.keys(stat.data[0])[0]]}\n data={stat.data}\n key={key}\n />\n \n )\n })\n } \n </Container>\n </div>\n );\n }\n}\n\nexport default App\n","// This optional code is used to register a service worker.\n// register() is not called by default.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on subsequent visits to a page, after all the\n// existing tabs open on the page have been closed, since previously cached\n// resources are updated in the background.\n\n// To learn more about the benefits of this model and instructions on how to\n// opt-in, read https://bit.ly/CRA-PWA\n\nconst isLocalhost = Boolean(\n window.location.hostname === 'localhost' ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === '[::1]' ||\n // 127.0.0.1/8 is considered localhost for IPv4.\n window.location.hostname.match(\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\n )\n);\n\nexport function register(config) {\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n // The URL constructor is available in all browsers that support SW.\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\n if (publicUrl.origin !== window.location.origin) {\n // Our service worker won't work if PUBLIC_URL is on a different origin\n // from what our page is served on. This might happen if a CDN is used to\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\n return;\n }\n\n window.addEventListener('load', () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\n\n if (isLocalhost) {\n // This is running on localhost. Let's check if a service worker still exists or not.\n checkValidServiceWorker(swUrl, config);\n\n // Add some additional logging to localhost, pointing developers to the\n // service worker/PWA documentation.\n navigator.serviceWorker.ready.then(() => {\n console.log(\n 'This web app is being served cache-first by a service ' +\n 'worker. To learn more, visit https://bit.ly/CRA-PWA'\n );\n });\n } else {\n // Is not localhost. Just register service worker\n registerValidSW(swUrl, config);\n }\n });\n }\n}\n\nfunction registerValidSW(swUrl, config) {\n navigator.serviceWorker\n .register(swUrl)\n .then(registration => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n if (installingWorker == null) {\n return;\n }\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the updated precached content has been fetched,\n // but the previous service worker will still serve the older\n // content until all client tabs are closed.\n console.log(\n 'New content is available and will be used when all ' +\n 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'\n );\n\n // Execute callback\n if (config && config.onUpdate) {\n config.onUpdate(registration);\n }\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n console.log('Content is cached for offline use.');\n\n // Execute callback\n if (config && config.onSuccess) {\n config.onSuccess(registration);\n }\n }\n }\n };\n };\n })\n .catch(error => {\n console.error('Error during service worker registration:', error);\n });\n}\n\nfunction checkValidServiceWorker(swUrl, config) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl)\n .then(response => {\n // Ensure service worker exists, and that we really are getting a JS file.\n const contentType = response.headers.get('content-type');\n if (\n response.status === 404 ||\n (contentType != null && contentType.indexOf('javascript') === -1)\n ) {\n // No service worker found. Probably a different app. Reload the page.\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister().then(() => {\n window.location.reload();\n });\n });\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl, config);\n }\n })\n .catch(() => {\n console.log(\n 'No internet connection found. App is running in offline mode.'\n );\n });\n}\n\nexport function unregister() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister();\n });\n }\n}\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.css';\nimport 'bootstrap/dist/css/bootstrap.min.css'\nimport App from './App';\nimport * as serviceWorker from './serviceWorker';\n\nReactDOM.render(<App />, document.getElementById('root'));\n\n// If you want your app to work offline and load faster, you can change\n// unregister() to register() below. Note this comes with some pitfalls.\n// Learn more about service workers: https://bit.ly/CRA-PWA\nserviceWorker.unregister();\n"],"sourceRoot":""}