mirror of
https://github.com/schollz/hostyoself.git
synced 2026-01-23 02:15:14 +00:00
add file listing if nothing is found
This commit is contained in:
parent
3520f36f72
commit
78f06e76ca
3 changed files with 124 additions and 2 deletions
18
static/main.js
vendored
18
static/main.js
vendored
|
|
@ -121,7 +121,23 @@ const socketMessageListener = (event) => {
|
|||
}
|
||||
console.log(data)
|
||||
consoleLog(`[debug] ${data.message}`)
|
||||
if (data.type == "get") {
|
||||
if (data.type == "files") {
|
||||
if (files.length > 0) {
|
||||
socketSend({
|
||||
type: "files",
|
||||
message: JSON.stringify(files),
|
||||
success: true,
|
||||
key: document.getElementById("inputKey").value,
|
||||
});
|
||||
} else {
|
||||
socketSend({
|
||||
type: "files",
|
||||
message: "none found",
|
||||
success: false,
|
||||
key: document.getElementById("inputKey").value,
|
||||
});
|
||||
}
|
||||
} else if (data.type == "get") {
|
||||
var foundFile = false
|
||||
var iToSend = 0
|
||||
for (i = 0; i < files.length; i++) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue