Skip to content

Commit

Permalink
django-admin的链接都调整为后台打开
Browse files Browse the repository at this point in the history
  • Loading branch information
hhyo committed Jun 10, 2019
1 parent 976eee1 commit c2c44c9
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 17 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
[![codecov](https://codecov.io/gh/hhyo/archery/branch/master/graph/badge.svg)](https://codecov.io/gh/hhyo/archery)
[![version](https://img.shields.io/badge/python-3.6.5-blue.svg)](https://www.python.org/downloads/release/python-365/)
[![version](https://img.shields.io/badge/django-2.0-brightgreen.svg)](https://docs.djangoproject.com/zh-hans/2.0/)
[![docker_pulls](https://img.shields.io/docker/pulls/hhyo/archery.svg)](https://hub.docker.com/r/hhyo/archery/)
[![HitCount](http://hits.dwyl.io/hhyo/hhyo/Archery.svg)](http://hits.dwyl.io/hhyo/hhyo/Archery)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](http://github.com/hhyo/archery/blob/master/LICENSE)
[![996.icu](https://img.shields.io/badge/link-996.icu-red.svg)](https://996.icu)
Expand Down
18 changes: 9 additions & 9 deletions common/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
{% endif %}
{% if perms.sql.menu_queryapplylist %}
<li>
<a href="/queryapplylist/">权限申请</a>
<a href="/queryapplylist/">权限管理</a>
</li>
{% endif %}

Expand Down Expand Up @@ -139,25 +139,25 @@
<a href="#"><i class="fa fa-stethoscope fa-fw"></i> 数据库审核<span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li>
<a href="/themis/">规则设置</a>
<a target="_blank" href="/themis/">规则设置</a>
</li>
<li>
<a href="#">规则增加<span class="fa arrow"></span></a>
<ul class="nav nav-third-level collapse">
<li>
<a href="/themis/sqlreview/rule/simple/addition">简单规则</a>
<a target="_blank" href="/themis/sqlreview/rule/simple/addition">简单规则</a>
</li>
<li>
<a href="/themis/sqlreview/rule/complex/addition">复杂规则</a>
<a target="_blank" href="/themis/sqlreview/rule/complex/addition">复杂规则</a>
</li>
</ul>
<!-- /.nav-third-level -->
</li>
<li>
<a href="/themis/new/version/sql/review/rule/info/index">任务发布</a>
<a target="_blank" href="/themis/new/version/sql/review/rule/info/index">任务发布</a>
</li>
<li>
<a href="/themis/new/version/sql/review/task/index">任务查询</a>
<a target="_blank" href="/themis/new/version/sql/review/task/index">任务查询</a>
</li>
</ul>
<!-- /.nav-second-level -->
Expand Down Expand Up @@ -210,13 +210,13 @@
<a href="#">其他配置管理 <span class="fa arrow"></span></a>
<ul class="nav nav-third-level collapse">
<li>
<a href="/admin/sql/users/">用户管理</a>
<a target="_blank" href="/admin/sql/users/">用户管理</a>
</li>
<li>
<a href="/admin/auth/group/">权限组管理</a>
<a target="_blank" href="/admin/auth/group/">权限组管理</a>
</li>
<li>
<a href="/admin/">全部后台数据</a>
<a target="_blank" href="/admin/">全部后台数据</a>
</li>
</ul>
<!-- /.nav-third-level -->
Expand Down
6 changes: 3 additions & 3 deletions sql/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ class AliyunAccessKey(models.Model):
"""
ak = models.CharField(max_length=50)
secret = models.CharField(max_length=100)
is_enable = models.BooleanField(choices=((False, '禁用'), (True, '启用')))
is_enable = models.BooleanField('是否启用', default=True)
remark = models.CharField(max_length=50, default='', blank=True)

@property
Expand Down Expand Up @@ -563,7 +563,7 @@ class AliyunRdsConfig(models.Model):
"""
instance = models.OneToOneField(Instance, on_delete=models.CASCADE)
rds_dbinstanceid = models.CharField('对应阿里云RDS实例ID', max_length=100)
is_enable = models.BooleanField('是否启用', choices=((False, '禁用'), (True, '启用')))
is_enable = models.BooleanField('是否启用', default=True)

def __int__(self):
return self.rds_dbinstanceid
Expand All @@ -589,7 +589,7 @@ class Meta:
('menu_sqlanalyze', '菜单 SQL分析'),
('menu_query', '菜单 SQL查询'),
('menu_sqlquery', '菜单 在线查询'),
('menu_queryapplylist', '菜单 查询权限申请'),
('menu_queryapplylist', '菜单 权限管理'),
('menu_sqloptimize', '菜单 SQL优化'),
('menu_sqladvisor', '菜单 优化工具'),
('menu_slowquery', '菜单 慢查日志'),
Expand Down
4 changes: 2 additions & 2 deletions sql/templates/group.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@
title: '组名称',
field: 'group_name',
formatter: function (value, row, index) {
return "<a href=\"/admin/sql/resourcegroup/" + row.group_id + "/change/\">" + value + "</a>"
return "<a target=\"_blank\" href=\"/admin/sql/resourcegroup/" + row.group_id + "/change/\">" + value + "</a>"
}
}, {
title: '关联对象',
field: '',
formatter: function (value, row, index) {
return "<button class=\"btn btn-warning btn-xs\" onclick=\"window.location.href='/grouprelations/" + row.group_id + "/'\">管理</button>\n"
return "<button class=\"btn btn-warning btn-xs\" onclick=\"window.open('/grouprelations/" + row.group_id + "/')\">管理</button>\n"
}
}],
onLoadSuccess: function () {
Expand Down
4 changes: 2 additions & 2 deletions sql/templates/instance.html
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ <h4 class="modal-title" id="myModalLabel">清理Binlog日志</h4>
title: '实例名称',
field: 'instance_name',
formatter: function (value, row, index) {
return "<a href=\"/admin/sql/instance/" + row.id + "/change/\">" + value + "</a>"
return "<a target=\"_blank\" href=\"/admin/sql/instance/" + row.id + "/change/\">" + value + "</a>"
}
}, {
title: '实例类型',
Expand All @@ -154,7 +154,7 @@ <h4 class="modal-title" id="myModalLabel">清理Binlog日志</h4>
var btn_del_binLog = '';
var btn_user_manger = '';
if (row.db_type === 'mysql') {
btn_user_manger = "<button class=\"btn btn-info btn-xs\" onclick=\"window.location.href='/instanceuser/" + row.id + "/'\">用户</button>\n";
btn_user_manger = "<button class=\"btn btn-info btn-xs\" onclick=\"window.open('/instanceuser/" + row.id + "\')\">用户</button>\n";
btn_del_binLog = "<button class=\"btn btn-danger btn-xs\" instance_id=\"" + row.id + "\" + instance_name=\"" + row.instance_name + "\"+ onclick=\"del_binLog(this)" + "\">Binlog清理</button>\n"
}
var btn_test = "<button class=\"btn btn-warning btn-xs\" instance_id=\"" + row.id + "\" onclick=\"check_instance(this)" + "\">测试</button>\n";
Expand Down
2 changes: 1 addition & 1 deletion sql/utils/resource_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def user_instances(user, type='all', db_type='all', tags=None):
instances = instances.distinct()
# 过滤type
if type != 'all':
instances = instances.get(type=type)
instances = instances.filter(type=type)

# 过滤db_type
if db_type != 'all':
Expand Down

0 comments on commit c2c44c9

Please sign in to comment.