1
0
mirror of https://github.com/newnius/YAO-portal.git synced 2025-12-13 00:56:44 +00:00
This commit is contained in:
2019-04-23 16:57:15 +08:00
parent dbfe0c5bb7
commit 75657a7d6d
18 changed files with 396 additions and 123 deletions

View File

@@ -7,6 +7,8 @@ function summary_render() {
var ctx_mem = document.getElementById('summary-chart-mem').getContext('2d');
var ctx_jobs = document.getElementById('summary-chart-jobs').getContext('2d');
var ctx_gpu = document.getElementById('summary-chart-gpu').getContext('2d');
var ctx_gpu_util = document.getElementById('summary-chart-gpu-util').getContext('2d');
var ctx_gpu_mem = document.getElementById('summary-chart-gpu-mem').getContext('2d');
var ajax = $.ajax({
url: window.config.BASE_URL + "/service?action=summary_get",
@@ -19,7 +21,7 @@ function summary_render() {
$("#modal-msg").modal('show');
}
/* CPU Load */
ctx_cpu.canvas.height = 200;
new Chart(ctx_cpu, {
"type": "line",
@@ -34,15 +36,19 @@ function summary_render() {
}]
},
"options": {
title: {
display: true,
text: 'GPU Load'
},
legend: {
display: false
},
maintainAspectRatio:false
maintainAspectRatio: false
}
});
/* Jobs */
var data = {
datasets: [{
data: Object.values(res['jobs']),
@@ -56,12 +62,69 @@ function summary_render() {
type: 'pie',
data: data,
options: {
title: {
display: true,
text: 'Jobs'
},
legend: {
display: false
}
}
});
/* Mem Using */
ctx_mem.canvas.height = 200;
new Chart(ctx_mem, {
"type": "line",
"data": {
"labels": ["January", "February", "March", "April", "May", "June", "July"],
"datasets": [{
"label": "My First Data set",
"data": [2, 0.5, 1.5, 0.81, 1.56, 1.55, 1.40],
"fill": true,
"borderColor": "rgb(75, 192, 192)",
"lineTension": 0.1
}]
},
"options": {
title: {
display: true,
text: 'MEM Using'
},
legend: {
display: false
},
maintainAspectRatio: false
}
});
/* GPU Util */
ctx_gpu_util.canvas.height = 200;
new Chart(ctx_gpu_util, {
"type": "line",
"data": {
"labels": ["January", "February", "March", "April", "May", "June", "July"],
"datasets": [{
"label": "My First Data set",
"data": [2, 0.5, 1.5, 0.81, 1.56, 1.55, 1.40],
"fill": true,
"borderColor": "rgb(75, 192, 192)",
"lineTension": 0.1
}]
},
"options": {
title: {
display: true,
text: 'GPU Utilization'
},
legend: {
display: false
},
maintainAspectRatio: false
}
});
/* GPUs */
var data2 = {
datasets: [{
data: Object.values(res['gpu']),
@@ -75,11 +138,42 @@ function summary_render() {
type: 'pie',
data: data2,
options: {
title: {
display: true,
text: 'GPUs'
},
legend: {
display: false
}
}
});
/* GPU Mem Using */
ctx_gpu_mem.canvas.height = 200;
new Chart(ctx_gpu_mem, {
"type": "line",
"data": {
"labels": ["January", "February", "March", "April", "May", "June", "July"],
"datasets": [{
"label": "My First Data set",
"data": [2, 0.5, 1.5, 0.81, 1.56, 1.55, 1.40],
"fill": true,
"borderColor": "rgb(75, 192, 192)",
"lineTension": 0.1
}]
},
"options": {
title: {
display: true,
text: 'GPU MEM Using'
},
legend: {
display: false
},
maintainAspectRatio: false
}
});
});
ajax.fail(function (jqXHR, textStatus) {
$("#modal-msg-content").html("Request failed : " + jqXHR.statusText);