tum 2 年 前
コミット
b27e2eda76

BIN
app/Output/excel_out_test_excel_formatter_update.xlsx


+ 1 - 0
app/backend/templates/backend/service_status.html

@@ -79,6 +79,7 @@
79 79
   <li>{{ si.test_name }} 
80 80
     <a href="{% url "backend:service_status" %}?cmd={{ si.test_defn_uri }}&section=test_define" class='text-decoration-none badge bg-primary'>Test Define</a>
81 81
     <a href="{% url "backend:service_status" %}?cmd={{ si.test_type_uri }}&section=test_type" class='text-decoration-none badge bg-primary'>Test Type</a>
82
+    <a href="{% url "backend:service_status" %}?cmd={{ si.test_name|config_cur }}&section=ConfigCur" class='text-decoration-none badge bg-primary'>Config Cur</a>
82 83
   </li>
83 84
   {% endfor %}
84 85
 </ul>

+ 7 - 0
app/backend/templatetags/backend_tags.py

@@ -1,4 +1,6 @@
1 1
 from django import template
2
+from django.utils.http import urlencode
3
+
2 4
 
3 5
 register = template.Library()
4 6
 
@@ -7,3 +9,8 @@ register = template.Library()
7 9
 def to_label(value):
8 10
     value = value.replace('_', ' ')
9 11
     return value.title()
12
+
13
+@register.filter
14
+def config_cur(test_name):
15
+    import urllib.parse
16
+    return urllib.parse.quote_plus(f"/API/REST/Test/v1/ConfigCur?sections=all&test_type_name={test_name}&size=0")

+ 4 - 1
app/backend/views.py

@@ -112,10 +112,13 @@ def remote(request):
112 112
 
113 113
 def service_status(request):
114 114
     cmd = request.GET.get('cmd', None)
115
+    import urllib.parse
115 116
     section = request.GET.get('section', 'all')
116 117
     # exfo = Exfo("administrator", "exf0w0rxC@t4dm!n")
117 118
     # exfo.login()
118
-    r = exfo.call_remote_api(cmd+"?sections=all&size=0")
119
+    cmd = urllib.parse.unquote(cmd)
120
+    pprint(f" cmd = {cmd}")
121
+    r = exfo.call_remote_api(cmd)
119 122
     pprint(r.json())
120 123
     # return JsonResponse(r.json())
121 124
     return render(request, 'backend/service_status.html', {'res': r, 'section': section})

+ 1 - 1
app/exfo/lib.py

@@ -41,7 +41,7 @@ class Exfo:
41 41
           'Accept': 'application/json'
42 42
         }
43 43
         if service == "sla":
44
-            ep = "/SLAs/v1/SLA?size=100"
44
+            ep = "/SLAs/v1/SLA?size=0"
45 45
         url = self.BASE_URL + ep
46 46
         response = self.session.get(url, headers=headers, data=payload, verify=False)
47 47
         pprint(response.json())