mirror of
https://github.com/pldubouilh/gossa.git
synced 2026-08-29 05:16:33 -04:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b59ea991ff | ||
|
|
d17040df0b | ||
|
|
1cac56abfa | ||
|
|
ad423948cc | ||
|
|
da7f84f5c9 | ||
|
|
23e9e6853f | ||
|
|
7644c9f4d0 | ||
|
|
fc4d4dbd09 | ||
|
|
8443ab443c | ||
|
|
31c8ee518a | ||
|
|
cc703cd70d | ||
|
|
c963d1773b | ||
|
|
623acc30a6 | ||
|
|
746d6d55bc |
@@ -6,20 +6,15 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v1
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: 1.19.1
|
go-version: 1.23.0
|
||||||
id: go
|
id: go
|
||||||
|
|
||||||
- name: deps
|
|
||||||
run: npm i -g standard
|
|
||||||
|
|
||||||
- name: Check out code into the Go module directory
|
|
||||||
uses: actions/checkout@v1
|
|
||||||
with:
|
|
||||||
submodules: true
|
|
||||||
|
|
||||||
- name: Run
|
- name: Run
|
||||||
run: make ci
|
run: make ci
|
||||||
|
|
||||||
|
|||||||
@@ -10,33 +10,25 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v1
|
uses: actions/checkout@v4
|
||||||
with:
|
|
||||||
submodules: true
|
|
||||||
|
|
||||||
- name: Set up Go
|
|
||||||
uses: actions/setup-go@v1
|
|
||||||
with:
|
|
||||||
go-version: 1.19.1
|
|
||||||
id: go
|
|
||||||
|
|
||||||
- name: Set env
|
- name: Set env
|
||||||
run: echo "GIT_TAG=`echo $(git describe --tags --abbrev=0)`" >> $GITHUB_ENV
|
run: echo "GIT_TAG=`echo $(git describe --tags --abbrev=0)`" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v1.2.0
|
uses: docker/setup-qemu-action@v3
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v1.6.0
|
|
||||||
|
|
||||||
- name: Login to DockerHub
|
- name: Login to DockerHub
|
||||||
uses: docker/login-action@v1.10.0
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_USER }}
|
username: ${{ secrets.DOCKER_USER }}
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- name: Build and release on dockerhub
|
- name: Build and release on dockerhub
|
||||||
uses: docker/build-push-action@v2.7.0
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
file: support/build.Dockerfile
|
file: support/build.Dockerfile
|
||||||
push: true
|
push: true
|
||||||
@@ -47,17 +39,19 @@ jobs:
|
|||||||
run: make build-all
|
run: make build-all
|
||||||
|
|
||||||
- name: "Release gh release versioned"
|
- name: "Release gh release versioned"
|
||||||
uses: ncipollo/release-action@58ae73b360456532aafd58ee170c045abbeaee37
|
uses: ncipollo/release-action@v1
|
||||||
with:
|
with:
|
||||||
allowUpdates: true
|
allowUpdates: true
|
||||||
artifacts: "builds/*"
|
artifacts: "builds/*"
|
||||||
|
bodyFile: "builds/buildout"
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: "Release gh release latest"
|
- name: "Release gh release latest"
|
||||||
uses: ncipollo/release-action@58ae73b360456532aafd58ee170c045abbeaee37
|
uses: ncipollo/release-action@v1
|
||||||
with:
|
with:
|
||||||
tag: latest
|
tag: latest
|
||||||
name: Latest
|
name: Latest
|
||||||
allowUpdates: true
|
allowUpdates: true
|
||||||
artifacts: "builds/*"
|
artifacts: "builds/*"
|
||||||
|
bodyFile: "builds/buildout"
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
@@ -1,39 +0,0 @@
|
|||||||
name: rc
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- 'rc/**'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
name: Build
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
|
|
||||||
- name: Set up Go
|
|
||||||
uses: actions/setup-go@v1
|
|
||||||
with:
|
|
||||||
go-version: 1.19.1
|
|
||||||
id: go
|
|
||||||
|
|
||||||
- name: Check out code into the Go module directory
|
|
||||||
uses: actions/checkout@v1
|
|
||||||
with:
|
|
||||||
submodules: true
|
|
||||||
|
|
||||||
- name: Run
|
|
||||||
run: make ci
|
|
||||||
|
|
||||||
- name: Build all artifacts
|
|
||||||
run: make build-all
|
|
||||||
|
|
||||||
- name: "Release gh release prerelease"
|
|
||||||
uses: ncipollo/release-action@58ae73b360456532aafd58ee170c045abbeaee37
|
|
||||||
with:
|
|
||||||
allowUpdates: true
|
|
||||||
prerelease: true
|
|
||||||
tag: "rc"
|
|
||||||
artifacts: "builds/*"
|
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
FLAGS := -ldflags "-s -w" -trimpath
|
FLAGS := -trimpath
|
||||||
NOCGO := CGO_ENABLED=0
|
NOCGO := CGO_ENABLED=0
|
||||||
|
|
||||||
build::
|
build::
|
||||||
@@ -17,10 +17,7 @@ run-ro::
|
|||||||
run-extra::
|
run-extra::
|
||||||
./gossa -verb=true -prefix="/fancy-path/" -k=false -symlinks=true test-fixture
|
./gossa -verb=true -prefix="/fancy-path/" -k=false -symlinks=true test-fixture
|
||||||
|
|
||||||
lint-js::
|
ci:: build-all test
|
||||||
standard
|
|
||||||
|
|
||||||
ci:: build-all test lint-js
|
|
||||||
echo "done"
|
echo "done"
|
||||||
|
|
||||||
test::
|
test::
|
||||||
@@ -59,13 +56,14 @@ watch-test::
|
|||||||
ls gossa.go gossa_test.go ui/* | entr -rc make test
|
ls gossa.go gossa_test.go ui/* | entr -rc make test
|
||||||
|
|
||||||
build-all:: build
|
build-all:: build
|
||||||
${NOCGO} GOOS=linux GOARCH=amd64 go build ${FLAGS} -o builds/gossa-linux-x64
|
go version
|
||||||
${NOCGO} GOOS=linux GOARCH=arm go build ${FLAGS} -o builds/gossa-linux-arm
|
${NOCGO} GOOS=linux GOARCH=amd64 go build ${FLAGS} -o builds/gossa-linux-x64
|
||||||
${NOCGO} GOOS=linux GOARCH=arm64 go build ${FLAGS} -o builds/gossa-linux-arm64
|
${NOCGO} GOOS=linux GOARCH=arm go build ${FLAGS} -o builds/gossa-linux-arm
|
||||||
${NOCGO} GOOS=darwin GOARCH=amd64 go build ${FLAGS} -o builds/gossa-mac-x64
|
${NOCGO} GOOS=linux GOARCH=arm64 go build ${FLAGS} -o builds/gossa-linux-arm64
|
||||||
${NOCGO} GOOS=darwin GOARCH=arm64 go build ${FLAGS} -o builds/gossa-mac-arm64
|
${NOCGO} GOOS=darwin GOARCH=amd64 go build ${FLAGS} -o builds/gossa-mac-x64
|
||||||
${NOCGO} GOOS=windows GOARCH=amd64 go build ${FLAGS} -o builds/gossa-windows.exe
|
${NOCGO} GOOS=darwin GOARCH=arm64 go build ${FLAGS} -o builds/gossa-mac-arm64
|
||||||
sha256sum builds/*
|
${NOCGO} GOOS=windows GOARCH=amd64 go build ${FLAGS} -o builds/gossa-windows.exe
|
||||||
|
sha256sum builds/* | tee builds/buildout
|
||||||
|
|
||||||
clean::
|
clean::
|
||||||
rm -f gossa
|
rm -f gossa
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
module github.com/pldubouilh/gossa
|
module github.com/pldubouilh/gossa
|
||||||
|
|
||||||
go 1.16
|
go 1.23.0
|
||||||
|
|||||||
@@ -3,11 +3,17 @@ package main
|
|||||||
import (
|
import (
|
||||||
"archive/zip"
|
"archive/zip"
|
||||||
"compress/gzip"
|
"compress/gzip"
|
||||||
|
"crypto/md5"
|
||||||
|
"crypto/sha1"
|
||||||
|
"crypto/sha256"
|
||||||
|
"crypto/sha512"
|
||||||
_ "embed"
|
_ "embed"
|
||||||
|
"encoding/hex"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"hash"
|
||||||
"html"
|
"html"
|
||||||
"html/template"
|
"html/template"
|
||||||
"io"
|
"io"
|
||||||
@@ -100,8 +106,9 @@ func replyList(w http.ResponseWriter, r *http.Request, fullPath string, path str
|
|||||||
p.Title = template.HTML(html.EscapeString(title))
|
p.Title = template.HTML(html.EscapeString(title))
|
||||||
|
|
||||||
for _, el := range files {
|
for _, el := range files {
|
||||||
info, err := el.Info()
|
info, errInfo := el.Info()
|
||||||
if err != nil {
|
el, err := os.Stat(fullPath + "/" + el.Name())
|
||||||
|
if err != nil || errInfo != nil {
|
||||||
log.Println("error - cant stat a file", err)
|
log.Println("error - cant stat a file", err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
@@ -109,7 +116,7 @@ func replyList(w http.ResponseWriter, r *http.Request, fullPath string, path str
|
|||||||
if *skipHidden && strings.HasPrefix(el.Name(), ".") {
|
if *skipHidden && strings.HasPrefix(el.Name(), ".") {
|
||||||
continue // dont print hidden files if we're not allowed
|
continue // dont print hidden files if we're not allowed
|
||||||
}
|
}
|
||||||
if *symlinks && info.Mode()&os.ModeSymlink != 0 {
|
if !*symlinks && info.Mode()&os.ModeSymlink != 0 {
|
||||||
continue // dont follow symlinks if we're not allowed
|
continue // dont follow symlinks if we're not allowed
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -126,7 +133,7 @@ func replyList(w http.ResponseWriter, r *http.Request, fullPath string, path str
|
|||||||
} else {
|
} else {
|
||||||
sl := strings.Split(name, ".")
|
sl := strings.Split(name, ".")
|
||||||
ext := strings.ToLower(sl[len(sl)-1])
|
ext := strings.ToLower(sl[len(sl)-1])
|
||||||
row := rowTemplate{name, template.URL(href), humanize(info.Size()), ext}
|
row := rowTemplate{name, template.URL(href), humanize(el.Size()), ext}
|
||||||
p.RowsFiles = append(p.RowsFiles, row)
|
p.RowsFiles = append(p.RowsFiles, row)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -226,21 +233,42 @@ func zipRPC(w http.ResponseWriter, r *http.Request) {
|
|||||||
func rpc(w http.ResponseWriter, r *http.Request) {
|
func rpc(w http.ResponseWriter, r *http.Request) {
|
||||||
var err error
|
var err error
|
||||||
var rpc rpcCall
|
var rpc rpcCall
|
||||||
defer exitPath(w, "rpc", rpc)
|
defer exitPath(w, "rpc", &rpc)
|
||||||
bodyBytes, err := io.ReadAll(r.Body)
|
bodyBytes, err := io.ReadAll(r.Body)
|
||||||
check(err)
|
check(err)
|
||||||
json.Unmarshal(bodyBytes, &rpc)
|
json.Unmarshal(bodyBytes, &rpc)
|
||||||
|
ret := []byte("ok")
|
||||||
|
|
||||||
if rpc.Call == "mkdirp" {
|
switch rpc.Call {
|
||||||
|
case "mkdirp":
|
||||||
err = os.MkdirAll(enforcePath(rpc.Args[0]), os.ModePerm)
|
err = os.MkdirAll(enforcePath(rpc.Args[0]), os.ModePerm)
|
||||||
} else if rpc.Call == "mv" {
|
case "mv":
|
||||||
err = os.Rename(enforcePath(rpc.Args[0]), enforcePath(rpc.Args[1]))
|
err = os.Rename(enforcePath(rpc.Args[0]), enforcePath(rpc.Args[1]))
|
||||||
} else if rpc.Call == "rm" {
|
case "rm":
|
||||||
err = os.RemoveAll(enforcePath(rpc.Args[0]))
|
err = os.RemoveAll(enforcePath(rpc.Args[0]))
|
||||||
|
case "sum":
|
||||||
|
file, err := os.Open(enforcePath(rpc.Args[0]))
|
||||||
|
check(err)
|
||||||
|
var hash hash.Hash
|
||||||
|
switch rpc.Args[1] {
|
||||||
|
case "md5":
|
||||||
|
hash = md5.New()
|
||||||
|
case "sha1":
|
||||||
|
hash = sha1.New()
|
||||||
|
case "sha256":
|
||||||
|
hash = sha256.New()
|
||||||
|
case "sha512":
|
||||||
|
hash = sha512.New()
|
||||||
|
}
|
||||||
|
_, err = io.Copy(hash, file)
|
||||||
|
check(err)
|
||||||
|
checksum := hash.Sum(nil)
|
||||||
|
ret = make([]byte, hex.EncodedLen(len(checksum)))
|
||||||
|
hex.Encode(ret, checksum)
|
||||||
}
|
}
|
||||||
|
|
||||||
check(err)
|
check(err)
|
||||||
w.Write([]byte("ok"))
|
w.Write(ret)
|
||||||
}
|
}
|
||||||
|
|
||||||
func enforcePath(p string) string {
|
func enforcePath(p string) string {
|
||||||
|
|||||||
@@ -238,6 +238,8 @@ func doTestRegular(t *testing.T, url string, testExtra bool) {
|
|||||||
hasListing := strings.Contains(body0, `readme.md`)
|
hasListing := strings.Contains(body0, `readme.md`)
|
||||||
body1 = get(t, url+"/support/readme.md")
|
body1 = get(t, url+"/support/readme.md")
|
||||||
hasReadme := strings.Contains(body1, `the master branch is automatically built and pushed`)
|
hasReadme := strings.Contains(body1, `the master branch is automatically built and pushed`)
|
||||||
|
body2 = get(t, url)
|
||||||
|
hasMainListing := strings.Contains(body2, `href="support">support/</a>`)
|
||||||
|
|
||||||
if !testExtra && hasReadme {
|
if !testExtra && hasReadme {
|
||||||
t.Fatal("error symlink file reached where illegal")
|
t.Fatal("error symlink file reached where illegal")
|
||||||
@@ -249,6 +251,11 @@ func doTestRegular(t *testing.T, url string, testExtra bool) {
|
|||||||
} else if testExtra && !hasListing {
|
} else if testExtra && !hasListing {
|
||||||
t.Fatal("error symlink folder unreachable")
|
t.Fatal("error symlink folder unreachable")
|
||||||
}
|
}
|
||||||
|
if !testExtra && hasMainListing {
|
||||||
|
t.Fatal("error symlink folder where illegal")
|
||||||
|
} else if testExtra && !hasMainListing {
|
||||||
|
t.Fatal("error symlink folder unreachable")
|
||||||
|
}
|
||||||
|
|
||||||
if testExtra {
|
if testExtra {
|
||||||
fmt.Println("\r\n~~~~~~~~~~ test symlink mkdir & cleanup")
|
fmt.Println("\r\n~~~~~~~~~~ test symlink mkdir & cleanup")
|
||||||
|
|||||||
@@ -29,7 +29,9 @@ a simple UI comes as default, featuring :
|
|||||||
|
|
||||||
[nix](https://search.nixos.org/packages?channel=unstable&show=gossa&from=0&size=50&sort=relevance&type=packages&query=gossa) - e.g. `nix-shell -p gossa`
|
[nix](https://search.nixos.org/packages?channel=unstable&show=gossa&from=0&size=50&sort=relevance&type=packages&query=gossa) - e.g. `nix-shell -p gossa`
|
||||||
|
|
||||||
binaries are available on the [release page](https://github.com/pldubouilh/gossa/releases) - or simply `make build` this repo.
|
[mpr](https://mpr.makedeb.org/packages/gossa)
|
||||||
|
|
||||||
|
binaries are available on the [release page](https://github.com/pldubouilh/gossa/releases)
|
||||||
|
|
||||||
all builds are reproducible, checkout the hashes on the release page.
|
all builds are reproducible, checkout the hashes on the release page.
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
FROM golang:1.18 as builder
|
FROM docker.io/library/golang:1.23.0-alpine AS builder
|
||||||
|
RUN apk add --no-cache make
|
||||||
WORKDIR /gossaSrc
|
WORKDIR /gossaSrc
|
||||||
COPY . /gossaSrc
|
COPY . /gossaSrc
|
||||||
RUN make
|
RUN make
|
||||||
|
|||||||
Vendored
+89
-25
@@ -160,6 +160,7 @@ function rpc (call, args, cb) {
|
|||||||
const mkdirCall = (path, cb) => rpc('mkdirp', [prependPath(path)], cb)
|
const mkdirCall = (path, cb) => rpc('mkdirp', [prependPath(path)], cb)
|
||||||
const rmCall = (path1, cb) => rpc('rm', [prependPath(path1)], cb)
|
const rmCall = (path1, cb) => rpc('rm', [prependPath(path1)], cb)
|
||||||
const mvCall = (path1, path2, cb) => rpc('mv', [path1, path2], cb)
|
const mvCall = (path1, path2, cb) => rpc('mv', [path1, path2], cb)
|
||||||
|
const sumCall = (path, type, cb) => rpc('sum', [prependPath(path), type], cb)
|
||||||
|
|
||||||
// File upload
|
// File upload
|
||||||
let totalDone = 0
|
let totalDone = 0
|
||||||
@@ -383,7 +384,7 @@ function resetView () {
|
|||||||
scrollToArrow()
|
scrollToArrow()
|
||||||
}
|
}
|
||||||
|
|
||||||
window.quitAll = () => helpOff() || picsOff() || videosOff() || padOff() || pdfOff()
|
window.quitAll = () => helpOff() || sumsOff() || picsOff() || videosOff() || padOff() || pdfOff()
|
||||||
|
|
||||||
// Mkdir icon
|
// Mkdir icon
|
||||||
window.mkdirBtn = function () {
|
window.mkdirBtn = function () {
|
||||||
@@ -659,6 +660,40 @@ function helpOff () {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// checksums
|
||||||
|
function getSum (type) {
|
||||||
|
upBarPc.style.display = 'block'
|
||||||
|
upBarPc.innerText = 'computing checksum...'
|
||||||
|
upBarPc.style.width = '100%'
|
||||||
|
sumsOff()
|
||||||
|
sumCall(getASelected().innerText, type, loaded => {
|
||||||
|
navigator.clipboard.writeText(loaded.target.responseText)
|
||||||
|
upBarPc.style.display = 'none'
|
||||||
|
flicker(okBadge)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const isSumsMode = () => sums.style.display === 'block'
|
||||||
|
|
||||||
|
const sumsToggle = () => isSumsMode() ? sumsOff() : sumsOn()
|
||||||
|
|
||||||
|
function sumsOn () {
|
||||||
|
if (isFolder(getASelected())) {
|
||||||
|
alert('cannot checksum a directory')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
sums.style.display = 'block'
|
||||||
|
table.style.display = 'none'
|
||||||
|
}
|
||||||
|
|
||||||
|
window.sumsOff = sumsOff
|
||||||
|
function sumsOff () {
|
||||||
|
if (!isSumsMode()) return
|
||||||
|
sums.style.display = 'none'
|
||||||
|
table.style.display = 'table'
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
// Paste handler
|
// Paste handler
|
||||||
const cuts = []
|
const cuts = []
|
||||||
function onPaste () {
|
function onPaste () {
|
||||||
@@ -749,40 +784,69 @@ document.body.addEventListener('keydown', e => {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ctrl keys
|
// Modifier keys
|
||||||
if ((e.ctrlKey || e.metaKey) && !e.shiftKey) {
|
if (!e.shiftKey) {
|
||||||
switch (e.code) {
|
if (e.ctrlKey || e.metaKey) {
|
||||||
case 'KeyC':
|
switch (e.code) {
|
||||||
return prevent(e) || isRo() || cpPath()
|
case 'KeyC':
|
||||||
|
return prevent(e) || isRo() || cpPath()
|
||||||
|
|
||||||
case 'KeyH':
|
case 'KeyH':
|
||||||
return prevent(e) || isRo() || helpToggle()
|
return prevent(e) || isRo() || helpToggle()
|
||||||
|
|
||||||
case 'KeyX':
|
case 'KeyZ':
|
||||||
return prevent(e) || isRo() || onCut()
|
return prevent(e) || isRo() || sumsToggle()
|
||||||
|
|
||||||
case 'KeyR':
|
case 'KeyX':
|
||||||
return prevent(e) || refresh()
|
return prevent(e) || isRo() || onCut()
|
||||||
|
|
||||||
case 'KeyV':
|
case 'KeyR':
|
||||||
return prevent(e) || isRo() || ensureMove() || onPaste()
|
return prevent(e) || refresh()
|
||||||
|
|
||||||
case 'Backspace':
|
case 'KeyV':
|
||||||
return prevent(e) || isRo() || window.rm(e)
|
return prevent(e) || isRo() || ensureMove() || onPaste()
|
||||||
|
|
||||||
case 'KeyE':
|
case 'Backspace':
|
||||||
return prevent(e) || isRo() || window.rename(e)
|
return prevent(e) || isRo() || window.rm(e)
|
||||||
|
|
||||||
case 'KeyM':
|
case 'KeyE':
|
||||||
return prevent(e) || isRo() || window.mkdirBtn()
|
return prevent(e) || isRo() || window.rename(e)
|
||||||
|
|
||||||
case 'KeyU':
|
case 'KeyM':
|
||||||
return prevent(e) || isRo() || manualUpload.click()
|
return prevent(e) || isRo() || window.mkdirBtn()
|
||||||
|
|
||||||
case 'Enter':
|
case 'KeyU':
|
||||||
case 'ArrowRight':
|
return prevent(e) || isRo() || manualUpload.click()
|
||||||
return prevent(e) || dl(getASelected())
|
|
||||||
|
case 'Enter':
|
||||||
|
case 'ArrowRight':
|
||||||
|
return prevent(e) || dl(getASelected())
|
||||||
|
}
|
||||||
|
} else if (isSumsMode()) {
|
||||||
|
switch (e.code) {
|
||||||
|
case 'Digit1':
|
||||||
|
return prevent(e) || isRo() || getSum('sha1')
|
||||||
|
|
||||||
|
case 'Digit2':
|
||||||
|
return prevent(e) || isRo() || getSum('sha256')
|
||||||
|
|
||||||
|
case 'Digit3':
|
||||||
|
return prevent(e) || isRo() || getSum('sha512')
|
||||||
|
|
||||||
|
case 'Digit5':
|
||||||
|
return prevent(e) || isRo() || getSum('md5')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// Workaround Firefox requirement for transient activation
|
||||||
|
// https://developer.mozilla.org/en-US/docs/Web/Security/User_activation
|
||||||
|
// Firefox requires user interaction (that is not reserved by the user agent)
|
||||||
|
// before a file picker can be displayed. This means that ctrl/meta are not
|
||||||
|
// usable as modifiers until the user clicks the page or presses another
|
||||||
|
// non-modifier key. To work around this, the shift key can be used, instead.
|
||||||
|
if (e.code == 'KeyU') {
|
||||||
|
return prevent(e) || isRo() || manualUpload.click()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (e.code) {
|
switch (e.code) {
|
||||||
|
|||||||
Vendored
+6
-8
@@ -344,12 +344,8 @@ h1 > span:hover {
|
|||||||
right: 30px;
|
right: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#helpHead {
|
#helpTable,
|
||||||
margin-top: 60px;
|
#sumsTable {
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
#helpTable {
|
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
width: 70%;
|
width: 70%;
|
||||||
max-width: 790px;
|
max-width: 790px;
|
||||||
@@ -360,7 +356,8 @@ h1 > span:hover {
|
|||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
#helpTable td {
|
#helpTable td,
|
||||||
|
#sumsTable td {
|
||||||
width: 200px;
|
width: 200px;
|
||||||
padding: 9px;
|
padding: 9px;
|
||||||
border: 1px solid #fff;
|
border: 1px solid #fff;
|
||||||
@@ -369,7 +366,8 @@ h1 > span:hover {
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#help {
|
#help,
|
||||||
|
#sums {
|
||||||
background-color: black;
|
background-color: black;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0px;
|
top: 0px;
|
||||||
|
|||||||
Vendored
+12
-3
@@ -4,7 +4,7 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="theme-color" content="rgb(45,52,54)">
|
<meta name="theme-color" content="rgb(45,52,54)">
|
||||||
<meta name="msapplication-navbutton-color" content="rgb(45,52,54)">
|
<meta name="msapplication-navbutton-color" content="rgb(45,52,54)">
|
||||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
<meta name="mobile-web-app-capable" content="yes">
|
||||||
<meta name="viewport" content="width=device-width">
|
<meta name="viewport" content="width=device-width">
|
||||||
|
|
||||||
<link rel="manifest" href='data:application/manifest+json,{"name":"{{.Title}}","short_name":"{{.Title}}","description":" ","icons":[{"src":"data:image/svg+xml;base64,favicon_will_be_here","sizes":"150x150","type":"image/svg+xml"}],"background":"rgb(45,52,54)","theme_color":"rgb(45,52,54)","display":"standalone"}' />
|
<link rel="manifest" href='data:application/manifest+json,{"name":"{{.Title}}","short_name":"{{.Title}}","description":" ","icons":[{"src":"data:image/svg+xml;base64,favicon_will_be_here","sizes":"150x150","type":"image/svg+xml"}],"background":"rgb(45,52,54)","theme_color":"rgb(45,52,54)","display":"standalone"}' />
|
||||||
@@ -26,10 +26,11 @@
|
|||||||
<tr><td>Ctrl/Meta + C</td><td>copy URL to clipboard</td></tr>
|
<tr><td>Ctrl/Meta + C</td><td>copy URL to clipboard</td></tr>
|
||||||
<tr><td>Ctrl/Meta + E</td><td>rename item</td></tr>
|
<tr><td>Ctrl/Meta + E</td><td>rename item</td></tr>
|
||||||
<tr><td>Ctrl/Meta + Backspace</td><td>delete item</td></tr>
|
<tr><td>Ctrl/Meta + Backspace</td><td>delete item</td></tr>
|
||||||
<tr><td>Ctrl/Meta + U</td><td>upload new file/folder</td></tr>
|
<tr><td>Ctrl/Meta/Shift + U</td><td>upload new file/folder</td></tr>
|
||||||
<tr><td>Ctrl/Meta + M</td><td>create a new directory</td></tr>
|
<tr><td>Ctrl/Meta + M</td><td>create a new directory</td></tr>
|
||||||
<tr><td>Ctrl/Meta + X</td><td>cut selected path</td></tr>
|
<tr><td>Ctrl/Meta + X</td><td>cut selected path</td></tr>
|
||||||
<tr><td>Ctrl/Meta + V</td><td>paste previously selected paths to directory</td></tr>
|
<tr><td>Ctrl/Meta + V</td><td>paste previously selected paths to directory</td></tr>
|
||||||
|
<tr><td>Ctrl/Meta + Z</td><td>copy checksums of selected file</td></tr>
|
||||||
<tr><td>Ctrl + click</td><td>download selected item as archive</td></tr>
|
<tr><td>Ctrl + click</td><td>download selected item as archive</td></tr>
|
||||||
<tr><td>click file icon </td><td>rename item</td></tr>
|
<tr><td>click file icon </td><td>rename item</td></tr>
|
||||||
<tr><td>double click file icon</td><td>delete item</td></tr>
|
<tr><td>double click file icon</td><td>delete item</td></tr>
|
||||||
@@ -38,10 +39,18 @@
|
|||||||
<tr><td>any other letter</td><td>fuzzy search</td></tr>
|
<tr><td>any other letter</td><td>fuzzy search</td></tr>
|
||||||
</tbody></table></div>
|
</tbody></table></div>
|
||||||
|
|
||||||
|
<div onclick="window.sumsOff()" style="display: none;" id="sums"><table id="sumsTable"><tbody>
|
||||||
|
<tr><td>Key</td><td>Hash Algorithm</td></tr>
|
||||||
|
<tr><td>1</td><td>copy sha1 sum</td></tr>
|
||||||
|
<tr><td>2</td><td>copy sha256 sum</td></tr>
|
||||||
|
<tr><td>3</td><td>copy sha512 sum</td></tr>
|
||||||
|
<tr><td>5</td><td>copy md5 sum</td></tr>
|
||||||
|
</tbody></table></div>
|
||||||
|
|
||||||
<div style="display: none;" onclick="window.quitAll()" id="quitAll"><i style="display: none;" id="toast">cant reach server</i></div>
|
<div style="display: none;" onclick="window.quitAll()" id="quitAll"><i style="display: none;" id="toast">cant reach server</i></div>
|
||||||
<textarea style="display: none;" id="text-editor"></textarea>
|
<textarea style="display: none;" id="text-editor"></textarea>
|
||||||
<div id="drop-grid"></div>
|
<div id="drop-grid"></div>
|
||||||
<input type="file" id="clickupload" style="display:none"/>
|
<input type="file" id="clickupload" multiple style="display:none"/>
|
||||||
|
|
||||||
<h1 onclick="return titleClick(event)">.{{.Title}}</h1>
|
<h1 onclick="return titleClick(event)">.{{.Title}}</h1>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user