()
| 107 | } |
| 108 | |
| 109 | func UpdateIndex() { |
| 110 | utils.Log.Debug("Updating index.html with settings...") |
| 111 | favicon := setting.GetStr(conf.Favicon) |
| 112 | logo := strings.Split(setting.GetStr(conf.Logo), "\n")[0] |
| 113 | title := setting.GetStr(conf.SiteTitle) |
| 114 | customizeHead := setting.GetStr(conf.CustomizeHead) |
| 115 | customizeBody := setting.GetStr(conf.CustomizeBody) |
| 116 | mainColor := setting.GetStr(conf.MainColor) |
| 117 | utils.Log.Debug("Applying replacements for default pages...") |
| 118 | replaceMap1 := map[string]string{ |
| 119 | "https://res.oplist.org/logo/logo.svg": favicon, |
| 120 | "https://res.oplist.org/logo/logo.png": logo, |
| 121 | "Loading...": title, |
| 122 | "main_color: undefined": fmt.Sprintf("main_color: '%s'", mainColor), |
| 123 | } |
| 124 | conf.ManageHtml = replaceStrings(conf.RawIndexHtml, replaceMap1) |
| 125 | utils.Log.Debug("Applying replacements for manage pages...") |
| 126 | replaceMap2 := map[string]string{ |
| 127 | "<!-- customize head -->": customizeHead, |
| 128 | "<!-- customize body -->": customizeBody, |
| 129 | } |
| 130 | conf.IndexHtml = replaceStrings(conf.ManageHtml, replaceMap2) |
| 131 | utils.Log.Debug("Index.html update completed") |
| 132 | } |
| 133 | |
| 134 | func ManifestJSON(c *gin.Context) { |
| 135 | // Get site configuration to ensure consistent base path handling |
no test coverage detected