mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-10 04:06:47 +00:00
fix(instances): Guest Info says when the agent fails and keeps what it answered
When the guest agent failed, the Guest Info section stayed empty with no word: the request's error answer was not handled. An agent without the time zone or host name command lost the OS details it had answered too. The section now shows the agent's error, and a missing command leaves out only its own details.
This commit is contained in:
parent
e29a79c76d
commit
11348b2c37
4 changed files with 29 additions and 11 deletions
|
|
@ -438,15 +438,17 @@
|
|||
}
|
||||
function load_osinfo() {
|
||||
$.getJSON("{% url 'instances:osinfo' instance.id %}", function (data) {
|
||||
$.each(data, function() {
|
||||
$('#oshostname').text(data['host-name']);
|
||||
$('#osname').text(data.id);
|
||||
$('#osprettyname').text(data['pretty-name']);
|
||||
$('#oskernelrelease').text(data['kernel-release']);
|
||||
$('#oskernelversion').text(data['kernel-version']);
|
||||
$('#osversion').text(data.version);
|
||||
$('#ostimezone').text(data.zone + " / " + data.offset);
|
||||
})
|
||||
$('#osinfo-error').addClass('d-none');
|
||||
$('#oshostname').text(data['host-name'] || '');
|
||||
$('#osname').text(data.id || '');
|
||||
$('#osprettyname').text(data['pretty-name'] || '');
|
||||
$('#oskernelrelease').text(data['kernel-release'] || '');
|
||||
$('#oskernelversion').text(data['kernel-version'] || '');
|
||||
$('#osversion').text(data.version || '');
|
||||
$('#ostimezone').text(data.zone ? data.zone + " / " + data.offset : '');
|
||||
}).fail(function (xhr) {
|
||||
var error = xhr.responseJSON && xhr.responseJSON.error;
|
||||
$('#osinfo-error').text(error || "{% trans 'The guest agent did not answer' %}").removeClass('d-none');
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue