mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-13 19:52:40 +00:00
Prettify stuff
This commit is contained in:
@@ -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>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user