mirror of https://github.com/Xhofe/alist
🔧 change customize settings
parent
bdc1f68746
commit
809850321a
|
@ -36,14 +36,14 @@ func InitSettings() {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Key: "logo",
|
Key: "logo",
|
||||||
Value: "https://store.heytapimage.com/cdo-portal/feedback/202110/30/d43c41c5d257c9bc36366e310374fb19.png",
|
Value: "https://store.heytapimage.com/cdo-portal/feedback/202112/05/1542f45f86b8609495b69c5380753135.png",
|
||||||
Description: "logo",
|
Description: "logo",
|
||||||
Type: "string",
|
Type: "string",
|
||||||
Group: model.PUBLIC,
|
Group: model.PUBLIC,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Key: "favicon",
|
Key: "favicon",
|
||||||
Value: "https://store.heytapimage.com/cdo-portal/feedback/202110/30/d43c41c5d257c9bc36366e310374fb19.png",
|
Value: "https://store.heytapimage.com/cdo-portal/feedback/202112/05/1542f45f86b8609495b69c5380753135.png",
|
||||||
Description: "favicon",
|
Description: "favicon",
|
||||||
Type: "string",
|
Type: "string",
|
||||||
Group: model.PUBLIC,
|
Group: model.PUBLIC,
|
||||||
|
@ -114,17 +114,34 @@ func InitSettings() {
|
||||||
Group: model.PRIVATE,
|
Group: model.PRIVATE,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Key: "customize style",
|
Key: "customize head",
|
||||||
Value: "",
|
Value: `<style>
|
||||||
|
.chakra-ui-light{
|
||||||
|
background-image: linear-gradient(120deg,#e0c3fc 0%,#8ec5fc 100%) !important;
|
||||||
|
background-attachment: fixed;
|
||||||
|
}
|
||||||
|
.main-box {
|
||||||
|
border-radius: 15px !important;
|
||||||
|
}
|
||||||
|
.chakra-ui-light .main-box {
|
||||||
|
background-color: white !important;
|
||||||
|
}
|
||||||
|
.chakra-ui-light .readme-box {
|
||||||
|
background-color: white !important;
|
||||||
|
}
|
||||||
|
.readme-box {
|
||||||
|
border-radius: 15px !important;
|
||||||
|
}
|
||||||
|
</style>`,
|
||||||
Type: "text",
|
Type: "text",
|
||||||
Description: "customize style, don't need add <style></style>",
|
Description: "Customize head, placed at the beginning of the head",
|
||||||
Group: model.PRIVATE,
|
Group: model.PRIVATE,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Key: "customize script",
|
Key: "customize body",
|
||||||
Value: "",
|
Value: "",
|
||||||
Type: "text",
|
Type: "text",
|
||||||
Description: "customize script, don't need add <script></script>",
|
Description: "Customize script, placed at the end of the body",
|
||||||
Group: model.PRIVATE,
|
Group: model.PRIVATE,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -41,9 +41,6 @@ var (
|
||||||
RawIndexHtml string
|
RawIndexHtml string
|
||||||
IndexHtml string
|
IndexHtml string
|
||||||
CheckParent bool
|
CheckParent bool
|
||||||
//CustomizeStyle string
|
|
||||||
//CustomizeScript string
|
|
||||||
//Favicon string
|
|
||||||
CheckDown bool
|
CheckDown bool
|
||||||
|
|
||||||
DavUsername string
|
DavUsername string
|
||||||
|
|
|
@ -72,18 +72,15 @@ func LoadSettings() {
|
||||||
}
|
}
|
||||||
title, err := GetSettingByKey("title")
|
title, err := GetSettingByKey("title")
|
||||||
if err == nil {
|
if err == nil {
|
||||||
//conf.CustomizeStyle = customizeStyle.Value
|
|
||||||
conf.IndexHtml = strings.Replace(conf.IndexHtml, "Loading...", title.Value, 1)
|
conf.IndexHtml = strings.Replace(conf.IndexHtml, "Loading...", title.Value, 1)
|
||||||
}
|
}
|
||||||
customizeStyle, err := GetSettingByKey("customize style")
|
customizeHead, err := GetSettingByKey("customize head")
|
||||||
if err == nil {
|
if err == nil {
|
||||||
//conf.CustomizeStyle = customizeStyle.Value
|
conf.IndexHtml = strings.Replace(conf.IndexHtml, "<!-- customize head -->", customizeHead.Value, 1)
|
||||||
conf.IndexHtml = strings.Replace(conf.IndexHtml, "/* customize-style */", customizeStyle.Value, 1)
|
|
||||||
}
|
}
|
||||||
customizeScript, err := GetSettingByKey("customize script")
|
customizeBody, err := GetSettingByKey("customize body")
|
||||||
if err == nil {
|
if err == nil {
|
||||||
//conf.CustomizeStyle = customizeScript.Value
|
conf.IndexHtml = strings.Replace(conf.IndexHtml, "<!-- customize body -->", customizeBody.Value, 1)
|
||||||
conf.IndexHtml = strings.Replace(conf.IndexHtml, "// customize-js", customizeScript.Value, 1)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
davUsername, err := GetSettingByKey("WebDAV username")
|
davUsername, err := GetSettingByKey("WebDAV username")
|
||||||
|
|
Loading…
Reference in New Issue