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
82a63695
Commit
82a63695
authored
Oct 22, 2019
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 修改term大小
parent
3a10fd41
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
52 deletions
+17
-52
manager.py
apps/assets/backends/manager.py
+2
-0
celery_task_log.html
apps/ops/templates/ops/celery_task_log.html
+4
-1
command_execution_create.html
apps/ops/templates/ops/command_execution_create.html
+2
-42
api_urls.py
apps/perms/urls/api_urls.py
+9
-9
No files found.
apps/assets/backends/manager.py
View file @
82a63695
...
@@ -67,6 +67,8 @@ class AssetUserManager:
...
@@ -67,6 +67,8 @@ class AssetUserManager:
return
AssetUserQuerySet
(
instances
)
return
AssetUserQuerySet
(
instances
)
def
get
(
self
,
username
,
asset
,
**
kwargs
):
def
get
(
self
,
username
,
asset
,
**
kwargs
):
print
(
username
)
print
(
asset
)
instances
=
self
.
filter
(
username
,
assets
=
[
asset
],
**
kwargs
)
instances
=
self
.
filter
(
username
,
assets
=
[
asset
],
**
kwargs
)
if
len
(
instances
)
==
1
:
if
len
(
instances
)
==
1
:
return
instances
[
0
]
return
instances
[
0
]
...
...
apps/ops/templates/ops/celery_task_log.html
View file @
82a63695
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
<title>
{% trans 'Task log' %}
</title>
<title>
{% trans 'Task log' %}
</title>
<script
src=
"{% static 'js/jquery-3.1.1.min.js' %}"
></script>
<script
src=
"{% static 'js/jquery-3.1.1.min.js' %}"
></script>
<script
src=
"{% static 'js/plugins/xterm/xterm.js' %}"
></script>
<script
src=
"{% static 'js/plugins/xterm/xterm.js' %}"
></script>
<script
src=
"{% static 'js/plugins/xterm/addons/fit/fit.js' %}"
></script>
<link
rel=
"stylesheet"
href=
"{% static 'js/plugins/xterm/xterm.css' %}"
/>
<link
rel=
"stylesheet"
href=
"{% static 'js/plugins/xterm/xterm.css' %}"
/>
<style>
<style>
body
{
body
{
...
@@ -40,7 +41,7 @@
...
@@ -40,7 +41,7 @@
disableStdin
:
true
disableStdin
:
true
});
});
term
.
open
(
document
.
getElementById
(
'term'
));
term
.
open
(
document
.
getElementById
(
'term'
));
term
.
resize
(
120
,
30
);
window
.
fit
.
fit
(
term
);
ws
=
new
WebSocket
(
wsURL
);
ws
=
new
WebSocket
(
wsURL
);
ws
.
onmessage
=
function
(
e
)
{
ws
.
onmessage
=
function
(
e
)
{
...
@@ -61,5 +62,7 @@
...
@@ -61,5 +62,7 @@
term
.
write
(
"Connect websocket server error"
)
term
.
write
(
"Connect websocket server error"
)
}
}
}
}
}).
on
(
'resize'
,
window
,
function
()
{
window
.
fit
.
fit
(
term
);
});
});
</script>
</script>
apps/ops/templates/ops/command_execution_create.html
View file @
82a63695
...
@@ -104,41 +104,6 @@
...
@@ -104,41 +104,6 @@
var
url
=
null
;
var
url
=
null
;
var
treeUrl
=
"{% url 'api-perms:my-nodes-with-assets-as-tree' %}?cache_policy=1"
;
var
treeUrl
=
"{% url 'api-perms:my-nodes-with-assets-as-tree' %}?cache_policy=1"
;
function
proposeGeometry
(
term
)
{
if
(
!
term
.
element
.
parentElement
)
{
return
null
;
}
var
parentElementStyle
=
window
.
getComputedStyle
(
term
.
element
.
parentElement
);
var
parentElementHeight
=
parseInt
(
parentElementStyle
.
getPropertyValue
(
'height'
));
var
parentElementWidth
=
Math
.
max
(
0
,
parseInt
(
parentElementStyle
.
getPropertyValue
(
'width'
)));
var
elementStyle
=
window
.
getComputedStyle
(
term
.
element
);
var
elementPadding
=
{
top
:
parseInt
(
elementStyle
.
getPropertyValue
(
'padding-top'
)),
bottom
:
parseInt
(
elementStyle
.
getPropertyValue
(
'padding-bottom'
)),
right
:
parseInt
(
elementStyle
.
getPropertyValue
(
'padding-right'
)),
left
:
parseInt
(
elementStyle
.
getPropertyValue
(
'padding-left'
))
};
var
elementPaddingVer
=
elementPadding
.
top
+
elementPadding
.
bottom
;
var
elementPaddingHor
=
elementPadding
.
right
+
elementPadding
.
left
;
var
availableHeight
=
parentElementHeight
-
elementPaddingVer
;
var
availableWidth
=
parentElementWidth
-
elementPaddingHor
-
term
.
_core
.
viewport
.
scrollBarWidth
;
var
geometry
=
{
cols
:
Math
.
floor
(
availableWidth
/
term
.
_core
.
renderer
.
dimensions
.
actualCellWidth
),
rows
:
Math
.
floor
(
availableHeight
/
term
.
_core
.
renderer
.
dimensions
.
actualCellHeight
)
};
return
geometry
;
}
function
fit
(
term
)
{
var
geometry
=
proposeGeometry
(
term
);
if
(
geometry
)
{
if
(
term
.
rows
!==
geometry
.
rows
||
term
.
cols
!==
geometry
.
cols
)
{
term
.
_core
.
renderer
.
clear
();
term
.
resize
(
geometry
.
cols
,
geometry
.
rows
);
}
}
}
function
initTree
()
{
function
initTree
()
{
$
(
'#assetTree'
).
html
(
"{% trans 'Loading' %}"
+
'..'
);
$
(
'#assetTree'
).
html
(
"{% trans 'Loading' %}"
+
'..'
);
if
(
systemUserId
)
{
if
(
systemUserId
)
{
...
@@ -159,12 +124,6 @@
...
@@ -159,12 +124,6 @@
enable
:
true
enable
:
true
}
}
},
},
async
:
{
enable
:
true
,
url
:
url
,
autoParam
:
[
"id=key"
,
"name=n"
,
"level=lv"
],
type
:
'get'
},
edit
:
{
edit
:
{
enable
:
true
,
enable
:
true
,
showRemoveBtn
:
false
,
showRemoveBtn
:
false
,
...
@@ -254,7 +213,8 @@
...
@@ -254,7 +213,8 @@
});
});
term
.
open
(
document
.
getElementById
(
'term'
));
term
.
open
(
document
.
getElementById
(
'term'
));
var
msg
=
"{% trans 'Select the left asset, select the running system user, execute command in batch' %}"
+
"
\
r
\n
"
;
var
msg
=
"{% trans 'Select the left asset, select the running system user, execute command in batch' %}"
+
"
\
r
\n
"
;
fit
(
term
);
window
.
fit
.
fit
(
term
);
{
#
fit
(
term
);
#
}
term
.
write
(
msg
);
term
.
write
(
msg
);
var
scheme
=
document
.
location
.
protocol
===
"https:"
?
"wss"
:
"ws"
;
var
scheme
=
document
.
location
.
protocol
===
"https:"
?
"wss"
:
"ws"
;
...
...
apps/perms/urls/api_urls.py
View file @
82a63695
...
@@ -62,10 +62,10 @@ asset_permission_urlpatterns = [
...
@@ -62,10 +62,10 @@ asset_permission_urlpatterns = [
path
(
'user-groups/<uuid:pk>/assets/<uuid:asset_id>/system-users/'
,
api
.
UserGroupGrantedAssetSystemUsersApi
.
as_view
(),
name
=
'user-group-asset-system-users'
),
path
(
'user-groups/<uuid:pk>/assets/<uuid:asset_id>/system-users/'
,
api
.
UserGroupGrantedAssetSystemUsersApi
.
as_view
(),
name
=
'user-group-asset-system-users'
),
# 用户和资产授权变更
# 用户和资产授权变更
path
(
'asset-permissions/<uuid:pk>/user/remove/'
,
api
.
AssetPermissionRemoveUserApi
.
as_view
(),
name
=
'asset-permission-remove-user'
),
path
(
'asset-permissions/<uuid:pk>/user
s
/remove/'
,
api
.
AssetPermissionRemoveUserApi
.
as_view
(),
name
=
'asset-permission-remove-user'
),
path
(
'asset-permissions/<uuid:pk>/user/add/'
,
api
.
AssetPermissionAddUserApi
.
as_view
(),
name
=
'asset-permission-add-user'
),
path
(
'asset-permissions/<uuid:pk>/user
s
/add/'
,
api
.
AssetPermissionAddUserApi
.
as_view
(),
name
=
'asset-permission-add-user'
),
path
(
'asset-permissions/<uuid:pk>/asset/remove/'
,
api
.
AssetPermissionRemoveAssetApi
.
as_view
(),
name
=
'asset-permission-remove-asset'
),
path
(
'asset-permissions/<uuid:pk>/asset
s
/remove/'
,
api
.
AssetPermissionRemoveAssetApi
.
as_view
(),
name
=
'asset-permission-remove-asset'
),
path
(
'asset-permissions/<uuid:pk>/asset/add/'
,
api
.
AssetPermissionAddAssetApi
.
as_view
(),
name
=
'asset-permission-add-asset'
),
path
(
'asset-permissions/<uuid:pk>/asset
s
/add/'
,
api
.
AssetPermissionAddAssetApi
.
as_view
(),
name
=
'asset-permission-add-asset'
),
# 授权规则中授权的资产
# 授权规则中授权的资产
path
(
'asset-permissions/<uuid:pk>/assets/'
,
api
.
AssetPermissionAssetsApi
.
as_view
(),
name
=
'asset-permission-assets'
),
path
(
'asset-permissions/<uuid:pk>/assets/'
,
api
.
AssetPermissionAssetsApi
.
as_view
(),
name
=
'asset-permission-assets'
),
...
@@ -75,7 +75,7 @@ asset_permission_urlpatterns = [
...
@@ -75,7 +75,7 @@ asset_permission_urlpatterns = [
path
(
'asset-permissions/user/actions/'
,
api
.
GetUserAssetPermissionActionsApi
.
as_view
(),
name
=
'get-user-asset-permission-actions'
),
path
(
'asset-permissions/user/actions/'
,
api
.
GetUserAssetPermissionActionsApi
.
as_view
(),
name
=
'get-user-asset-permission-actions'
),
# 刷新缓存
# 刷新缓存
path
(
'asset-permissions/
user/
cache/refresh/'
,
api
.
RefreshAssetPermissionCacheApi
.
as_view
(),
name
=
'refresh-asset-permission-cache'
),
path
(
'asset-permissions/cache/refresh/'
,
api
.
RefreshAssetPermissionCacheApi
.
as_view
(),
name
=
'refresh-asset-permission-cache'
),
]
]
...
@@ -99,10 +99,10 @@ remote_app_permission_urlpatterns = [
...
@@ -99,10 +99,10 @@ remote_app_permission_urlpatterns = [
path
(
'remote-app-permissions/user/validate/'
,
api
.
ValidateUserRemoteAppPermissionApi
.
as_view
(),
name
=
'validate-user-remote-app-permission'
),
path
(
'remote-app-permissions/user/validate/'
,
api
.
ValidateUserRemoteAppPermissionApi
.
as_view
(),
name
=
'validate-user-remote-app-permission'
),
# 用户和RemoteApp变更
# 用户和RemoteApp变更
path
(
'remote-app-permissions/<uuid:pk>/user/add/'
,
api
.
RemoteAppPermissionAddUserApi
.
as_view
(),
name
=
'remote-app-permission-add-user'
),
path
(
'remote-app-permissions/<uuid:pk>/user
s
/add/'
,
api
.
RemoteAppPermissionAddUserApi
.
as_view
(),
name
=
'remote-app-permission-add-user'
),
path
(
'remote-app-permissions/<uuid:pk>/user/remove/'
,
api
.
RemoteAppPermissionRemoveUserApi
.
as_view
(),
name
=
'remote-app-permission-remove-user'
),
path
(
'remote-app-permissions/<uuid:pk>/user
s
/remove/'
,
api
.
RemoteAppPermissionRemoveUserApi
.
as_view
(),
name
=
'remote-app-permission-remove-user'
),
path
(
'remote-app-permissions/<uuid:pk>/remote-app/remove/'
,
api
.
RemoteAppPermissionRemoveRemoteAppApi
.
as_view
(),
name
=
'remote-app-permission-remove-remote-app'
),
path
(
'remote-app-permissions/<uuid:pk>/remote-app
s
/remove/'
,
api
.
RemoteAppPermissionRemoveRemoteAppApi
.
as_view
(),
name
=
'remote-app-permission-remove-remote-app'
),
path
(
'remote-app-permissions/<uuid:pk>/remote-app/add/'
,
api
.
RemoteAppPermissionAddRemoteAppApi
.
as_view
(),
name
=
'remote-app-permission-add-remote-app'
),
path
(
'remote-app-permissions/<uuid:pk>/remote-app
s
/add/'
,
api
.
RemoteAppPermissionAddRemoteAppApi
.
as_view
(),
name
=
'remote-app-permission-add-remote-app'
),
]
]
old_version_urlpatterns
=
[
old_version_urlpatterns
=
[
...
...
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