bugfix/ sonarcloud bug fix

This commit is contained in:
Reena-cell 2022-12-20 22:57:32 +01:00
parent bb8e6c4075
commit 8432e2b995
33 changed files with 93 additions and 160 deletions

View File

@ -1,11 +1,10 @@
$(document).ready(function($) {
$('.runner button.forSave').click(function(e) {
e.preventDefault();
var t = $(this);
var runner = t.parent().parent().parent();
var api_collection_name = $(runner).find('.api_collection_name').val();
var api_collection_is_sharable = $(runner).find('.api_collection_is_sharable').val();
var api_collection_description = $(runner).find('.api_collection_description').val();
let runner = $(this).parent().parent().parent();
let api_collection_name = $(runner).find('.api_collection_name').val();
let api_collection_is_sharable = $(runner).find('.api_collection_is_sharable').val();
let api_collection_description = $(runner).find('.api_collection_description').val();
$('.runner button.forSave').attr("disabled","disabled");
$('.runner button.forDelete').attr("disabled","disabled");
@ -20,9 +19,8 @@ $(document).ready(function($) {
$('.runner button.forDelete').click(function(e) {
e.preventDefault();
var t = $(this);
var runner = t.parent().parent().parent();
var api_collection_id = $(runner).find('.api_collection_id').html();
let runner = $(this).parent().parent().parent();
let api_collection_id = $(runner).find('.api_collection_id').html();
$('.runner button.forSave').attr("disabled","disabled");
$('.runner button.forDelete').attr("disabled","disabled");
$.post('delete/apicollection', {

View File

@ -73,8 +73,8 @@ class DetailView(LoginRequiredMixin, FormView):
except APIError as err:
messages.error(self.request, err)
return super(DetailView, self).form_invalid(form)
except:
messages.error(self.request, 'Unknown Error')
except BaseException as err:
error_once_only(self.request, (Exception("Unknown Error. Details:" + str(err))))
return super(DetailView, self).form_invalid(form)
if 'code' in api_collection_endpoint and api_collection_endpoint['code']>=400:
messages.error(self.request, api_collection_endpoint['message'])
@ -126,8 +126,8 @@ class DeleteCollectionEndpointView(LoginRequiredMixin, FormView):
messages.success(request, msg)
except APIError as err:
messages.error(request, err)
except:
messages.error(self.request, 'Unknown Error')
except BaseException as err:
messages.error(self.request, 'Unknown Error', err)
redirect_url = reverse('my-api-collection-detail',kwargs={"api_collection_id":kwargs['api_collection_id']})
return HttpResponseRedirect(redirect_url)
@ -155,7 +155,6 @@ def connectormethod_update(request):
'api_collection_is_sharable': request.POST.get('api_collection_is_sharable'),
'method_body': request.POST.get('api_collection_method_body_update').strip()
}
result = HttpResponse(content_type = 'application/json')
result = api.put(urlpath, payload=payload)
return result

View File

@ -54,7 +54,7 @@ urlpatterns += i18n_patterns(
url(r'^connectormethod/', include('connectormethod.urls')),
url(r'^dynamicendpoints/', include('dynamicendpoints.urls')),
url(r'^apicollections/', include('apicollections.urls')),
url(r'^apicollections/list', include('apicollectionlist.urls')),
url(r'^apicollections-list', include('apicollectionlist.urls')),
)
#prefix_default_language=False,
#)+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

View File

@ -208,13 +208,17 @@ table.tablesorter thead tr .headerSortDown, table.tablesorter thead tr .headerSo
}
.language-select {
text-decoration: none;
color:#fff;
margin-left:5rem;
text-decoration: none !important;
}
#uk {
cursor:pointer;
}
#es {
cursor:pointer;
}1
}
.language_underline_format > a > span:hover
{
text-decoration: underline;
font-weight: bold !important;
}

View File

@ -2,7 +2,7 @@ $(document).ready(function($) {
$('table.tablesorter').tablesorter();
$('#authentication-select').change(function() {
$('.authentication-method').hide();
var method = $(this).val();
let method = $(this).val();
$(`#authenticate-${method}`).show();
});
});

View File

@ -14,7 +14,6 @@
<link href="{% static 'css/base.css' %}" rel="stylesheet">
<link href="{% static 'css/jsoneditor.min.css' %}" rel="stylesheet">
<link href="{% static 'css/obpjsoneditor.css' %}" rel="stylesheet">
<!--<link href="{{ override_css_url }}" rel="stylesheet">-->
{% block extracss %}{% endblock extracss %}
</head>
@ -63,7 +62,7 @@
<li class="dropdown{% if customers_create_url in request.path %} active{% endif %}">
<a href="#" data-toggle="dropdown" class="dropdown-toggle">{% trans "Resources" %}</a>
<ul class="dropdown-menu">
<li {% if system_view_url in request.path %} class="active" {% endif %}><a href="{{ system_view_url }}">{% trans "System View" %}</a></li>
<li {% if system_view_url in request.path %} class="active" {% endif %}><a href="{{ system_view_url }}">{% trans "System Views" %}</a></li>
<hr class="dropdown-hr">
<li {% if accounts_create_url in request.path %} class="active" {% endif %}><a href="{{ accounts_create_url }}">{% trans "Account Create" %}</a></li>
<li {% if accounts_list_url in request.path %} class="active" {% endif %}><a href="{{ accounts_list_url }}">{% trans "Account List" %}</a></li>
@ -92,6 +91,7 @@
</li>
<hr class="dropdown-hr">
<li {% if api_collections_index_url in request.path %} class="active" {% endif %}><a href="{{ api_collections_index_url }}">{% trans "My API Collections" %}</a></li>
<hr class="dropdown-hr">
<li {% if api_collections_list_url in request.path %} class="active" {% endif %}><a href="{{ api_collections_list_url }}">{% trans "All API Collections" %}</a></li>
</ul>
</li>
@ -100,19 +100,16 @@
<a href="{{ API_TESTER_URL }}">{% trans "API Tester" %}</a>
</li>
{% endif %}
<!--<ul class="nav navbar-nav navbar-right" style="padding-top:13px; margin-left:12rem">-->
<li>
{% if user.is_authenticated %}
<p class="navbar-right button-select"><span id="navbar-login-username">{{API_USERNAME}}</span>&nbsp;&nbsp;<a href="/logout" class="btn btn-default">{% trans "Logout" %} </a></p>
{% endif %}
</li>
<!--</ul>-->
<li class="language-select"><a style="color:#fff;">Language
<li class="language-select language_underline_format"><a style="color:#fff; text-decoration: none !important;">Language
<span id="uk">EN</span>
|
<span id="es">ES</span></a></li>
</ul>
<!--/.nav-collapse -->
</div>
</div>
</nav>

View File

@ -46,10 +46,6 @@
<label for="password">Password:</label>
{{ directlogin_form.password }}
</div>
<!--<div class="form-group"style="visibility:hidden">
<label for="consumer-key">Consumer Key:</label>
{{ directlogin_form.consumer_key }}
</div>-->
<button class="btn btn-primary">Login</button>
</form>
</div>

View File

@ -24,7 +24,6 @@ def get_cache_key_for_current_call(request, urlpath):
"""we will generate the cache key by login username+urlpath
url path may contain lots of special characters, here we use the hash method first.
"""
#TODO, we need the obp user.provide there.
return context_processors.api_username(request).get('API_USERNAME') + str(hash(urlpath))

View File

@ -1,11 +1,10 @@
$(document).ready(function($) {
$('.runner button.forSave').click(function(e) {
e.preventDefault();
var t = $(this);
var runner = t.parent().parent().parent();
var connector_method_name = $(runner).find('.connector_method_name').val();
var connector_method_programming_lang = $(runner).find('.connector_method_programming_lang').val();
var connector_method_body = $(runner).find('.connector_method_body').val();
let runner = $(this).parent().parent().parent();
let connector_method_name = $(runner).find('.connector_method_name').val();
let connector_method_programming_lang = $(runner).find('.connector_method_programming_lang').val();
let connector_method_body = $(runner).find('.connector_method_body').val();
$('.runner button.forSave').attr("disabled", "disabled");
$('.runner button.forDelete').attr("disabled", "disabled");
@ -20,11 +19,10 @@ $(document).ready(function($) {
$('.runner button.forUpdate').click(function(e) {
e.preventDefault();
var t = $(this);
var runner = t.parent().parent().parent();
var connector_method_id = $(runner).find('.connector_method_id').html();
var connector_method_programming_lang_update = $(runner).find('.connector_method_programming_lang_update').val();
var connector_method_body_update = $(runner).find('.connector_method_body_update').val();
let runner = $(this).parent().parent().parent();
let connector_method_id = $(runner).find('.connector_method_id').html();
let connector_method_programming_lang_update = $(runner).find('.connector_method_programming_lang_update').val();
let connector_method_body_update = $(runner).find('.connector_method_body_update').val();
$('.runner button.forSave').attr("disabled", "disabled");
$('.runner button.forUpdate').attr("disabled", "disabled");

View File

@ -73,6 +73,5 @@ def connectormethod_update(request):
'programming_lang': request.POST.get('connector_method_programming_lang_update'),
'method_body': request.POST.get('connector_method_body_update').strip()
}
result = HttpResponse(content_type = 'application/json')
result = api.put(urlpath, payload=payload)
return result

View File

@ -16,9 +16,6 @@ from base.filters import BaseFilter, FilterTime
from .forms import ApiConsumersForm
# import logging
# logger = logging.getLogger(__name__)
class FilterAppType(BaseFilter):
"""Filter consumers by application type"""
@ -129,7 +126,6 @@ class DetailView(LoginRequiredMixin, FormView):
'per_week_call_limit': data['per_week_call_limit'],
'per_month_call_limit': data['per_month_call_limit']
}
user = self.api.put(urlpath, payload=payload)
except APIError as err:
messages.error(self.request, err)
return super(DetailView, self).form_invalid(api_consumers_form)
@ -191,8 +187,8 @@ class EnableDisableView(LoginRequiredMixin, RedirectView):
messages.success(self.request, self.success)
except APIError as err:
messages.error(self.request, err)
except:
messages.error(self.request, "Unknown")
except APIError as err:
messages.error(self.request, err)
urlpath = self.request.POST.get('next', reverse('consumers-index'))
query = self.request.GET.urlencode()

View File

@ -26,9 +26,7 @@ class CustomerListView(CreateView, LoginRequiredMixin, FormView ):
try:
self.bankids = get_banks(self.request)
customers_list = []
#for bank_id in self.bankids:
urlpath = '/customers'
#urlpath = 'http://127.0.0.1:8080/obp/v4.0.0/my/customers'
result = api.get(urlpath)
if 'customers' in result:
customers_list.extend(result['customers'])

View File

@ -9,12 +9,12 @@ $(document).ready(function($) {
//and will use the data from click `save` button.
var json_editors = []
$('.parameters').click(function() {
var runner = $(this).parent().parent().parent();
var json_editor_id= $(runner).find('.jsoneditor_div')[0].id;
var json_editor_number = json_editor_id.replace("jsoneditor","");
var container = $("#"+json_editor_id);
var parameters = JSON.parse($(runner).find('textarea[name="parameters"]').text());
var jsoneditor_div = $(runner).find('.jsoneditor_div');
let runner = $(this).parent().parent().parent();
let json_editor_id= $(runner).find('.jsoneditor_div')[0].id;
let json_editor_number = json_editor_id.replace("jsoneditor","");
let container = $("#"+json_editor_id);
let parameters = JSON.parse($(runner).find('textarea[name="parameters"]').text());
let jsoneditor_div = $(runner).find('.jsoneditor_div');
//make sure only create one jsoneditor_div block
if(!(jsoneditor_div.css("display") ==="block")){
json_editors[json_editor_number] = new JSONEditor(container[0], options, parameters);
@ -27,11 +27,10 @@ $(document).ready(function($) {
});
$('.runner button.forSave').click(function() {
var t = $(this);
var runner = $(this).parent().parent().parent();
var jsoneditor_id= $(runner).find('.jsoneditor_div')[0].id
var json_editor_number = jsoneditor_id.replace("jsoneditor","")
var parameters_Json_editor = JSON.stringify(json_editors[json_editor_number].get());
let runner = $(this).parent().parent().parent();
let jsoneditor_id= $(runner).find('.jsoneditor_div')[0].id
let json_editor_number = jsoneditor_id.replace("jsoneditor","")
let parameters_Json_editor = JSON.stringify(json_editors[json_editor_number].get());
console.log("parameters_Json_editor:"+parameters_Json_editor)
$('.runner button.forSave').attr("disabled","disabled");
$('.runner button.forDelete').attr("disabled","disabled");
@ -45,9 +44,8 @@ $(document).ready(function($) {
});
$('.runner button.forDelete').click(function() {
var t = $(this);
var runner = $(this).parent().parent().parent();
var dynamic_endpoint_id = $(runner).find('.dynamic_endpoint_id').text();
let runner = $(this).parent().parent().parent();
let dynamic_endpoint_id = $(runner).find('.dynamic_endpoint_id').text();
$('.runner button.forSave').attr("disabled","disabled");
$('.runner button.forDelete').attr("disabled","disabled");
$.post('dynamicendpoints/delete/dynamicendpoint', {

View File

@ -274,10 +274,10 @@ class IndexView(LoginRequiredMixin, FormView):
@exception_handle
@csrf_exempt
def dynamicendpoints_save(request):
parameters_Json_editor = request.POST.get('parameters_Json_editor')
parameters_Json_editor_dynamic = request.POST.get('parameters_Json_editor')
api = API(request.session.get('obp'))
urlpath = '/management/dynamic-endpoints'
result = api.post(urlpath, payload=json.loads(parameters_Json_editor) )
result = api.post(urlpath, payload=json.loads(parameters_Json_editor_dynamic) )
return result

View File

@ -1,7 +1,6 @@
import requests
import os
import dotenv
#from deepl_translation_fun import trasnlator
BASE_DIR = os.getcwd() #method tells us the location of current working directory

View File

@ -7,29 +7,27 @@ languages=['de','es','fr','hi'] # Defining languages
# This class is used for converting languages
class clsTranslate():
def translateText(self, strString, strTolang):
class languageConverting():
def parametersTextConverte(self, stString, prevlangToNewlang):
"""
This function translates one language into another language. It takes two
parameters
1. strString :=> String that you want to convert
2. strTolang :=> Languages(fr,hi,es etc)
1. prevStrToNewString :=> String that you want to convert
2. prevlangToNewlang :=> Languages(fr,hi,es etc)
"""
self.strString = strString
self.strTolang = strTolang
translator = translator(text=self.strString, language=self.strTolang)
self.prevStrToNewString = prevStrToNewString
self.prevlangToNewlang = prevlangToNewlang
translator = translator(text=self.prevStrToNewString, language=self.prevlangToNewlang)
return (str(translator))
# This is method for writing file
def writeFile(language):
print(language,"Started")
def localeWriteFile(language):
fileName=f'locale/{language}/LC_MESSAGES/django.po' # Openning a file
try:
with open(fileName,encoding='utf-8') as f: # Reading from the file
a=[i.replace("\n","") for i in f.readlines()] # Reading everyline from a file and store it into a
except Exception as e: # same like try block.
print(fileName, e)
b=0
for i in range(len(a)):
if 'msgid' in a[i] and a[i]!='msgid ""':
@ -37,29 +35,25 @@ def writeFile(language):
break
if b!=0:
trans=clsTranslate() # Creating object for translation class
trans=languageConverting() # Creating object for translation class
for i in range(b-1,len(a)):
try:
if "msgid" in a[i]:
msgid,msgstr=a[i],a[i+1]
if msgstr == 'msgstr ""':
ms=msgid[7:len(msgid)-1]
val=trans.translateText(ms,language)
val=trans.parametersTextConverte(ms,language)
a[i+1]=f'msgstr "{val}"'
# print(a[i])
except: pass
try:
lock.acquire()
with open(fileName,'w',encoding='utf-8') as f:
for i in a:
f.write(f"{i}\n")
print(language,"is completed")
lock.release()
except Exception as e:
print(e)
lock.release()
else:
print(language,"is completed")
with tpe() as e:
e.map(writeFile,languages)
e.map(localeWriteFile,languages)

View File

@ -7,14 +7,14 @@ $(document).ready(function($) {
//each method_routing will have each own json_editor, and will put data into it when click `parameter` box
//and will use the data from click `save` button.
var json_editors = []
let json_editors = []
$('.parameters').click(function() {
var runner = $(this).parent().parent().parent();
var json_editor_id= $(runner).find('.jsoneditor_div')[0].id;
var json_editor_number = json_editor_id.replace("jsoneditor","");
var container = $("#"+json_editor_id);
var parameters = JSON.parse($(runner).find('textarea[name="parameters"]').text());
var jsoneditor_div = $(runner).find('.jsoneditor_div');
let runner = $(this).parent().parent().parent();
let json_editor_id= $(runner).find('.jsoneditor_div')[0].id;
let json_editor_number = json_editor_id.replace("jsoneditor","");
let container = $("#"+json_editor_id);
let parameters = JSON.parse($(runner).find('textarea[name="parameters"]').text());
let jsoneditor_div = $(runner).find('.jsoneditor_div');
//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);
@ -30,21 +30,20 @@ $(document).ready(function($) {
});
$('.runner button.forSave').click(function() {
var t = $(this);
var runner = $(this).parent().parent().parent();
var method_routing_id = $(runner).find('.method_routing_id').text();
var method_name = $(runner).find('.method_name').text();
var connector_name = $(runner).find('.connector_name').val();
var bank_id_pattern = $(runner).find('textarea[name="bank_id_pattern"]').val();
var is_bank_id_exact_match = $(runner).find('.is_bank_id_exact_match').val();
var parameters = $(runner).find('textarea[name="parameters"]').val();
var jsoneditor_id= $(runner).find('.jsoneditor_div')[0].id;
var json_editor_number = jsoneditor_id.replace("jsoneditor","");
let runner = $(this).parent().parent().parent();
let method_routing_id = $(runner).find('.method_routing_id').text();
let method_name = $(runner).find('.method_name').text();
let connector_name = $(runner).find('.connector_name').val();
let bank_id_pattern = $(runner).find('textarea[name="bank_id_pattern"]').val();
let is_bank_id_exact_match = $(runner).find('.is_bank_id_exact_match').val();
let parameters = $(runner).find('textarea[name="parameters"]').val();
let jsoneditor_id= $(runner).find('.jsoneditor_div')[0].id;
let json_editor_number = jsoneditor_id.replace("jsoneditor","");
//if the user do not click the `parameters` box, then there is no json_editors here,so we use the parameters directly.
if (typeof json_editors[json_editor_number] === 'undefined') {
parameters_Json_editor = parameters;
let parameters_Json_editor = parameters;
} else {
parameters_Json_editor = JSON.stringify(json_editors[json_editor_number].get());
let parameters_Json_editor = JSON.stringify(json_editors[json_editor_number].get());
}
$('.runner button.forSave').attr("disabled","disabled");
$('.runner button.forDelete').attr("disabled","disabled");
@ -63,9 +62,8 @@ $(document).ready(function($) {
});
$('.runner button.forDelete').click(function() {
var t = $(this);
var runner = $(this).parent().parent().parent();
method_routing_id = $(runner).find('.method_routing_id').text();
let runner = $(this).parent().parent().parent();
let method_routing_id = $(runner).find('.method_routing_id').text();
$('.runner button.forSave').attr("disabled","disabled");
$('.runner button.forDelete').attr("disabled","disabled");
$.post('methodrouting/delete/method', {

View File

@ -99,7 +99,7 @@
<textarea class="form-control" rows="1"
name="bank_id_pattern">{{ method_routing.bank_id_pattern }}</textarea>
</div>
<div class="col-xs-12 col-sm-1" align="center">
<div class="col-xs-12 col-sm-1" style="align:center;">
<select class="is_bank_id_exact_match form-control">
{% if method_routing.is_bank_id_exact_match == False %}
<option value="False">{% trans "False" %}</option>

View File

@ -5,7 +5,6 @@ URLs for config app
from django.conf.urls import url
#from .views import IndexView, methodrouting_save, methodrouting_delete
from methodrouting.views import IndexView, methodrouting_save, methodrouting_delete
urlpatterns = [

View File

@ -51,13 +51,13 @@ class IndexView(LoginRequiredMixin, FormView):
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."))
method_Swagger_Url = '{}/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#"
method_Swagger_Url = "http://127.0.0.1:8082/message-docs?connector=stored_procedure_vDec2019#"
context.update({
'method_routings': method_routings,
"methodSwaggerUrl": methodSwaggerUrl
"method_Swagger_Url": method_Swagger_Url
})
return context
@ -68,7 +68,6 @@ def methodrouting_save(request):
connector_name = request.POST.get('connector_name')
bank_id_pattern = request.POST.get('bank_id_pattern')
is_bank_id_exact_match = request.POST.get('is_bank_id_exact_match')
parameters = request.POST.get('parameters')
method_routing_id = request.POST.get('method_routing_id')
parameters_Json_editor = request.POST.get('parameters_Json_editor')
#from sonarcloud: Dynamic code execution should not be vulnerable to injection attacks

View File

@ -68,7 +68,7 @@ class APIMetricsForm(MetricsForm):
('true', 'Yes'),
('false', 'No'),
)
VERB_SELECTION = (
SELECT_VERB = (
('', _('Any')),
('DELETE', 'DELETE'),
('GET', 'GET'),
@ -127,7 +127,7 @@ class APIMetricsForm(MetricsForm):
)
verb_selection = forms.ChoiceField(
label=_('Verb Select'),
choices=VERB_SELECTION,
choices=SELECT_VERB,
widget=forms.Select(
attrs={
'class': 'form-control',
@ -213,31 +213,15 @@ class ConnectorMetricsForm(MetricsForm):
class CustomSummaryForm(forms.Form):
to_date = forms.DateField(
label=_('To Date'),
# input_formats=[settings.API_DATEFORMAT],
# widget=forms.DateTimeInput(
# attrs={
# 'placeholder': 'yyyy-mm-ddThh:mm:ss',
# 'class': 'form-control',
# }
# ),
widget=DatePickerInput(format='%Y-%m-%d'),
required=True,
# initial=str(datetime.now().strftime('%Y-%m-%dT%H:%M:%S.%fZ')),
initial=str(datetime.now().strftime('%Y-%m-%d')),
)
from_date_custom = forms.DateField(
label=_('From Date'),
#input_formats=[settings.API_DATEFORMAT],
# widget=forms.DateTimeInput(
# attrs={
# 'placeholder': 'yyyy-mm-ddThh:mm:ss',
# 'class': 'form-control',
# }
# )
widget=DatePickerInput(format='%Y-%m-%d'),
required=True,
#initial=str(datetime.now().strftime('%Y-%m-%d')),
initial=(datetime.now() - timedelta(6)).strftime('%Y-%m-%d'),
)
exclude_app_names = forms.CharField(
@ -259,16 +243,8 @@ class CustomSummaryForm(forms.Form):
class MonthlyMetricsSummaryForm(forms.Form):
to_date = forms.DateField(
label=_('To Date'),
# input_formats=[settings.API_DATEFORMAT],
# widget=forms.DateTimeInput(
# attrs={
# 'placeholder': 'yyyy-mm-ddThh:mm:ss',
# 'class': 'form-control',
# }
# ),
widget=DatePickerInput(format='%Y-%m-%d'),
required=True,
# initial=str(datetime.now().strftime('%Y-%m-%dT%H:%M:%S.%fZ')),
initial=str(datetime.now().strftime('%Y-%m-%d')),
)
exclude_app_names = forms.CharField(

View File

@ -5,7 +5,7 @@ document.getElementsByClassName("include_system_calls")[0].innerHTML=`<div>
</div>`
function systemCalls(){
var checkbox = document.getElementById('include_system_calls_id');
let checkbox = document.getElementById('include_system_calls_id');
if (checkbox.checked == false) {
document.getElementById("obp_app_table").style.display = "none";
}else{

View File

@ -1,5 +1,5 @@
$(document).ready(function($) {
var barChart = new Chart($("#barchart"), {
let barChart = Chart($("#barchart"), {
type: 'horizontalBar',
data: {
labels: BarchartData['labels'],

View File

@ -3,8 +3,8 @@
{% load i18n %}
{% block nav_tabs %}
<li><a href="{% url 'api-metrics' %}?{{ request.GET.urlencode }}">{% trans "List" %}</a></li>
<li class="active"><a href="{% url 'api-metrics-summary-partial-function' %}?{{ request.GET.urlencode }}">{% trans "Summary by Partial Function" %}</a></li>
<a href="{% url 'api-metrics' %}?{{ request.GET.urlencode }}">{% trans "List" %}</a>
<a href="{% url 'api-metrics-summary-partial-function' %}?{{ request.GET.urlencode }}" class="active">{% trans "Summary by Partial Function" %}</a>
{% endblock nav_tabs %}
{% block tab_content %}

View File

@ -14,15 +14,12 @@
<li><a href="{% url 'metrics-summary' %}?{{ request.GET.urlencode }}">{% trans "Month" %}</a></li>
<li><a href="{% url 'weekly-summary' %}?{{ request.GET.urlencode }}">{% trans "Week" %}</a></li>
<li><a href="{% url 'daily-summary' %}?{{ request.GET.urlencode }}">{% trans "Day" %}</a></li>
<!--<li><a href="{% url 'hourly-summary' %}?{{ request.GET.urlencode }}">Hour</a></li>-->
<li class="active"><a href="{% url 'custom-summary' %}?{{ request.GET.urlencode }}">{% trans "Custom" %}</a></li>
{% endblock nav_tabs %}
</ul>
<div id="metrics-filter">
<!--{% load bootstrap3 %} {# import bootstrap4/bootstrap3 #}-->
<!--{% bootstrap_css %} {# Embed Bootstrap CSS #}-->
{% bootstrap_javascript jquery='full' %} {# Embed Bootstrap JS+jQuery #}
{% block extrahead %} {# Extra Resources Start #}

View File

@ -19,7 +19,6 @@
<li><a href="{% url 'metrics-summary' %}?{{ request.GET.urlencode }}">{% trans "Month" %}</a></li>
<li><a href="{% url 'weekly-summary' %}?{{ request.GET.urlencode }}">{% trans "Week" %}</a></li>
<li class="active"><a href="{% url 'daily-summary' %}?{{ request.GET.urlencode }}">{% trans "Day" %}</a></li>
<!--<li><a href="{% url 'hourly-summary' %}?{{ request.GET.urlencode }}">Hour</a></li>-->
<li><a href="{% url 'custom-summary' %}?{{ request.GET.urlencode }}">{% trans "Custom" %}</a></li>
{% endblock nav_tabs %}
</ul>

View File

@ -74,7 +74,7 @@
<div class="tab-pane active">
<h2>{% trans "Period" %}: {% trans "From" %}{{ from_date }} {% trans "to" %} {{ to_date }}</h2>
<table border="1" id="obp_app_table">
<table border="1" id="obp_app_table" summary="Table about call APIs in every hours">
<tr>
<th></th>
<th></th>
@ -89,11 +89,11 @@
</tr>
<tr>
<td>{% trans "Calls per minute" %}:</td>
<td bgcolor="#FF0000">{%for item in calls_per_hour_list%}<li>{{item}}</li>{% endfor %}</td>
<td style="background-color:#FF0000">{%for item in calls_per_hour_list%}<li><ol>{{item}}</ol></li>{% endfor %}</td>
</tr>
<tr>
<td>{% trans "Calls per minute" %}:</td>
<td bgcolor="#FF0000"><img src="data:image/png;base64, {{ per_hour_chart }}" alt="somealt" /></td>
<td style="background-color:#FF0000"><img src="data:image/png;base64, {{ per_hour_chart }}" alt="somealt" /></td>
</tr>
<tr>
<td>{% trans "Average number of calls hour" %}: </td>

View File

@ -14,15 +14,12 @@
<li class="active"><a href="{% url 'metrics-summary' %}?{{ request.GET.urlencode }}">{% trans "Month" %}</a></li>
<li><a href="{% url 'weekly-summary' %}?{{ request.GET.urlencode }}">{% trans "Week" %}</a></li>
<li><a href="{% url 'daily-summary' %}?{{ request.GET.urlencode }}">{% trans "Day" %}</a></li>
<!--<li><a href="{% url 'hourly-summary' %}?{{ request.GET.urlencode }}">Hour</a></li>-->
<li><a href="{% url 'custom-summary' %}?{{ request.GET.urlencode }}">{% trans "Custom" %}</a></li>
{% endblock nav_tabs %}
</ul>
<div id="metrics-filter">
<!--{% load bootstrap3 %} {# import bootstrap4/bootstrap3 #}-->
<!--{% bootstrap_css %} {# Embed Bootstrap CSS #}-->
{% bootstrap_javascript jquery='full' %} {# Embed Bootstrap JS+jQuery #}
{% block extrahead %} {# Extra Resources Start #}

View File

@ -18,7 +18,6 @@
<li><a href="{% url 'metrics-summary' %}?{{ request.GET.urlencode }}">{% trans "Month" %}</a></li>
<li><a href="{% url 'weekly-summary' %}?{{ request.GET.urlencode }}">{% trans "Week" %}</a></li>
<li><a href="{% url 'daily-summary' %}?{{ request.GET.urlencode }}">{% trans "Day" %}</a></li>
<!--<li><a href="{% url 'hourly-summary' %}?{{ request.GET.urlencode }}">Hour</a></li>-->
<li><a href="{% url 'custom-summary' %}?{{ request.GET.urlencode }}">{% trans "Custom" %}</a></li>
{% endblock nav_tabs %}
</ul>

View File

@ -20,7 +20,6 @@
<li><a href="{% url 'metrics-summary' %}?{{ request.GET.urlencode }}">{% trans "Month" %}</a></li>
<li class="active"><a href="{% url 'weekly-summary' %}?{{ request.GET.urlencode }}">{% trans "Week" %}</a></li>
<li><a href="{% url 'daily-summary' %}?{{ request.GET.urlencode }}">{% trans "Day" %}</a></li>
<!--<li><a href="{% url 'hourly-summary' %}?{{ request.GET.urlencode }}">Hour</a></li>-->
<li><a href="{% url 'custom-summary' %}?{{ request.GET.urlencode }}">{% trans "Custom" %}</a></li>
{% endblock nav_tabs %}
</ul>

View File

@ -20,7 +20,6 @@
<li><a href="{% url 'metrics-summary' %}?{{ request.GET.urlencode }}">{% trans "Month" %}</a></li>
<li><a href="{% url 'weekly-summary' %}?{{ request.GET.urlencode }}">{% trans "Week" %}</a></li>
<li><a href="{% url 'daily-summary' %}?{{ request.GET.urlencode }}">{% trans "Day" %}</a></li>
<!--<li><a href="{% url 'hourly-summary' %}?{{ request.GET.urlencode }}">Hour</a></li>-->
<li><a href="{% url 'custom-summary' %}?{{ request.GET.urlencode }}">{% trans "Custom" %}</a></li>
{% endblock nav_tabs %}
</ul>

View File

@ -354,7 +354,7 @@ class MonthlyMetricsSummaryView(LoginRequiredMixin, TemplateView):
# If include OBP Apps is selected
if cleaned_data.get('include_obp_apps'):
app_names = app_names
pass
else:
for app in app_names:
if app in local_settings.EXCLUDE_APPS:
@ -654,9 +654,7 @@ class MonthlyMetricsSummaryView(LoginRequiredMixin, TemplateView):
for api in top_apis:
api['Implemented_by_partial_function'] = api['Implemented_by_partial_function'] + '(' + api['implemented_in_version'] + ')'
top_apis = top_apis[:10]
# for api in top_apis:
# #print("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TOP APIS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
# print(str(top_apis.index(api) + 1) + "," + api['Implemented_by_partial_function'] + "," + str(api['count']))
# for api in top_apis.
top_apis = reversed(top_apis)
return top_apis
@ -812,8 +810,6 @@ class MonthlyMetricsSummaryView(LoginRequiredMixin, TemplateView):
if form.is_valid():
is_included_obp_apps = form.cleaned_data.get('include_obp_apps')
exclude_app_names = form.cleaned_data.get("exclude_app_names")
#if exclude_app_names not in local_settings.EXCLUDE_APPS:
# error_once_only(self.request, "Invalid Exclude App Name, Please select" + str(local_settings.EXCLUDE_APPS) + "Anyone of these")
form_to_date_string = form.data['to_date']
to_date = convert_form_date_to_obpapi_datetime_format(form_to_date_string)

View File

@ -1,7 +1,7 @@
{% extends 'base.html' %} {% load static %} {% load i18n %}
{% block page_title %} {{ block.super }} / {% trans "System View" %}{% endblock page_title %} {% block content %}
<div id="systemview">
<h1>{% trans "System View" %}</h1>
<h1>{% trans "System Views" %}</h1>
<div class="table-responsive">
<table class="table table-hover tablesorter" id="system_view" aria-describedby="system view">
<thead>