Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
jumpserver
Commits
f87db2f4
Unverified
Commit
f87db2f4
authored
Sep 26, 2019
by
老广
Committed by
GitHub
Sep 26, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bugfix (#3284)
* [Update] 用户资产页面链接是 新窗口打开 * [Bugfix] 修复切换组织时, refer为空导致的bug * [Update] 修复执行命令时报错
parent
3c12c339
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
11 deletions
+7
-11
user_remote_app_list.html
...ications/templates/applications/user_remote_app_list.html
+1
-1
user_asset_list.html
apps/assets/templates/assets/user_asset_list.html
+2
-3
utils.py
apps/assets/utils.py
+0
-4
views.py
apps/orgs/views.py
+1
-1
asset_permission.py
apps/perms/utils/asset_permission.py
+3
-2
No files found.
apps/applications/templates/applications/user_remote_app_list.html
View file @
f87db2f4
...
@@ -49,7 +49,7 @@ function initTable() {
...
@@ -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
)
}}
}}
],
],
...
...
apps/assets/templates/assets/user_asset_list.html
View file @
f87db2f4
...
@@ -29,7 +29,7 @@ var showAssetHref = false; // Need input default true
...
@@ -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
()
{
...
@@ -85,4 +85,4 @@ function toggle() {
...
@@ -85,4 +85,4 @@ function toggle() {
}
}
</script>
</script>
{% endblock %}
{% endblock %}
\ No newline at end of file
apps/assets/utils.py
View file @
f87db2f4
...
@@ -54,10 +54,6 @@ class TreeService(Tree):
...
@@ -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
=
{}
...
...
apps/orgs/views.py
View file @
f87db2f4
...
@@ -17,7 +17,7 @@ class SwitchOrgView(DetailView):
...
@@ -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
):
...
...
apps/perms/utils/asset_permission.py
View file @
f87db2f4
...
@@ -158,9 +158,10 @@ class AssetPermissionUtilV2(AssetPermissionUtilCacheMixin):
...
@@ -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
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment