diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml
index c504686a..ff6ea28d 100644
--- a/.github/workflows/main.yaml
+++ b/.github/workflows/main.yaml
@@ -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
diff --git a/cmd/utils.go b/cmd/utils.go
index 2bd9e760..d4ccbacc 100644
--- a/cmd/utils.go
+++ b/cmd/utils.go
@@ -87,16 +87,23 @@ func python(fn pythonFunc, cfg pythonConfig) cobraFunc {
data := pythonData{hadDB: true}
path := getParam(cmd.Flags(), "database")
+ absPath, err := filepath.Abs(path)
+ if err != nil {
+ panic(err)
+ }
exists, err := dbExists(path)
if err != nil {
panic(err)
} else if exists && cfg.noDB {
- log.Fatal(path + " already exists")
+ log.Fatal(absPath + " already exists")
} else if !exists && !cfg.noDB && !cfg.allowNoDB {
- log.Fatal(path + " does not exist. Please run 'filebrowser config init' first.")
+ log.Fatal(absPath + " does not exist. Please run 'filebrowser config init' first.")
+ } else if !exists && !cfg.noDB {
+ log.Println("Warning: filebrowser.db can't be found. Initialing in " + strings.TrimSuffix(absPath, "filebrowser.db"))
}
+ log.Println("Using database: " + absPath)
data.hadDB = exists
db, err := storm.Open(path)
checkErr(err)
diff --git a/frontend/public/index.html b/frontend/public/index.html
index 39d926d8..530da7cf 100644
--- a/frontend/public/index.html
+++ b/frontend/public/index.html
@@ -16,6 +16,8 @@
[{[ if .Name -]}][{[ .Name ]}][{[ else ]}]File Browser[{[ end ]}]
+
+
diff --git a/frontend/src/components/prompts/Delete.vue b/frontend/src/components/prompts/Delete.vue
index f65e69b7..2527c855 100644
--- a/frontend/src/components/prompts/Delete.vue
+++ b/frontend/src/components/prompts/Delete.vue
@@ -45,6 +45,7 @@ export default {
submit: async function () {
buttons.loading("delete");
+ window.sessionStorage.setItem("modified", "true");
try {
if (!this.isListing) {
await api.remove(this.$route.path);
diff --git a/frontend/src/components/prompts/Info.vue b/frontend/src/components/prompts/Info.vue
index d82b107e..a67f21a3 100644
--- a/frontend/src/components/prompts/Info.vue
+++ b/frontend/src/components/prompts/Info.vue
@@ -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;
diff --git a/frontend/src/components/prompts/Move.vue b/frontend/src/components/prompts/Move.vue
index bbc19d36..87d13c65 100644
--- a/frontend/src/components/prompts/Move.vue
+++ b/frontend/src/components/prompts/Move.vue
@@ -11,7 +11,7 @@
diff --git a/frontend/src/components/prompts/Rename.vue b/frontend/src/components/prompts/Rename.vue
index b6fb38ed..f3a96c2e 100644
--- a/frontend/src/components/prompts/Rename.vue
+++ b/frontend/src/components/prompts/Rename.vue
@@ -88,6 +88,7 @@ export default {
newLink =
url.removeLastDir(oldLink) + "/" + encodeURIComponent(this.name);
+ window.sessionStorage.setItem("modified", "true");
try {
await api.move([{ from: oldLink, to: newLink }]);
if (!this.isListing) {
diff --git a/frontend/src/css/mobile.css b/frontend/src/css/mobile.css
index 3779d6e7..8047a5b6 100644
--- a/frontend/src/css/mobile.css
+++ b/frontend/src/css/mobile.css
@@ -2,10 +2,6 @@
nav {
width: 10em
}
- /* Mobile Only fix div hidden by bottom navigation bar of mobile browser when using height: 100vh */
- #previewer .preview {
- height: calc(100% - 4em) !important;
- }
}
@media (max-width: 1024px) {
diff --git a/frontend/src/css/styles.css b/frontend/src/css/styles.css
index 00442507..bac14c6d 100644
--- a/frontend/src/css/styles.css
+++ b/frontend/src/css/styles.css
@@ -152,8 +152,7 @@ main .spinner .bounce2 {
/* PREVIEWER */
#previewer {
- background-color: rgba(0, 0, 0, 0.9);
- padding-top: 4em;
+ background-color: rgba(0, 0, 0, 0.99);
position: fixed;
top: 0;
left: 0;
@@ -166,15 +165,25 @@ main .spinner .bounce2 {
#previewer header {
background: none;
color: #fff;
+ border-bottom: 0px;
+ box-shadow: 0px 0px 0px;
+ z-index: 19999;
}
#previewer header > .action i {
color: #fff;
+ text-shadow: 1px 1px 1px #000000;
+}
+
+#previewer header > title {
+ white-space: nowrap;
+ text-shadow: 1px 1px 1px #000000;
}
@media (min-width: 738px) {
#previewer header #dropdown .action i {
color: #fff;
+ text-shadow: 1px 1px 1px #000000;
}
}
@@ -188,7 +197,7 @@ main .spinner .bounce2 {
#previewer .preview {
text-align: center;
- height: calc(100vh - 4em);
+ height: 100%;
}
#previewer .preview pre {
@@ -203,6 +212,12 @@ main .spinner .bounce2 {
margin: 0;
}
+#previewer .preview audio {
+ width: 95%;
+ height: 88%;
+}
+
+
#previewer .preview video {
height: 100%;
}
@@ -247,7 +262,7 @@ main .spinner .bounce2 {
#previewer > button {
margin: 0;
position: fixed;
- top: calc(50% + 1.85em);
+ top: 50%;
transform: translateY(-50%);
background-color: rgba(80, 80, 80, 0.5);
color: white;
diff --git a/frontend/src/views/Files.vue b/frontend/src/views/Files.vue
index ff7b84a6..29a7afd9 100644
--- a/frontend/src/views/Files.vue
+++ b/frontend/src/views/Files.vue
@@ -3,10 +3,10 @@
-
+
-
+
@@ -52,12 +52,8 @@ 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 (
this.req.type === "text" ||
this.req.type === "textImmutable"
@@ -72,7 +68,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 +116,9 @@ export default {
this.$store.commit("closeHovers");
// Set loading to true and reset the error.
- this.setLoading(true);
+ if (window.sessionStorage.getItem("listFrozen") !=="true" && window.sessionStorage.getItem("modified") !=="true"){
+ this.setLoading(true);
+ }
this.error = null;
let url = this.$route.path;
diff --git a/frontend/src/views/Share.vue b/frontend/src/views/Share.vue
index cdcfdf60..0bbf6436 100644
--- a/frontend/src/views/Share.vue
+++ b/frontend/src/views/Share.vue
@@ -29,7 +29,7 @@