mirror of
https://github.com/gtsteffaniak/filebrowser.git
synced 2026-11-18 06:49:43 -05:00
Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2eb352c2d3 | ||
|
|
43bb4a36b4 | ||
|
|
c67abefc7b | ||
|
|
2ecb9036aa |
No files matched your search
@@ -2,6 +2,15 @@
|
||||
|
||||
All notable changes to this project will be documented in this file. For commit guidelines, please refer to [Standard Version](https://github.com/conventional-changelog/standard-version).
|
||||
|
||||
## v1.2.1-stable
|
||||
|
||||
**BugFixes**:
|
||||
- startup icon generation order issue (#2019)
|
||||
- login button on shares not showing (#2028)
|
||||
- removed file watcher link in context menu for shares (#2025)
|
||||
- Direct download link for single-file shares generates incorrect URL (#2026)
|
||||
- Deleting files causes error V1.2.0 #2039
|
||||
|
||||
## v1.2.7-beta
|
||||
|
||||
**BugFixes**:
|
||||
|
||||
+1
-1
@@ -119,7 +119,7 @@ func updateShowFirstLogin(user *users.User) bool {
|
||||
|
||||
// func to convert legacy user with perm key to permissions
|
||||
func updatePermissions(user *users.User) bool {
|
||||
if user.Version == 1 {
|
||||
if user.Version >= 1 {
|
||||
return false
|
||||
}
|
||||
updateUser := true
|
||||
|
||||
@@ -278,8 +278,6 @@ func setupFrontend(generate bool) {
|
||||
}
|
||||
// Load custom favicon if configured
|
||||
loadCustomFavicon()
|
||||
// Generate PWA icons from custom favicon if needed
|
||||
generatePWAIcons()
|
||||
}
|
||||
|
||||
func setupMedia() {
|
||||
@@ -788,23 +786,6 @@ func loadCustomFavicon() {
|
||||
logger.Infof("Using custom favicon: %s", Env.FaviconPath)
|
||||
}
|
||||
|
||||
// generatePWAIcons sets up PWA icon paths (actual generation happens after preview service starts)
|
||||
func generatePWAIcons() {
|
||||
// Set PWA icons directory in cache
|
||||
Env.PWAIconsDir = filepath.Join(Config.Server.CacheDir, "icons")
|
||||
|
||||
// Initialize with default paths (all icons will be generated)
|
||||
Env.PWAIcon192 = "icons/pwa-icon-192.png"
|
||||
Env.PWAIcon256 = "icons/pwa-icon-256.png"
|
||||
Env.PWAIcon512 = "icons/pwa-icon-512.png"
|
||||
|
||||
// Create icons directory with configured permissions
|
||||
// Note: Parent cache directory should already exist from testCacheDirSpeed()
|
||||
if err := os.MkdirAll(Env.PWAIconsDir, fileutils.PermDir); err != nil {
|
||||
logger.Warningf("Failed to create PWA icons directory %s: %v", Env.PWAIconsDir, err)
|
||||
}
|
||||
}
|
||||
|
||||
func loadLoginIcon() {
|
||||
const imageName = "login icon"
|
||||
allowedFormats := []string{".svg", ".png", ".jpg", ".jpeg", ".gif", ".webp", ".ico"}
|
||||
|
||||
@@ -43,8 +43,8 @@ type CommonShare struct {
|
||||
AllowReplacements bool `json:"allowReplacements,omitempty"` // allow replacements of files
|
||||
SidebarLinks []users.SidebarLink `json:"sidebarLinks"` // customizable sidebar links
|
||||
HasPassword bool `json:"hasPassword,omitempty"`
|
||||
ShowHidden bool `json:"showHidden,omitempty"` // show hidden files in share (true = show, false = hide)
|
||||
DisableLoginOption bool `json:"disableLoginOption,omitempty"` // disable login option in share (true = hide, false = show)
|
||||
ShowHidden bool `json:"showHidden,omitempty"` // show hidden files in share (true = show, false = hide)
|
||||
DisableLoginOption bool `json:"disableLoginOption"` // disable login option in share (true = hide, false = show)
|
||||
}
|
||||
type CreateBody struct {
|
||||
CommonShare
|
||||
|
||||
@@ -78,7 +78,7 @@ func publicRawHandler(w http.ResponseWriter, r *http.Request, d *requestContext)
|
||||
// Get all "file" parameter values (supports repeated params)
|
||||
files := r.URL.Query()["file"]
|
||||
if len(files) == 0 {
|
||||
return http.StatusBadRequest, fmt.Errorf("no files specified")
|
||||
files = []string{"/"}
|
||||
}
|
||||
|
||||
// Get the actual source name from the share's source mapping
|
||||
|
||||
+1
-1
@@ -284,7 +284,7 @@ func rawFilesHandler(w http.ResponseWriter, r *http.Request, d *requestContext,
|
||||
return http.StatusForbidden, fmt.Errorf("user is not allowed to download")
|
||||
}
|
||||
|
||||
if len(fileList) == 0 {
|
||||
if len(fileList) == 0 && d.share == nil {
|
||||
return http.StatusBadRequest, fmt.Errorf("no files specified")
|
||||
}
|
||||
|
||||
|
||||
@@ -233,7 +233,19 @@ func generateSingleIcon(previewService *preview.Service, sourceData []byte, icon
|
||||
// All icons are generated as PNG for maximum compatibility (Apple devices, PWA, older browsers)
|
||||
func GeneratePWAIcons() error {
|
||||
logger.Info("Generating PWA icons...")
|
||||
// Set PWA icons directory in cache
|
||||
settings.Env.PWAIconsDir = filepath.Join(settings.Config.Server.CacheDir, "icons")
|
||||
|
||||
// Initialize with default paths (all icons will be generated)
|
||||
settings.Env.PWAIcon192 = "icons/pwa-icon-192.png"
|
||||
settings.Env.PWAIcon256 = "icons/pwa-icon-256.png"
|
||||
settings.Env.PWAIcon512 = "icons/pwa-icon-512.png"
|
||||
|
||||
// Create icons directory with configured permissions
|
||||
// Note: Parent cache directory should already exist from testCacheDirSpeed()
|
||||
if err := os.MkdirAll(settings.Env.PWAIconsDir, fileutils.PermDir); err != nil {
|
||||
logger.Warningf("Failed to create PWA icons directory %s: %v", settings.Env.PWAIconsDir, err)
|
||||
}
|
||||
// Load and prepare source data as PNG
|
||||
sourceData, err := loadFaviconSource()
|
||||
if err != nil {
|
||||
|
||||
@@ -148,7 +148,7 @@
|
||||
<action v-if="showGoToRaw" icon="open_in_new" :label="$t('general.openFile')" @action="goToRaw()" />
|
||||
<action v-if="shouldShowParentFolder()" icon="folder" :label="$t('buttons.openParentFolder')" @action="openParentFolder" />
|
||||
<action v-if="isPreview && permissions.modify" icon="mode_edit" :label="$t('general.rename')" @action="showRenameHoverForPreview" />
|
||||
<action v-if="hasDownload && !req.isDir" icon="visibility" :label="$t('buttons.watchFile')" @action="watchFile()" />
|
||||
<action v-if="showWatch" icon="visibility" :label="$t('buttons.watchFile')" @action="watchFile()" />
|
||||
<action v-if="hasDownload" icon="file_download" :label="$t('general.download')" @action="startDownload" />
|
||||
<action v-if="showEdit" icon="edit" :label="$t('general.edit')" @action="edit()" />
|
||||
<action v-if="showSave" icon="save" :label="$t('general.save')" @action="save()" />
|
||||
@@ -187,6 +187,9 @@ export default {
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
showWatch() {
|
||||
return this.hasDownload && !this.req.isDir && !this.isShare;
|
||||
},
|
||||
showGoToItem() {
|
||||
return this.isDuplicateFinder && this.selectedCount == 1;
|
||||
},
|
||||
|
||||
@@ -57,6 +57,7 @@ import { notify } from "@/notify";
|
||||
import { getTypeInfo } from "@/utils/mimetype";
|
||||
import ListingItem from "@/components/files/ListingItem.vue";
|
||||
import { eventBus } from "@/store/eventBus";
|
||||
import url from "@/utils/url";
|
||||
|
||||
export default {
|
||||
name: "delete",
|
||||
@@ -230,7 +231,7 @@ export default {
|
||||
const failedCount = response.failed ? response.failed.length : 0;
|
||||
|
||||
if (failedCount === 0) {
|
||||
// All succeeded - close prompt and reload
|
||||
// All succeeded - close prompt and handle navigation
|
||||
buttons.success("delete");
|
||||
notify.showSuccessToast(this.$t('prompts.deleted'));
|
||||
|
||||
@@ -245,7 +246,27 @@ export default {
|
||||
if (!this.items) {
|
||||
mutations.resetSelected();
|
||||
}
|
||||
mutations.setReload(true);
|
||||
|
||||
// Smart navigation: if in preview mode with single item deletion, navigate intelligently
|
||||
if (getters.isPreviewView() && this.itemsToDelete.length === 1) {
|
||||
// Try next, then previous, then parent directory
|
||||
if (state.navigation.nextItem) {
|
||||
// Use goToItem with undefined to use router.replace (no history entry)
|
||||
url.goToItem(state.navigation.nextItem.source, state.navigation.nextItem.path, undefined);
|
||||
} else if (state.navigation.previousItem) {
|
||||
// Use goToItem with undefined to use router.replace (no history entry)
|
||||
url.goToItem(state.navigation.previousItem.source, state.navigation.previousItem.path, undefined);
|
||||
} else {
|
||||
// Navigate to parent directory of deleted item
|
||||
const deletedItemPath = this.itemsToDelete[0].path;
|
||||
const parentPath = url.removeLastDir(deletedItemPath);
|
||||
const deletedItemSource = this.itemsToDelete[0].source;
|
||||
url.goToItem(deletedItemSource, parentPath, {});
|
||||
}
|
||||
} else {
|
||||
// For listing view or multiple deletions, just reload
|
||||
mutations.setReload(true);
|
||||
}
|
||||
} else if (succeededCount > 0) {
|
||||
// Partial success - keep prompt open to show errors
|
||||
buttons.done("delete");
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
</div>
|
||||
|
||||
<div v-if="!disableQuickToggles" class="card-wrapper" @mouseleave="hideTooltip">
|
||||
<div class="quick-toggles" :class="{ 'extra-padding': !hasCreateOptions }">
|
||||
<div class="quick-toggles" :class="{ 'extra-padding': hasCreateOptions }">
|
||||
<div class="clickable" :class="{ active: user?.singleClick }" @click="toggleClick"
|
||||
@mouseenter="showTooltip($event, $t('index.toggleClick'))" @mouseleave="hideTooltip" v-if="!isInvalidShare">
|
||||
<i class="material-icons">ads_click</i>
|
||||
@@ -97,7 +97,7 @@ export default {
|
||||
},
|
||||
hasCreateOptions() {
|
||||
if (getters.isShare()) {
|
||||
return state.shareInfo?.allowCreate
|
||||
return state.shareInfo?.allowCreate == true
|
||||
}
|
||||
return state.user?.permissions?.create || state.user?.permissions?.share || state.user?.permissions?.admin;
|
||||
},
|
||||
@@ -128,7 +128,7 @@ export default {
|
||||
shouldShowLogin() {
|
||||
if (getters.isShare()) {
|
||||
// Don't show login until shareInfo is fully loaded
|
||||
if (state.shareInfo && state.shareInfo.disableLoginOption == undefined) {
|
||||
if (state.shareInfo && state.shareInfo?.disableLoginOption) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -146,7 +146,6 @@ export default {
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
||||
openContextMenu() {
|
||||
mutations.resetSelected();
|
||||
mutations.showHover({
|
||||
|
||||
@@ -737,7 +737,7 @@
|
||||
"green": "groen",
|
||||
"blue": "blauw",
|
||||
"yellow": "geel",
|
||||
"violet": "violet",
|
||||
"violet": "paars",
|
||||
"orange": "oranje"
|
||||
},
|
||||
"editor": {
|
||||
@@ -850,4 +850,4 @@
|
||||
"reconnected": "Opnieuw verbinding gemaakt met server.",
|
||||
"connectionLost": "De verbinding met de server is verbroken. Probeer opnieuw verbinding te maken..."
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -206,31 +206,11 @@ export default {
|
||||
req() {
|
||||
return state.req;
|
||||
},
|
||||
deletedItem() {
|
||||
return state.deletedItem;
|
||||
},
|
||||
disableFileViewer() {
|
||||
return state.shareInfo?.disableFileViewer;
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
deletedItem() {
|
||||
if (!state.deletedItem) {
|
||||
return;
|
||||
}
|
||||
this.isDeleted = true;
|
||||
this.listing = null; // Invalidate the listing to force a refresh
|
||||
|
||||
// Let the navigation component handle next/previous logic
|
||||
if (state.navigation.nextLink) {
|
||||
this.$router.replace({ path: state.navigation.nextLink });
|
||||
} else if (state.navigation.previousLink) {
|
||||
this.$router.replace({ path: state.navigation.previousLink });
|
||||
} else {
|
||||
this.close();
|
||||
}
|
||||
mutations.setDeletedItem(false);
|
||||
},
|
||||
async req() {
|
||||
if (!getters.isLoggedIn()) {
|
||||
return;
|
||||
@@ -257,7 +237,6 @@ export default {
|
||||
} else if (state.req.items) {
|
||||
this.listing = state.req.items;
|
||||
}
|
||||
mutations.setDeletedItem(false);
|
||||
window.addEventListener("keydown", this.keyEvent);
|
||||
this.subtitlesList = await this.subtitles();
|
||||
this.updatePreview();
|
||||
|
||||
Reference in new issue
Block a user