-
-
- {/*
*/}
-
(upload = ref)}
- onChange={(event) => {
- //const file = event.target.value
- //const fileObject = URL.createObjectURL(actualFile)
- //setFile(fileObject)
- //const files = event.target.files[0]
- uploadFiles(event.target.files);
- }}
- />
-
-
- {fileNamespaces !== undefined &&
- fileNamespaces !== null &&
- fileNamespaces.length > 1 ? (
-
- File Category
-
-
- ) : null}
-
- {renderTextBox ?
-
-
-
-
- :
-
-
- }
- {renderTextBox &&
{
- handleKeyDown(event);
- }}
- InputProps={{
- style: {
- color: "white",
- },
- }}
- color="primary"
- placeholder="File category name"
- required
- margin="dense"
- defaultValue={""}
- autoFocus
- />}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {files === undefined || files === null || files.length === 0
- ? null
- : files.map((file, index) => {
- if (file.namespace === "") {
- file.namespace = "default";
- }
-
- if (file.namespace !== selectedNamespace) {
- return null;
- }
-
- var bgColor = "#27292d";
- if (index % 2 === 0) {
- bgColor = "#1f2023";
- }
-
- const filenamesplit = file.filename.split(".")
- const iseditable = file.filesize < 100000 && file.status === "active" && allowedFileTypes.includes(filenamesplit[filenamesplit.length-1])
-
- return (
-
-
-
-
-
-
- ) : (
-
-
-
-
-
-
-
-
-
- )
- }
- style={{
- minWidth: 100,
- maxWidth: 100,
- overflow: "hidden",
- }}
- />
-
-
-
-
-
-
- {
- setOpenEditor(true)
- setOpenFileId(file.id)
- readFileData(file)
- }}
- >
-
-
-
-
-
-
- {
- downloadFile(file);
- }}
- >
-
-
-
-
-
-
- {
- deleteFile(file);
- }}
- >
-
-
-
-
-
- {
- const elementName = "copy_element_shuffle";
- var copyText =
- document.getElementById(elementName);
- if (
- copyText !== null &&
- copyText !== undefined
- ) {
- const clipboard = navigator.clipboard;
- if (clipboard === undefined) {
- alert.error(
- "Can only copy over HTTPS (port 3443)"
- );
- return;
- }
-
- navigator.clipboard.writeText(file.id);
- copyText.select();
- copyText.setSelectionRange(
- 0,
- 99999
- ); /* For mobile devices */
-
- /* Copy the text inside the text field */
- document.execCommand("copy");
-
- alert.info(file.id + " copied to clipboard");
- }
- }}
- >
-
-
-
-
- style={{
- minWidth: 250,
- maxWidth: 250,
- // overflow: "hidden",
- }}
- />
-
- );
- })}
-
-
-