Prettify stuff

This commit is contained in:
Selis
2023-06-19 18:44:18 +02:00
parent ef252a2eae
commit a4aa5ecd6b
303 changed files with 8522 additions and 2019 deletions

View File

@@ -6,7 +6,15 @@ import { NtosWindow } from '../layouts';
export const NtosFileManager = (props, context) => {
const { act, data } = useBackend(context);
const { PC_device_theme, usbconnected, filename, filedata, error, files = [], usbfiles = [] } = data;
const {
PC_device_theme,
usbconnected,
filename,
filedata,
error,
files = [],
usbfiles = [],
} = data;
return (
<NtosWindow resizable theme={PC_device_theme}>
<NtosWindow.Content scrollable>
@@ -15,9 +23,21 @@ export const NtosFileManager = (props, context) => {
title={'Viewing File ' + filename}
buttons={
<Fragment>
<Button icon="pen" content="Edit" onClick={() => act('PRG_edit')} />
<Button icon="print" content="Print" onClick={() => act('PRG_printfile')} />
<Button icon="times" content="Close" onClick={() => act('PRG_closefile')} />
<Button
icon="pen"
content="Edit"
onClick={() => act('PRG_edit')}
/>
<Button
icon="print"
content="Print"
onClick={() => act('PRG_printfile')}
/>
<Button
icon="times"
content="Close"
onClick={() => act('PRG_closefile')}
/>
</Fragment>
}>
{/* This dangerouslySetInnerHTML is only ever passed data that has passed through pencode2html
@@ -74,7 +94,12 @@ export const NtosFileManager = (props, context) => {
<Flex wrap="wrap" position="fixed" bottom="5px">
<Flex.Item>
<Section>
<Button bottom="0" left="0" icon="ban" onClick={() => act('PRG_clearerror')} />
<Button
bottom="0"
left="0"
icon="ban"
onClick={() => act('PRG_clearerror')}
/>
</Section>
</Flex.Item>
<Section>
@@ -88,7 +113,15 @@ export const NtosFileManager = (props, context) => {
};
const FileTable = (props) => {
const { files = [], usbconnected, usbmode, onUpload, onDelete, onRename, onOpen } = props;
const {
files = [],
usbconnected,
usbmode,
onUpload,
onDelete,
onRename,
onOpen,
} = props;
return (
<Table>
<Table.Row header>
@@ -128,9 +161,17 @@ const FileTable = (props) => {
/>
{!!usbconnected &&
(usbmode ? (
<Button icon="download" tooltip="Download" onClick={() => onUpload(file.uid)} />
<Button
icon="download"
tooltip="Download"
onClick={() => onUpload(file.uid)}
/>
) : (
<Button icon="upload" tooltip="Upload" onClick={() => onUpload(file.uid)} />
<Button
icon="upload"
tooltip="Upload"
onClick={() => onUpload(file.uid)}
/>
))}
</Fragment>
)}