improve (admin): additional customisations on admin console

This commit is contained in:
Mickael Kerjean
2021-09-19 14:04:11 +10:00
parent 5a7027af48
commit 2e86ac7bb2
3 changed files with 34 additions and 28 deletions

View File

@ -101,7 +101,7 @@
transition-delay: 0.7s;
h2{
font-family: 'Source Code Pro', monospace;
color: var(--primary);
color: white;
font-weight: 300;
font-size: 1.5em;
margin: 25px 0 40px 0;
@ -116,7 +116,7 @@
overflow: hidden;
text-overflow: ellipsis;
a.active, a:hover{
color: var(--primary);
color: white;
}
}
}

View File

@ -36,10 +36,10 @@ export class FilesPage extends React.Component {
}
this.state = {
path: (decodeURIComponent(location.pathname).replace("/files", "") || "/" ),
sort: settings_get("filespage_sort") || "type",
sort: settings_get("filespage_sort") || CONFIG["default_sort"] || "type",
sort_reverse: true,
show_hidden: settings_get("filespage_show_hidden") || CONFIG["display_hidden"],
view: settings_get("filespage_view") || "grid",
view: settings_get("filespage_view") || CONFIG["default_view"] || "grid",
is_search: false,
files: [],
selected: [],

View File

@ -81,6 +81,8 @@ func NewConfiguration() Configuration {
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: "upload_button", Type: "boolean", Default: false, Description: "Display the upload button on any device"},
FormElement{Name: "upload_pool_size", Type: "number", Default: 15, Description: "Maximum number of files upload in parallel (Default: 15)"},
FormElement{Name: "filepage_default_view", Type: "select", Default: "grid", Opts: []string{"list", "grid"}, Description: "Default layout for files and folder on the file page"},
FormElement{Name: "filepage_default_sort", Type: "select", Default: "type", Opts: []string{"type", "date", "name"}, Description: "Default order for files and folder on the file page"},
FormElement{Name: "custom_css", Type: "long_text", Default: "", Description: "Set custom css code for your instance"},
},
},
@ -351,31 +353,35 @@ 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"`
UploadButton bool `json:"upload_button"`
Connections interface{} `json:"connections"`
EnableShare bool `json:"enable_share"`
Logout string `json:"logout"`
MimeTypes map[string]string `json:"mime"`
UploadPoolSize int `json:"upload_pool_size"`
RefreshAfterUpload bool `json:"refresh_after_upload"`
Editor string `json:"editor"`
ForkButton bool `json:"fork_button"`
DisplayHidden bool `json:"display_hidden"`
AutoConnect bool `json:"auto_connect"`
Name string `json:"name"`
UploadButton bool `json:"upload_button"`
Connections interface{} `json:"connections"`
EnableShare bool `json:"enable_share"`
Logout string `json:"logout"`
MimeTypes map[string]string `json:"mime"`
UploadPoolSize int `json:"upload_pool_size"`
RefreshAfterUpload bool `json:"refresh_after_upload"`
FilePageDefaultSort string `json:"default_sort"`
FilePageDefaultView string `json:"default_view"`
}{
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(),
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(),
UploadPoolSize: this.Get("general.upload_pool_size").Int(),
RefreshAfterUpload: this.Get("general.refresh_after_upload").Bool(),
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(),
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(),
UploadPoolSize: this.Get("general.upload_pool_size").Int(),
RefreshAfterUpload: this.Get("general.refresh_after_upload").Bool(),
FilePageDefaultSort: this.Get("general.filepage_default_sort").String(),
FilePageDefaultView: this.Get("general.filepage_default_view").String(),
}
}