From dcedb74824f619f677a04d91b2f3c52c0aecf9f5 Mon Sep 17 00:00:00 2001 From: Yann Stepienik Date: Sun, 15 Dec 2024 16:53:31 +0000 Subject: [PATCH] [skip ci] readme --- client/src/api/docker.demo.jsx | 14 +- client/src/api/storage.demo.jsx | 244 ++++++++++++++++++++++++++++++++ 2 files changed, 250 insertions(+), 8 deletions(-) diff --git a/client/src/api/docker.demo.jsx b/client/src/api/docker.demo.jsx index 531f8f2d..74c2e24a 100644 --- a/client/src/api/docker.demo.jsx +++ b/client/src/api/docker.demo.jsx @@ -152,14 +152,12 @@ function getContainerLogs(containerId, searchQuery, limit, lastReceivedLogs, err } function attachTerminal(name) { - return new Promise((resolve, reject) => { - setTimeout(() => { - resolve({ - "status": "ok", - })}, - 100 - ); - }); + return { + send: (data) => { + onmessage("This is a demo, what did you expect?"); + }, + close: ()=>{} + }; } function createTerminal(name) { diff --git a/client/src/api/storage.demo.jsx b/client/src/api/storage.demo.jsx index 72d52406..098f33c9 100644 --- a/client/src/api/storage.demo.jsx +++ b/client/src/api/storage.demo.jsx @@ -10827,8 +10827,252 @@ const snapRAID = { }, }; +const listDir = (storage, path) => { + return new Promise((resolve, reject) => { + setTimeout(() => { + resolve({ + "data": { + "directory": [ + { + "name": "bin", + "type": "file", + "size": 7, + "isDir": false, + "ext": "", + "created": 1686543832, + "uid": 0, + "gid": 0, + "fullPath": "/mnt/host/bin" + }, + { + "name": "boot", + "type": "directory", + "size": 4096, + "isDir": true, + "ext": "", + "created": 1732516405, + "uid": 0, + "gid": 0, + "fullPath": "/mnt/host/boot" + }, + { + "name": "dev", + "type": "directory", + "size": 3020, + "isDir": true, + "ext": "", + "created": 1704722510, + "uid": 0, + "gid": 0, + "fullPath": "/mnt/host/dev" + }, + { + "name": "etc", + "type": "directory", + "size": 4096, + "isDir": true, + "ext": "", + "created": 1731221224, + "uid": 0, + "gid": 0, + "fullPath": "/mnt/host/etc" + }, + { + "name": "home", + "type": "directory", + "size": 4096, + "isDir": true, + "ext": "", + "created": 1677765300, + "uid": 0, + "gid": 0, + "fullPath": "/mnt/host/home" + }, + { + "name": "lib", + "type": "file", + "size": 7, + "isDir": false, + "ext": "", + "created": 1686543832, + "uid": 0, + "gid": 0, + "fullPath": "/mnt/host/lib" + }, + { + "name": "lib64", + "type": "file", + "size": 9, + "isDir": false, + "ext": "", + "created": 1686543832, + "uid": 0, + "gid": 0, + "fullPath": "/mnt/host/lib64" + }, + { + "name": "lost+found", + "type": "directory", + "size": 16384, + "isDir": true, + "ext": "", + "created": 1686543794, + "uid": 0, + "gid": 0, + "fullPath": "/mnt/host/lost+found" + }, + { + "name": "media", + "type": "directory", + "size": 4096, + "isDir": true, + "ext": "", + "created": 1686543842, + "uid": 0, + "gid": 0, + "fullPath": "/mnt/host/media" + }, + { + "name": "mnt", + "type": "directory", + "size": 4096, + "isDir": true, + "ext": "", + "created": 1686543842, + "uid": 0, + "gid": 0, + "fullPath": "/mnt/host/mnt" + }, + { + "name": "opt", + "type": "directory", + "size": 4096, + "isDir": true, + "ext": "", + "created": 1688037646, + "uid": 0, + "gid": 0, + "fullPath": "/mnt/host/opt" + }, + { + "name": "proc", + "type": "directory", + "size": 0, + "isDir": true, + "ext": "", + "created": 1704722492, + "uid": 0, + "gid": 0, + "fullPath": "/mnt/host/proc" + }, + { + "name": "root", + "type": "directory", + "size": 4096, + "isDir": true, + "ext": "", + "created": 1732203499, + "uid": 0, + "gid": 0, + "fullPath": "/mnt/host/root" + }, + { + "name": "run", + "type": "directory", + "size": 700, + "isDir": true, + "ext": "", + "created": 1734245739, + "uid": 0, + "gid": 0, + "fullPath": "/mnt/host/run" + }, + { + "name": "sbin", + "type": "file", + "size": 8, + "isDir": false, + "ext": "", + "created": 1686543832, + "uid": 0, + "gid": 0, + "fullPath": "/mnt/host/sbin" + }, + { + "name": "srv", + "type": "directory", + "size": 4096, + "isDir": true, + "ext": "", + "created": 1686543842, + "uid": 0, + "gid": 0, + "fullPath": "/mnt/host/srv" + }, + { + "name": "sys", + "type": "directory", + "size": 0, + "isDir": true, + "ext": "", + "created": 1704722492, + "uid": 0, + "gid": 0, + "fullPath": "/mnt/host/sys" + }, + { + "name": "tmp", + "type": "directory", + "size": 4096, + "isDir": true, + "ext": "", + "created": 1734277127, + "uid": 0, + "gid": 0, + "fullPath": "/mnt/host/tmp" + }, + { + "name": "usr", + "type": "directory", + "size": 4096, + "isDir": true, + "ext": "", + "created": 1707633020, + "uid": 0, + "gid": 0, + "fullPath": "/mnt/host/usr" + }, + { + "name": "var", + "type": "directory", + "size": 4096, + "isDir": true, + "ext": "", + "created": 1686543842, + "uid": 0, + "gid": 0, + "fullPath": "/mnt/host/var" + } + ], + "path": "/", + "storage": "local", + "storages": [ + { + "name": "local", + "path": "/" + } + ] + }, + "status": "OK" + })}, + 1000 + ); + }); +} + export { mounts, disks, + listDir, snapRAID, }; \ No newline at end of file