From 2f1061a41010bd893695bf915bbb256f42016303 Mon Sep 17 00:00:00 2001 From: takejohn <105504345+takejohn@users.noreply.github.com> Date: Fri, 5 Apr 2024 23:27:45 +0900 Subject: [PATCH 1/8] =?UTF-8?q?=E3=83=AC=E3=82=A4=E3=82=A2=E3=82=A6?= =?UTF-8?q?=E3=83=88=E3=82=92=E4=BD=9C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/astro/src/layouts/Layout.astro | 19 +++++++++++++++++++ packages/astro/src/pages/[...path].astro | 18 +++--------------- 2 files changed, 22 insertions(+), 15 deletions(-) create mode 100644 packages/astro/src/layouts/Layout.astro diff --git a/packages/astro/src/layouts/Layout.astro b/packages/astro/src/layouts/Layout.astro new file mode 100644 index 0000000..340609b --- /dev/null +++ b/packages/astro/src/layouts/Layout.astro @@ -0,0 +1,19 @@ +--- +import { ViewTransitions } from "astro:transitions"; +--- + + + + + + + + SimpleCDN + + + + + + + + diff --git a/packages/astro/src/pages/[...path].astro b/packages/astro/src/pages/[...path].astro index 382aa28..28f7420 100644 --- a/packages/astro/src/pages/[...path].astro +++ b/packages/astro/src/pages/[...path].astro @@ -2,7 +2,7 @@ import { type DirectoryEntry, getDirectoryEntries } from "@packages/common"; import Entry from "../components/Entry.astro"; import UploadButton from "../components/UploadButton.astro"; -import { ViewTransitions } from "astro:transitions"; +import Layout from "../layouts/Layout.astro"; const dirPath: string = Astro.params.path ?? ''; let files: DirectoryEntry[] | null = null; @@ -24,17 +24,7 @@ if (files == null) { } --- - - - - - - - SimpleCDN - - - - +

CDN File list


@@ -47,6 +37,4 @@ if (files == null) { )} - - - \ No newline at end of file + From c73b755001277e38c3366b3a1c5ccc0acc38bf7f Mon Sep 17 00:00:00 2001 From: takejohn <105504345+takejohn@users.noreply.github.com> Date: Sat, 6 Apr 2024 00:39:14 +0900 Subject: [PATCH 2/8] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E3=82=92?= =?UTF-8?q?=E3=83=A2=E3=83=80=E3=83=B3=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/astro/src/components/Entry.astro | 44 ++++++++++++++++++++--- packages/astro/src/components/List.astro | 11 ++++++ packages/astro/src/pages/[...path].astro | 5 +-- 3 files changed, 54 insertions(+), 6 deletions(-) create mode 100644 packages/astro/src/components/List.astro diff --git a/packages/astro/src/components/Entry.astro b/packages/astro/src/components/Entry.astro index 5732b23..4451848 100644 --- a/packages/astro/src/components/Entry.astro +++ b/packages/astro/src/components/Entry.astro @@ -8,9 +8,45 @@ interface Props { const { name, href, size } = Astro.props; --- -
  • - - {name} +
  • + +
    + {name} + {(size != null) && ({size})} +
    - {(size != null) && ({size})}
  • + + diff --git a/packages/astro/src/components/List.astro b/packages/astro/src/components/List.astro new file mode 100644 index 0000000..8a58f5c --- /dev/null +++ b/packages/astro/src/components/List.astro @@ -0,0 +1,11 @@ +
      + +
    + + diff --git a/packages/astro/src/pages/[...path].astro b/packages/astro/src/pages/[...path].astro index 28f7420..0b7d510 100644 --- a/packages/astro/src/pages/[...path].astro +++ b/packages/astro/src/pages/[...path].astro @@ -3,6 +3,7 @@ import { type DirectoryEntry, getDirectoryEntries } from "@packages/common"; import Entry from "../components/Entry.astro"; import UploadButton from "../components/UploadButton.astro"; import Layout from "../layouts/Layout.astro"; +import List from "../components/List.astro"; const dirPath: string = Astro.params.path ?? ''; let files: DirectoryEntry[] | null = null; @@ -31,10 +32,10 @@ if (files == null) { {(files == null) &&

    404 Not Found

    } アップロード(ログインが必要です)
    -
      + {(parentDir != null) && } {files?.map((file) => )} -
    +
    From 588cc34f08e25c202faa53b83b46d3f71b5dbaf8 Mon Sep 17 00:00:00 2001 From: takejohn <105504345+takejohn@users.noreply.github.com> Date: Sat, 6 Apr 2024 21:14:02 +0900 Subject: [PATCH 3/8] =?UTF-8?q?=E3=82=A2=E3=82=A4=E3=82=B3=E3=83=B3?= =?UTF-8?q?=E4=BD=9C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/astro/public/static/directory.svg | 45 ++++++++++++++++++++ packages/astro/public/static/file.svg | 49 ++++++++++++++++++++++ packages/astro/public/static/parent.svg | 41 ++++++++++++++++++ packages/astro/src/components/Entry.astro | 25 ++++++++++- packages/astro/src/pages/[...path].astro | 8 +++- 5 files changed, 165 insertions(+), 3 deletions(-) create mode 100644 packages/astro/public/static/directory.svg create mode 100644 packages/astro/public/static/file.svg create mode 100644 packages/astro/public/static/parent.svg diff --git a/packages/astro/public/static/directory.svg b/packages/astro/public/static/directory.svg new file mode 100644 index 0000000..43dce7b --- /dev/null +++ b/packages/astro/public/static/directory.svg @@ -0,0 +1,45 @@ + + + + + + + + + + + + + diff --git a/packages/astro/public/static/file.svg b/packages/astro/public/static/file.svg new file mode 100644 index 0000000..35f8719 --- /dev/null +++ b/packages/astro/public/static/file.svg @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + diff --git a/packages/astro/public/static/parent.svg b/packages/astro/public/static/parent.svg new file mode 100644 index 0000000..1e1d42b --- /dev/null +++ b/packages/astro/public/static/parent.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + diff --git a/packages/astro/src/components/Entry.astro b/packages/astro/src/components/Entry.astro index 4451848..916ed59 100644 --- a/packages/astro/src/components/Entry.astro +++ b/packages/astro/src/components/Entry.astro @@ -1,16 +1,33 @@ --- +type EntryType = 'file' | 'directory' | 'parent'; + interface Props { name: string; href: string; size?: string; + type: EntryType; +} + +const { name, href, size, type } = Astro.props; + +function getIconSrc() { + switch (type) { + default: + case 'file': + return '/static/file.svg'; + case 'directory': + return '/static/directory.svg'; + case 'parent': + return '/static/parent.svg'; + } } -const { name, href, size } = Astro.props; ---
  • + ファイル {name} {(size != null) && ({size})}
    @@ -38,6 +55,12 @@ const { name, href, size } = Astro.props; margin: 0; } + .icon { + height: 1.25em; + width: auto; + vertical-align: middle; + } + .name { font-family: monospace; } diff --git a/packages/astro/src/pages/[...path].astro b/packages/astro/src/pages/[...path].astro index 0b7d510..5f9fc36 100644 --- a/packages/astro/src/pages/[...path].astro +++ b/packages/astro/src/pages/[...path].astro @@ -33,9 +33,13 @@ if (files == null) { アップロード(ログインが必要です) - {(parentDir != null) && } + {(parentDir != null) && } {files?.map((file) => - + )} From 24479c1347b5f9f61ebbcf41632214d8afe345c7 Mon Sep 17 00:00:00 2001 From: takejohn <105504345+takejohn@users.noreply.github.com> Date: Sat, 6 Apr 2024 21:41:20 +0900 Subject: [PATCH 4/8] =?UTF-8?q?prefetch=E3=82=84=E3=82=81=E3=82=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/astro/astro.config.mjs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/astro/astro.config.mjs b/packages/astro/astro.config.mjs index 95f47eb..f6ab42f 100644 --- a/packages/astro/astro.config.mjs +++ b/packages/astro/astro.config.mjs @@ -12,5 +12,6 @@ export default defineConfig({ ssr: { noExternal: ['path-to-regexp'] } - } -}); \ No newline at end of file + }, + prefetch: false +}); From 52d6e19d20a45009e884c86d6374f373fd8de347 Mon Sep 17 00:00:00 2001 From: takejohn <105504345+takejohn@users.noreply.github.com> Date: Sat, 6 Apr 2024 22:39:33 +0900 Subject: [PATCH 5/8] =?UTF-8?q?=E3=82=A2=E3=82=A4=E3=82=B3=E3=83=B3?= =?UTF-8?q?=E3=80=81=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E5=90=8D=E3=80=81?= =?UTF-8?q?=E3=82=B5=E3=82=A4=E3=82=BA=E3=82=92=E3=83=90=E3=83=A9=E3=83=B3?= =?UTF-8?q?=E3=82=B9=E3=82=88=E3=81=8F=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/astro/src/components/Entry.astro | 38 +++++++++++++++++++++-- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/packages/astro/src/components/Entry.astro b/packages/astro/src/components/Entry.astro index 916ed59..5d632aa 100644 --- a/packages/astro/src/components/Entry.astro +++ b/packages/astro/src/components/Entry.astro @@ -27,9 +27,17 @@ function getIconSrc() {
  • - ファイル - {name} - {(size != null) && ({size})} +
    + ファイル +
    +
    +
    + {name} +
    +
    + {(size != null) && {size}} +
    +
  • @@ -72,4 +80,28 @@ function getIconSrc() { .box:hover .name { font-weight: bold; } + + .box { + display: flex; + } + + .icon-box { + width: 1.5em; + } + + .data-box { + display: flex; + width: 100%; + } + + .name-box { + flex: 2; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + + .size-box { + flex: 1; + } From f73b242c28a6a495f670d8493d946662628c2c58 Mon Sep 17 00:00:00 2001 From: takejohn <105504345+takejohn@users.noreply.github.com> Date: Sat, 6 Apr 2024 23:04:14 +0900 Subject: [PATCH 6/8] =?UTF-8?q?Header=E3=82=B3=E3=83=B3=E3=83=9D=E3=83=BC?= =?UTF-8?q?=E3=83=8D=E3=83=B3=E3=83=88=E3=82=92=E4=BD=9C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/astro/src/components/Header.astro | 28 ++++++++++++++++++++++ packages/astro/src/pages/[...path].astro | 9 ++----- 2 files changed, 30 insertions(+), 7 deletions(-) create mode 100644 packages/astro/src/components/Header.astro diff --git a/packages/astro/src/components/Header.astro b/packages/astro/src/components/Header.astro new file mode 100644 index 0000000..4dcb2e4 --- /dev/null +++ b/packages/astro/src/components/Header.astro @@ -0,0 +1,28 @@ +--- +import UploadButton from "../components/UploadButton.astro"; + +interface Props { + found: boolean; +} + +const { found } = Astro.props; +--- + +
    +
    +

    CDN File list

    +
    + {(!found) &&

    404 Not Found

    } + アップロード(ログインが必要です) +
    + + diff --git a/packages/astro/src/pages/[...path].astro b/packages/astro/src/pages/[...path].astro index 5f9fc36..e4abb68 100644 --- a/packages/astro/src/pages/[...path].astro +++ b/packages/astro/src/pages/[...path].astro @@ -1,9 +1,9 @@ --- import { type DirectoryEntry, getDirectoryEntries } from "@packages/common"; import Entry from "../components/Entry.astro"; -import UploadButton from "../components/UploadButton.astro"; import Layout from "../layouts/Layout.astro"; import List from "../components/List.astro"; +import Header from "../components/Header.astro"; const dirPath: string = Astro.params.path ?? ''; let files: DirectoryEntry[] | null = null; @@ -26,12 +26,7 @@ if (files == null) { --- -
    -

    CDN File list

    -
    - {(files == null) &&

    404 Not Found

    } - アップロード(ログインが必要です) -
    +
    {(parentDir != null) && } {files?.map((file) => From c2fee1677adc5abfbfc0773e1e10d3adfdf32039 Mon Sep 17 00:00:00 2001 From: takejohn <105504345+takejohn@users.noreply.github.com> Date: Sun, 7 Apr 2024 00:14:33 +0900 Subject: [PATCH 7/8] =?UTF-8?q?=E3=82=A2=E3=83=83=E3=83=97=E3=83=AD?= =?UTF-8?q?=E3=83=BC=E3=83=89=E3=81=AE=E3=83=9C=E3=82=BF=E3=83=B3=E3=81=AE?= =?UTF-8?q?=E3=83=87=E3=82=B6=E3=82=A4=E3=83=B3=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/astro/public/static/upload.svg | 45 +++++++++++++++++++ packages/astro/src/components/Header.astro | 2 +- .../astro/src/components/UploadButton.astro | 20 ++++++++- 3 files changed, 65 insertions(+), 2 deletions(-) create mode 100644 packages/astro/public/static/upload.svg diff --git a/packages/astro/public/static/upload.svg b/packages/astro/public/static/upload.svg new file mode 100644 index 0000000..e367368 --- /dev/null +++ b/packages/astro/public/static/upload.svg @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + diff --git a/packages/astro/src/components/Header.astro b/packages/astro/src/components/Header.astro index 4dcb2e4..dd6cc0e 100644 --- a/packages/astro/src/components/Header.astro +++ b/packages/astro/src/components/Header.astro @@ -13,7 +13,7 @@ const { found } = Astro.props;

    CDN File list

    {(!found) &&

    404 Not Found

    } - アップロード(ログインが必要です) +