Просмотр исходного кода

#17653: Style JSON data for config & export templates (#19171)

Jeremy Stretch 10 месяцев назад
Родитель
Сommit
13c6602ea8

+ 5 - 1
netbox/templates/extras/configtemplate.html

@@ -71,7 +71,11 @@
       <div class="card">
         <h2 class="card-header">{% trans "Environment Parameters" %}</h2>
         <div class="card-body">
-          <pre>{{ object.environment_params }}</pre>
+          {% if object.environment_params %}
+            <pre>{{ object.environment_params|json }}</pre>
+          {% else %}
+            <span class="text-muted">{% trans "None" %}</span>
+          {% endif %}
         </div>
       </div>
       {% plugin_right_page object %}

+ 5 - 1
netbox/templates/extras/exporttemplate.html

@@ -82,7 +82,11 @@
       <div class="card">
         <h2 class="card-header">{% trans "Environment Parameters" %}</h2>
         <div class="card-body">
-          <pre>{{ object.environment_params }}</pre>
+          {% if object.environment_params %}
+            <pre>{{ object.environment_params|json }}</pre>
+          {% else %}
+            <span class="text-muted">{% trans "None" %}</span>
+          {% endif %}
         </div>
       </div>
       {% plugin_right_page object %}