- added new pasta type URL and automatic redirection endpoint

- added water.css styling
- added CL argument to set port
- added raw URL to pasta list
This commit is contained in:
Dániel Szabó 2022-04-23 16:47:36 +01:00
parent e8b0e3a482
commit f56ffa98e4
9 changed files with 251 additions and 120 deletions

View file

@ -3,22 +3,26 @@
<title>MicroBin</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<body style="max-width: 720px;
<link rel="stylesheet" href="/static/water.css">
</head>
<body style="
max-width: 720px;
margin: auto;
padding-left:0.5rem;
padding-right:0.5rem;
line-height: 1.5;
font-size: 1.1em;">
font-size: 1.1em;
">
<br>
<b style="margin-right: 0.5rem">
MicroBin
<i><span style="font-size:2.2rem; margin-right:1rem">μ</span></i> MicroBin
</b>
|
<a href="/" style="margin-right: 0.5rem; margin-left: 0.5rem">New Pasta</a>
|
<a href="/pastalist" style="margin-right: 0.5rem; margin-left: 0.5rem">Pasta List</a>
|
<a href="https://github.com/szabodanika/microbin" style="margin-right: 0.5rem; margin-left: 0.5rem">GitHub</a>
<hr>
<a href="/" style="margin-right: 0.5rem; margin-left: 0.5rem">New Pasta</a>
<a href="/pastalist" style="margin-right: 0.5rem; margin-left: 0.5rem">Pasta List</a>
<a href="https://github.com/szabodanika/microbin" style="margin-right: 0.5rem; margin-left: 0.5rem">GitHub</a>
<hr>

View file

@ -1,6 +1,6 @@
{% include "header.html" %}
<form action="create" method="POST">
<input name="id" value="0" type="hidden">
<br>
<label for="expiration">Expiration</label><br>
<select name="expiration" id="expiration">
<optgroup label="Expire">
@ -15,9 +15,9 @@
<br>
<label>Content</label>
<br>
<textarea style="width: 100%; min-height: 100px" name="content"></textarea>
<br>
<textarea style="width: 100%; min-height: 100px" name="content" autofocus></textarea>
<br>
<input style="width: 100px; background-color: limegreen"; type="submit" value="Save"/>
<br>
</form>
{% include "footer.html" %}
{% include "footer.html" %}

View file

@ -1,6 +1,4 @@
{% include "header.html" %}
<a href="/rawpasta/{{pasta.idAsAnimals()}}">Raw Pasta</a>
<pre style="background: lightgray; border: 1px black solid; padding: 0.5rem; overflow: auto">
{{pasta}}
</pre>
{% include "footer.html" %}
<a href="/raw/{{pasta.idAsAnimals()}}">Raw Pasta</a>
<pre><code>{{pasta}}</code></pre>
{% include "footer.html" %}

View file

@ -6,8 +6,13 @@
No pastas yet. 😔 Create one <a href="/">here</a>.
</p>
{%- else %}
<table style="width: 100%" border="1">
<tr style="background: lightgrey">
<br>
<table style="width: 100%">
<thead>
<tr>
<th colspan="4">Pastas</th>
</tr>
<tr>
<th>
Key
</th>
@ -21,22 +26,71 @@
</th>
</tr>
</thead>
<tbody>
{% for pasta in pastas %}
<tr>
<td>
<a href="/pasta/{{pasta.idAsAnimals()}}">{{pasta.idAsAnimals()}}</a>
</td>
<td>
{{pasta.createdAsString()}}
</td>
<td>
{{pasta.expirationAsString()}}
</td>
<td>
<a href="/remove/{{pasta.idAsAnimals()}}">Remove</a>
</td>
</tr>
{% if pasta.pasta_type == "text" %}
<tr>
<td>
<a href="/pasta/{{pasta.idAsAnimals()}}">{{pasta.idAsAnimals()}}</a>
</td>
<td>
{{pasta.createdAsString()}}
</td>
<td>
{{pasta.expirationAsString()}}
</td>
<td>
<a style="margin-right:1rem" href="/raw/{{pasta.idAsAnimals()}}">Raw</a>
<a href="/remove/{{pasta.idAsAnimals()}}">Remove</a>
</td>
</tr>
{%- endif %}
{% endfor %}
</tbody>
</table>
<br>
<table>
<thead>
<tr>
<th colspan="4">URL Redirects</th>
</tr>
<tr >
<th>
Key
</th>
<th>
Created
</th>
<th>
Expiration
</th>
<th>
</th>
</tr>
</thead>
{% for pasta in pastas %}
{% if pasta.pasta_type == "url" %}
<tr>
<td>
<a href="/url/{{pasta.idAsAnimals()}}">{{pasta.idAsAnimals()}}</a>
</td>
<td>
{{pasta.createdAsString()}}
</td>
<td>
{{pasta.expirationAsString()}}
</td>
<td>
<a style="margin-right:1rem" href="/raw/{{pasta.idAsAnimals()}}">Raw</a>
<a href="/remove/{{pasta.idAsAnimals()}}">Remove</a>
</td>
</tr>
{%- endif %}
{% endfor %}
</tbody>
</table>
<br>
{%- endif %}
{% include "footer.html" %}
{% include "footer.html" %}