diff --git a/blueprints/terminal.py b/blueprints/terminal.py index 9574edb..f295e8f 100644 --- a/blueprints/terminal.py +++ b/blueprints/terminal.py @@ -140,7 +140,6 @@ def is_valid_binary(path: str) -> bool: if is_valid_path("/".join(parts[:-1])): files = get_nodes_in_directory("/".join(parts[:-1])) for item in files: - print(item) if item["name"] == parts[-1] and item["type"] == 2: return True return False @@ -236,7 +235,6 @@ def ls(): return json_response(request, {"output": f"ls: cannot access '{path}': No such file or directory"}, 200) files = get_nodes_in_directory(path) - print(files) output = [file["name"] for file in files] if all_files: output.insert(0, ".") @@ -420,7 +418,7 @@ def nano(): return json_response(request, {"output": f"nano: cannot write to '{path}': Permission denied"}, 200) if update_file_content(path, content): - output = f"File '{path}' updated successfully" + output = "" else: output = f"nano: failed to update '{path}'" else: diff --git a/templates/terminal.html b/templates/terminal.html index fe45d3d..d0535b3 100644 --- a/templates/terminal.html +++ b/templates/terminal.html @@ -39,6 +39,52 @@ flex: 1; caret-color: #0f0; } + #nano-editor { + display: none; + position: fixed; + top: 0; + left: 0; + width: 100vw; + height: 100vh; + background: #000; + z-index: 1000; + flex-direction: column; + } + #nano-editor.active { + display: flex; + } + #nano-header { + padding: 10px 20px; + border-bottom: 1px solid #0f0; + color: #0f0; + } + #nano-textarea { + flex: 1; + background: #000; + color: #fff; + border: none; + padding: 20px; + font-family: 'Courier New', monospace; + font-size: 16px; + resize: none; + outline: none; + } + #nano-footer { + padding: 10px 20px; + border-top: 1px solid #0f0; + color: #0f0; + font-size: 14px; + } + #nano-save-prompt { + display: none; + padding: 10px 20px; + background: #111; + border-top: 1px solid #0f0; + color: #fff; + } + #nano-save-prompt.active { + display: block; + } @@ -56,13 +102,27 @@ + +