mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-29 00:51:53 +08:00
optional upload prefix
This commit is contained in:
@@ -533,6 +533,12 @@
|
||||
<input type="text" id="msd-new-url" style="width: 100%">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Optional upload prefix:</td>
|
||||
<td>
|
||||
<input type="text" id="msd-new-prefix" style="width: 100%" placeholder="... like /foo/bar">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<hr>
|
||||
<table class="kv">
|
||||
@@ -544,6 +550,10 @@
|
||||
<td></td>
|
||||
<td>• To speed up the upload, close the stream window.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>• A non-empty upload prefix will be created when uploading.</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="hidden" id="msd-uploading-sub">
|
||||
|
||||
@@ -71,6 +71,9 @@ li(id="msd-dropdown" class="right feature-disabled")
|
||||
tr
|
||||
td #[b Or] paste a URL:
|
||||
td #[input(type="text" id="msd-new-url" style="width: 100%")]
|
||||
tr
|
||||
td Optional upload prefix:
|
||||
td #[input(type="text" id="msd-new-prefix" style="width: 100%" placeholder="... like /foo/bar")]
|
||||
hr
|
||||
table(class="kv")
|
||||
tr
|
||||
@@ -79,6 +82,9 @@ li(id="msd-dropdown" class="right feature-disabled")
|
||||
tr
|
||||
td
|
||||
td • To speed up the upload, close the stream window.
|
||||
tr
|
||||
td
|
||||
td • A non-empty upload prefix will be created when uploading.
|
||||
div(id="msd-uploading-sub" class="hidden")
|
||||
hr
|
||||
table(class="kv")
|
||||
|
||||
@@ -176,6 +176,16 @@ ul#navbar li div.menu div.buttons select {
|
||||
padding: 0 16px;
|
||||
}
|
||||
|
||||
ul#navbar li div.menu input[type=text] {
|
||||
height: 1.5em;
|
||||
}
|
||||
ul#navbar li div.menu input[type=text]::-moz-placeholder {
|
||||
text-align: center;
|
||||
}
|
||||
ul#navbar li div.menu input[type=text]::-webkit-input-placeholder {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
ul#navbar li div.menu hr {
|
||||
margin: 0;
|
||||
display: block;
|
||||
|
||||
@@ -114,11 +114,12 @@ export function Msd() {
|
||||
var __clickUploadNewButton = function() {
|
||||
let file = tools.input.getFile($("msd-new-file"));
|
||||
__http = new XMLHttpRequest();
|
||||
let prefix = encodeURIComponent($("msd-new-prefix").value);
|
||||
if (file) {
|
||||
__http.open("POST", `/api/msd/write?image=${encodeURIComponent(file.name)}&remove_incomplete=1`, true);
|
||||
__http.open("POST", `/api/msd/write?prefix=${prefix}&image=${encodeURIComponent(file.name)}&remove_incomplete=1`, true);
|
||||
} else {
|
||||
let url = $("msd-new-url").value;
|
||||
__http.open("POST", `/api/msd/write_remote?url=${encodeURIComponent(url)}&remove_incomplete=1`, true);
|
||||
__http.open("POST", `/api/msd/write_remote?prefix=${prefix}&url=${encodeURIComponent(url)}&remove_incomplete=1`, true);
|
||||
}
|
||||
__http.upload.timeout = 7 * 24 * 3600;
|
||||
__http.onreadystatechange = __httpStateChange;
|
||||
|
||||
Reference in New Issue
Block a user