mirror of
https://github.com/hansjone/netx.git
synced 2026-10-09 04:20:45 +08:00
Enrich WebCRT SFTP listing and add a resizable terminal split.
Show size, mtime, owner, group, and mode, and let users drag the SFTP panel width. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
499b4cc2a1
commit
12153b89fb
7 changed files with 397 additions and 138 deletions
|
|
@ -734,6 +734,20 @@ class WebcrtServiceTests(unittest.TestCase):
|
|||
# Direct SSH is allowed (no raise).
|
||||
_require_ssh_direct({"protocol": "ssh", "hop_enabled": False}, {"protocol": "ssh"})
|
||||
|
||||
def test_sftp_list_metadata_helpers(self) -> None:
|
||||
from types import SimpleNamespace
|
||||
|
||||
from netx_api.webcrt_sftp import _filemode, _owner_group
|
||||
|
||||
self.assertEqual(_filemode(0o100644), "-rw-r--r--")
|
||||
self.assertEqual(_filemode(0o040755), "drwxr-xr-x")
|
||||
owner, group = _owner_group(
|
||||
SimpleNamespace(longname="-rw------- 1 alice eng 12 Jan 1 00:00 a", st_uid=1000, st_gid=100)
|
||||
)
|
||||
self.assertEqual((owner, group), ("alice", "eng"))
|
||||
owner2, group2 = _owner_group(SimpleNamespace(longname="", st_uid=0, st_gid=1))
|
||||
self.assertEqual((owner2, group2), ("0", "1"))
|
||||
|
||||
@patch.object(svc, "_audit")
|
||||
def test_find_ssh_session_for_ne_prefers_attached(self, _mock_audit: MagicMock) -> None:
|
||||
conn = _FakeConn()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue