diff --git a/apimanager/apimanager/settings.py b/apimanager/apimanager/settings.py
index c303ea7..6ef6969 100644
--- a/apimanager/apimanager/settings.py
+++ b/apimanager/apimanager/settings.py
@@ -62,7 +62,7 @@ INSTALLED_APPS = [
]
MIDDLEWARE = [
- 'django.middleware.cache.UpdateCacheMiddleware',
+ # 'django.middleware.cache.UpdateCacheMiddleware',
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
@@ -70,11 +70,11 @@ MIDDLEWARE = [
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
- 'django.middleware.cache.FetchFromCacheMiddleware',
+ # 'django.middleware.cache.FetchFromCacheMiddleware',
]
#cache the view page, we set 60s = 1m,
-CACHE_MIDDLEWARE_SECONDS = 60
+# CACHE_MIDDLEWARE_SECONDS = 60
# TIMEOUT is 31104000 seconds = 60*60*24*30*12 (1 year)
# MAX_ENTRIES is 1000000 entities
diff --git a/apimanager/dynamicendpoints/templates/dynamicendpoints/index.html b/apimanager/dynamicendpoints/templates/dynamicendpoints/index.html
index 9350455..23ff31b 100644
--- a/apimanager/dynamicendpoints/templates/dynamicendpoints/index.html
+++ b/apimanager/dynamicendpoints/templates/dynamicendpoints/index.html
@@ -19,7 +19,6 @@
#}
{{ dynamic_endpoint.dynamic_endpoint_id }}
diff --git a/apimanager/methodrouting/static/methodrouting/js/methodrouting.js b/apimanager/methodrouting/static/methodrouting/js/methodrouting.js
index 58375c4..955a278 100644
--- a/apimanager/methodrouting/static/methodrouting/js/methodrouting.js
+++ b/apimanager/methodrouting/static/methodrouting/js/methodrouting.js
@@ -15,12 +15,17 @@ $(document).ready(function($) {
var container = $("#"+json_editor_id);
parameters = JSON.parse($(runner).find('textarea[name="parameters"]').text());
var jsoneditor_div = $(runner).find('.jsoneditor_div');
- //make sure only create one jsoneditor_div block
- if(!(jsoneditor_div.css("display") ==="block")){
+ //make sure only create one jsoneditor_div block, click once to open and then close the block.
+ if (typeof json_editors[json_editor_number] === 'undefined') {
json_editors[json_editor_number] = new JSONEditor(container[0], options, parameters);
jsoneditor_div.css("display","block");
}else{
- json_editors[json_editor_number] = json_editors[json_editor_number].set(parameters)
+ // json_editors[json_editor_number] = json_editors[json_editor_number].set(parameters)
+ if(jsoneditor_div.css("display") ==="block"){
+ jsoneditor_div.css("display","none");
+ }else{
+ jsoneditor_div.css("display","block");
+ }
}
});
diff --git a/apimanager/methodrouting/templates/methodrouting/index.html b/apimanager/methodrouting/templates/methodrouting/index.html
index 2116595..5f30a9d 100644
--- a/apimanager/methodrouting/templates/methodrouting/index.html
+++ b/apimanager/methodrouting/templates/methodrouting/index.html
@@ -31,8 +31,8 @@
#}
-
{{ method_routing.method_name }}
+
+
-
@@ -105,10 +105,16 @@
class="method_routing_id">{{ method_routing.method_routing_id }}
-
- saved.
-
-
+ {% if method_routing.method_routing_id == "" %}
+
+
+
+ {% else %}
+
+
+
+
+ {% endif %}
diff --git a/apimanager/methodrouting/views.py b/apimanager/methodrouting/views.py
index 57986f9..0ce4da6 100644
--- a/apimanager/methodrouting/views.py
+++ b/apimanager/methodrouting/views.py
@@ -43,11 +43,23 @@ class IndexView(LoginRequiredMixin, FormView):
error_once_only(self.request, (Exception("Unknown Error. Details:" + str(err))))
else:
for i in range(len(method_routings)):
- method_routings[i]['parameters'] = json.dumps(method_routings[i]['parameters'], sort_keys=False)
+ #if the parameters are empty, we provide the example value.
+ if(str(method_routings[i]['parameters']).find("key") == -1):
+ method_routings[i]['parameters'] = json.dumps([{
+ "key":"url",
+ "value":"http://mydomain.com/xxx"
+ }], sort_keys=False)
+ else:
+ method_routings[i]['parameters'] = json.dumps(method_routings[i]['parameters'], sort_keys=False)
+ if(str(settings.API_ROOT).find("127.0.0.1") == -1):
+ methodSwaggerUrl = '{}/message-docs?connector=stored_procedure_vDec2019#'.format(settings.API_HOST.replace(".openbankproject.", "-explorer.openbankproject."))
+ else:
+ methodSwaggerUrl = "http://127.0.0.1:8082/message-docs?connector=stored_procedure_vDec2019#"
+
context.update({
'method_routings': method_routings,
- "methodSwaggerUrl": json.dumps('{}/message-docs/rest_vMar2019/swagger2.0?functions'.format(settings.API_ROOT ))
+ "methodSwaggerUrl": methodSwaggerUrl
})
return context