Skip to content

Commit

Permalink
修复了一个可能存在的BUG以及升级pyechats到最新版 (#2513)
Browse files Browse the repository at this point in the history
* 合并base.css到style.css

* 更新 pyecharts==2.0.4

* 修复 WSGIRequest object has no attribute user 错误

---------

Co-authored-by: Yc Chen <[email protected]>
  • Loading branch information
finovy and Yc Chen committed Feb 5, 2024
1 parent 37dfc32 commit 14bb468
Show file tree
Hide file tree
Showing 9 changed files with 219 additions and 207 deletions.
5 changes: 1 addition & 4 deletions common/static/echarts/echarts.min.js

Large diffs are not rendered by default.

285 changes: 208 additions & 77 deletions common/static/style.css
Original file line number Diff line number Diff line change
@@ -1,134 +1,265 @@
body {
font-family: Candara, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, Cantarell, "Helvetica Neue", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
font-family: Candara, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, Cantarell, "Helvetica Neue", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}

a {
color: #222;
color: #222;
}

.fa {
color: #666;
color: #666;
}

.fa.fa-5x {
color: white;
color: white;
}

.fa.fa-fw {
margin-right: 10px;
margin-right: 10px;
}

a:hover {
color: #555555;
color: #555555;
}

.navbar-brand strong {
font-size: 26px;
font-family: Candara Light, serif;
margin-left: 4px;
letter-spacing: 2px;
font-size: 26px;
font-family: Candara Light, serif;
margin-left: 4px;
letter-spacing: 2px;
}

.navbar-brand > img {
height: 50px;
height: 50px;
}

.user-bottom-div {
display: block;
text-align: center;
background-color: #ddd;
position: fixed;
bottom: 0;
width: 100%;
height: 50px;
line-height: 50px;
display: block;
text-align: center;
background-color: #ddd;
position: fixed;
bottom: 0;
width: 100%;
height: 50px;
line-height: 50px;
}

.lsb-login {
display: flex;
justify-content: center;
align-items: center;
height: 90vh;
margin: 0;
display: flex;
justify-content: center;
align-items: center;
height: 90vh;
margin: 0;
}

.login-form-wrapper {
background-color: #FFF;
border-radius: 4px;
box-shadow: rgba(0, 0, 0, 0.1) 0 3px 5px;
padding: 30px 40px;
border-top: 5px solid #337ab7;
background-color: #FFF;
border-radius: 4px;
box-shadow: rgba(0, 0, 0, 0.1) 0 3px 5px;
padding: 30px 40px;
border-top: 5px solid #337ab7;
}

table {
max-width: none !important;
/*解决 ios 横向滚动失效*/
max-width: none !important;
/*解决 ios 横向滚动失效*/
}

.user-bottom-div {
display: block;
text-align: center;
background-color: #ddd;
position: fixed;
bottom: 0;
width: 100%;
height: 50px;
line-height: 50px;
display: block;
text-align: center;
background-color: #ddd;
position: fixed;
bottom: 0;
width: 100%;
height: 50px;
line-height: 50px;
}

.lsb-login {
display: flex;
justify-content: center;
align-items: center;
height: 90vh;
margin: 0;
display: flex;
justify-content: center;
align-items: center;
height: 90vh;
margin: 0;
}

.login-form-wrapper {
background-color: #FFF;
border-radius: 4px;
box-shadow: rgba(0, 0, 0, 0.1) 0 3px 5px;
padding: 30px 10px;
border-top: 5px solid #337ab7;
background-color: #FFF;
border-radius: 4px;
box-shadow: rgba(0, 0, 0, 0.1) 0 3px 5px;
padding: 30px 10px;
border-top: 5px solid #337ab7;
}

.login-form {
margin: 20px;
margin: 20px;
}

.sidebar .sidebar-nav.navbar-collapse {
padding-left: 0;
padding-right: 0;
padding-left: 0;
padding-right: 0;
}

.sidebar .sidebar-search {
padding: 15px;
padding: 15px;
}

.sidebar ul li a {
border-left: 3px solid transparent;
color: #333;
border-left: 3px solid transparent;
color: #333;
}

.sidebar ul li a.active {
background-color: #eeeeee;
border-left: 3px solid #337ab7;
background-color: #eeeeee;
border-left: 3px solid #337ab7;
}

.sidebar .arrow {
float: right;
margin-top: 3px;
float: right;
margin-top: 3px;
}

.sidebar .fa.arrow:before {
content: "\f104";
content: "\f104";
}

.sidebar .active > a > .fa.arrow:before {
content: "\f107";
content: "\f107";
}

.sidebar .nav-second-level li,
.sidebar .nav-third-level li {
border-bottom: none !important;
border-bottom: none !important;
}

.sidebar .nav-second-level li a {
padding-left: 47px;
padding-left: 47px;
}

.sidebar .nav-third-level li a {
padding-left: 52px;
padding-left: 52px;
}

@media (min-width: 768px) {
.sidebar {
z-index: 1;
position: absolute;
width: 200px;
margin-top: 51px;
}
.navbar-top-links .dropdown-messages,
.navbar-top-links .dropdown-tasks,
.navbar-top-links .dropdown-alerts {
margin-left: auto;
}
.sidebar {
z-index: 1;
position: absolute;
width: 200px;
margin-top: 51px;
}

.navbar-top-links .dropdown-messages,
.navbar-top-links .dropdown-tasks,
.navbar-top-links .dropdown-alerts {
margin-left: auto;
}
}

.fixed-table-container {
border: none;
border: none;
}

/*# sourceMappingURL=style.css.map */


/* -- sidebar --------------------------------------------------------------- */

div.sphinxsidebarwrapper {
padding: 10px 5px 0 10px;
}

div.sphinxsidebar {
float: left;
width: 230px;
margin-left: -100%;
font-size: 90%;
word-wrap: break-word;
overflow-wrap: break-word;
}

div.sphinxsidebar ul {
list-style: none;
}

div.sphinxsidebar ul ul,
div.sphinxsidebar ul.want-points {
margin-left: 20px;
list-style: square;
}

div.sphinxsidebar ul ul {
margin-top: 0;
margin-bottom: 0;
}

div.sphinxsidebar form {
margin-top: 10px;
}

div.sphinxsidebar input {
border: 1px solid #98dbcc;
font-family: sans-serif;
font-size: 1em;
}

div.sphinxsidebar #searchbox input[type="text"] {
width: 170px;
}

/* -- general index --------------------------------------------------------- */

table.indextable {
width: 100%;
}

table.indextable td {
text-align: left;
vertical-align: top;
}

table.indextable ul {
margin-top: 0;
margin-bottom: 0;
list-style-type: none;
}

table.indextable > tbody > tr > td > ul {
padding-left: 0em;
}

table.indextable tr.pcap {
height: 10px;
}

table.indextable tr.cap {
margin-top: 10px;
background-color: #f2f2f2;
}

img.toggler {
margin-right: 3px;
margin-top: 3px;
cursor: pointer;
}

div.modindex-jumpbox {
border-top: 1px solid #ddd;
border-bottom: 1px solid #ddd;
margin: 1em 0 1em 0;
padding: 0.4em;
}

div.genindex-jumpbox {
border-top: 1px solid #ddd;
border-bottom: 1px solid #ddd;
margin: 1em 0 1em 0;
padding: 0.4em;
}

/* -- domain module index --------------------------------------------------- */

table.modindextable td {
padding: 2px;
border-collapse: collapse;
}
/*# sourceMappingURL=style.css.map */
22 changes: 9 additions & 13 deletions common/utils/global_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,17 @@

def global_info(request):
"""存放用户,菜单信息等."""
user = request.user
twofa_type = "disabled"
if user and user.is_authenticated:
# 获取待办数量
try:
todo = Audit.todo(user)
except Exception:
todo = 0

twofa_config = TwoFactorAuthConfig.objects.filter(user=user)
if twofa_config:
twofa_type = twofa_config[0].auth_type
try:
if request.user and request.user.is_authenticated:
# 获取待办数量
todo = Audit.todo(request.user)
twofa_config = TwoFactorAuthConfig.objects.filter(user=request.user)
if twofa_config:
twofa_type = twofa_config[0].auth_type
else:
twofa_type = "disabled"
else:
todo = 0
except Exception:
todo = 0

watermark_enabled = SysConfig().get("watermark_enabled", False)
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ django-redis==5.2.0
redis==3.5.3
pyodbc==4.*
gunicorn==20.0.4
pyecharts==1.9.1
pyecharts==2.0.4
aliyun-python-sdk-rds==2.1.1
cx-Oracle==7.3.0
supervisor==4.1.0
Expand Down
Empty file removed sql/static/css/.gitkeep
Empty file.
Loading

0 comments on commit 14bb468

Please sign in to comment.