From 51e423e4a6f82507d43dbbc9f8f2f322dea912ed Mon Sep 17 00:00:00 2001 From: Kevin Neaton Date: Fri, 3 Jul 2020 00:53:44 -0400 Subject: [PATCH] Add CID column --- dir-index.html | 22 ++++++++++++++++++++++ test/main.go | 3 +++ 2 files changed, 25 insertions(+) diff --git a/dir-index.html b/dir-index.html index 7f2ce11..75ec450 100644 --- a/dir-index.html +++ b/dir-index.html @@ -33,6 +33,17 @@ .ml-auto { margin-left: auto; } + .text-truncate { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + .table-responsive { + display: block; + width: 100%; + overflow-x: auto; + -webkit-overflow-scrolling: touch; + } {{ .Path }} @@ -75,6 +86,7 @@ {{ end }} +
+ {{ range .Listing }} @@ -93,10 +106,19 @@ + {{ end }}
@@ -84,6 +96,7 @@ ..
{{ .Name }} + {{ if .Hash }} + + {{ slice .Hash 0 40 }} + {{ slice .Hash 40 }} + + {{ end }} + {{ .Size }}
+
diff --git a/test/main.go b/test/main.go index 6c851ae..208b2ad 100644 --- a/test/main.go +++ b/test/main.go @@ -24,6 +24,7 @@ type directoryItem struct { Size string Name string Path string + Hash string } type breadcrumb struct { @@ -37,10 +38,12 @@ var testData = listingTemplateData{ Size: "25 MiB", Name: "short-film.mov", Path: testPath + "/short-film.mov", + Hash: "QmQuxBarQXB2mzChmMeKY47C43LxUdg1NDJ5MWcKMKxDu7", }, { Size: "1 KiB", Name: "this-piece-of-papers-got-47-words-37-sentences-58-words-we-wanna-know.txt", Path: testPath + "/this-piece-of-papers-got-47-words-37-sentences-58-words-we-wanna-know.txt", + Hash: "QmquXbaRQXB2mzChmMeKY47C43LxUdg1NDJ5MWcKMKxDu7", }}, Size: "25 MiB", Path: testPath, -- GitLab