Skip to content
Permalink
Browse files

django-admin的链接都调整为后台打开

  • Loading branch information
hhyo committed Jun 10, 2019
1 parent 976eee1 commit c2c44c9586ac49034da12bfdcb717f26cbf7ee66
Showing with 18 additions and 17 deletions.
  1. +1 −0 README.md
  2. +9 −9 common/templates/base.html
  3. +3 −3 sql/models.py
  4. +2 −2 sql/templates/group.html
  5. +2 −2 sql/templates/instance.html
  6. +1 −1 sql/utils/resource_group.py
@@ -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)
@@ -108,7 +108,7 @@
{% endif %}
{% if perms.sql.menu_queryapplylist %}
<li>
<a href="/queryapplylist/">权限申请</a>
<a href="/queryapplylist/">权限管理</a>
</li>
{% endif %}

@@ -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 -->
@@ -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 -->
@@ -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
@@ -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
@@ -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', '菜单 慢查日志'),
@@ -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 () {
@@ -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: '实例类型',
@@ -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";
@@ -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':

0 comments on commit c2c44c9

Please sign in to comment.
You can’t perform that action at this time.