Merge pull request #96 from hongwei1/master

added the methodRouting Swagger Url and added the .gitgnore
This commit is contained in:
Simon Redfern 2019-11-11 16:42:33 +01:00 committed by GitHub
commit de93444791
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 5 deletions

3
.gitignore vendored
View File

@ -4,4 +4,5 @@ __pycache__/
apimanager/apimanager/local_settings.py
.idea
API-Manager.iml
apimanager/.DS_Store
apimanager/.DS_Store
venv

View File

@ -38,8 +38,8 @@
<div class="runner">
<div class="row">
<div class="col-xs-12 col-sm-2">
<div class="form-group" cols="1" rows="1"><div
class="method_name">{{ method_routing.method_name }}</div></div>
<div class="form-group" cols="1" rows="1">
<a href="{{ methodSwaggerUrl }}={{ method_routing.method_name }}" class="method_name">{{ method_routing.method_name }}</a></div>
</div>
<div class="col-xs-12 col-sm-2">
<select class="connector_name form-control " }>

View File

@ -5,6 +5,7 @@ Views of config app
import json
from django.conf import settings
from django.http import JsonResponse
from django.contrib import messages
from django.contrib.auth.mixins import LoginRequiredMixin
@ -26,7 +27,7 @@ class IndexView(LoginRequiredMixin, FormView):
context = super(IndexView, self).get_context_data(**kwargs)
api = API(self.request.session.get('obp'))
urlpath = '/management/method_routings?active=true'
method_routings =''
try:
response = api.get(urlpath)
if 'code' in response and response['code'] >= 400:
@ -34,6 +35,7 @@ class IndexView(LoginRequiredMixin, FormView):
else:
msg = 'Submit successfully!'
messages.success(self.request, msg)
method_routings=response['method_routings']
except APIError as err:
error_once_only(self.request, Exception("OBP-API server is not running or do not response properly. "
"Please check OBP-API server. "
@ -41,7 +43,10 @@ class IndexView(LoginRequiredMixin, FormView):
except BaseException as err:
error_once_only(self.request, (Exception("Unknown Error. Details:" + str(err))))
else:
context.update(response)
context.update({
'method_routings': method_routings,
'methodSwaggerUrl': '{}/message-docs/rest_vMar2019/swagger2.0?functions'.format(settings.API_ROOT )
})
return context
@exception_handle