mirror of https://github.com/jumpserver/jumpserver
commit
8387c8dbe4
|
@ -49,7 +49,7 @@ function initTable() {
|
||||||
$(td).html(hostname);
|
$(td).html(hostname);
|
||||||
}},
|
}},
|
||||||
{targets: 5, createdCell: function (td, cellData, rowData) {
|
{targets: 5, createdCell: function (td, cellData, rowData) {
|
||||||
var conn_btn = '<a href="{% url "luna-view" %}?type=remote_app&login_to=' + cellData +'" class="btn btn-xs btn-primary">{% trans "Connect" %}</a>'.replace("{{ DEFAULT_PK }}", cellData);
|
var conn_btn = '<a href="{% url "luna-view" %}?type=remote_app&login_to=' + cellData +'" class="btn btn-xs btn-primary" target="_blank">{% trans "Connect" %}</a>'.replace("{{ DEFAULT_PK }}", cellData);
|
||||||
$(td).html(conn_btn)
|
$(td).html(conn_btn)
|
||||||
}}
|
}}
|
||||||
],
|
],
|
||||||
|
|
|
@ -29,7 +29,7 @@ var showAssetHref = false; // Need input default true
|
||||||
var actions = {
|
var actions = {
|
||||||
targets: 4, createdCell: function (td, cellData) {
|
targets: 4, createdCell: function (td, cellData) {
|
||||||
var conn_btn = '<a href="{% url "luna-view" %}?login_to=' + cellData +
|
var conn_btn = '<a href="{% url "luna-view" %}?login_to=' + cellData +
|
||||||
'" class="btn btn-xs btn-primary">{% trans "Connect" %}</a>';
|
'" class="btn btn-xs btn-primary" target="_blank">{% trans "Connect" %}</a>';
|
||||||
$(td).html(conn_btn)
|
$(td).html(conn_btn)
|
||||||
}};
|
}};
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
|
|
|
@ -54,10 +54,6 @@ class TreeService(Tree):
|
||||||
tree.init_assets()
|
tree.init_assets()
|
||||||
return tree
|
return tree
|
||||||
|
|
||||||
def init_assets_async(self):
|
|
||||||
t = threading.Thread(target=self.init_assets)
|
|
||||||
t.start()
|
|
||||||
|
|
||||||
def init_assets(self):
|
def init_assets(self):
|
||||||
from orgs.utils import tmp_to_root_org
|
from orgs.utils import tmp_to_root_org
|
||||||
self.all_nodes_assets_map = {}
|
self.all_nodes_assets_map = {}
|
||||||
|
|
|
@ -17,7 +17,7 @@ class SwitchOrgView(DetailView):
|
||||||
oid = str(self.object.id)
|
oid = str(self.object.id)
|
||||||
request.session['oid'] = oid
|
request.session['oid'] = oid
|
||||||
host = request.get_host()
|
host = request.get_host()
|
||||||
referer = request.META.get('HTTP_REFERER')
|
referer = request.META.get('HTTP_REFERER', '')
|
||||||
if referer.find(host) == -1:
|
if referer.find(host) == -1:
|
||||||
return redirect(reverse('index'))
|
return redirect(reverse('index'))
|
||||||
if UUID_PATTERN.search(referer):
|
if UUID_PATTERN.search(referer):
|
||||||
|
|
|
@ -158,9 +158,10 @@ class AssetPermissionUtilV2(AssetPermissionUtilCacheMixin):
|
||||||
|
|
||||||
@timeit
|
@timeit
|
||||||
def filter_permissions(self, **filters):
|
def filter_permissions(self, **filters):
|
||||||
filters_json = json.dumps(filters, sort_keys=True)
|
self.cache_policy = '0'
|
||||||
|
# filters_json = json.dumps(filters, sort_keys=True)
|
||||||
self._permissions = self.permissions.filter(**filters)
|
self._permissions = self.permissions.filter(**filters)
|
||||||
self._filter_id = md5(filters_json.encode()).hexdigest()
|
# self._filter_id = md5(filters_json.encode()).hexdigest()
|
||||||
|
|
||||||
@lazyproperty
|
@lazyproperty
|
||||||
def user_tree(self):
|
def user_tree(self):
|
||||||
|
|
Loading…
Reference in New Issue