改进监控页面样式,增加 chart.js 库文件
This commit is contained in:
@@ -1,12 +1,30 @@
|
|||||||
require(["jquery", "chart"], function ($, Chart) {
|
require(["jquery", "chart"], function ($, Chart) {
|
||||||
|
var data2 = {
|
||||||
|
labels: ["January", "February", "March", "April", "May", "June", "July",
|
||||||
|
"January", "February", "March", "April", "January", "February", "March", "April"],
|
||||||
|
datasets: [
|
||||||
|
{
|
||||||
|
label: "2222222",
|
||||||
|
fillColor: "rgba(50,187,205,0.2)",
|
||||||
|
strokeColor: "rgba(151,187,205,1)",
|
||||||
|
pointColor: "rgba(151,187,205,1)",
|
||||||
|
pointStrokeColor: "#fff",
|
||||||
|
pointHighlightFill: "#fff",
|
||||||
|
pointHighlightStroke: "rgba(151,187,205,1)",
|
||||||
|
data: [3, 7, 8, 9, 1, 4, 10, 10, 9, 8, 7, 10, 10, 10, 10]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
new Chart($("#waiting-queue-chart").get(0).getContext("2d")).Line(data2);
|
||||||
|
|
||||||
var data = {
|
var data = {
|
||||||
labels: ["January", "February", "March", "April", "May", "June", "July",
|
labels: ["January", "February", "March", "April", "May", "June", "July",
|
||||||
"January", "February", "March", "April", "January", "February", "March", "April"],
|
"January", "February", "March", "April", "January", "February", "March", "April"],
|
||||||
datasets: [
|
datasets: [
|
||||||
{
|
{
|
||||||
label: "11111111",
|
label: "11111111",
|
||||||
fillColor: "rgba(220,220,220,0.2)",
|
fillColor: "rgba(255,255,255,0.2)",
|
||||||
strokeColor: "rgba(220,220,220,1)",
|
strokeColor: "rgba(250,68,68,1)",
|
||||||
pointColor: "rgba(220,220,220,1)",
|
pointColor: "rgba(220,220,220,1)",
|
||||||
pointStrokeColor: "#fff",
|
pointStrokeColor: "#fff",
|
||||||
pointHighlightFill: "#fff",
|
pointHighlightFill: "#fff",
|
||||||
@@ -15,7 +33,7 @@ require(["jquery", "chart"], function ($, Chart) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "2222222",
|
label: "2222222",
|
||||||
fillColor: "rgba(151,187,205,0.2)",
|
fillColor: "rgba(50,187,205,0.2)",
|
||||||
strokeColor: "rgba(151,187,205,1)",
|
strokeColor: "rgba(151,187,205,1)",
|
||||||
pointColor: "rgba(151,187,205,1)",
|
pointColor: "rgba(151,187,205,1)",
|
||||||
pointStrokeColor: "#fff",
|
pointStrokeColor: "#fff",
|
||||||
@@ -26,31 +44,37 @@ require(["jquery", "chart"], function ($, Chart) {
|
|||||||
]
|
]
|
||||||
};
|
};
|
||||||
Chart.defaults.global.responsive = true;
|
Chart.defaults.global.responsive = true;
|
||||||
var myLineChart = new Chart($("#myChart").get(0).getContext("2d")).Line(data);
|
new Chart($("#judge-instance-chart").get(0).getContext("2d")).Line(data);
|
||||||
|
|
||||||
var data1 = [
|
var data1 = {
|
||||||
{
|
labels: ["January", "February", "March", "April", "May", "June", "July",
|
||||||
value: 300,
|
"January", "February", "March", "April", "January", "February", "March", "April"],
|
||||||
color:"#F7464A",
|
datasets: [
|
||||||
highlight: "#FF5A5E",
|
{
|
||||||
label: "Red"
|
label: "2222222",
|
||||||
},
|
fillColor: "rgba(50,187,205,0.2)",
|
||||||
{
|
strokeColor: "rgba(151,187,205,1)",
|
||||||
value: 50,
|
pointColor: "rgba(151,187,205,1)",
|
||||||
color: "#46BFBD",
|
pointStrokeColor: "#fff",
|
||||||
highlight: "#5AD3D1",
|
pointHighlightFill: "#fff",
|
||||||
label: "Green"
|
pointHighlightStroke: "rgba(151,187,205,1)",
|
||||||
},
|
data: [3, 7, 8, 9, 1, 4, 10, 10, 9, 8, 7, 10, 10, 10, 10]
|
||||||
{
|
},
|
||||||
value: 100,
|
{
|
||||||
color: "#FDB45C",
|
label: "2222222",
|
||||||
highlight: "#FFC870",
|
fillColor: "rgba(50,187,205,0.2)",
|
||||||
label: "Yellow"
|
strokeColor: "rgba(252,214,48,1)",
|
||||||
}
|
pointColor: "rgba(252,214,48,1)",
|
||||||
];
|
pointStrokeColor: "#fff",
|
||||||
|
pointHighlightFill: "#fff",
|
||||||
|
pointHighlightStroke: "rgba(151,187,205,1)",
|
||||||
|
data: [30, 70, 58, 49, 19, 44, 100, 100, 89, 88, 77, 50, 80, 66, 100]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
Chart.defaults.global.responsive = true;
|
||||||
|
new Chart($("#c1").get(0).getContext("2d")).Line(data1);
|
||||||
|
|
||||||
|
|
||||||
new Chart($("#c1").get(0).getContext("2d")).Pie(data1);
|
|
||||||
new Chart($("#c2").get(0).getContext("2d")).Pie(data1);
|
|
||||||
|
|
||||||
});
|
});
|
||||||
3477
static/src/js/lib/chart/Chart.js
vendored
Executable file
3477
static/src/js/lib/chart/Chart.js
vendored
Executable file
File diff suppressed because it is too large
Load Diff
@@ -2,18 +2,26 @@
|
|||||||
<h1>服务器监控</h1>
|
<h1>服务器监控</h1>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<h3>判题实例数量</h3>
|
|
||||||
<div>
|
<div>
|
||||||
<canvas id="myChart" style="min-width:100%;max-height: 300px;"></canvas>
|
<h3>等待判题队列长度</h3>
|
||||||
<div style="text-align: center;">判题实例数量变化</div>
|
|
||||||
|
<div id="waiting-queue">
|
||||||
|
<canvas class="line-chart" id="waiting-queue-chart"></canvas>
|
||||||
</div>
|
</div>
|
||||||
<div style="width: 50%;float: left;">
|
|
||||||
<canvas id="c1" width="250" height="125"></canvas>
|
|
||||||
<div style="text-align: center;">内存</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div style="width: 50%;float: left;">
|
<div>
|
||||||
<canvas id="c2" width="250" height="125"></canvas>
|
|
||||||
<div style="text-align: center"> cpu</div>
|
<h3>【10.1.24.23 - judge1 】</h3>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<canvas class="line-chart" id="judge-instance-chart"></canvas>
|
||||||
|
<div class="chart-description">判题实例数量变化</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<canvas id="c1" class="line-chart"></canvas>
|
||||||
|
<div class="chart-description">cpu 和 内存</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user