Escaping angle brackets in a device config file

The configuration file may contain brackets (">" or "<"), which must be escaped
This commit is contained in:
Ursadon 2021-07-29 15:45:32 +07:00 committed by GitHub
parent 18a4232783
commit 27f3816fc6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -39,9 +39,9 @@ $(document).ready(function() {
url: "{% url 'dcim-api:device-napalm' pk=object.pk %}?method=get_config", url: "{% url 'dcim-api:device-napalm' pk=object.pk %}?method=get_config",
dataType: 'json', dataType: 'json',
success: function(json) { success: function(json) {
$('#running_config').html($.trim(json['get_config']['running'])); $('#running_config').text($.trim(json['get_config']['running']));
$('#startup_config').html($.trim(json['get_config']['startup'])); $('#startup_config').text($.trim(json['get_config']['startup']));
$('#candidate_config').html($.trim(json['get_config']['candidate'])); $('#candidate_config').text($.trim(json['get_config']['candidate']));
}, },
error: function(xhr) { error: function(xhr) {
alert(xhr.responseText); alert(xhr.responseText);