mirror of
https://github.com/OpenBankProject/API-Manager.git
synced 2026-02-06 17:16:49 +00:00
Merge pull request #96 from hongwei1/master
added the methodRouting Swagger Url and added the .gitgnore
This commit is contained in:
commit
de93444791
3
.gitignore
vendored
3
.gitignore
vendored
@ -4,4 +4,5 @@ __pycache__/
|
||||
apimanager/apimanager/local_settings.py
|
||||
.idea
|
||||
API-Manager.iml
|
||||
apimanager/.DS_Store
|
||||
apimanager/.DS_Store
|
||||
venv
|
||||
@ -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 " }>
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user