var password=$("#password").val();
$("#password").change(function(e) {
password=$("#password").val();
+ update();
});
var qpsgraph = new Rickshaw.Graph( {
function updateRingBuffers()
{
var filtered=$("#filter1").is(':checked')
- var qstring='/jsonstat?api-key='+password+'&command=get-query-ring&name=queries&callback=?';
+ var qstring='/jsonstat?api-key='+password+'&command=get-query-ring&name=queries';
if(filtered)
qstring=qstring+"&public-filtered=1";
});
filtered=$("#filter2").is(':checked')
- qstring='/jsonstat?api-key='+password+'&command=get-query-ring&name=servfail-queries&callback=?';
+ qstring='/jsonstat?api-key='+password+'&command=get-query-ring&name=servfail-queries';
if(filtered)
qstring=qstring+"&public-filtered=1";
});
- $.getJSON('/jsonstat?api-key='+password+'&command=get-remote-ring&name=remotes&callback=?',
+ $.getJSON('/jsonstat?api-key='+password+'&command=get-remote-ring&name=remotes',
function(data) {
var bouw="<table><tr><th>Number</th><th>Remote</th></tr>";
var num=0, total=0, rest=0;
});
- $.getJSON('/jsonstat?api-key='+password+'&command=get-remote-ring&name=servfail-remotes&callback=?',
+ $.getJSON('/jsonstat?api-key='+password+'&command=get-remote-ring&name=servfail-remotes',
function(data) {
var bouw="<table><tr><th>Number</th><th>Servfail Remote</th></tr>";
var num=0, total=0, rest=0;
function update()
{
-
$.ajax({
- url: '/api/v1/servers/localhost/statistics?api-key='+password+'&callback=?',
+ url: '/api/v1/servers/localhost/statistics?api-key='+password,
type: 'GET',
- dataType: 'jsonp',
+ dataType: 'json',
success: function(adata, x, y) {
+ $("#connection-status").hide();
+ $("#connection-error").html("");
var data={};
$.each(adata, function(key, val) {
data[val.name]=val.value;
gdata=data;
},
- error: function() {
- alert('boo!');
+ error: function(o) {
+ $("#connection-status").show();
+ $("#connection-error").html(o.status+" "+o.statusText);
},
beforeSend: function(xhr) {
xhr.setRequestHeader('X-API-Key', 'changeme');
}
});
- $.ajax({ url: '/api/v1/servers/localhost?api-key='+password+'&callback=?', type: 'GET', dataType: 'jsonp',
+ $.ajax({ url: '/api/v1/servers/localhost?api-key='+password, type: 'GET', dataType: 'json',
success: function(data) {
$("#version").text("PowerDNS "+data["daemon_type"]+" "+data["version"]);
}