我想显示90-07%的输出显示该节点在2018-07-13发生断电的情况。”
$.ajax({
url: "url",
type: "POST",
//username:'*******',
//password:'*****',
headers: {
'Authorization': make_base_auth('*****', '********'),
'Content-Type': 'application/json',
'att-modelkey': 'ds129k_splited_netcool',
'att-modelversion': '509bdd2416f31dc725f30929f9b929872af2ed79'
},
data: JSON.stringify({{js_data|safe}}),
success: function(result) {
console.log(result);
var res = JSON.stringify(result);
res = res.split(",").join(" <br/> chances of having an outage on this node ");
$('.datashow').html(res);
},
});
})
我得到如下输出。
{
"hostName": "nictst4",
"CID": 0,
"startDate": "2018-07-13",
"endDate": "2018-07-20"
} {
"category": 0
chances of having an outage on this node "2018-07-13": 0
chances of having an outage on this node "2018-07-14": 0
chances of having an outage on this node "2018-07-15": 0
chances of having an outage on this node "2018-07-16": 0
chances of having an outage on this node "2018-07-17": 0
chances of having an outage on this node "2018-07-18": 0
chances of having an outage on this node "2018-07-19": 0
chances of having an outage on this node "2018-07-20": 0
}
但是,我想显示出像
{
"hostName": "nictst4",
"CID": 0,
"startDate": "2018-07-13",
"endDate": "2018-07-20"
} {
"category": 0
0 % chances of having an outage on this node "2018-07-13"
0 % chances of having an outage on this node "2018-07-14"
0 % chances of having an outage on this node "2018-07-15"
0 % chances of having an outage on this node "2018-07-16"
0 % chances of having an outage on this node "2018-07-17"
0 % chances of having an outage on this node "2018-07-18"
0 % chances of having an outage on this node "2018-07-19"
0 % chances of having an outage on this node "2018-07-20"
}
请帮助我。