parent
d2e7234d96
commit
769901c895
2 changed files with 118 additions and 98 deletions
|
@ -334,10 +334,14 @@ Changes the maximum width of the UI from 720 pixels to 1080 pixels.
|
||||||
|
|
||||||
Add the given public path prefix to all urls.
|
Add the given public path prefix to all urls.
|
||||||
|
|
||||||
|
The URL copy feature will only copy the entire URL if this is provided. Otherwise only the path (eg. `/url/dog-cat-bat`) will be copied to your clipboard!
|
||||||
|
|
||||||
This allows you to host MicroBin behind a reverse proxy on a subpath.
|
This allows you to host MicroBin behind a reverse proxy on a subpath.
|
||||||
Note that MicroBin itself still expects all routes to be as without this option, and thus is unsuited
|
Note that MicroBin itself still expects all routes to be as without this option, and thus is unsuited
|
||||||
if you are running MicroBin directly.
|
if you are running MicroBin directly.
|
||||||
|
|
||||||
|
Example: `--public-path https://myserver.com` or `--public-path http://localhost:8080`
|
||||||
|
|
||||||
#### Example Usage (caddy)
|
#### Example Usage (caddy)
|
||||||
|
|
||||||
An example of running MicroBin behind the reverse proxy `caddy` on the path `/paste` (using systemd)
|
An example of running MicroBin behind the reverse proxy `caddy` on the path `/paste` (using systemd)
|
||||||
|
|
|
@ -49,7 +49,8 @@
|
||||||
<td>
|
<td>
|
||||||
<a style="margin-right:1rem" href="{{ args.public_path }}/raw/{{pasta.id_as_animals()}}">Raw</a>
|
<a style="margin-right:1rem" href="{{ args.public_path }}/raw/{{pasta.id_as_animals()}}">Raw</a>
|
||||||
{% if pasta.file.is_some() %}
|
{% if pasta.file.is_some() %}
|
||||||
<a style="margin-right:1rem" href="{{ args.public_path }}/file/{{pasta.id_as_animals()}}/{{pasta.file.as_ref().unwrap().name()}}">File</a>
|
<a style="margin-right:1rem"
|
||||||
|
href="{{ args.public_path }}/file/{{pasta.id_as_animals()}}/{{pasta.file.as_ref().unwrap().name()}}">File</a>
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{% if pasta.editable %}
|
{% if pasta.editable %}
|
||||||
<a style="margin-right:1rem" href="{{ args.public_path }}/edit/{{pasta.id_as_animals()}}">Edit</a>
|
<a style="margin-right:1rem" href="{{ args.public_path }}/edit/{{pasta.id_as_animals()}}">Edit</a>
|
||||||
|
@ -99,7 +100,8 @@
|
||||||
{{pasta.expiration_as_string()}}
|
{{pasta.expiration_as_string()}}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a style="margin-right:1rem" href="{{ args.public_path }}raw/{{pasta.id_as_animals()}}">Raw</a>
|
<a style="margin-right:1rem" id="copy-button"
|
||||||
|
data-url="{{ args.public_path }}/url/{{pasta.id_as_animals()}}">Copy</a>
|
||||||
{% if pasta.editable %}
|
{% if pasta.editable %}
|
||||||
<a style="margin-right:1rem" href="{{ args.public_path }}/edit/{{pasta.id_as_animals()}}">Edit</a>
|
<a style="margin-right:1rem" href="{{ args.public_path }}/edit/{{pasta.id_as_animals()}}">Edit</a>
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
@ -112,4 +114,18 @@
|
||||||
</table>
|
</table>
|
||||||
<br>
|
<br>
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// const btn = document.getElementById("copy-button")
|
||||||
|
const btn = document.querySelector("#copy-button");
|
||||||
|
btn.addEventListener("click", () => {
|
||||||
|
navigator.clipboard.writeText(btn.dataset.url)
|
||||||
|
btn.innerHTML = "Copied"
|
||||||
|
setTimeout(() => {
|
||||||
|
btn.innerHTML = "Copy"
|
||||||
|
}, 1000)
|
||||||
|
})
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
{% include "footer.html" %}
|
{% include "footer.html" %}
|
Loading…
Add table
Reference in a new issue