Upload folder using huggingface_hub
Browse files
6.2.0/fileexplorer/Index.svelte
CHANGED
|
@@ -5,7 +5,7 @@
|
|
| 5 |
import { Gradio } from "@gradio/utils";
|
| 6 |
import { File } from "@gradio/icons";
|
| 7 |
|
| 8 |
-
import { Block, BlockLabel } from "@gradio/atoms";
|
| 9 |
import DirectoryExplorer from "./shared/DirectoryExplorer.svelte";
|
| 10 |
|
| 11 |
import { StatusTracker } from "@gradio/statustracker";
|
|
@@ -54,6 +54,14 @@
|
|
| 54 |
on_clear_status={() =>
|
| 55 |
gradio.dispatch("clear_status", gradio.shared.loading_status)}
|
| 56 |
/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
<BlockLabel
|
| 58 |
show_label={gradio.shared.show_label}
|
| 59 |
Icon={File}
|
|
|
|
| 5 |
import { Gradio } from "@gradio/utils";
|
| 6 |
import { File } from "@gradio/icons";
|
| 7 |
|
| 8 |
+
import { Block, BlockLabel, IconButtonWrapper } from "@gradio/atoms";
|
| 9 |
import DirectoryExplorer from "./shared/DirectoryExplorer.svelte";
|
| 10 |
|
| 11 |
import { StatusTracker } from "@gradio/statustracker";
|
|
|
|
| 54 |
on_clear_status={() =>
|
| 55 |
gradio.dispatch("clear_status", gradio.shared.loading_status)}
|
| 56 |
/>
|
| 57 |
+
{#if gradio.shared.show_label && gradio.props.buttons && gradio.props.buttons.length > 0}
|
| 58 |
+
<IconButtonWrapper
|
| 59 |
+
buttons={gradio.props.buttons}
|
| 60 |
+
on_custom_button_click={(id) => {
|
| 61 |
+
gradio.dispatch("custom_button_click", { id });
|
| 62 |
+
}}
|
| 63 |
+
/>
|
| 64 |
+
{/if}
|
| 65 |
<BlockLabel
|
| 66 |
show_label={gradio.shared.show_label}
|
| 67 |
Icon={File}
|
6.2.0/fileexplorer/types.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
import type { LoadingStatus } from "@gradio/statustracker";
|
| 2 |
-
import type { SelectData } from "@gradio/utils";
|
| 3 |
import type { FileNode } from "./shared/types";
|
| 4 |
|
| 5 |
export interface FileExplorerProps {
|
|
@@ -15,6 +15,7 @@ export interface FileExplorerProps {
|
|
| 15 |
server: {
|
| 16 |
ls: (path: string[]) => Promise<FileNode[]>;
|
| 17 |
};
|
|
|
|
| 18 |
}
|
| 19 |
|
| 20 |
export interface FileExplorerEvents {
|
|
@@ -22,4 +23,5 @@ export interface FileExplorerEvents {
|
|
| 22 |
input: never;
|
| 23 |
select: SelectData;
|
| 24 |
clear_status: LoadingStatus;
|
|
|
|
| 25 |
}
|
|
|
|
| 1 |
import type { LoadingStatus } from "@gradio/statustracker";
|
| 2 |
+
import type { SelectData, CustomButton } from "@gradio/utils";
|
| 3 |
import type { FileNode } from "./shared/types";
|
| 4 |
|
| 5 |
export interface FileExplorerProps {
|
|
|
|
| 15 |
server: {
|
| 16 |
ls: (path: string[]) => Promise<FileNode[]>;
|
| 17 |
};
|
| 18 |
+
buttons: (string | CustomButton)[] | null;
|
| 19 |
}
|
| 20 |
|
| 21 |
export interface FileExplorerEvents {
|
|
|
|
| 23 |
input: never;
|
| 24 |
select: SelectData;
|
| 25 |
clear_status: LoadingStatus;
|
| 26 |
+
custom_button_click: { id: number };
|
| 27 |
}
|