refactor(example): use a file for HTML form landing page example
This commit is contained in:
parent
e0d6712dd3
commit
1f041d3f74
|
@ -9,100 +9,7 @@ max_content_length = "10MB"
|
|||
upload_path = "./upload"
|
||||
timeout = "30s"
|
||||
expose_version = false
|
||||
landing_page = """
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>rustypaste</title>
|
||||
<meta charset="utf-8" />
|
||||
<style>
|
||||
body {
|
||||
background-color: #f2f2f2;
|
||||
font-family: arial, sans-serif;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
pre {
|
||||
background-color: #333;
|
||||
color: #fff;
|
||||
font-size: 18px;
|
||||
margin: 0;
|
||||
overflow: auto;
|
||||
padding: 20px;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
h2 {
|
||||
color: #333;
|
||||
font-size: 24px;
|
||||
margin-top: 40px;
|
||||
}
|
||||
form {
|
||||
margin: 20px 0;
|
||||
}
|
||||
input[type="url"],
|
||||
input[type="file"] {
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
|
||||
font-family: arial, sans-serif;
|
||||
font-size: 18px;
|
||||
margin-right: 10px;
|
||||
padding: 10px;
|
||||
width: 400px;
|
||||
}
|
||||
input[type="submit"] {
|
||||
background-color: #333;
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
|
||||
color: #fff;
|
||||
cursor: pointer;
|
||||
font-family: arial, sans-serif;
|
||||
font-size: 18px;
|
||||
padding: 10px 20px;
|
||||
transition: background-color 0.2s ease-in-out;
|
||||
}
|
||||
input[type="submit"]:hover {
|
||||
background-color: #444;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<pre>
|
||||
┬─┐┬ ┬┌─┐┌┬┐┬ ┬┌─┐┌─┐┌─┐┌┬┐┌─┐
|
||||
├┬┘│ │└─┐ │ └┬┘├─┘├─┤└─┐ │ ├┤
|
||||
┴└─└─┘└─┘ ┴ ┴ ┴ ┴ ┴└─┘ ┴ └─┘
|
||||
the server administrator might remove any pastes that they do not personally
|
||||
want to host.
|
||||
|
||||
by default, pastes expire every hour.
|
||||
</pre
|
||||
>
|
||||
<h2>share url</h2>
|
||||
<form action="/" method="post" enctype="multipart/form-data">
|
||||
<input type="url" name="url" />
|
||||
<input type="submit" value="share" />
|
||||
</form>
|
||||
|
||||
<h2>share file from url</h2>
|
||||
<form action="/" method="post" enctype="multipart/form-data">
|
||||
<input type="url" name="remote" />
|
||||
<input type="submit" value="share" />
|
||||
</form>
|
||||
|
||||
<h2>share file</h2>
|
||||
<form action="/" method="post" enctype="multipart/form-data">
|
||||
<input type="file" name="file" />
|
||||
<input type="submit" value="share" />
|
||||
</form>
|
||||
|
||||
<h2>share one-time file</h2>
|
||||
<form action="/" method="post" enctype="multipart/form-data">
|
||||
<input type="file" name="oneshot" />
|
||||
<input type="submit" value="share" />
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
"""
|
||||
landing_page_file = "landing_page.html"
|
||||
landing_page_content_type = "text/html; charset=utf-8"
|
||||
|
||||
[paste]
|
||||
|
|
|
@ -0,0 +1,92 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<title>rustypaste</title>
|
||||
<meta charset="utf-8" />
|
||||
<style>
|
||||
body {
|
||||
background-color: #f2f2f2;
|
||||
font-family: arial, sans-serif;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
pre {
|
||||
background-color: #333;
|
||||
color: #fff;
|
||||
font-size: 18px;
|
||||
margin: 0;
|
||||
overflow: auto;
|
||||
padding: 20px;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
h2 {
|
||||
color: #333;
|
||||
font-size: 24px;
|
||||
margin-top: 40px;
|
||||
}
|
||||
form {
|
||||
margin: 20px 0;
|
||||
}
|
||||
input[type="url"],
|
||||
input[type="file"] {
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
|
||||
font-family: arial, sans-serif;
|
||||
font-size: 18px;
|
||||
margin-right: 10px;
|
||||
padding: 10px;
|
||||
width: 400px;
|
||||
}
|
||||
input[type="submit"] {
|
||||
background-color: #333;
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
|
||||
color: #fff;
|
||||
cursor: pointer;
|
||||
font-family: arial, sans-serif;
|
||||
font-size: 18px;
|
||||
padding: 10px 20px;
|
||||
transition: background-color 0.2s ease-in-out;
|
||||
}
|
||||
input[type="submit"]:hover {
|
||||
background-color: #444;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<pre>
|
||||
┬─┐┬ ┬┌─┐┌┬┐┬ ┬┌─┐┌─┐┌─┐┌┬┐┌─┐
|
||||
├┬┘│ │└─┐ │ └┬┘├─┘├─┤└─┐ │ ├┤
|
||||
┴└─└─┘└─┘ ┴ ┴ ┴ ┴ ┴└─┘ ┴ └─┘
|
||||
the server administrator might remove any pastes that they do not personally
|
||||
want to host.
|
||||
|
||||
by default, pastes expire every hour.
|
||||
</pre
|
||||
>
|
||||
<h2>share url</h2>
|
||||
<form action="/" method="post" enctype="multipart/form-data">
|
||||
<input type="url" name="url" />
|
||||
<input type="submit" value="share" />
|
||||
</form>
|
||||
|
||||
<h2>share file from url</h2>
|
||||
<form action="/" method="post" enctype="multipart/form-data">
|
||||
<input type="url" name="remote" />
|
||||
<input type="submit" value="share" />
|
||||
</form>
|
||||
|
||||
<h2>share file</h2>
|
||||
<form action="/" method="post" enctype="multipart/form-data">
|
||||
<input type="file" name="file" />
|
||||
<input type="submit" value="share" />
|
||||
</form>
|
||||
|
||||
<h2>share one-time file</h2>
|
||||
<form action="/" method="post" enctype="multipart/form-data">
|
||||
<input type="file" name="oneshot" />
|
||||
<input type="submit" value="share" />
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue