Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

Commit

Permalink
format code
Browse files Browse the repository at this point in the history
  • Loading branch information
codeskyblue committed Jun 20, 2017
1 parent d23dc68 commit 0c55f09
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 42 deletions.
2 changes: 1 addition & 1 deletion res/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,4 +260,4 @@ $(function() {
W.wsLog.close()
}
})
});
});
82 changes: 41 additions & 41 deletions res/js/settings.js
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
/* javascript */
var vm = new Vue({
el: '#app',
data: {
name: name,
pid: '-',
childPids: [],
}
el: '#app',
data: {
name: name,
pid: '-',
childPids: [],
}
});

var maxDataCount = 30;
var ws = newWebsocket('/ws/perfs/' + name, {
onopen: function(evt) {
console.log(evt);
},
onmessage: function(evt) {
var data = JSON.parse(evt.data);
vm.pid = data.pid;
vm.childPids = data.pids;
console.log("pid", data.pid, data); //evt.data.pid);
if (memData && data.rss) {
memData.push({
value: [new Date(), data.rss],
})
if (memData.length > maxDataCount) {
memData.shift();
}
chartMem.setOption({
series: [{
data: memData,
}]
});
}
if (cpuData && data.pcpu !== undefined) {
cpuData.push({
value: [new Date(), data.pcpu],
})
if (cpuData.length > maxDataCount) {
cpuData.shift();
}
chartCpu.setOption({
series: [{
data: cpuData,
}]
})
}
onopen: function(evt) {
console.log(evt);
},
onmessage: function(evt) {
var data = JSON.parse(evt.data);
vm.pid = data.pid;
vm.childPids = data.pids;
console.log("pid", data.pid, data); //evt.data.pid);
if (memData && data.rss) {
memData.push({
value: [new Date(), data.rss],
})
if (memData.length > maxDataCount) {
memData.shift();
}
chartMem.setOption({
series: [{
data: memData,
}]
});
}
if (cpuData && data.pcpu !== undefined) {
cpuData.push({
value: [new Date(), data.pcpu],
})
if (cpuData.length > maxDataCount) {
cpuData.shift();
}
chartCpu.setOption({
series: [{
data: cpuData,
}]
})
}
})
}
})

0 comments on commit 0c55f09

Please sign in to comment.