You've already forked filebrowser
mirror of
https://github.com/filebrowser/filebrowser.git
synced 2025-11-26 14:25:26 +08:00
feat: add option to hide the login button from public-facing pages (#3922)
Co-authored-by: Henrique Dias <mail@hacdias.com>
This commit is contained in:
@@ -63,6 +63,7 @@
|
||||
</template>
|
||||
<template v-else>
|
||||
<router-link
|
||||
v-if="!hideLoginButton"
|
||||
class="action"
|
||||
to="/login"
|
||||
:aria-label="$t('sidebar.login')"
|
||||
@@ -124,6 +125,7 @@ import * as auth from "@/utils/auth";
|
||||
import {
|
||||
version,
|
||||
signup,
|
||||
hideLoginButton,
|
||||
disableExternal,
|
||||
disableUsedPercentage,
|
||||
noAuth,
|
||||
@@ -153,6 +155,7 @@ export default {
|
||||
return this.currentPromptName === "sidebar";
|
||||
},
|
||||
signup: () => signup,
|
||||
hideLoginButton: () => hideLoginButton,
|
||||
version: () => version,
|
||||
disableExternal: () => disableExternal,
|
||||
disableUsedPercentage: () => disableUsedPercentage,
|
||||
|
||||
@@ -166,6 +166,7 @@
|
||||
"allowNew": "Create new files and directories",
|
||||
"allowPublish": "Publish new posts and pages",
|
||||
"allowSignup": "Allow users to signup",
|
||||
"hideLoginButton": "Hide the login button from public pages",
|
||||
"avoidChanges": "(leave blank to avoid changes)",
|
||||
"branding": "Branding",
|
||||
"brandingDirectoryPath": "Branding directory path",
|
||||
|
||||
1
frontend/src/types/settings.d.ts
vendored
1
frontend/src/types/settings.d.ts
vendored
@@ -1,6 +1,7 @@
|
||||
interface ISettings {
|
||||
signup: boolean;
|
||||
createUserDir: boolean;
|
||||
hideLoginButton: boolean;
|
||||
minimumPasswordLength: number;
|
||||
userHomeBasePath: string;
|
||||
defaults: SettingsDefaults;
|
||||
|
||||
@@ -18,6 +18,7 @@ const enableExec: boolean = window.FileBrowser.EnableExec;
|
||||
const tusSettings = window.FileBrowser.TusSettings;
|
||||
const origin = window.location.origin;
|
||||
const tusEndpoint = `/api/tus`;
|
||||
const hideLoginButton = window.FileBrowser.HideLoginButton;
|
||||
|
||||
export {
|
||||
name,
|
||||
@@ -39,4 +40,5 @@ export {
|
||||
tusSettings,
|
||||
origin,
|
||||
tusEndpoint,
|
||||
hideLoginButton,
|
||||
};
|
||||
|
||||
@@ -18,6 +18,11 @@
|
||||
{{ t("settings.createUserDir") }}
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<input type="checkbox" v-model="settings.hideLoginButton" />
|
||||
{{ t("settings.hideLoginButton") }}
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label class="small">{{ t("settings.userHomeBasePath") }}</label>
|
||||
<input
|
||||
|
||||
Reference in New Issue
Block a user