Archived
1
0
Fork 0

Make the application modular to have a "main" and "backend" part.

This commit is contained in:
Henrik Hautakoski 2018-10-09 22:26:01 +02:00
parent 884f721002
commit e5b0e1fcfd
No known key found for this signature in database
GPG key ID: 839F3A7EAFAEAFAA
28 changed files with 112 additions and 7 deletions

View file

@ -0,0 +1,14 @@
<div class="section">
<h1>Callback created</h1>
<p>Set this link as callback url for the service you want to debug:</p>
<strong>{{ serverUrl() }}{{ url(['for': 'cb-endpoint', 'id': id]) }}</strong>
<a class="button button-default" href="{{ url('/callback/show/' ~ id) }}">
{{ icon('solid/eye') }} View
</a>
</div>

View file

@ -0,0 +1,69 @@
<div class="section">
<div class="clearfix">
<h2 class="pull-left">Callbacks</h2>
<div class="pull-right">
<a class="button button-large button-primary" href="{{ url('/callback/new') }}">
{{ icon('solid/plus') }} New
</a>
</div>
</div>
{% if page.items|length > 0 %}
<div class="callback-list">
{% for item in page.items %}
<div class="callback-list-item">
<div class="callback-list-item-header">
<a class="callback-list-item-name" href="/callback/show/{{ item.public_id }}">{{ item.name|e }}</a>
{% if item.countRequests() > 0 %}
<span class="badge badge-primary">
{{ item.countRequests() }} Requests
</span>
{% endif %}
</div>
<div class="callback-list-item-info">
<span>{{ icon('clock') }} Created at: {{ item.created_at }}</span>
<span>
{{ icon('paper-plane') }}
{% if item.countRequests() > 0 %}
Last request: {{ item.last_request }}
{% else %}
No requests yet.
{% endif %}
</span>
<span>
{{ icon('solid/link') }}
{{ serverUrl() }}{{ url(['for': 'cb-endpoint', 'id': item.public_id]) }}
</span>
</div>
<a class="callback-list-item-arrow" href="/callback/show/{{ item.public_id }}">
{{ icon('solid/arrow-alt-circle-right') }}
</a>
</div>
{% endfor %}
</div>
{% else %}
<div class="blankslate">
<h3>No callbacks made yet.</h3>
<p><a href="{{ url('/callback/new') }}">Create</a> a callback to begin!</p>
</div>
{% endif %}
<nav class="text-center" aria-label="Page navigation">
{{ partial('pagination') }}
</nav>
</div>

View file

@ -0,0 +1,39 @@
<div class="section center-block" style="width: 400px">
<h2>Create callback</h2>
<!--
<form class="form-horizontal" method="post">
<div class="form-group">
<label class="col-sm-2 control-label" for="name">Name</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="name" id="name">
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<input type="submit" class="button button-brand" value="Create">
</div>
</div>
</form>
-->
<form class="form-horizontal" method="post">
<div class="form-group">
<label class="col-sm-2 control-label" for="name">Name</label>
<div class="col-sm-10">
{{ form.render('Name') }}
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
{{ form.render('Create') }}
</div>
</div>
</form>
</div>

View file

@ -0,0 +1,140 @@
<div class="section">
<div class="clearfix">
<h3 class="pull-left">{{ item.name|e }}</h3>
<h5 class="pull-right"><strong>Created at:</strong> {{ item.created_at }}</h5>
</div>
<div class="panel-group request-list" id="request-list" role="tablist" aria-multiselectable="true">
{% for index, req in page.items %}
<div class="panel request-list-item">
<a id="request-item-head-{{ index }}" class="request-list-item-header collapsed"
href="#request-item-body-{{ index }}" aria-controls="request-item-body-{{ index }}"
data-parent="#request-list" data-toggle="collapse" aria-expanded="true" >
<div class="request-list-item-header-row">
<span class="request-list-item-header-method">
{{ req.getMethod() }}
</span>
<span class="request-list-item-header-uri">
<span class="url">{{ urlStyle(req.getUri()) }}</span>
</span>
<span class="request-list-item-header-timestamp">
{{ icon('clock') }} {{ req.getTimestamp() }}
</span>
</div>
<div class="request-list-item-header-row">
<span class="request-list-item-header-type">
{{ icon('file-alt') }} {{ req.getType() }}
</span>
<span class="request-list-item-header-size">
{{ icon('solid/database') }} {{ req.getSize() }} b
</span>
<span class="request-list-item-header-ip">
{{ icon('compass') }} {{ req.getSourceIp() }}
</span>
</div>
</a>
<div id="request-item-body-{{ index }}" class="collapse"
role="tabpanel" aria-labelledby="request-item-head-{{ index }}">
<div class="request-list-item-detail">
{% if req.getUriQuery()|length > 0 %}
<button class="request-list-item-detail-button" type="button"
data-toggle="collapse" data-target="#request-list-item-detail-query-{{ index }}"
aria-expanded="false" aria-controls="request-list-item-detail-query-{{ index }}">
Query
</button>
<div id="request-list-item-detail-query-{{ index }}" class="collapse in">
<table class="request-list-item-detail-headers">
<thead>
<tr>
<th class="request-list-item-detail-headers-key">Key</th>
<th class="request-list-item-detail-headers-value">Value</th>
</tr>
</thead>
<tbody>
{% for key, val in req.getUriQuery() %}
<tr>
<td><strong>{{ key|e }}</strong></td>
<td>{{ val|e }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endif %}
<button class="request-list-item-detail-button" type="button"
data-toggle="collapse" data-target="#request-list-item-detail-headers-{{ index }}"
aria-expanded="false" aria-controls="request-list-item-detail-headers-{{ index }}">
Headers
</button>
<div id="request-list-item-detail-headers-{{ index }}" class="collapse">
<table class="request-list-item-detail-headers">
<thead>
<tr>
<th class="request-list-item-detail-headers-key">Key</th>
<th class="request-list-item-detail-headers-value">Value</th>
</tr>
</thead>
<tbody>
{% for key, val in req.getHeaders() %}
<tr>
<td><strong>{{ key|e }}</strong></td>
<td>{{ val|e }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<button class="request-list-item-detail-button" type="button"
data-toggle="collapse" data-target="#request-list-item-detail-body-{{ index }}"
aria-expanded="false" aria-controls="request-list-item-detail-body-{{ index }}">
Body
</button>
<div id="request-list-item-detail-body-{{ index }}" class="request-list-item-detail-body collapse in">
{% if (req.getBody()|length < 1) %}
<div class="blankslate blankslate-sm">
<h3>Empty body</h3>
</div>
{% else %}
<pre>{{ req.getBody() }}</pre>
{% endif %}
</div>
</div>
</div>
</div>
{% else %}
<div class="blankslate">
<h3>No requests made yet.</h3>
<p>No http requests has been made to this callback.</p>
</div>
{% endfor %}
</div>
<nav class="text-center" aria-label="Page navigation">
{{ partial('pagination') }}
</nav>
</div>