Merge pull request #72 from hay-kot/feat/disable-file-attachment
feat: disable file attachment
This commit is contained in:
commit
bc26fe87a5
4 changed files with 18 additions and 5 deletions
|
@ -329,3 +329,7 @@ Displays your MicroBin's version information.
|
||||||
### --wide
|
### --wide
|
||||||
|
|
||||||
Changes the maximum width of the UI from 720 pixels to 1080 pixels.
|
Changes the maximum width of the UI from 720 pixels to 1080 pixels.
|
||||||
|
|
||||||
|
### --no-file-upload
|
||||||
|
|
||||||
|
Disables and hides the file upload option in the UI.
|
|
@ -59,4 +59,7 @@ pub struct Args {
|
||||||
|
|
||||||
#[clap(long, env="MICROBIN_WIDE")]
|
#[clap(long, env="MICROBIN_WIDE")]
|
||||||
pub wide: bool,
|
pub wide: bool,
|
||||||
|
|
||||||
|
#[clap(short, long, env="MICROBIN_NO_FILE_UPLOAD")]
|
||||||
|
pub no_file_upload: bool,
|
||||||
}
|
}
|
|
@ -106,6 +106,10 @@ pub async fn create(
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
"file" => {
|
"file" => {
|
||||||
|
if ARGS.no_file_upload {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
let path = field.content_disposition().get_filename();
|
let path = field.content_disposition().get_filename();
|
||||||
|
|
||||||
let path = match path {
|
let path = match path {
|
||||||
|
|
|
@ -59,11 +59,13 @@
|
||||||
<input type="hidden" name="syntax-highlight" value="none">
|
<input type="hidden" name="syntax-highlight" value="none">
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
|
{% if !args.no_file_upload %}
|
||||||
<div>
|
<div>
|
||||||
<label>File attachment</label>
|
<label>File attachment</label>
|
||||||
<br>
|
<br>
|
||||||
<input style="width: 100%;" type="file" id="file" name="file">
|
<input style="width: 100%;" type="file" id="file" name="file">
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<label>Content</label>
|
<label>Content</label>
|
||||||
<br>
|
<br>
|
||||||
|
|
Loading…
Reference in a new issue