updated with more changes (#1105)

This commit is contained in:
Graham Steffaniak authored and GitHub committed 2025-08-22 15:29:16 -05:00
1 parent 2fac9d30d9
commit 4dc90a9dd0
43 files changed
+101 -78

No files matched your search

+12 -2
View File
@@ -11,12 +11,22 @@ All notable changes to this project will be documented in this file. For commit
- hide share card in share
- download count for a share shows up on share management
**Notes**:
- updated description for indexingIntervalMinutes https://github.com/gtsteffaniak/filebrowser/issues/1067
**BugFixes**:
- fixed styling issues https://github.com/gtsteffaniak/filebrowser/issues/1086 https://github.com/gtsteffaniak/filebrowser/issues/1081 https://github.com/gtsteffaniak/filebrowser/issues/1082
- fixed styling issues https://github.com/gtsteffaniak/filebrowser/issues/1086 https://github.com/gtsteffaniak/filebrowser/issues/1081 https://github.com/gtsteffaniak/filebrowser/issues/1082 https://github.com/gtsteffaniak/filebrowser/issues/1098
- fix download limit issue https://github.com/gtsteffaniak/filebrowser/issues/1085
- fixed oidc user defaults for new user https://github.com/gtsteffaniak/filebrowser/issues/1071
- shares get updated when files moved in ui https://github.com/gtsteffaniak/filebrowser/issues/760
- click listing behavior doesn't clear (introduced in 0.8.0)
- click listing behavior doesn't clear (introduced in 0.8.0) https://github.com/gtsteffaniak/filebrowser/issues/1101
- show download count and limit in share list in settings https://github.com/gtsteffaniak/filebrowser/issues/1103
- fix windows alt+arrow movement issue https://github.com/gtsteffaniak/filebrowser/issues/1094
- nav memory issue for filenames with brackets https://github.com/gtsteffaniak/filebrowser/issues/1092
- files with "+"" in name issue https://github.com/gtsteffaniak/filebrowser/issues/1089
- fixed editor bug in share view https://github.com/gtsteffaniak/filebrowser/issues/1084
- other share related issues https://github.com/gtsteffaniak/filebrowser/issues/1087 https://github.com/gtsteffaniak/filebrowser/issues/1064
## v0.8.0-beta
+1 -1
View File
@@ -79,7 +79,7 @@ type Source struct {
type SourceConfig struct {
Private bool `json:"private"` // designate as source as private -- currently just means no sharing permitted.
Disabled bool `json:"disabled"` // disable the source, this is useful so you don't need to remove it from the config file
IndexingInterval uint32 `json:"indexingIntervalMinutes"` // optional manual overide interval in seconds to re-index the source
IndexingInterval uint32 `json:"indexingIntervalMinutes"` // optional manual overide interval in minutes to re-index the source
DisableIndexing bool `json:"disableIndexing"` // disable the indexing of this source
MaxWatchers int `json:"maxWatchers"` // number of concurrent watchers to use for this source, currently not supported
NeverWatchPaths []string `json:"neverWatchPaths"` // paths that get initially once. Useful for folders that rarely change contents (without source path prefix)
+1 -1
View File
@@ -20,12 +20,12 @@ type CommonShare struct {
Favicon string `json:"favicon,omitempty"`
QuickDownload bool `json:"quickDownload,omitempty"`
HideNavButtons bool `json:"hideNavButtons,omitempty"`
DisableSidebar bool `json:"disableSidebar"`
ViewMode string `json:"viewMode,omitempty"`
Source string `json:"source,omitempty"` // backend source is path to maintain between name changes
Path string `json:"path,omitempty"`
DownloadURL string `json:"downloadURL,omitempty"`
DisableShareCard bool `json:"disableShareCard,omitempty"`
DisableSidebar bool `json:"disableSidebar,omitempty"`
Username string `json:"username,omitempty"`
}
type CreateBody struct {
+1 -8
View File
@@ -6,7 +6,6 @@ import (
"encoding/json"
"fmt"
"net/http"
"net/url"
"runtime"
"slices"
"strings"
@@ -47,12 +46,7 @@ type handleFunc func(w http.ResponseWriter, r *http.Request, data *requestContex
func withHashFileHelper(fn handleFunc) handleFunc {
return withOrWithoutUserHelper(func(w http.ResponseWriter, r *http.Request, data *requestContext) (int, error) {
hash := r.URL.Query().Get("hash")
encodedPath := r.URL.Query().Get("path")
// Decode the URL-encoded path
path, err := url.QueryUnescape(encodedPath)
if err != nil {
return http.StatusBadRequest, fmt.Errorf("invalid path encoding: %v", err)
}
path := r.URL.Query().Get("path")
// Get the file link by hash
link, err := store.Share.GetByHash(hash)
if err != nil {
@@ -90,7 +84,6 @@ func withHashFileHelper(fn handleFunc) handleFunc {
Expand: true,
Content: r.URL.Query().Get("content") == "true",
})
fmt.Println("file", file.Source)
file.Token = link.Token
if err != nil {
logger.Errorf("error fetching file info for share. hash=%v path=%v error=%v", hash, path, err)
-1
View File
@@ -33,7 +33,6 @@ func publicRawHandler(w http.ResponseWriter, r *http.Request, d *requestContext)
return http.StatusForbidden, fmt.Errorf("share downloads limit reached")
}
if d.share.DownloadsLimit > 0 {
fmt.Println("downloads increased", d.share.Downloads, d.share.DownloadsLimit)
d.share.Mu.Lock()
d.share.Downloads++
d.share.Mu.Unlock()
+1
View File
@@ -190,6 +190,7 @@ func sharePostHandler(w http.ResponseWriter, r *http.Request, d *requestContext)
body.Path = s.Path
body.Source = s.Source
s.CommonShare = body.CommonShare
if err = store.Share.Save(s); err != nil {
return http.StatusInternalServerError, err
}
+2
View File
@@ -61,6 +61,7 @@ func handleWithStaticData(w http.ResponseWriter, r *http.Request, d *requestCont
"description": "FileBrowser Quantum is a file manager for the web which can be used to manage files on your server",
}
shareOverrides := map[string]interface{}{
"isShare": false,
"banner": "",
"title": "",
"quickDownload": false,
@@ -85,6 +86,7 @@ func handleWithStaticData(w http.ResponseWriter, r *http.Request, d *requestCont
shareOverrides["disableFileViewer"] = d.share.DisablingFileViewer
shareOverrides["disableShareCard"] = d.share.DisableShareCard
shareOverrides["disableSidebar"] = d.share.DisableSidebar
shareOverrides["isShare"] = true
if d.share.Favicon != "" {
if strings.HasPrefix(d.share.Favicon, "http") {
data["favicon"] = d.share.Favicon
+1 -1
View File
@@ -3010,7 +3010,7 @@ const docTemplate = `{
]
},
"indexingIntervalMinutes": {
"description": "optional manual overide interval in seconds to re-index the source",
"description": "optional manual overide interval in minutes to re-index the source",
"type": "integer"
},
"maxWatchers": {
+1 -1
View File
@@ -2999,7 +2999,7 @@
]
},
"indexingIntervalMinutes": {
"description": "optional manual overide interval in seconds to re-index the source",
"description": "optional manual overide interval in minutes to re-index the source",
"type": "integer"
},
"maxWatchers": {
+1 -1
View File
@@ -531,7 +531,7 @@ definitions:
- $ref: '#/definitions/settings.IncludeIndexFilter'
description: include files and folders from indexing, if exclude is not set
indexingIntervalMinutes:
description: optional manual overide interval in seconds to re-index the source
description: optional manual overide interval in minutes to re-index the source
type: integer
maxWatchers:
description: number of concurrent watchers to use for this source, currently
+1 -1
View File
@@ -23,7 +23,7 @@ server:
config:
private: false # designate as source as private -- currently just means no sharing permitted.
disabled: false # disable the source, this is useful so you don't need to remove it from the config file
indexingIntervalMinutes: 0 # optional manual overide interval in seconds to re-index the source
indexingIntervalMinutes: 0 # optional manual overide interval in minutes to re-index the source
disableIndexing: false # disable the indexing of this source
maxWatchers: 0 # number of concurrent watchers to use for this source, currently not supported
neverWatchPaths: []
+1 -1
View File
@@ -393,7 +393,7 @@ export default {
},
initializeCreateState() {
// Only set initial showCreate state, don't override user choices
if (state.selected.length > 0) {
if (state.selected.length > 0 || getters.isShare()) {
this.showCreate = false;
} else {
this.showCreate = true;
+1 -4
View File
@@ -51,10 +51,7 @@ export default {
event.preventDefault();
if (this.name === "") return;
await filesApi.post(state.req.source,state.req.path + "/" + this.name, "", true );
goToItem(
state.req.source,
state.req.path + "/" + encodeURIComponent(this.name)
);
goToItem(state.req.source, state.req.path + "/" + this.name);
} catch (error) {
notify.showError(error);
}
@@ -504,6 +504,7 @@ export default {
quickDownload: this.quickDownload,
hideNavButtons: this.disableNavButtons,
disableShareCard: this.disableShareCard,
disableSidebar: this.disableSidebar,
};
if (this.isEditMode) {
payload.hash = this.link.hash;
+2 -2
View File
@@ -398,7 +398,6 @@
"toggleClick": "تبديل نقرة واحدة",
"toggleDark": "تبديل الوضع الداكن",
"toggleSticky": "تبديل الوضع اللاصق",
"of": "من",
"used": "مستعمل",
"noSources": "لا توجد مصادر متاحة لهذا المستخدم. إما أن تقوم بإضافة مصدر لهذا المستخدم أو تكوين مصدر مع defaultEnabled: true"
},
@@ -425,7 +424,8 @@
"folders": "المجلدات",
"exit": "الخروج",
"permanent": "دائم",
"hash": "تجزئة"
"hash": "تجزئة",
"of": "من"
},
"access": {
"rules": "قواعد الوصول",
+2 -2
View File
@@ -449,7 +449,6 @@
"toggleClick": "Přepnout jedno kliknutí",
"toggleDark": "Přepnout tmavý režim",
"toggleSticky": "Přepnout sticky režim",
"of": "z",
"used": "použito",
"noSources": "Pro tohoto uživatele nejsou dostupné žádné zdroje. Přidejte zdroj pro uživatele nebo nastavte zdroj s defaultEnabled: true"
},
@@ -491,7 +490,8 @@
"folders": "Složky",
"exit": "Exit",
"permanent": "Permanentní",
"hash": "Hash"
"hash": "Hash",
"of": "z"
},
"access": {
"rules": "Pravidla přístupu",
+2 -2
View File
@@ -398,7 +398,6 @@
"toggleClick": "Einzelklick umschalten",
"toggleDark": "Dunkelmodus umschalten",
"toggleSticky": "Sticky-Modus umschalten",
"of": "von",
"used": "belegt",
"noSources": "Für diesen Benutzer sind keine Quellen verfügbar. Entweder eine Quelle für diesen Benutzer hinzufügen oder eine Quelle mit defaultEnabled: true konfigurieren"
},
@@ -425,7 +424,8 @@
"folders": "Ordner",
"exit": "Ausfahrt",
"permanent": "Dauerhaft",
"hash": "Hash"
"hash": "Hash",
"of": "von"
},
"access": {
"rules": "Zugangsregeln",
+2 -2
View File
@@ -398,7 +398,6 @@
"toggleClick": "Εναλλαγή με ένα κλικ",
"toggleDark": "Εναλλαγή σκοτεινής λειτουργίας",
"toggleSticky": "Εναλλαγή της λειτουργίας Sticky",
"of": "του",
"used": "χρησιμοποιημένο",
"noSources": "Δεν υπάρχουν διαθέσιμες πηγές για αυτόν τον χρήστη. Είτε προσθέστε μια πηγή για αυτόν τον χρήστη είτε ρυθμίστε μια πηγή με defaultEnabled: true"
},
@@ -425,7 +424,8 @@
"folders": "Φάκελοι",
"exit": "Έξοδος",
"permanent": "Μόνιμο",
"hash": "Κατακερματισμός"
"hash": "Κατακερματισμός",
"of": "του"
},
"access": {
"rules": "Κανόνες πρόσβασης",
+2 -2
View File
@@ -398,7 +398,6 @@
"toggleClick": "Abrir con un solo clic",
"toggleDark": "Activar modo oscuro",
"toggleSticky": "Barra lateral visible",
"of": "de",
"used": "usado",
"noSources": "No hay fuentes disponibles. Añada una o active defaultEnabled: true."
},
@@ -425,7 +424,8 @@
"folders": "Carpetas",
"exit": "Salida",
"permanent": "Permanente",
"hash": "Hash"
"hash": "Hash",
"of": "de"
},
"access": {
"rules": "Normas de acceso",
+2 -2
View File
@@ -398,7 +398,6 @@
"toggleClick": "Activation du mode simple clic",
"toggleDark": "Mode sombre/clair",
"toggleSticky": "Activer/Désactiver le mode persistent",
"of": "de",
"used": "utilisé",
"noSources": "Aucune source n'est disponible pour cet utilisateur. Ajoutez une source pour cet utilisateur ou configurez une source avec defaultEnabled : true"
},
@@ -425,7 +424,8 @@
"folders": "Dossiers",
"exit": "Sortie",
"permanent": "Permanent",
"hash": "Hachures"
"hash": "Hachures",
"of": "de"
},
"access": {
"rules": "Règles d'accès",
+2 -2
View File
@@ -398,7 +398,6 @@
"toggleClick": "החלף לחיצה אחת",
"toggleDark": "הפעל מצב כהה",
"toggleSticky": "הפעל/כבה מצב דביק",
"of": "של",
"used": "משומש",
"noSources": "אין מקורות זמינים עבור משתמש זה. הוסף מקור עבור משתמש זה או הגדר מקור עם defaultEnabled: true"
},
@@ -425,7 +424,8 @@
"folders": "תיקיות",
"exit": "יציאה",
"permanent": "קבוע",
"hash": "חשיש"
"hash": "חשיש",
"of": "של"
},
"access": {
"rules": "כללי גישה",
+2 -2
View File
@@ -398,7 +398,6 @@
"toggleClick": "Egyetlen kattintás kapcsolása",
"toggleDark": "Sötét üzemmód átkapcsolása",
"toggleSticky": "Ragadós mód átkapcsolása",
"of": "a",
"used": "használt",
"noSources": "Ehhez a felhasználóhoz nem állnak rendelkezésre források. Vagy adjon hozzá egy forrást ehhez a felhasználóhoz, vagy konfiguráljon egy forrást a defaultEnabled: true beállítással."
},
@@ -425,7 +424,8 @@
"folders": "Mappák",
"exit": "Kilépés",
"permanent": "Állandó",
"hash": "Hash"
"hash": "Hash",
"of": "a"
},
"access": {
"rules": "Hozzáférési szabályok",
+2 -2
View File
@@ -398,7 +398,6 @@
"toggleClick": "Alterna il clic singolo",
"toggleDark": "Alterna la modalità scura",
"toggleSticky": "Alterna la modalità appiccicosa",
"of": "di",
"used": "usato",
"noSources": "Non ci sono fonti disponibili per questo utente. Aggiungere una fonte per questo utente o configurare una fonte con defaultEnabled: true."
},
@@ -425,7 +424,8 @@
"folders": "Cartelle",
"exit": "Uscita",
"permanent": "Permanente",
"hash": "Hash"
"hash": "Hash",
"of": "di"
},
"access": {
"rules": "Regole di accesso",
+2 -2
View File
@@ -398,7 +398,6 @@
"toggleClick": "トグル・シングルクリック",
"toggleDark": "ダークモードの切り替え",
"toggleSticky": "スティッキーモードの切り替え",
"of": "の",
"used": "中古",
"noSources": "このユーザが使用できるソースはありません。このユーザのソースを追加するか、defaultEnabled: true でソースを構成します。"
},
@@ -425,7 +424,8 @@
"folders": "フォルダ",
"exit": "出口",
"permanent": "正社員",
"hash": "ハッシュ"
"hash": "ハッシュ",
"of": "の"
},
"access": {
"rules": "アクセス規則",
+2 -2
View File
@@ -398,7 +398,6 @@
"toggleClick": "클릭 한 번으로 토글",
"toggleDark": "다크 모드 전환",
"toggleSticky": "고정 모드 토글",
"of": "의",
"used": "사용됨",
"noSources": "이 사용자에 대해 사용할 수 있는 소스가 없습니다. 이 사용자에 대한 소스를 추가하거나 defaultEnabled: true로 소스를 구성하세요."
},
@@ -425,7 +424,8 @@
"folders": "폴더",
"exit": "종료",
"permanent": "영구",
"hash": "해시"
"hash": "해시",
"of": "의"
},
"access": {
"rules": "액세스 규칙",
+2 -2
View File
@@ -398,7 +398,6 @@
"toggleClick": "Schakelen Enkele klik",
"toggleDark": "Donkere modus inschakelen",
"toggleSticky": "Kleefmodus schakelen",
"of": "van",
"used": "tweedehands",
"noSources": "Geen bronnen beschikbaar voor deze gebruiker. Voeg een bron toe voor deze gebruiker of configureer een bron met defaultEnabled: true"
},
@@ -491,7 +490,8 @@
"folders": "Mappen",
"exit": "Ga naar",
"permanent": "Permanent",
"hash": "Hash"
"hash": "Hash",
"of": "van"
},
"access": {
"rules": "Toegangsregels",
+2 -2
View File
@@ -398,7 +398,6 @@
"toggleClick": "Przełączanie jednym kliknięciem",
"toggleDark": "Przełączanie trybu ciemnego",
"toggleSticky": "Przełączanie trybu samoprzylepnego",
"of": "z",
"used": "używany",
"noSources": "Brak dostępnych źródeł dla tego użytkownika. Dodaj źródło dla tego użytkownika lub skonfiguruj źródło z defaultEnabled: true."
},
@@ -425,7 +424,8 @@
"folders": "Foldery",
"exit": "Wyjście",
"permanent": "Na stałe",
"hash": "Hash"
"hash": "Hash",
"of": "z"
},
"access": {
"rules": "Zasady dostępu",
+2 -2
View File
@@ -398,7 +398,6 @@
"toggleClick": "Alternar clique único",
"toggleDark": "Alternar o modo escuro",
"toggleSticky": "Alternar o modo de aderência",
"of": "de",
"used": "usado",
"noSources": "Não há fontes disponíveis para esse usuário. Adicione uma fonte para esse usuário ou configure uma fonte com defaultEnabled: true"
},
@@ -425,7 +424,8 @@
"folders": "Pastas",
"exit": "Sair",
"permanent": "Permanente",
"hash": "Hash"
"hash": "Hash",
"of": "de"
},
"access": {
"rules": "Regras de acesso",
+2 -2
View File
@@ -398,7 +398,6 @@
"toggleClick": "Alternar clique único",
"toggleDark": "Alternar o modo escuro",
"toggleSticky": "Alternar o modo de aderência",
"of": "de",
"used": "utilizado",
"noSources": "Não existem fontes disponíveis para este utilizador. Adicione uma fonte para este utilizador ou configure uma fonte com defaultEnabled: true"
},
@@ -491,7 +490,8 @@
"folders": "Pastas",
"exit": "Sair",
"permanent": "Permanente",
"hash": "Haxixe"
"hash": "Haxixe",
"of": "de"
},
"access": {
"rules": "Regras de acesso",
+2 -2
View File
@@ -398,7 +398,6 @@
"toggleClick": "Comutare clic unic",
"toggleDark": "Comutarea modului întunecat",
"toggleSticky": "Schimbarea modului lipicios",
"of": "de",
"used": "utilizate",
"noSources": "Nu există surse disponibile pentru acest utilizator. Adăugați o sursă pentru acest utilizator sau configurați o sursă cu defaultEnabled: true"
},
@@ -425,7 +424,8 @@
"folders": "Dosare",
"exit": "Ieșire",
"permanent": "Permanent",
"hash": "Hash"
"hash": "Hash",
"of": "de"
},
"access": {
"rules": "Reguli de acces",
+2 -2
View File
@@ -398,7 +398,6 @@
"toggleClick": "Переключение одним щелчком",
"toggleDark": "Переключение темного режима",
"toggleSticky": "Переключение режима липкости",
"of": "из",
"used": "используется",
"noSources": "Для этого пользователя нет доступных источников. Либо добавьте источник для этого пользователя, либо настройте источник с параметром defaultEnabled: true"
},
@@ -425,7 +424,8 @@
"folders": "Папки",
"exit": "Выход",
"permanent": "Постоянно",
"hash": "Хаш"
"hash": "Хаш",
"of": "из"
},
"access": {
"rules": "Правила доступа",
+2 -2
View File
@@ -398,7 +398,6 @@
"toggleClick": "Prepínanie jedným kliknutím",
"toggleDark": "Prepínanie tmavého režimu",
"toggleSticky": "Prepnutie režimu Sticky",
"of": "z",
"used": "použité",
"noSources": "Pre tohto používateľa nie sú k dispozícii žiadne zdroje. Buď pridajte zdroj pre tohto používateľa, alebo nakonfigurujte zdroj s defaultEnabled: true"
},
@@ -425,7 +424,8 @@
"folders": "Priečinky",
"exit": "Exit",
"permanent": "Trvalé",
"hash": "Hash"
"hash": "Hash",
"of": "z"
},
"access": {
"rules": "Pravidlá prístupu",
+2 -2
View File
@@ -398,7 +398,6 @@
"toggleClick": "Toggle Enkelklick",
"toggleDark": "Växla till mörkt läge",
"toggleSticky": "Växla klisterläge",
"of": "av",
"used": "används",
"noSources": "Inga källor tillgängliga för den här användaren. Lägg antingen till en källa för den här användaren eller konfigurera en källa med defaultEnabled: true"
},
@@ -491,7 +490,8 @@
"folders": "Mappar",
"exit": "Avsluta",
"permanent": "Permanent",
"hash": "Hash"
"hash": "Hash",
"of": "av"
},
"access": {
"rules": "Regler för åtkomst",
+2 -2
View File
@@ -398,7 +398,6 @@
"toggleClick": "Tek Tıklamayı Değiştir",
"toggleDark": "Karanlık Modu Aç / Kapat",
"toggleSticky": "Yapışkan Modunu Değiştir",
"of": ".",
"used": "kullanılmış",
"noSources": "Bu kullanıcı için kullanılabilir kaynak yok. Ya bu kullanıcı için bir kaynak ekleyin ya da defaultEnabled: true ile bir kaynak yapılandırın"
},
@@ -425,7 +424,8 @@
"folders": "Klasörler",
"exit": "Çıkış",
"permanent": "Daimi",
"hash": "Hash"
"hash": "Hash",
"of": "."
},
"access": {
"rules": "Erişim kuralları",
+2 -2
View File
@@ -398,7 +398,6 @@
"toggleClick": "Перемикання одним клацанням миші",
"toggleDark": "Увімкнути темний режим",
"toggleSticky": "Увімкнути липкий режим",
"of": "з",
"used": "використаний",
"noSources": "Для цього користувача немає доступних джерел. Або додайте джерело для цього користувача, або налаштуйте джерело з defaultEnabled: true"
},
@@ -491,7 +490,8 @@
"folders": "Папки",
"exit": "Виходьте.",
"permanent": "Постійний",
"hash": "Хеш"
"hash": "Хеш",
"of": "з"
},
"access": {
"rules": "Правила доступу",
+2 -2
View File
@@ -398,7 +398,6 @@
"toggleClick": "单击切换",
"toggleDark": "切换黑暗模式",
"toggleSticky": "切换粘贴模式",
"of": "的",
"used": "中古",
"noSources": "该用户没有可用的信息源。要么为该用户添加一个信息源,要么配置一个默认为 true 的信息源。"
},
@@ -491,7 +490,8 @@
"folders": "文件夹",
"exit": "退出",
"permanent": "永久性",
"hash": "散列"
"hash": "散列",
"of": "的"
},
"access": {
"rules": "访问规则",
+2 -2
View File
@@ -398,7 +398,6 @@
"toggleClick": "切換單擊",
"toggleDark": "切換黑暗模式",
"toggleSticky": "切換黏貼模式",
"of": "的",
"used": "中古",
"noSources": "此使用者沒有可用的來源。請為此使用者新增來源,或設定預設啟用:true 的來源。"
},
@@ -491,7 +490,8 @@
"folders": "資料夾",
"exit": "離開",
"permanent": "長期",
"hash": "散列"
"hash": "散列",
"of": "的"
},
"access": {
"rules": "存取規則",
-1
View File
@@ -40,7 +40,6 @@ export function showPopup(type, message, autoclose = true) {
: JSON.stringify(message)
let apiMessage
console.log('message', message)
// check if message starts with "Error: "
if (normalizedMessage.startsWith('Error: ')) {
const errorMessage = normalizedMessage.replace(/^Error:\s*/, '')
+8 -3
View File
@@ -1,7 +1,7 @@
import { removePrefix, buildItemUrl, removeLeadingSlash } from '@/utils/url.js'
import { getFileExtension } from '@/utils/files.js'
import { state, mutations } from '@/store'
import { noAuth } from '@/utils/constants.js'
import { noAuth, shareOverrides } from '@/utils/constants.js'
import { getTypeInfo } from '@/utils/mimetype'
import { fromNow } from '@/utils/moment'
import * as i18n from '@/i18n'
@@ -41,8 +41,7 @@ export const getters = {
isLoading: () => Object.keys(state.loading).length > 0,
isSettings: () => getters.currentView() === 'settings',
isShare: () => {
const pathname = getters.routePath()
return pathname.startsWith(`/public/share`)
return shareOverrides.isShare
},
isDarkMode: () => {
if (state.user == null) {
@@ -138,6 +137,9 @@ export const getters = {
return { dirs, files }
},
isSidebarVisible: () => {
if (shareOverrides.disableSidebar) {
return false
}
const cv = getters.currentView()
if (cv == 'onlyOfficeEditor') {
return false
@@ -342,6 +344,9 @@ export const getters = {
return false
},
officeViewingDisabled: filename => {
if (shareOverrides.isShare) {
return true
}
const ext = ' ' + getFileExtension(filename)
if (state.user.disableOfficePreviewExt) {
const disabledExts = ' ' + state.user.disableOfficePreviewExt.toLowerCase()
+9 -1
View File
@@ -157,7 +157,15 @@ export default {
if (window.location.hash === this.lastHash) return;
this.lastHash = window.location.hash;
if (window.location.hash) {
const id = url.base64Encode(window.location.hash.slice(1));
const rawHash = window.location.hash.slice(1);
let decodedName = rawHash;
try {
decodedName = decodeURIComponent(rawHash);
} catch (e) {
// If the hash contains malformed escape sequences, fall back to raw
decodedName = rawHash;
}
const id = url.base64Encode(encodeURIComponent(decodedName));
const element = document.getElementById(id);
if (element) {
element.scrollIntoView({
+2 -1
View File
@@ -115,7 +115,8 @@ export default {
return state.isSearchActive || getters.currentPromptName() != "";
},
isDisabledMultiAction() {
return this.isDisabled || (getters.isStickySidebar() && getters.multibuttonState() === "menu") || (getters.isShare() && shareOverrides.disableSidebar);
const shareDisabled = shareOverrides.disableSidebar && getters.multibuttonState() === "menu";
return this.isDisabled || (getters.isStickySidebar() && getters.multibuttonState() === "menu") || shareDisabled;
},
showSwitchView() {
return getters.currentView() === "listingView";
+9 -2
View File
@@ -591,7 +591,10 @@ export default {
if (state.isSearchActive || getters.currentView() != "listingView" || getters.currentPromptName()) {
return;
}
const { key, ctrlKey, metaKey, which } = event;
const { key, ctrlKey, metaKey, altKey, which } = event;
if (altKey) {
return;
}
// Check if the key is alphanumeric
const isAlphanumeric = /^[a-z0-9]$/i.test(key);
const modifierKeys = ctrlKey || metaKey;
@@ -615,7 +618,7 @@ export default {
if (getters.currentPromptName()) {
return;
}
let currentPath = state.route.path.replace(/\/+$/, ""); // Remove trailing slashes
let currentPath = url.removeTrailingSlash(state.route.path);
let newPath = currentPath.substring(0, currentPath.lastIndexOf("/"));
if (modifierKeys) {
@@ -659,6 +662,10 @@ export default {
case "ArrowDown":
case "ArrowLeft":
case "ArrowRight":
// Allow native browser navigation when Alt is held
if (event.altKey) {
return;
}
event.preventDefault();
this.navigateKeboardArrows(key);
break;
+2 -2
View File
@@ -2,7 +2,7 @@
<div id="previewer" @mousemove="toggleNavigation" @touchstart="toggleNavigation">
<div class="preview" v-if="!isDeleted">
<ExtendedImage v-if="previewType == 'image' || pdfConvertable" :src="raw"
@navigate-previous="prev"
@navigate-previous="prev"
@navigate-next="next">
</ExtendedImage>
<audio v-else-if="previewType == 'audio'" ref="player" :src="raw" controls :autoplay="autoPlay"
@@ -128,7 +128,7 @@ export default {
raw() {
if (this.pdfConvertable) {
if (getters.isShare()) {
const previewPath = url.removeTrailingSlash(state.req.path) + "/" + this.name;
const previewPath = url.removeTrailingSlash(state.req.path);
return publicApi.getPreviewURL(previewPath,"original");
}
return (