mirror of
https://ghfast.top/https://github.com/zsjy/halo-theme-dream2.0-plus.git
synced 2025-03-15 18:59:40 +08:00
控制台按钮调整,新增一种显示风格
This commit is contained in:
parent
03fa1e2c75
commit
09d7249977
@ -98,69 +98,93 @@ spec:
|
||||
- group: basic_style
|
||||
label: '基础样式'
|
||||
formSchema:
|
||||
- $formkit: group
|
||||
name: console
|
||||
label: 控制台
|
||||
value:
|
||||
show_console: false
|
||||
console_icon: ri-equalizer-line
|
||||
console_title: 控制台
|
||||
console_url: '/console'
|
||||
console_target: _blank
|
||||
children:
|
||||
- $formkit: radio
|
||||
name: show_console
|
||||
id: show_console
|
||||
label: 显示控制台
|
||||
label: 控制台按钮
|
||||
help: 在网站右上角显示用于登录或进入后台管理的按钮。
|
||||
value: 'false'
|
||||
options:
|
||||
- label: 显示
|
||||
value: true
|
||||
- label: 隐藏
|
||||
value: false
|
||||
- label: 登录组件样式
|
||||
value: 'logon'
|
||||
- label: 控制台按钮样式
|
||||
value: 'console'
|
||||
- label: 不显示
|
||||
value: 'false'
|
||||
- $formkit: group
|
||||
name: logon
|
||||
if: $get(show_console).value != 'false'
|
||||
label: 登录组件样式
|
||||
value:
|
||||
console_login_class: 'ri-login-circle-line'
|
||||
console_person_class: 'ri-account-circle-line'
|
||||
console_manage_class: 'ri-settings-3-line'
|
||||
console_logout_class: 'ri-logout-circle-line'
|
||||
children:
|
||||
- $formkit: text
|
||||
name: console_login_class
|
||||
label: 登录按钮图标
|
||||
help: '输入登录按钮图标class,清空不显示图标。'
|
||||
- $formkit: text
|
||||
name: console_person_class
|
||||
label: 个人中心按钮图标
|
||||
help: '输入个人中心按钮图标class,清空不显示图标。'
|
||||
- $formkit: text
|
||||
name: console_manage_class
|
||||
label: 后台管理按钮图标
|
||||
help: '输入后台管理按钮图标class,清空不显示图标。'
|
||||
- $formkit: text
|
||||
name: console_logout_class
|
||||
label: 注销登录按钮图标
|
||||
help: '输入注销登录按钮图标class,清空不显示图标。'
|
||||
- $formkit: group
|
||||
name: console
|
||||
if: $get(show_console).value != 'false'
|
||||
label: 控制台按钮样式
|
||||
value:
|
||||
console_icon: 'ri-equalizer-line'
|
||||
console_title: '控制台'
|
||||
console_url: '/console'
|
||||
console_target: '_blank'
|
||||
console_logon_url: '/console'
|
||||
console_logon_target: '_blank'
|
||||
children:
|
||||
- $formkit: text
|
||||
name: console_icon
|
||||
if: $get(show_console).value
|
||||
label: 控制台图标
|
||||
help: '控制台图标,留空显示默认图标。'
|
||||
- $formkit: text
|
||||
name: console_title
|
||||
if: $get(show_console).value
|
||||
label: 控制台鼠标悬停提示,留空不显示
|
||||
- $formkit: text
|
||||
name: console_url
|
||||
validation: requiredc
|
||||
if: $get(show_console).value
|
||||
label: 未登录,控制台跳转URL
|
||||
value: '/login'
|
||||
help: '未登录,控制台跳转URL,可使用“redirect_uri”参数进行登录后跳转,例如:“/login?redirect_uri=/”,登录后默认跳转到前台页面。'
|
||||
- $formkit: radio
|
||||
if: $get(show_console).value
|
||||
name: console_target
|
||||
validation: required
|
||||
value: _blank
|
||||
label: 未登录,控制台跳转方式
|
||||
options:
|
||||
- value: _blank
|
||||
- value: '_blank'
|
||||
label: 新标签页
|
||||
- value: _self
|
||||
- value: '_self'
|
||||
label: 当前窗口
|
||||
- $formkit: text
|
||||
name: console_logon_url
|
||||
validation: required
|
||||
if: $get(show_console).value
|
||||
value: '/console'
|
||||
label: 已登录,控制台跳转URL
|
||||
help: '已登录,控制台跳转URL。'
|
||||
- $formkit: radio
|
||||
if: $get(show_console).value
|
||||
name: console_logon_target
|
||||
validation: required
|
||||
value: _blank
|
||||
label: 已登录,控制台跳转方式
|
||||
options:
|
||||
- value: _blank
|
||||
- value: '_blank'
|
||||
label: 新标签页
|
||||
- value: _self
|
||||
- value: '_self'
|
||||
label: 当前窗口
|
||||
- $formkit: radio
|
||||
name: load_progress
|
||||
|
@ -4136,17 +4136,11 @@ button.swiper-pagination-bullet {
|
||||
}
|
||||
|
||||
.navbar-console {
|
||||
float: right;
|
||||
margin-left: 5px;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
display: flex;
|
||||
background: transparent !important;
|
||||
|
||||
& > i {
|
||||
font-size: 23px;
|
||||
color: var(--main);
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.navbar-logon {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -4183,9 +4177,6 @@ button.swiper-pagination-bullet {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.navbar-console {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.swiper-button-prev,
|
||||
@ -5316,3 +5307,86 @@ button.swiper-pagination-bullet {
|
||||
.search-page-title {
|
||||
margin-top: 0 !important;
|
||||
}
|
||||
|
||||
//登录组件
|
||||
.navbar-logon {
|
||||
margin-left: 5px;
|
||||
|
||||
&-head {
|
||||
|
||||
& > img {
|
||||
border-radius: 50%;
|
||||
width: 34px;
|
||||
height: 34px;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
&-group {
|
||||
display: block;
|
||||
visibility: hidden;
|
||||
position: absolute;
|
||||
width: auto;
|
||||
min-width: 8rem;
|
||||
top: 60px;
|
||||
z-index: 5;
|
||||
opacity: 0;
|
||||
border-top: 3px solid var(--theme);
|
||||
transform-origin: top;
|
||||
background: var(--bg-d);
|
||||
box-shadow: 0 0 10px rgba(0, 0, 0, .15);
|
||||
border-radius: 0 0 var(--radius-inner) var(--radius-inner);
|
||||
padding: 10px 0;
|
||||
transform: translateX(-50%) perspective(600px) rotateX(-45deg);
|
||||
transition: opacity .35s, visibility .35s, transform .35s, -webkit-transform .35s;
|
||||
|
||||
&-menu {
|
||||
padding: 5px;
|
||||
text-align: center;
|
||||
line-height: 2rem;
|
||||
|
||||
& > a {
|
||||
color: var(--title);
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
& > i {
|
||||
margin-right: 5px;
|
||||
color: var(--title);
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
&::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: -10px;
|
||||
right: 1.8rem;
|
||||
transform: translateX(-50%);
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-left: 7px solid transparent;
|
||||
border-right: 7px solid transparent;
|
||||
border-bottom: 7px solid var(--theme);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.navbar-logon:hover .navbar-logon-group,
|
||||
.navbar-logon:focus-within .navbar-logon-group {
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
transform: translateX(-50%) perspective(600px) rotateX(0);
|
||||
}
|
||||
|
||||
.navbar-logon-group-menu:hover ,
|
||||
.navbar-logon-group-menu:focus-within {
|
||||
background: var(--bg-a);
|
||||
|
||||
a, i {
|
||||
color: var(--theme);
|
||||
}
|
||||
|
||||
}
|
||||
|
2
templates/assets/css/style.min.css
vendored
2
templates/assets/css/style.min.css
vendored
File diff suppressed because one or more lines are too long
@ -1,4 +1,5 @@
|
||||
<header class="navbar" th:classappend="${!theme.config.basic_info.header_fixed}? 'animation' : 'fixed'" xmlns:th="https://www.thymeleaf.org">
|
||||
<header class="navbar" th:classappend="${!theme.config.basic_info.header_fixed}? 'animation' : 'fixed'"
|
||||
xmlns:th="https://www.thymeleaf.org" xmlns:sec="http://www.w3.org/1999/xhtml">
|
||||
<div class="navbar-above" th:classappend="${!theme.config.basic_info.header_fixed}? 'animation'">
|
||||
<div th:class="${theme.config.basic_style.sidebar_column != 'all' ? 'container two-column' : 'container' }">
|
||||
<i class="ri-list-unordered navbar-slideicon"></i>
|
||||
@ -69,11 +70,36 @@
|
||||
</div>
|
||||
<i th:unless="${theme.config.page_config.search.search_enable}" class="ri-search-line navbar-searchicon" onclick="javascript:SearchWidget.open();"></i>
|
||||
<a th:if="${theme.config.page_config.search.search_enable}" class="navbar-searchicon" target="_self" href="/search"><i class="ri-search-line navbar-searchicon"></i></a>
|
||||
<a data-not-pjax th:if="${theme.config.basic_style.console.show_console}" class="navbar-console" th:href="${!#strings.isEmpty(logonUserName) ? theme.config.basic_style.console.console_logon_url : theme.config.basic_style.console.console_url}"
|
||||
<a data-not-pjax th:if="${theme.config.basic_style.show_console == 'console'}" class="navbar-console" th:href="${!#strings.isEmpty(logonUserName) ? theme.config.basic_style.console.console_logon_url : theme.config.basic_style.console.console_url}"
|
||||
th:target="${!#strings.isEmpty(logonUserName) ? theme.config.basic_style.console.console_logon_target : theme.config.basic_style.console.console_target}"
|
||||
th:title="${theme.config.basic_style.console.console_title}">
|
||||
<i th:class="${#strings.defaultString(theme.config.basic_style.console.console_icon, 'ri-equalizer-line')}"></i>
|
||||
</a>
|
||||
<div th:if="${theme.config.basic_style.show_console == 'logon'}" class="navbar-logon" th:with="currentUser = ${contributorFinder.getContributor(#authentication.name)}">
|
||||
<div class="navbar-logon-head">
|
||||
<img th:src="${currentUser.avatar ?: #theme.assets('/img/avatar.svg')}"
|
||||
th:alt="${currentUser.displayName}"
|
||||
/>
|
||||
</div>
|
||||
<ul class="navbar-logon-group">
|
||||
<li sec:authorize="isAuthenticated()" class="navbar-logon-group-menu">
|
||||
<i th:if="${!#strings.isEmpty(theme.config.basic_style.logon.console_person_class)}" th:class="${theme.config.basic_style.logon.console_person_class}"></i>
|
||||
<a href="/uc" target="_blank">个人中心</a>
|
||||
</li>
|
||||
<li sec:authorize="isAuthenticated()" class="navbar-logon-group-menu">
|
||||
<i th:if="${!#strings.isEmpty(theme.config.basic_style.logon.console_manage_class)}" th:class="${theme.config.basic_style.logon.console_manage_class}"></i>
|
||||
<a href="/console" target="_blank">后台管理</a>
|
||||
</li>
|
||||
<li sec:authorize="isAuthenticated()" class="navbar-logon-group-menu">
|
||||
<i th:if="${!#strings.isEmpty(theme.config.basic_style.logon.console_logout_class)}" th:class="${theme.config.basic_style.logon.console_logout_class}"></i>
|
||||
<a href="/logout">注销登录</a>
|
||||
</li>
|
||||
<li sec:authorize="isAnonymous()" class="navbar-logon-group-menu">
|
||||
<i th:if="${!#strings.isEmpty(theme.config.basic_style.logon.console_login_class)}" th:class="${theme.config.basic_style.logon.console_login_class}"></i>
|
||||
<a href="/login" onclick="this.href = '/login?redirect_uri=' + encodeURIComponent(window.location.href)">登录</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -30,7 +30,7 @@ spec:
|
||||
settingName: theme-dream2-plus-setting
|
||||
configMapName: theme-dream2-plus-configMap
|
||||
# 版本号
|
||||
version: 1.3.2.beta5
|
||||
version: 1.3.2.beta6
|
||||
# 最低支持的 Halo 版本
|
||||
require: ">=2.20.0"
|
||||
# 许可
|
||||
|
Loading…
x
Reference in New Issue
Block a user