mirror of
https://github.com/wavetermdev/waveterm.git
synced 2024-12-21 16:38:23 +01:00
remove dirnav, small formatting changes
This commit is contained in:
parent
dfa0245606
commit
e4204b96d8
@ -21,6 +21,7 @@
|
||||
|
||||
.dir-table-head-cell {
|
||||
flex: 0 0 auto;
|
||||
user-select: none;
|
||||
}
|
||||
.dir-table-head-cell:not(:first-child) {
|
||||
position: relative;
|
||||
|
@ -197,7 +197,7 @@ function DirectoryTable({
|
||||
}),
|
||||
columnHelper.accessor("modestr", {
|
||||
cell: (info) => <span className="dir-table-modestr">{info.getValue()}</span>,
|
||||
header: () => <span>Permissions</span>,
|
||||
header: () => <span>Perm</span>,
|
||||
size: 91,
|
||||
minSize: 90,
|
||||
sortingFn: "alphanumeric",
|
||||
|
@ -20,6 +20,16 @@ import "./view.less";
|
||||
const MaxFileSize = 1024 * 1024 * 10; // 10MB
|
||||
const MaxCSVSize = 1024 * 1024 * 1; // 1MB
|
||||
|
||||
function isTextFile(mimeType: string): boolean {
|
||||
return (
|
||||
mimeType.startsWith("text/") ||
|
||||
mimeType == "application/sql" ||
|
||||
(mimeType.startsWith("application/") &&
|
||||
(mimeType.includes("json") || mimeType.includes("yaml") || mimeType.includes("toml"))) ||
|
||||
mimeType == "application/pem-certificate-chain"
|
||||
);
|
||||
}
|
||||
|
||||
export class PreviewModel implements ViewModel {
|
||||
blockId: string;
|
||||
blockAtom: jotai.Atom<Block>;
|
||||
@ -407,12 +417,7 @@ function PreviewView({ blockId, model }: { blockId: string; model: PreviewModel
|
||||
/>
|
||||
);
|
||||
}
|
||||
} else if (
|
||||
mimeType.startsWith("text/") ||
|
||||
mimeType == "application/sql" ||
|
||||
(mimeType.startsWith("application/") &&
|
||||
(mimeType.includes("json") || mimeType.includes("yaml") || mimeType.includes("toml")))
|
||||
) {
|
||||
} else if (isTextFile(mimeType)) {
|
||||
specializedView = <CodeEditPreview readonly={true} contentAtom={fileContentAtom} filename={fileName} />;
|
||||
} else if (mimeType === "directory") {
|
||||
specializedView = <DirectoryPreview fileNameAtom={fileNameAtom} model={model} />;
|
||||
@ -432,7 +437,6 @@ function PreviewView({ blockId, model }: { blockId: string; model: PreviewModel
|
||||
|
||||
return (
|
||||
<div className="full-preview scrollbar-hide-until-hover">
|
||||
<DirNav cwdAtom={fileNameAtom} />
|
||||
<div ref={contentRef} className="full-preview-content">
|
||||
{specializedView}
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user