Commit 6a596d6e authored by Vladislav Gumerov's avatar Vladislav Gumerov

added address.js and server folder

parent 634aa460
MIT License
Copyright (c) 2019 Vlad Gumerov
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
{ {
"main.css": "/static/css/main.fc12b575.chunk.css", "main.css": "/static/css/main.fc12b575.chunk.css",
"main.js": "/static/js/main.26f36514.chunk.js", "main.js": "/static/js/main.8c610268.chunk.js",
"main.js.map": "/static/js/main.26f36514.chunk.js.map", "main.js.map": "/static/js/main.8c610268.chunk.js.map",
"static/js/1.41eb0558.chunk.js": "/static/js/1.41eb0558.chunk.js", "static/js/1.41eb0558.chunk.js": "/static/js/1.41eb0558.chunk.js",
"static/js/1.41eb0558.chunk.js.map": "/static/js/1.41eb0558.chunk.js.map", "static/js/1.41eb0558.chunk.js.map": "/static/js/1.41eb0558.chunk.js.map",
"runtime~main.js": "/static/js/runtime~main.229c360f.js", "runtime~main.js": "/static/js/runtime~main.229c360f.js",
"runtime~main.js.map": "/static/js/runtime~main.229c360f.js.map", "runtime~main.js.map": "/static/js/runtime~main.229c360f.js.map",
"static/css/main.fc12b575.chunk.css.map": "/static/css/main.fc12b575.chunk.css.map", "static/css/main.fc12b575.chunk.css.map": "/static/css/main.fc12b575.chunk.css.map",
"index.html": "/index.html", "index.html": "/index.html",
"precache-manifest.d7d8b6e8cd6d518875d47fc40cd59de4.js": "/precache-manifest.d7d8b6e8cd6d518875d47fc40cd59de4.js", "precache-manifest.75f058a22ef87f2d997369ce54540577.js": "/precache-manifest.75f058a22ef87f2d997369ce54540577.js",
"service-worker.js": "/service-worker.js" "service-worker.js": "/service-worker.js"
} }
\ No newline at end of file
<!doctype html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta http-equiv="X-UA-Compatible" content="ie=edge"><title>system-load</title><script src="../../system-load/src/js/index.js"></script><link href="/static/css/main.fc12b575.chunk.css" rel="stylesheet"></head><body><div id="root"></div><script>!function(l){function e(e){for(var r,t,n=e[0],o=e[1],u=e[2],f=0,i=[];f<n.length;f++)t=n[f],p[t]&&i.push(p[t][0]),p[t]=0;for(r in o)Object.prototype.hasOwnProperty.call(o,r)&&(l[r]=o[r]);for(s&&s(e);i.length;)i.shift()();return c.push.apply(c,u||[]),a()}function a(){for(var e,r=0;r<c.length;r++){for(var t=c[r],n=!0,o=1;o<t.length;o++){var u=t[o];0!==p[u]&&(n=!1)}n&&(c.splice(r--,1),e=f(f.s=t[0]))}return e}var t={},p={2:0},c=[];function f(e){if(t[e])return t[e].exports;var r=t[e]={i:e,l:!1,exports:{}};return l[e].call(r.exports,r,r.exports,f),r.l=!0,r.exports}f.m=l,f.c=t,f.d=function(e,r,t){f.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},f.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.t=function(r,e){if(1&e&&(r=f(r)),8&e)return r;if(4&e&&"object"==typeof r&&r&&r.__esModule)return r;var t=Object.create(null);if(f.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:r}),2&e&&"string"!=typeof r)for(var n in r)f.d(t,n,function(e){return r[e]}.bind(null,n));return t},f.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(r,"a",r),r},f.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},f.p="/";var r=window.webpackJsonp=window.webpackJsonp||[],n=r.push.bind(r);r.push=e,r=r.slice();for(var o=0;o<r.length;o++)e(r[o]);var s=n;a()}([])</script><script src="/static/js/1.41eb0558.chunk.js"></script><script src="/static/js/main.26f36514.chunk.js"></script></body></html> <!doctype html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta http-equiv="X-UA-Compatible" content="ie=edge"><title>system-load</title><script src="../../system-load/src/js/index.js"></script><link href="/static/css/main.fc12b575.chunk.css" rel="stylesheet"></head><body><div id="root"></div><script>!function(l){function e(e){for(var r,t,n=e[0],o=e[1],u=e[2],f=0,i=[];f<n.length;f++)t=n[f],p[t]&&i.push(p[t][0]),p[t]=0;for(r in o)Object.prototype.hasOwnProperty.call(o,r)&&(l[r]=o[r]);for(s&&s(e);i.length;)i.shift()();return c.push.apply(c,u||[]),a()}function a(){for(var e,r=0;r<c.length;r++){for(var t=c[r],n=!0,o=1;o<t.length;o++){var u=t[o];0!==p[u]&&(n=!1)}n&&(c.splice(r--,1),e=f(f.s=t[0]))}return e}var t={},p={2:0},c=[];function f(e){if(t[e])return t[e].exports;var r=t[e]={i:e,l:!1,exports:{}};return l[e].call(r.exports,r,r.exports,f),r.l=!0,r.exports}f.m=l,f.c=t,f.d=function(e,r,t){f.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},f.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.t=function(r,e){if(1&e&&(r=f(r)),8&e)return r;if(4&e&&"object"==typeof r&&r&&r.__esModule)return r;var t=Object.create(null);if(f.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:r}),2&e&&"string"!=typeof r)for(var n in r)f.d(t,n,function(e){return r[e]}.bind(null,n));return t},f.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(r,"a",r),r},f.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},f.p="/";var r=window.webpackJsonp=window.webpackJsonp||[],n=r.push.bind(r);r.push=e,r=r.slice();for(var o=0;o<r.length;o++)e(r[o]);var s=n;a()}([])</script><script src="/static/js/1.41eb0558.chunk.js"></script><script src="/static/js/main.8c610268.chunk.js"></script></body></html>
\ No newline at end of file \ No newline at end of file
...@@ -4,19 +4,19 @@ self.__precacheManifest = [ ...@@ -4,19 +4,19 @@ self.__precacheManifest = [
"url": "/static/js/runtime~main.229c360f.js" "url": "/static/js/runtime~main.229c360f.js"
}, },
{ {
"revision": "26f36514ffd0cf47e1ca", "revision": "8c6102683d12c7aeea81",
"url": "/static/js/main.26f36514.chunk.js" "url": "/static/js/main.8c610268.chunk.js"
}, },
{ {
"revision": "41eb055892f98c8d23d9", "revision": "41eb055892f98c8d23d9",
"url": "/static/js/1.41eb0558.chunk.js" "url": "/static/js/1.41eb0558.chunk.js"
}, },
{ {
"revision": "26f36514ffd0cf47e1ca", "revision": "8c6102683d12c7aeea81",
"url": "/static/css/main.fc12b575.chunk.css" "url": "/static/css/main.fc12b575.chunk.css"
}, },
{ {
"revision": "946bffc6dc422a0ca6bf6c1f81b9c557", "revision": "419ecadeecae4f5d54353e2770d5e7db",
"url": "/index.html" "url": "/index.html"
} }
]; ];
\ No newline at end of file
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
importScripts("https://storage.googleapis.com/workbox-cdn/releases/3.6.3/workbox-sw.js"); importScripts("https://storage.googleapis.com/workbox-cdn/releases/3.6.3/workbox-sw.js");
importScripts( importScripts(
"/precache-manifest.d7d8b6e8cd6d518875d47fc40cd59de4.js" "/precache-manifest.75f058a22ef87f2d997369ce54540577.js"
); );
workbox.clientsClaim(); workbox.clientsClaim();
......
(window.webpackJsonp=window.webpackJsonp||[]).push([[0],{25:function(e,t,a){e.exports=a(78)},31:function(e,t,a){},76:function(e,t,a){},78:function(e,t,a){"use strict";a.r(t);var n=a(0),i=a.n(n),o=a(24),r=a.n(o),s=(a(31),a(10)),l=a(11),c=a(13),u=a(12),m=a(14),d=function(e){function t(e){var a;Object(s.a)(this,t);var n=(a=Object(c.a)(this,Object(u.a)(t).call(this,e))).getData();return a.state={CPU:n.CPU,totalM:n.TotalMemory,freeM:n.FreeMemory,oneMin:n.oneMinute,fiveMin:n.fiveMinutes,fifteenMin:n.fifteenMinutes},a.changeData(),a}return Object(m.a)(t,e),Object(l.a)(t,[{key:"changeData",value:function(){var e=this;setInterval(function(){e.data=e.getData(),e.setState({CPU:e.data.CPU,totalM:e.data.TotalMemory,freeM:e.data.FreeMemory,oneMin:e.data.oneMinute,fiveMin:e.data.fiveMinutes,fifteenMin:e.data.fifteenMinutes})},2e3)}},{key:"getData",value:function(){var e=new XMLHttpRequest;if(e.open("GET","http://77.246.159.121/core/data.php",!1),e.send(),200==e.status)return JSON.parse(e.responseText);console.log(e.status)}},{key:"render",value:function(){return i.a.createElement("table",{className:"system-load-table"},i.a.createElement("tbody",null,i.a.createElement("tr",{className:"first_row"},i.a.createElement("th",null,"CPU"),i.a.createElement("th",null,"Total memory"),i.a.createElement("th",null,"Free memory"),i.a.createElement("th",null,"1 minute"),i.a.createElement("th",null,"5 minutes"),i.a.createElement("th",null,"15 minutes")),i.a.createElement("tr",{className:"second-row"},i.a.createElement("th",null,this.state.CPU,"%"),i.a.createElement("th",null,this.state.totalM.toFixed(2)+" \u041c\u0411"),i.a.createElement("th",null,this.state.freeM.toFixed(2)+" \u041c\u0411"),i.a.createElement("th",null,this.state.oneMin),i.a.createElement("th",null,this.state.fiveMin),i.a.createElement("th",null,this.state.fifteenMin))))}}]),t}(i.a.Component),h=a(15),f=a.n(h),b=function(e){function t(e){var a;Object(s.a)(this,t);var n=(a=Object(c.a)(this,Object(u.a)(t).call(this,e))).getData();return a.state={cpuData:[n.CPU],memoryData:[n.FreeMemory],timeData:[(new Date).toLocaleTimeString()],oneMinuteData:[n.oneMinute],fiveMinutesData:[n.fiveMinutes],fifteenMinutesData:[n.fifteenMinutes],data:n},a.changeCharts(),a}return Object(m.a)(t,e),Object(l.a)(t,[{key:"componentDidMount",value:function(){var e=document.getElementById("cpuChart").getContext("2d"),t=document.getElementById("memoryChart").getContext("2d"),a=document.getElementById("loadAverageChart").getContext("2d");this.cpuChart=new f.a(e,{type:"line",data:{labels:this.state.timeData,datasets:[{label:"CPU",backgroundColor:"rgba(255, 99, 132, 0.2)",borderColor:"rgb(255, 99, 132)",data:this.state.cpuData}]},options:{legend:{labels:{fontColor:"white",fontSize:18}},scales:{xAxes:[{gridLines:{color:"rgba(171,171,171,1)",lineWidth:.5},ticks:{fontColor:"white",fontSize:12}}],yAxes:[{gridLines:{color:"rgba(171,171,171,1)",lineWidth:.5},ticks:{fontColor:"white",fontSize:12,min:0,max:100,stepSize:20},scaleLabel:{display:!0,labelString:"PERCENTAGES",fontColor:"#c0c0c0"}}]}}}),this.memoryChart=new f.a(t,{type:"line",data:{labels:this.state.timeData,datasets:[{label:"Free memory",backgroundColor:"rgba(16, 115, 181, 0.2)",borderColor:"rgb(16, 115, 181)",data:this.state.memoryData}]},options:{legend:{labels:{fontColor:"white",fontSize:18}},scales:{xAxes:[{ticks:{fontColor:"white",fontSize:12},gridLines:{color:"rgba(171,171,171,1)",lineWidth:.5}}],yAxes:[{gridLines:{color:"rgba(171,171,171,1)",lineWidth:.5},ticks:{fontColor:"white",fontSize:12,min:0,max:this.state.data.TotalMemory,stepSize:this.state.data.TotalMemory/4},scaleLabel:{display:!0,labelString:"MEGABYTES",fontColor:"#c0c0c0"}}]}}}),this.loadAverageChart=new f.a(a,{type:"line",data:{labels:this.state.timeData,datasets:[{label:"1 minute",backgroundColor:"rgba(255, 99, 132, 0.05)",borderColor:"rgb(255, 99, 132)",data:this.state.oneMinuteData},{label:"5 minutes",backgroundColor:"rgba(65, 99, 222, 0.05)",borderColor:"rgb(65, 99, 222)",data:this.state.fiveMinutesData},{label:"15 minutes",backgroundColor:"rgba(145, 44, 132, 0.05)",borderColor:"rgb(145, 44, 132)",data:this.state.fifteenMinutesData}]},options:{legend:{labels:{fontColor:"white",fontSize:18}},scales:{xAxes:[{ticks:{fontColor:"white",fontSize:12},gridLines:{color:"rgba(171,171,171,1)",lineWidth:.5}}],yAxes:[{gridLines:{color:"rgba(171,171,171,1)",lineWidth:.5},ticks:{fontColor:"white",fontSize:12,min:0,stepSize:.5}}]}}})}},{key:"getData",value:function(){var e=new XMLHttpRequest;if(e.open("GET","http://77.246.159.121/core/data.php",!1),e.send(),200==e.status)return JSON.parse(e.responseText);console.log(e.status)}},{key:"changeCharts",value:function(){var e=this;setInterval(function(){e.data=e.getData(),e.state.timeData.length>=10&&(e.state.timeData.shift(),e.state.cpuData.shift(),e.state.memoryData.shift(),e.state.oneMinuteData.shift(),e.state.fiveMinutesData.shift(),e.state.fifteenMinutesData.shift()),e.state.cpuData.push(e.data.CPU/1),e.state.memoryData.push(e.data.FreeMemory.toFixed(2)),e.state.timeData.push((new Date).toLocaleTimeString()),e.state.oneMinuteData.push(e.data.oneMinute),e.state.fiveMinutesData.push(e.data.fiveMinutes),e.state.fifteenMinutesData.push(e.data.fifteenMinutes),e.loadAverageChart.update(),e.cpuChart.update(),e.memoryChart.update()},2e3)}},{key:"render",value:function(){return i.a.createElement("div",{className:"canvas-block"},i.a.createElement("div",{className:"cpu-and-memory-charts"},i.a.createElement("div",{className:"canvasCpu-block"},i.a.createElement("canvas",{id:"cpuChart"})),i.a.createElement("div",{className:"canvasMemory-block"},i.a.createElement("canvas",{id:"memoryChart"}))),i.a.createElement("div",{className:"loadAver"},i.a.createElement("canvas",{id:"loadAverageChart"})))}}]),t}(i.a.Component);a(76);var g=function(){return[i.a.createElement(d,null),i.a.createElement(b,null)]};r.a.render(i.a.createElement(g,null),document.getElementById("root"))}},[[25,2,1]]]);
//# sourceMappingURL=main.26f36514.chunk.js.map
\ No newline at end of file
(window.webpackJsonp=window.webpackJsonp||[]).push([[0],{25:function(e,t,a){e.exports=a(78)},31:function(e,t,a){},76:function(e,t,a){},78:function(e,t,a){"use strict";a.r(t);var n=a(0),i=a.n(n),o=a(24),r=a.n(o),s=(a(31),a(10)),l=a(11),c=a(13),u=a(12),m=a(14),d="http://77.246.159.121/server/data.php",h=function(e){function t(e){var a;Object(s.a)(this,t);var n=(a=Object(c.a)(this,Object(u.a)(t).call(this,e))).getData();return a.state={CPU:n.CPU,totalM:n.TotalMemory,freeM:n.FreeMemory,oneMin:n.oneMinute,fiveMin:n.fiveMinutes,fifteenMin:n.fifteenMinutes},a.changeData(),a}return Object(m.a)(t,e),Object(l.a)(t,[{key:"changeData",value:function(){var e=this;setInterval(function(){e.data=e.getData(),e.setState({CPU:e.data.CPU,totalM:e.data.TotalMemory,freeM:e.data.FreeMemory,oneMin:e.data.oneMinute,fiveMin:e.data.fiveMinutes,fifteenMin:e.data.fifteenMinutes})},2e3)}},{key:"getData",value:function(){var e=new XMLHttpRequest;if(e.open("GET",d,!1),e.send(),200==e.status)return JSON.parse(e.responseText);console.log(e.status)}},{key:"render",value:function(){return i.a.createElement("table",{className:"system-load-table"},i.a.createElement("tbody",null,i.a.createElement("tr",{className:"first_row"},i.a.createElement("th",null,"CPU"),i.a.createElement("th",null,"Total memory"),i.a.createElement("th",null,"Free memory"),i.a.createElement("th",null,"1 minute"),i.a.createElement("th",null,"5 minutes"),i.a.createElement("th",null,"15 minutes")),i.a.createElement("tr",{className:"second-row"},i.a.createElement("th",null,this.state.CPU,"%"),i.a.createElement("th",null,this.state.totalM.toFixed(2)+" \u041c\u0411"),i.a.createElement("th",null,this.state.freeM.toFixed(2)+" \u041c\u0411"),i.a.createElement("th",null,this.state.oneMin),i.a.createElement("th",null,this.state.fiveMin),i.a.createElement("th",null,this.state.fifteenMin))))}}]),t}(i.a.Component),f=a(15),b=a.n(f),g=function(e){function t(e){var a;Object(s.a)(this,t);var n=(a=Object(c.a)(this,Object(u.a)(t).call(this,e))).getData();return a.state={cpuData:[n.CPU],memoryData:[n.FreeMemory],timeData:[(new Date).toLocaleTimeString()],oneMinuteData:[n.oneMinute],fiveMinutesData:[n.fiveMinutes],fifteenMinutesData:[n.fifteenMinutes],data:n},a.changeCharts(),a}return Object(m.a)(t,e),Object(l.a)(t,[{key:"componentDidMount",value:function(){var e=document.getElementById("cpuChart").getContext("2d"),t=document.getElementById("memoryChart").getContext("2d"),a=document.getElementById("loadAverageChart").getContext("2d");this.cpuChart=new b.a(e,{type:"line",data:{labels:this.state.timeData,datasets:[{label:"CPU",backgroundColor:"rgba(255, 99, 132, 0.2)",borderColor:"rgb(255, 99, 132)",data:this.state.cpuData}]},options:{legend:{labels:{fontColor:"white",fontSize:18}},scales:{xAxes:[{gridLines:{color:"rgba(171,171,171,1)",lineWidth:.5},ticks:{fontColor:"white",fontSize:12}}],yAxes:[{gridLines:{color:"rgba(171,171,171,1)",lineWidth:.5},ticks:{fontColor:"white",fontSize:12,min:0,max:100,stepSize:20},scaleLabel:{display:!0,labelString:"PERCENTAGES",fontColor:"#c0c0c0"}}]}}}),this.memoryChart=new b.a(t,{type:"line",data:{labels:this.state.timeData,datasets:[{label:"Free memory",backgroundColor:"rgba(16, 115, 181, 0.2)",borderColor:"rgb(16, 115, 181)",data:this.state.memoryData}]},options:{legend:{labels:{fontColor:"white",fontSize:18}},scales:{xAxes:[{ticks:{fontColor:"white",fontSize:12},gridLines:{color:"rgba(171,171,171,1)",lineWidth:.5}}],yAxes:[{gridLines:{color:"rgba(171,171,171,1)",lineWidth:.5},ticks:{fontColor:"white",fontSize:12,min:0,max:this.state.data.TotalMemory,stepSize:this.state.data.TotalMemory/4},scaleLabel:{display:!0,labelString:"MEGABYTES",fontColor:"#c0c0c0"}}]}}}),this.loadAverageChart=new b.a(a,{type:"line",data:{labels:this.state.timeData,datasets:[{label:"1 minute",backgroundColor:"rgba(255, 99, 132, 0.05)",borderColor:"rgb(255, 99, 132)",data:this.state.oneMinuteData},{label:"5 minutes",backgroundColor:"rgba(65, 99, 222, 0.05)",borderColor:"rgb(65, 99, 222)",data:this.state.fiveMinutesData},{label:"15 minutes",backgroundColor:"rgba(145, 44, 132, 0.05)",borderColor:"rgb(145, 44, 132)",data:this.state.fifteenMinutesData}]},options:{legend:{labels:{fontColor:"white",fontSize:18}},scales:{xAxes:[{ticks:{fontColor:"white",fontSize:12},gridLines:{color:"rgba(171,171,171,1)",lineWidth:.5}}],yAxes:[{gridLines:{color:"rgba(171,171,171,1)",lineWidth:.5},ticks:{fontColor:"white",fontSize:12,min:0,stepSize:.5}}]}}})}},{key:"getData",value:function(){var e=new XMLHttpRequest;if(e.open("GET",d,!1),e.send(),200==e.status)return JSON.parse(e.responseText);console.log(e.status)}},{key:"changeCharts",value:function(){var e=this;setInterval(function(){e.data=e.getData(),e.state.timeData.length>=10&&(e.state.timeData.shift(),e.state.cpuData.shift(),e.state.memoryData.shift(),e.state.oneMinuteData.shift(),e.state.fiveMinutesData.shift(),e.state.fifteenMinutesData.shift()),e.state.cpuData.push(e.data.CPU/1),e.state.memoryData.push(e.data.FreeMemory.toFixed(2)),e.state.timeData.push((new Date).toLocaleTimeString()),e.state.oneMinuteData.push(e.data.oneMinute),e.state.fiveMinutesData.push(e.data.fiveMinutes),e.state.fifteenMinutesData.push(e.data.fifteenMinutes),e.loadAverageChart.update(),e.cpuChart.update(),e.memoryChart.update()},3e3)}},{key:"render",value:function(){return i.a.createElement("div",{className:"canvas-block"},i.a.createElement("div",{className:"cpu-and-memory-charts"},i.a.createElement("div",{className:"canvasCpu-block"},i.a.createElement("canvas",{id:"cpuChart"})),i.a.createElement("div",{className:"canvasMemory-block"},i.a.createElement("canvas",{id:"memoryChart"}))),i.a.createElement("div",{className:"loadAver"},i.a.createElement("canvas",{id:"loadAverageChart"})))}}]),t}(i.a.Component);a(76);var M=function(){return[i.a.createElement(h,null),i.a.createElement(g,null)]};r.a.render(i.a.createElement(M,null),document.getElementById("root"))}},[[25,2,1]]]);
//# sourceMappingURL=main.8c610268.chunk.js.map
\ No newline at end of file
const URL = "http://77.246.159.121/server/data.php";
export default URL
\ No newline at end of file
import React from 'react' import React from 'react'
import Chart from 'chart.js' import Chart from 'chart.js'
import URL from '../address'
class Charts extends React.Component { class Charts extends React.Component {
constructor(props) { constructor(props) {
...@@ -190,7 +191,7 @@ class Charts extends React.Component { ...@@ -190,7 +191,7 @@ class Charts extends React.Component {
getData() { getData() {
let xhr = new XMLHttpRequest(); let xhr = new XMLHttpRequest();
xhr.open('GET', 'http://77.246.159.121/core/data.php', false); xhr.open('GET', URL, false);
xhr.send(); xhr.send();
if (xhr.status != 200) { if (xhr.status != 200) {
console.log(xhr.status); console.log(xhr.status);
...@@ -220,9 +221,7 @@ class Charts extends React.Component { ...@@ -220,9 +221,7 @@ class Charts extends React.Component {
this.loadAverageChart.update(); this.loadAverageChart.update();
this.cpuChart.update(); this.cpuChart.update();
this.memoryChart.update(); this.memoryChart.update();
}, 3000)
}, 2000)
} }
render() { render() {
......
import React from 'react'; import React from 'react';
import URL from '../address'
class Table extends React.Component { class Table extends React.Component {
constructor(props) { constructor(props) {
...@@ -33,7 +34,7 @@ class Table extends React.Component { ...@@ -33,7 +34,7 @@ class Table extends React.Component {
getData() { getData() {
let xhr = new XMLHttpRequest(); let xhr = new XMLHttpRequest();
xhr.open('GET', 'http://77.246.159.121/core/data.php', false); xhr.open('GET', URL, false);
xhr.send(); xhr.send();
if (xhr.status != 200) { if (xhr.status != 200) {
console.log(xhr.status); console.log(xhr.status);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment