Skip to content

Commit

Permalink
Merge pull request OpenBankProject#55 from OpenBankProject/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
simonredfern authored Aug 19, 2018
2 parents c281da9 + 83fe0bc commit 40038e3
Show file tree
Hide file tree
Showing 13 changed files with 423 additions and 426 deletions.
16 changes: 15 additions & 1 deletion apimanager/apimanager/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'bootstrap3',
'bootstrap_datepicker_plus',
'mathfilters',

'base',
Expand Down Expand Up @@ -235,4 +237,16 @@
# Settings here might use parts overwritten in local settings
API_ROOT = API_HOST + API_BASE_PATH + API_VERSION
# For some reason, swagger is not available at the latest API version
API_URL_SWAGGER = API_HOST + '/obp/v1.4.0/resource-docs/v' + API_VERSION + '/swagger' # noqa
API_URL_SWAGGER = API_HOST + '/obp/v1.4.0/resource-docs/v' + API_VERSION + '/swagger' # noqa

CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': 'unix:/tmp/memcached.sock',
}
}

# Use BOOTSTRAP3 if you are using Bootstrap 3
BOOTSTRAP4 = {
'include_jquery': True,
}
20 changes: 18 additions & 2 deletions apimanager/base/static/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,24 @@ footer a:hover, .footer a:focus {
margin-left: 15px;
}

.dropdown-menu > .active > a, .dropdown-menu > .active > a:hover, .dropdown-menu > .active > a:active {
background-color: #53c4ef;
/*.dropdown-menu > .active > a, .dropdown-menu > .active > a:hover, .dropdown-menu > .active > a:active {*/
/*background-color: #53c4ef;*/
/*}*/

.dropdown-menu .sub-menu {
/*left: 100%;*/
position: absolute;
top: 0;
visibility: hidden;
margin-top: -1px;
}

.dropdown-menu li:hover .sub-menu {
visibility: visible;
}

.dropdown:hover .dropdown-menu {
display: block;
}

.btn-primary {
Expand Down
2 changes: 1 addition & 1 deletion apimanager/base/static/css/bootstrap.min.css

Large diffs are not rendered by default.

58 changes: 32 additions & 26 deletions apimanager/metrics/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@

from django import forms
from django.conf import settings
from datetime import date
from django.forms.widgets import SelectMultiple,CheckboxInput,CheckboxSelectMultiple
from datetime import datetime, timedelta
from time import strftime

from bootstrap_datepicker_plus import DatePickerInput, DateTimePickerInput

class MetricsForm(forms.Form):
start_date = forms.DateTimeField(
Expand Down Expand Up @@ -208,28 +210,30 @@ class ConnectorMetricsForm(MetricsForm):
class CustomSummaryForm(forms.Form):
to_date = forms.DateTimeField(
label='To Date',
input_formats=[settings.API_DATEFORMAT],
widget=forms.DateTimeInput(
attrs={
'placeholder': 'yyyy-mm-ddThh:mm:ss',
'class': 'form-control',
}
),
#input_formats=[settings.API_DATEFORMAT],
# widget=forms.DateTimeInput(
# attrs={
# 'placeholder': 'yyyy-mm-ddThh:mm:ss',
# 'class': 'form-control',
# }
# ),
widget=DateTimePickerInput(format='%Y-%m-%d %H:%M:%S'),
required=True,
initial=datetime.now().strftime('%Y-%m-%dT%H:%M:%S.%fZ'),
initial=str(datetime.now().strftime('%Y-%m-%d %H:%M:%S')),
)

from_date_custom = forms.DateTimeField(
label='Start Date',
input_formats=[settings.API_DATEFORMAT],
widget=forms.DateTimeInput(
attrs={
'placeholder': 'yyyy-mm-ddThh:mm:ss',
'class': 'form-control',
}
),
label='From Date',
#input_formats=[settings.API_DATEFORMAT],
# widget=forms.DateTimeInput(
# attrs={
# 'placeholder': 'yyyy-mm-ddThh:mm:ss',
# 'class': 'form-control',
# }
# ),
widget=DateTimePickerInput(format='%Y-%m-%d %H:%M:%S'),
required=True,
initial= (datetime.now() - timedelta(6)).strftime('%Y-%m-%dT%H:%M:%S.%fZ'),
initial= (datetime.now() - timedelta(6)).strftime('%Y-%m-%d %H:%M:%S'),
)

include_obp_apps = forms.BooleanField(required=False)
Expand All @@ -241,15 +245,17 @@ def __init__(self, *args, **kwargs):
class MetricsSummaryForm(forms.Form):
to_date = forms.DateTimeField(
label='To Date',
input_formats=[settings.API_DATEFORMAT],
widget=forms.DateTimeInput(
attrs={
'placeholder': 'yyyy-mm-ddThh:mm:ss',
'class': 'form-control',
}
),
#input_formats=[settings.API_DATEFORMAT],
# widget=forms.DateTimeInput(
# attrs={
# 'placeholder': 'yyyy-mm-ddThh:mm:ss',
# 'class': 'form-control',
# }
# ),
widget=DateTimePickerInput(format='%Y-%m-%d %H:%M:%S'),
required=True,
initial=datetime.now().strftime('%Y-%m-%dT%H:%M:%S.%fZ'),
#initial=str(datetime.now().strftime('%Y-%m-%dT%H:%M:%S.%fZ')),
initial=str(datetime.now().strftime('%Y-%m-%d %H:%M:%S')),
)

include_obp_apps = forms.BooleanField(required=False)
Expand Down
15 changes: 12 additions & 3 deletions apimanager/metrics/templates/metrics/custom_summary.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,21 @@ <h2>API instance : {{ api_host_name }}</h2>
<li><a href="{% url 'metrics-summary' %}?{{ request.GET.urlencode }}">Month</a></li>
<li><a href="{% url 'weekly-summary' %}?{{ request.GET.urlencode }}">Week</a></li>
<li><a href="{% url 'daily-summary' %}?{{ request.GET.urlencode }}">Day</a></li>
<li><a href="{% url 'hourly-summary' %}?{{ request.GET.urlencode }}">Hour</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 }}">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 #}
{{ form.media }} {# Form required JS and CSS #}
{% endblock %}

<h2>Filter</h2>
<form action="{% url 'custom-summary' %}" method="get">
{% if form.non_field_errors %}
Expand All @@ -51,7 +60,7 @@ <h2>Filter</h2>

<div class="col-xs-6 col-sm-3">
<div class="form-group">
{{ form.include_obp_apps }} Include OBP
{{ form.include_obp_apps }} Include System Calls
</div>
</div>

Expand Down Expand Up @@ -90,7 +99,7 @@ <h2>Period : From {{ from_date }} to {{ to_date }}</h2>
</tr>
<tr>
<td>Median time from consumer registration to first API call:</td>
<td>[]</td>
<td>{{ median_time_to_first_api_call }}</td>
</tr>

<tr>
Expand Down
21 changes: 15 additions & 6 deletions apimanager/metrics/templates/metrics/daily_summary.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,26 @@ <h2>API instance : {{ api_host_name }}</h2>
<div id="metrics-data">
<ul class="nav nav-tabs">
{% block nav_tabs %}
<!--<li><a href="{% url 'yearly-summary' %}?{{ request.GET.urlencode }}">Year</a></li>-->
<!--<li><a href="{% url 'quarterly-summary' %}?{{ request.GET.urlencode }}">Quarter</a></li>-->
<!--<li><a href="{% url 'metrics-summary' %}?{{ request.GET.urlencode }}">Month</a></li>-->
<li><a href="{% url 'yearly-summary' %}?{{ request.GET.urlencode }}">Year</a></li>
<li><a href="{% url 'quarterly-summary' %}?{{ request.GET.urlencode }}">Quarter</a></li>
<li><a href="{% url 'metrics-summary' %}?{{ request.GET.urlencode }}">Month</a></li>
<li><a href="{% url 'weekly-summary' %}?{{ request.GET.urlencode }}">Week</a></li>
<li class="active"><a href="{% url 'daily-summary' %}?{{ request.GET.urlencode }}">Day</a></li>
<!--<li><a href="{% url 'hourly-summary' %}?{{ request.GET.urlencode }}">Hour</a></li>-->
<!--<li><a href="{% url 'custom-summary' %}?{{ request.GET.urlencode }}">Custom</a></li>-->
<li><a href="{% url 'custom-summary' %}?{{ request.GET.urlencode }}">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 #}
{{ form.media }} {# Form required JS and CSS #}
{% endblock %}

<h2>Filter</h2>
<form action="{% url 'daily-summary' %}" method="get">
{% if form.non_field_errors %}
Expand All @@ -44,7 +53,7 @@ <h2>Filter</h2>

<div class="col-xs-6 col-sm-3">
<div class="form-group">
{{ form.include_obp_apps }} Include OBP
{{ form.include_obp_apps }} Include System Calls
</div>
</div>

Expand Down Expand Up @@ -84,7 +93,7 @@ <h2>Period : From {{ from_date }} to {{ to_date }}</h2>

<tr>
<td>Median time from consumer registration to first API call:</td>
<td>[]</td>
<td>{{ median_time_to_first_api_call }}</td>
</tr>

<tr>
Expand Down
13 changes: 11 additions & 2 deletions apimanager/metrics/templates/metrics/hourly_summary.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ <h2>API instance : {{ api_host_name }}</h2>
</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 #}
{{ form.media }} {# Form required JS and CSS #}
{% endblock %

<h2>Filter</h2>
<form action="{% url 'hourly-summary' %}" method="get">
{% if form.non_field_errors %}
Expand All @@ -43,7 +52,7 @@ <h2>Filter</h2>

<div class="col-xs-6 col-sm-3">
<div class="form-group">
{{ form.include_obp_apps }} Include OBP
{{ form.include_obp_apps }} Include System Calls
</div>
</div>

Expand Down Expand Up @@ -86,7 +95,7 @@ <h2>Period : From {{ from_date }} to {{ to_date }}</h2>

<tr>
<td>Median time from consumer registration to first API call:</td>
<td>[]</td>
<td>{{ median_time_to_first_api_call }}</td>
</tr>

<tr>
Expand Down
15 changes: 12 additions & 3 deletions apimanager/metrics/templates/metrics/quarterly_summary.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,21 @@ <h2>API instance : {{ api_host_name }}</h2>
<li><a href="{% url 'metrics-summary' %}?{{ request.GET.urlencode }}">Month</a></li>
<li><a href="{% url 'weekly-summary' %}?{{ request.GET.urlencode }}">Week</a></li>
<li><a href="{% url 'daily-summary' %}?{{ request.GET.urlencode }}">Day</a></li>
<li><a href="{% url 'hourly-summary' %}?{{ request.GET.urlencode }}">Hour</a></li>
<!--<li><a href="{% url 'hourly-summary' %}?{{ request.GET.urlencode }}">Hour</a></li>-->
<li><a href="{% url 'custom-summary' %}?{{ request.GET.urlencode }}">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 #}
{{ form.media }} {# Form required JS and CSS #}
{% endblock %}

<h2>Filter</h2>
<form action="{% url 'quarterly-summary' %}" method="get">
{% if form.non_field_errors %}
Expand All @@ -43,7 +52,7 @@ <h2>Filter</h2>

<div class="col-xs-6 col-sm-3">
<div class="form-group">
{{ form.include_obp_apps }} Include OBP
{{ form.include_obp_apps }} Include System Calls
</div>
</div>

Expand Down Expand Up @@ -87,7 +96,7 @@ <h2>Period : From {{ from_date }} to {{ to_date }}</h2>

<tr>
<td>Median time from consumer registration to first API call:</td>
<td>[]</td>
<td>{{ median_time_to_first_api_call }}</td>
</tr>

<tr>
Expand Down
21 changes: 15 additions & 6 deletions apimanager/metrics/templates/metrics/summary.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,26 @@ <h2>API instance : {{ api_host_name }}</h2>
<div id="metrics-data">
<ul class="nav nav-tabs">
{% block nav_tabs %}
<!--<li><a href="{% url 'yearly-summary' %}?{{ request.GET.urlencode }}">Year</a></li>-->
<!--<li><a href="{% url 'quarterly-summary' %}?{{ request.GET.urlencode }}">Quarter</a></li>-->
<li><a href="{% url 'yearly-summary' %}?{{ request.GET.urlencode }}">Year</a></li>
<li><a href="{% url 'quarterly-summary' %}?{{ request.GET.urlencode }}">Quarter</a></li>
<li class="active"><a href="{% url 'metrics-summary' %}?{{ request.GET.urlencode }}">Month</a></li>
<!--<li><a href="{% url 'weekly-summary' %}?{{ request.GET.urlencode }}">Week</a></li>-->
<li><a href="{% url 'weekly-summary' %}?{{ request.GET.urlencode }}">Week</a></li>
<li><a href="{% url 'daily-summary' %}?{{ request.GET.urlencode }}">Day</a></li>
<!--<li><a href="{% url 'hourly-summary' %}?{{ request.GET.urlencode }}">Hour</a></li>-->
<!--<li><a href="{% url 'custom-summary' %}?{{ request.GET.urlencode }}">Custom</a></li>-->
<li><a href="{% url 'custom-summary' %}?{{ request.GET.urlencode }}">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 #}
{{ form.media }} {# Form required JS and CSS #}
{% endblock %}

<h2>Filter</h2>
<form action="{% url 'metrics-summary' %}" method="get">
{% if form.non_field_errors %}
Expand All @@ -45,7 +54,7 @@ <h2>Filter</h2>

<div class="col-xs-6 col-sm-3">
<div class="form-group">
{{ form.include_obp_apps }} Include OBP
{{ form.include_obp_apps }} Include System Calls
</div>
</div>

Expand Down Expand Up @@ -84,7 +93,7 @@ <h2>Period : From {{ from_date }} to {{ to_date }}</h2>
</tr>
<tr>
<td>Median time from consumer registration to first API call:</td>
<td>[]</td>
<td>{{ median_time_to_first_api_call }}</td>
</tr>

<tr>
Expand Down
Loading

0 comments on commit 40038e3

Please sign in to comment.