Describe the bug
在浏览器首次打开网站,无论是主站还是分享链接,无论主题是什么,总是会首先出现那个默认的深蓝色主题,然后才跳回设置的主题,肉眼可见,影响观感
To Reproduce
Steps to reproduce the behavior:
Expected behavior
不出现这样的颜色变化
Desktop, Smartphone (please complete the following information):
aelbi1ox1#
Cloudreve是使用前端进行网页渲染,因此它的步骤大概是这样的:
其中注意到2,你的颜色配置是写在站点配置文件里的因此当你的服务器速度较慢时,必须文件已经加载完,页面显示出来后仍未加载到配置文件所以会导致这样的情况
如何解决:
w51jfk4q2#
@Henry14all我原先的想法也是这样。但是奈何非专业,修改了这个后构建,但是并没有用处Cloudreve/models/migration.go
Lines 132 to 133 in 9ff1b47
| | {Name: "defaultTheme", Value: #3f51b5, Type: "basic"}, || | {Name: "themes", Value: {"#3f51b5":{"palette":{"primary":{"main":"#3f51b5"},"secondary":{"main":"#f50057"}}},"#2196f3":{"palette":{"primary":{"main":"#2196f3"},"secondary":{"main":"#FFC107"}}},"#673AB7":{"palette":{"primary":{"main":"#673AB7"},"secondary":{"main":"#2196F3"}}},"#E91E63":{"palette":{"primary":{"main":"#E91E63"},"secondary":{"main":"#42A5F5","contrastText":"#fff"}}},"#FF5722":{"palette":{"primary":{"main":"#FF5722"},"secondary":{"main":"#3F51B5"}}},"#FFC107":{"palette":{"primary":{"main":"#FFC107"},"secondary":{"main":"#26C6DA"}}},"#8BC34A":{"palette":{"primary":{"main":"#8BC34A","contrastText":"#fff"},"secondary":{"main":"#FF8A65","contrastText":"#fff"}}},"#009688":{"palette":{"primary":{"main":"#009688"},"secondary":{"main":"#4DD0E1","contrastText":"#fff"}}},"#607D8B":{"palette":{"primary":{"main":"#607D8B"},"secondary":{"main":"#F06292"}}},"#795548":{"palette":{"primary":{"main":"#795548"},"secondary":{"main":"#4CAF50","contrastText":"#fff"}}}}, Type: "basic"}, |
#3f51b5
{"#3f51b5":{"palette":{"primary":{"main":"#3f51b5"},"secondary":{"main":"#f50057"}}},"#2196f3":{"palette":{"primary":{"main":"#2196f3"},"secondary":{"main":"#FFC107"}}},"#673AB7":{"palette":{"primary":{"main":"#673AB7"},"secondary":{"main":"#2196F3"}}},"#E91E63":{"palette":{"primary":{"main":"#E91E63"},"secondary":{"main":"#42A5F5","contrastText":"#fff"}}},"#FF5722":{"palette":{"primary":{"main":"#FF5722"},"secondary":{"main":"#3F51B5"}}},"#FFC107":{"palette":{"primary":{"main":"#FFC107"},"secondary":{"main":"#26C6DA"}}},"#8BC34A":{"palette":{"primary":{"main":"#8BC34A","contrastText":"#fff"},"secondary":{"main":"#FF8A65","contrastText":"#fff"}}},"#009688":{"palette":{"primary":{"main":"#009688"},"secondary":{"main":"#4DD0E1","contrastText":"#fff"}}},"#607D8B":{"palette":{"primary":{"main":"#607D8B"},"secondary":{"main":"#F06292"}}},"#795548":{"palette":{"primary":{"main":"#795548"},"secondary":{"main":"#4CAF50","contrastText":"#fff"}}}}
想请教一下我自已构建的话,能否指点一下"必须文件"的更改位置呢?
kupeojn63#
我也并非非常专业的人士,但是我并不懂你改了哪些部分?你是指改了这里的defaultTheme?Cloudreve/models/migration.go
Line 132 in 9ff1b47
| | {Name: "defaultTheme", Value: #3f51b5, Type: "basic"}, |
vybvopom4#
@Henry14all 是的,我以为它加载的默认的深蓝色,来源于这个,所以改为了其他主题。但是并没有变化,还是会从深蓝色变化为自己设置的主题。
enxuqcxy5#
@NoverNobida 我觉得这里是后端的设置代码,这些是你在控制面板里看到的设置项的代码吧。控制默认颜色的代码应该在前端那里。
ibrsph3r6#
@Henry14all我再找找,说不定就找到了。感谢回复。
6条答案
按热度按时间aelbi1ox1#
Cloudreve是使用前端进行网页渲染,因此它的步骤大概是这样的:
1.加载站点配置文件
其中注意到2,你的颜色配置是写在站点配置文件里的
因此当你的服务器速度较慢时,必须文件已经加载完,页面显示出来后仍未加载到配置文件
所以会导致这样的情况
如何解决:
w51jfk4q2#
@Henry14all
我原先的想法也是这样。但是奈何非专业,修改了这个后构建,但是并没有用处
Cloudreve/models/migration.go
Lines 132 to 133 in 9ff1b47
| | {Name: "defaultTheme", Value:
#3f51b5
, Type: "basic"}, || | {Name: "themes", Value:
{"#3f51b5":{"palette":{"primary":{"main":"#3f51b5"},"secondary":{"main":"#f50057"}}},"#2196f3":{"palette":{"primary":{"main":"#2196f3"},"secondary":{"main":"#FFC107"}}},"#673AB7":{"palette":{"primary":{"main":"#673AB7"},"secondary":{"main":"#2196F3"}}},"#E91E63":{"palette":{"primary":{"main":"#E91E63"},"secondary":{"main":"#42A5F5","contrastText":"#fff"}}},"#FF5722":{"palette":{"primary":{"main":"#FF5722"},"secondary":{"main":"#3F51B5"}}},"#FFC107":{"palette":{"primary":{"main":"#FFC107"},"secondary":{"main":"#26C6DA"}}},"#8BC34A":{"palette":{"primary":{"main":"#8BC34A","contrastText":"#fff"},"secondary":{"main":"#FF8A65","contrastText":"#fff"}}},"#009688":{"palette":{"primary":{"main":"#009688"},"secondary":{"main":"#4DD0E1","contrastText":"#fff"}}},"#607D8B":{"palette":{"primary":{"main":"#607D8B"},"secondary":{"main":"#F06292"}}},"#795548":{"palette":{"primary":{"main":"#795548"},"secondary":{"main":"#4CAF50","contrastText":"#fff"}}}}
, Type: "basic"}, |想请教一下我自已构建的话,能否指点一下"必须文件"的更改位置呢?
kupeojn63#
我也并非非常专业的人士,但是我并不懂你改了哪些部分?
你是指改了这里的defaultTheme?
Cloudreve/models/migration.go
Line 132 in 9ff1b47
| | {Name: "defaultTheme", Value:
#3f51b5
, Type: "basic"}, |vybvopom4#
@Henry14all 是的,我以为它加载的默认的深蓝色,来源于这个,所以改为了其他主题。但是并没有变化,还是会从深蓝色变化为自己设置的主题。
enxuqcxy5#
@NoverNobida 我觉得这里是后端的设置代码,这些是你在控制面板里看到的设置项的代码吧。控制默认颜色的代码应该在前端那里。
ibrsph3r6#
@Henry14all
我再找找,说不定就找到了。感谢回复。