mirror of
https://codeberg.org/PLG-Development/PLG-MuDiCS
synced 2026-07-06 00:47:09 +00:00
show blackscreen added
This commit is contained in:
@@ -74,7 +74,7 @@ done
|
||||
return folder_element_list;
|
||||
}
|
||||
|
||||
export async function get_file_tree_data(ip: string, path: string): Promise<TreeElement[]|null> {
|
||||
export async function get_file_tree_data(ip: string, path: string): Promise<TreeElement[] | null> {
|
||||
const options = {
|
||||
method: 'PATCH',
|
||||
headers: { 'content-type': 'application/json' },
|
||||
@@ -84,11 +84,22 @@ export async function get_file_tree_data(ip: string, path: string): Promise<Tree
|
||||
};
|
||||
const raw_response = await request_display(ip, '/shellCommand', options);
|
||||
if (!raw_response) return null;
|
||||
const tree_structure: TreeElement[]|null = (JSON.parse(raw_response.stdout.trim()) as [TreeElement, any])[0].contents || null;
|
||||
const tree_structure: TreeElement[] | null = (JSON.parse(raw_response.stdout.trim()) as [TreeElement, any])[0].contents || null;
|
||||
return tree_structure;
|
||||
}
|
||||
|
||||
|
||||
export async function show_blackscreen(ip: string) {
|
||||
const options = {
|
||||
method: 'PATCH',
|
||||
headers: { 'content-type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
html: `<div style="width:100dvw; height:100dvh; background-color:black;"></div>`
|
||||
})
|
||||
};
|
||||
await request_display(ip, '/showHTML', options);
|
||||
}
|
||||
|
||||
|
||||
export async function ping_ip(ip: string): Promise<DisplayStatus> {
|
||||
const raw_response = await request_control(`/ping?ip=${ip}`, { method: 'GET' });
|
||||
|
||||
Reference in New Issue
Block a user