Merge branch 'filebrowser:master' into add-username-in-sidebar

pull/2821/head
Jonathan Bout 2024-02-23 21:29:11 +01:00 committed by GitHub
commit 8307232ed5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 75 additions and 45 deletions

View File

@ -13,26 +13,26 @@ jobs:
lint-frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18'
- run: make lint-frontend
lint-backend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.21.0
- run: make lint-backend
lint-commits:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v2
- uses: actions/setup-node@v4
with:
node-version: '18'
- run: make lint-commits
@ -46,16 +46,16 @@ jobs:
test-frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18'
- run: make test-frontend
test-backend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.21.0
- run: make test-backend
@ -71,13 +71,13 @@ jobs:
needs: [lint, test]
if: startsWith(github.event.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v2
- uses: actions/setup-go@v5
with:
go-version: 1.21.0
- uses: actions/setup-node@v2
- uses: actions/setup-node@v4
with:
node-version: '18'
- name: Set up QEMU

View File

@ -16,6 +16,8 @@
[{[ if .Name -]}][{[ .Name ]}][{[ else ]}]File Browser[{[ end ]}]
</title>
<meta name="robots" content="noindex,nofollow">
<link
rel="icon"
type="image/png"

View File

@ -2,7 +2,7 @@
<div
class="shell"
:class="{ ['shell--hidden']: !showShell }"
:style="{ height: `${this.shellHeight}em` }"
:style="{ height: `${this.shellHeight}em`, direction: 'ltr' }"
>
<div
@pointerdown="startDrag()"

View File

@ -191,7 +191,12 @@ export default {
action(overwrite, rename);
},
itemClick: function (event) {
if (!(event.ctrlKey || event.metaKey) && this.singleClick && !this.$store.state.multiple) this.open();
if (
!(event.ctrlKey || event.metaKey) &&
this.singleClick &&
!this.$store.state.multiple
)
this.open();
else this.click(event);
},
click: function (event) {

View File

@ -12,7 +12,7 @@
<div
class="card-action"
style="display: flex; align-items: center; justify-content: space-between;"
style="display: flex; align-items: center; justify-content: space-between"
>
<template v-if="user.perm.create">
<button
@ -20,7 +20,7 @@
@click="$refs.fileList.createDir()"
:aria-label="$t('sidebar.newFolder')"
:title="$t('sidebar.newFolder')"
style="justify-self: left;"
style="justify-self: left"
>
<span>{{ $t("sidebar.newFolder") }}</span>
</button>

View File

@ -133,14 +133,13 @@ export default {
: this.req.items[this.selected[0]].isDir)
);
},
resolution: function() {
resolution: function () {
if (this.selectedCount === 1) {
const selectedItem = this.req.items[this.selected[0]];
if (selectedItem && selectedItem.type === 'image') {
if (selectedItem && selectedItem.type === "image") {
return selectedItem.resolution;
}
}
else if (this.req && this.req.type === 'image') {
} else if (this.req && this.req.type === "image") {
return this.req.resolution;
}
return null;

View File

@ -11,7 +11,7 @@
<div
class="card-action"
style="display: flex; align-items: center; justify-content: space-between;"
style="display: flex; align-items: center; justify-content: space-between"
>
<template v-if="user.perm.create">
<button
@ -19,7 +19,7 @@
@click="$refs.fileList.createDir()"
:aria-label="$t('sidebar.newFolder')"
:title="$t('sidebar.newFolder')"
style="justify-self: left;"
style="justify-self: left"
>
<span>{{ $t("sidebar.newFolder") }}</span>
</button>

View File

@ -152,7 +152,7 @@ main .spinner .bounce2 {
/* PREVIEWER */
#previewer {
background-color: rgba(0, 0, 0, 0.9);
background-color: rgba(0, 0, 0, 0.99);
padding-top: 4em;
position: fixed;
top: 0;

View File

@ -3,10 +3,10 @@
<header-bar v-if="error || req.type == null" showMenu showLogo />
<breadcrumbs base="/files" />
<listing />
<errors v-if="error" :errorCode="error.status" />
<component v-else-if="currentView" :is="currentView"></component>
<div v-else>
<div v-else-if="currentView !== null">
<h2 class="message delayed">
<div class="spinner">
<div class="bounce1"></div>
@ -52,13 +52,10 @@ export default {
computed: {
...mapState(["req", "reload", "loading"]),
currentView() {
if (this.req.type == undefined) {
if (this.req.type == undefined || this.req.isDir) {
return null;
}
if (this.req.isDir) {
return "listing";
} else if (
else if (
this.req.type === "text" ||
this.req.type === "textImmutable"
) {
@ -72,7 +69,26 @@ export default {
this.fetchData();
},
watch: {
$route: "fetchData",
$route: function (to, from) {
if (from.path.endsWith("/")) {
if (to.path.endsWith("/")) {
window.sessionStorage.setItem('listFrozen', "false");
this.fetchData();
return;
} else {
window.sessionStorage.setItem('listFrozen', "true");
this.fetchData();
return;
}
} else if (to.path.endsWith("/")) {
this.$store.commit("updateRequest", {});
this.fetchData();
return;
} else {
this.fetchData();
return;
}
},
reload: function (value) {
if (value === true) {
this.fetchData();
@ -101,7 +117,9 @@ export default {
this.$store.commit("closeHovers");
// Set loading to true and reset the error.
if (window.sessionStorage.getItem('listFrozen') !=="true"){
this.setLoading(true);
}
this.error = null;
let url = this.$route.path;

View File

@ -129,6 +129,7 @@ export default {
try {
await api.put(this.$route.path, this.editor.getValue());
this.editor.session.getUndoManager().markClean();
buttons.success(button);
} catch (e) {
buttons.done(button);
@ -136,9 +137,7 @@ export default {
}
},
close() {
const originalContent = this.req.content;
const currentContent = this.editor.getValue();
if (originalContent !== currentContent) {
if (!this.editor.session.getUndoManager().isClean()) {
this.$store.commit("showHover", "discardEditorChanges");
return;
}

View File

@ -383,6 +383,7 @@ export default {
},
watch: {
req: function () {
if (window.sessionStorage.getItem('listFrozen') !=="true"){
// Reset the show value
this.showLimit = 50;
@ -394,6 +395,10 @@ export default {
// Fill and fit the window with listing items
this.fillWindow(true);
});
}
if (this.req.isDir) {
window.sessionStorage.setItem('listFrozen', "false");
}
},
},
mounted: function () {

View File

@ -1,6 +1,8 @@
<template>
<div
id="previewer"
@touchmove.prevent.stop
@wheel.prevent.stop
@mousemove="toggleNavigation"
@touchstart="toggleNavigation"
>