This repository has been archived on 2026-10-23. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
neuf-userinfo/static/js/status.js
T
2011-12-25 22:57:41 +01:00

31 lines
1.2 KiB
JavaScript

$(function() {
/* Display the service status of the user */
var img_check = ' <img src="/static/check.png" alt="OK" />';
var img_error = ' <img src="/static/exclamation_mark.png" alt="ERROR" />';
var image = '';
var title = '';
$.getJSON("/userstatus/client/?format=json", function(data) {
if(data.active) {
image = img_check;
title = "Du har en bruker til foreningsmaskinene. \nSiste vellykkede pålogging: " + data.last_successful_auth;
} else {
image = img_error;
title = "Ingen konto (mangler Kerberos principal).";
}
$("#client_status").append(image).prop('title', title).qtip();
});
$.getJSON('/userstatus/wireless/?format=json', function(data) {
if(data.active) {
image = img_check;
title = 'Du har tilgang til trådløst nettverk. \nSiste vellykkede pålogging: ' + data.last_successful_auth;
} else {
image = img_error;
title = 'Ingen trådløskonto (i Radius).';
}
$("#wireless_status").append(image).prop('title', title).qtip();
});
/* Any element with a title attribute gets a pretty qtip */
$("[title]").qtip();
});