-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix bugs 1. 修复default主题mixin.js文件丢失 2. 修复主题默认值为后台设置值 3. default主题样式优化 * 修复前台切换 theme-custom 不生效
- Loading branch information
Showing
16 changed files
with
104 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -627,3 +627,6 @@ other = "Característica" | |
|
||
[Template] | ||
other = "Plantilla" | ||
|
||
[Stat] | ||
other = "Stat" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -627,3 +627,6 @@ other = "功能" | |
|
||
[Template] | ||
other = "主题" | ||
|
||
[Stat] | ||
other = "信息" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -627,3 +627,6 @@ other = "功能" | |
|
||
[Template] | ||
other = "主題" | ||
|
||
[Stat] | ||
other = "信息" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
const mixinsVue = { | ||
delimiters: ['@#', '#@'], | ||
data: { | ||
preferredTemplate: null, | ||
isMobile: false | ||
}, | ||
created() { | ||
this.isMobile = this.checkIsMobile(); | ||
this.preferredTemplate = this.getCookie('preferred_theme') ? this.getCookie('preferred_theme') : this.$root.defaultTemplate; | ||
}, | ||
methods: { | ||
toggleTemplate(template) { | ||
if( template != this.preferredTemplate){ | ||
this.preferredTemplate = template; | ||
this.updateCookie("preferred_theme", template); | ||
window.location.reload(); | ||
} | ||
}, | ||
updateCookie(name, value) { | ||
document.cookie = name + "=" + value +"; path=/"; | ||
}, | ||
getCookie(name) { | ||
const cookies = document.cookie.split(';'); | ||
let cookieValue = null; | ||
for (let i = 0; i < cookies.length; i++) { | ||
const cookie = cookies[i].trim(); | ||
if (cookie.startsWith(name + '=')) { | ||
cookieValue = cookie.substring(name.length + 1, cookie.length); | ||
break; | ||
} | ||
} | ||
return cookieValue; | ||
}, | ||
checkIsMobile() { // 检测设备类型,页面宽度小于768px认为是移动设备 | ||
return window.innerWidth <= 768; | ||
}, | ||
logOut(id) { | ||
$.ajax({ | ||
type: 'POST', | ||
url: '/api/logout', | ||
data: JSON.stringify({ id: id }), | ||
contentType: 'application/json', | ||
success: function (resp) { | ||
if (resp.code == 200) { | ||
window.location.reload(); | ||
} else { | ||
alert('注销失败(Error ' + resp.code + '): ' + resp.message); | ||
} | ||
}, | ||
error: function (err) { | ||
alert('网络错误: ' + err.responseText); | ||
} | ||
}); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,14 +12,14 @@ | |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.min.css"> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/lipis/[email protected]/css/flag-icons.min.css"> | ||
<link rel="stylesheet" type="text/css" href="/static/semantic-ui-alerts.min.css"> | ||
<link rel="stylesheet" type="text/css" href="/static/theme-default/css/main.css?v20240222"> | ||
<link rel="stylesheet" type="text/css" href="/static/theme-default/css/main.css?v20240226"> | ||
<link rel="shortcut icon" type="image/png" href="/static/logo.svg" /> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/semantic.min.js"></script> | ||
<script src="/static/semantic-ui-alerts.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/echarts.min.js"></script> | ||
<script src="/static/theme-server-status/js/mixin.js?v20240225"></script> | ||
<script src="/static/theme-default/js/mixin.js?v20240226"></script> | ||
</head> | ||
<body> | ||
{{end}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ | |
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/echarts.min.js"></script> | ||
<script src="/static/theme-server-status/js/mixin.js?v20240225"></script> | ||
<script src="/static/theme-server-status/js/mixin.js?v20240226"></script> | ||
</head> | ||
<body> | ||
{{end}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters