mirror of
https://github.com/mickael-kerjean/filestash
synced 2025-12-15 21:04:46 +01:00
feature (menubar): toggle menubar from admin setting
This commit is contained in:
parent
c8c544051a
commit
3808ed856b
2 changed files with 33 additions and 26 deletions
|
|
@ -266,10 +266,14 @@ export class FilesPage extends React.Component {
|
|||
<InfiniteScroll pageStart={0} loader={$moreLoading} hasMore={this.state.files.length > 70}
|
||||
initialLoad={false} useWindow={false} loadMore={this.loadMore.bind(this)} threshold={100}>
|
||||
<NgShow className="container" cond={!!this.state.is_search || !this.state.loading}>
|
||||
<NgIf cond={this.state.path === "/"}>
|
||||
<NgIf cond={this.state.path === "/" && CONFIG["hide_menubar"] === false}>
|
||||
<FrequentlyAccess files={this.state.frequents} />
|
||||
</NgIf>
|
||||
<Submenu path={this.state.path} sort={this.state.sort} view={this.state.view} onSearch={this.onSearch.bind(this)} onViewUpdate={(value) => this.onView(value)} onSortUpdate={(value) => this.onSort(value)} accessRight={this.state.metadata || {}} selected={this.state.selected}></Submenu>
|
||||
{
|
||||
CONFIG["hide_menubar"] === false && (
|
||||
<Submenu path={this.state.path} sort={this.state.sort} view={this.state.view} onSearch={this.onSearch.bind(this)} onViewUpdate={(value) => this.onView(value)} onSortUpdate={(value) => this.onSort(value)} accessRight={this.state.metadata || {}} selected={this.state.selected}></Submenu>
|
||||
)
|
||||
}
|
||||
<NgIf cond={!this.state.loading}>
|
||||
<FileSystem path={this.state.path} sort={this.state.sort} view={this.state.view} selected={this.state.selected}
|
||||
files={this.state.files.slice(0, this.state.page_number * LOAD_PER_SCROLL)} isSearch={this.state.is_search}
|
||||
|
|
|
|||
|
|
@ -76,6 +76,7 @@ func NewConfiguration() Configuration {
|
|||
FormElement{Name: "fork_button", Type: "boolean", Default: true, Description: "Display the fork button in the login screen"},
|
||||
FormElement{Name: "logout", Type: "text", Default: "", Description: "Redirection URL whenever user click on the logout button"},
|
||||
FormElement{Name: "display_hidden", Type: "boolean", Default: false, Description: "Should files starting with a dot be visible by default?"},
|
||||
FormElement{Name: "hide_menubar", Type: "boolean", Default: false, Description: "Hide entire menubar"},
|
||||
FormElement{Name: "auto_connect", Type: "boolean", Default: false, Description: "User don't have to click on the login button if an admin is prefilling a unique backend"},
|
||||
FormElement{Name: "remember_me", Type: "boolean", Default: true, Description: "Visiblity of the remember me button on the login screen"},
|
||||
FormElement{Name: "upload_button", Type: "boolean", Default: false, Description: "Display the upload button on any device"},
|
||||
|
|
@ -349,37 +350,39 @@ func (this Configuration) Save() Configuration {
|
|||
|
||||
func (this Configuration) Export() interface{} {
|
||||
return struct {
|
||||
Editor string `json:"editor"`
|
||||
ForkButton bool `json:"fork_button"`
|
||||
DisplayHidden bool `json:"display_hidden"`
|
||||
AutoConnect bool `json:"auto_connect"`
|
||||
Name string `json:"name"`
|
||||
RememberMe bool `json:"remember_me"`
|
||||
UploadButton bool `json:"upload_button"`
|
||||
Connections interface{} `json:"connections"`
|
||||
EnableShare bool `json:"enable_share"`
|
||||
Logout string `json:"logout"`
|
||||
MimeTypes map[string]string `json:"mime"`
|
||||
Editor string `json:"editor"`
|
||||
ForkButton bool `json:"fork_button"`
|
||||
DisplayHidden bool `json:"display_hidden"`
|
||||
AutoConnect bool `json:"auto_connect"`
|
||||
Name string `json:"name"`
|
||||
RememberMe bool `json:"remember_me"`
|
||||
UploadButton bool `json:"upload_button"`
|
||||
Connections interface{} `json:"connections"`
|
||||
EnableShare bool `json:"enable_share"`
|
||||
Logout string `json:"logout"`
|
||||
HideMenubar bool `json:"hide_menubar"`
|
||||
MimeTypes map[string]string `json:"mime"`
|
||||
UploadPoolSize int `json:"upload_pool_size"`
|
||||
}{
|
||||
Editor: this.Get("general.editor").String(),
|
||||
ForkButton: this.Get("general.fork_button").Bool(),
|
||||
DisplayHidden: this.Get("general.display_hidden").Bool(),
|
||||
AutoConnect: this.Get("general.auto_connect").Bool(),
|
||||
Name: this.Get("general.name").String(),
|
||||
RememberMe: this.Get("general.remember_me").Bool(),
|
||||
UploadButton: this.Get("general.upload_button").Bool(),
|
||||
Connections: this.Conn,
|
||||
EnableShare: this.Get("features.share.enable").Bool(),
|
||||
Logout: this.Get("general.logout").String(),
|
||||
MimeTypes: AllMimeTypes(),
|
||||
Editor: this.Get("general.editor").String(),
|
||||
ForkButton: this.Get("general.fork_button").Bool(),
|
||||
DisplayHidden: this.Get("general.display_hidden").Bool(),
|
||||
AutoConnect: this.Get("general.auto_connect").Bool(),
|
||||
Name: this.Get("general.name").String(),
|
||||
RememberMe: this.Get("general.remember_me").Bool(),
|
||||
UploadButton: this.Get("general.upload_button").Bool(),
|
||||
Connections: this.Conn,
|
||||
EnableShare: this.Get("features.share.enable").Bool(),
|
||||
Logout: this.Get("general.logout").String(),
|
||||
HideMenubar: this.Get("general.hide_menubar").Bool(),
|
||||
MimeTypes: AllMimeTypes(),
|
||||
UploadPoolSize: this.Get("general.upload_pool_size").Int(),
|
||||
}
|
||||
}
|
||||
|
||||
func (this *Configuration) Get(key string) *Configuration {
|
||||
var traverse func (forms *[]Form, path []string) *FormElement
|
||||
traverse = func (forms *[]Form, path []string) *FormElement {
|
||||
var traverse func(forms *[]Form, path []string) *FormElement
|
||||
traverse = func(forms *[]Form, path []string) *FormElement {
|
||||
if len(path) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue