Преглед на файлове

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

Jeremy Stretch преди 10 месеца
родител
ревизия
13c6602ea8
променени са 2 файла, в които са добавени 10 реда и са изтрити 2 реда
  1. 5 1
      netbox/templates/extras/configtemplate.html
  2. 5 1
      netbox/templates/extras/exporttemplate.html

+ 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 %}