新增:支持关闭控制台打印主题信息

This commit is contained in:
j m 2024-03-29 14:10:27 +08:00
parent 1de70d3900
commit 68df3d7a2e
5 changed files with 18 additions and 2 deletions

View File

@ -1347,6 +1347,16 @@ spec:
label: busuanzi统计
- value: false
label: 不显示
- $formkit: radio
name: enable_console_version_info
label: 控制台打印版本信息
value: true
help: '控制台打印版本信息包括:主题名、主题版本、网站页面加载耗时。'
options:
- value: true
label: 开启
- value: false
label: 关闭
- $formkit: radio
name: enable_debug
label: 开启 DEBUG 日志

View File

@ -566,6 +566,9 @@ const commonContext = {
},
/* 显示主题版本信息 */
showThemeVersion() {
if(!DreamConfig.enable_console_version_info) {
return
}
window.logger(`%c页面加载耗时${Math.round(performance.now())}ms | Theme By Dream2 Plus ${DreamConfig.theme_version}`,
'color:#fff; background: linear-gradient(270deg, #986fee, #8695e6, #68b7dd, #18d7d3); padding: 8px 15px; border-radius: 0 15px 0 15px')
}

View File

@ -11,4 +11,4 @@
</div>
<div class="progress-percentage">${e.percent}</div>
</div>
</div>`}),$(".aside-timelife").html(n)}},initGrayMode(){var e,t,n;(!0===DreamConfig.gray_mode||"custom"===DreamConfig.gray_mode&&(e=(new Date).getTime(),t=new Date(DreamConfig.gray_mode_start_time).getTime(),n=new Date(DreamConfig.gray_mode_end_time).getTime(),t<=e)&&e<=n)&&$("html").addClass("gray-mode")},initEffects(){Utils.isMobile()||(DreamConfig.cursor_move&&Utils.cachedScript(`${DreamConfig.theme_base}/js/cursor/move/${DreamConfig.cursor_move}.min.js?mew=`+DreamConfig.theme_version),DreamConfig.cursor_click&&Utils.cachedScript(`${DreamConfig.theme_base}/js/cursor/click/${DreamConfig.cursor_click}.min.js?mew=`+DreamConfig.theme_version),DreamConfig.enable_live2d&&Utils.cachedScript(DreamConfig.theme_base+"/js/autoload.min.js?mew="+DreamConfig.theme_version),DreamConfig.effects_lantern_mode&&Utils.cachedScript(DreamConfig.theme_base+"/js/effects/lantern.min.js?mew="+DreamConfig.theme_version),DreamConfig.effects_sakura_mode&&Utils.cachedScript(DreamConfig.theme_base+"/js/effects/sakura.min.js?mew="+DreamConfig.theme_version),DreamConfig.effects_snowflake_mode&&Utils.cachedScript(DreamConfig.theme_base+"/js/effects/snowflake.min.js?mew="+DreamConfig.theme_version),DreamConfig.effects_universe_mode&&Utils.cachedScript(DreamConfig.theme_base+"/js/effects/universe.min.js?mew="+DreamConfig.theme_version),DreamConfig.effects_circle_magic_mode&&Utils.cachedScript(DreamConfig.theme_base+"/js/effects/circleMagic.min.js?mew="+DreamConfig.theme_version))},initTagCloud(){$(".tagcloud").length&&DreamConfig.show_tagcloud_style&&tagcloud({selector:".tagcloud .card-content",fontsize:18,radius:75,mspeed:"slow",ispeed:"slow",direction:45,keep:!1})},showThemeVersion(){window.logger(`%c${Math.round(performance.now())}ms | Theme By Dream2 Plus `+DreamConfig.theme_version,"color:#fff; background: linear-gradient(270deg, #986fee, #8695e6, #68b7dd, #18d7d3); padding: 8px 15px; border-radius: 0 15px 0 15px")}};window.commonContext=t;let o=-1;{const n=["initCarousel","sparkInput","websiteTime"],i=["initEffects","showThemeVersion"];Object.keys(t).forEach(e=>!n.includes(e)&&!i.includes(e)&&t[e]()),document.addEventListener("DOMContentLoaded",function(){$("html").addClass("loaded"),n.forEach(e=>t[e]&&t[e]())}),window.addEventListener("load",function(){i.forEach(e=>t[e]&&t[e]()),$("html").addClass("ready")})}})();
</div>`}),$(".aside-timelife").html(n)}},initGrayMode(){var e,t,n;(!0===DreamConfig.gray_mode||"custom"===DreamConfig.gray_mode&&(e=(new Date).getTime(),t=new Date(DreamConfig.gray_mode_start_time).getTime(),n=new Date(DreamConfig.gray_mode_end_time).getTime(),t<=e)&&e<=n)&&$("html").addClass("gray-mode")},initEffects(){Utils.isMobile()||(DreamConfig.cursor_move&&Utils.cachedScript(`${DreamConfig.theme_base}/js/cursor/move/${DreamConfig.cursor_move}.min.js?mew=`+DreamConfig.theme_version),DreamConfig.cursor_click&&Utils.cachedScript(`${DreamConfig.theme_base}/js/cursor/click/${DreamConfig.cursor_click}.min.js?mew=`+DreamConfig.theme_version),DreamConfig.enable_live2d&&Utils.cachedScript(DreamConfig.theme_base+"/js/autoload.min.js?mew="+DreamConfig.theme_version),DreamConfig.effects_lantern_mode&&Utils.cachedScript(DreamConfig.theme_base+"/js/effects/lantern.min.js?mew="+DreamConfig.theme_version),DreamConfig.effects_sakura_mode&&Utils.cachedScript(DreamConfig.theme_base+"/js/effects/sakura.min.js?mew="+DreamConfig.theme_version),DreamConfig.effects_snowflake_mode&&Utils.cachedScript(DreamConfig.theme_base+"/js/effects/snowflake.min.js?mew="+DreamConfig.theme_version),DreamConfig.effects_universe_mode&&Utils.cachedScript(DreamConfig.theme_base+"/js/effects/universe.min.js?mew="+DreamConfig.theme_version),DreamConfig.effects_circle_magic_mode&&Utils.cachedScript(DreamConfig.theme_base+"/js/effects/circleMagic.min.js?mew="+DreamConfig.theme_version))},initTagCloud(){$(".tagcloud").length&&DreamConfig.show_tagcloud_style&&tagcloud({selector:".tagcloud .card-content",fontsize:18,radius:75,mspeed:"slow",ispeed:"slow",direction:45,keep:!1})},showThemeVersion(){DreamConfig.enable_console_version_info&&window.logger(`%c${Math.round(performance.now())}ms | Theme By Dream2 Plus `+DreamConfig.theme_version,"color:#fff; background: linear-gradient(270deg, #986fee, #8695e6, #68b7dd, #18d7d3); padding: 8px 15px; border-radius: 0 15px 0 15px")}};window.commonContext=t;let o=-1;{const n=["initCarousel","sparkInput","websiteTime"],i=["initEffects","showThemeVersion"];Object.keys(t).forEach(e=>!n.includes(e)&&!i.includes(e)&&t[e]()),document.addEventListener("DOMContentLoaded",function(){$("html").addClass("loaded"),n.forEach(e=>t[e]&&t[e]())}),window.addEventListener("load",function(){i.forEach(e=>t[e]&&t[e]()),$("html").addClass("ready")})}})();

View File

@ -100,7 +100,10 @@
DreamConfig["effects_lantern_left"] = effects_lantern_left;
DreamConfig["effects_lantern_right"] = effects_lantern_right;
/** 启用标签云的风格 */
DreamConfig["show_tagcloud_style"] = [[${theme.config.sidebar.show_tagcloud_style}]];
/** 控制台主题信息 */
DreamConfig["enable_console_version_info"] = [[${theme.config.enhance.enable_console_version_info}]];
DreamConfig["theme_version"] = [[${theme.spec.version}]];
DreamConfig["theme_base"] = "[(${#theme.assets('/')})]";

View File

@ -22,6 +22,6 @@ spec:
settingName: theme-dream-setting
configMapName: theme-dream-configMap
# 版本号
version: 1.0.2.6
version: 1.0.2.8
# 最低支持的 Halo 版本
require: ">=2.6.0"