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
4531157c
Commit
4531157c
authored
Oct 16, 2016
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
may be some wrong
parent
26a8bce2
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
199 additions
and
54 deletions
+199
-54
__init__.py
apps/apps/__init__.py
+0
-0
admin.py
apps/apps/admin.py
+0
-0
api.py
apps/apps/api.py
+14
-0
apps.py
apps/apps/apps.py
+2
-2
models.py
apps/apps/models.py
+2
-3
serializers.py
apps/apps/serializers.py
+17
-0
terminal_list.html
apps/apps/templates/terminal/terminal_list.html
+79
-0
tests.py
apps/apps/tests.py
+0
-0
urls.py
apps/apps/urls.py
+18
-0
views.py
apps/apps/views.py
+17
-0
models.py
apps/assets/models.py
+1
-1
settings.py
apps/jumpserver/settings.py
+1
-1
urls.py
apps/jumpserver/urls.py
+1
-0
record.js
apps/static/js/record.js
+1
-1
term.js
apps/static/js/term.js
+23
-23
webterminal.js
apps/static/js/webterminal.js
+8
-7
wssh.js
apps/static/js/wssh.js
+1
-1
_nav.html
apps/templates/_nav.html
+5
-3
views.py
apps/terminal/views.py
+0
-3
api.py
apps/users/api.py
+2
-2
user_list.html
apps/users/templates/users/user_list.html
+7
-7
No files found.
apps/
terminal
/__init__.py
→
apps/
apps
/__init__.py
View file @
4531157c
File moved
apps/
terminal
/admin.py
→
apps/
apps
/admin.py
View file @
4531157c
File moved
apps/apps/api.py
0 → 100644
View file @
4531157c
# -*- coding: utf-8 -*-
#
from
rest_framework.generics
import
ListCreateAPIView
from
.models
import
Terminal
from
.serializers
import
TerminalSerializer
class
TerminalApi
(
ListCreateAPIView
):
queryset
=
Terminal
.
objects
.
all
()
serializer_class
=
TerminalSerializer
apps/
terminal
/apps.py
→
apps/
apps
/apps.py
View file @
4531157c
...
...
@@ -3,5 +3,5 @@ from __future__ import unicode_literals
from
django.apps
import
AppConfig
class
Terminal
Config
(
AppConfig
):
name
=
'
terminal
'
class
Apps
Config
(
AppConfig
):
name
=
'
apps
'
apps/
terminal
/models.py
→
apps/
apps
/models.py
View file @
4531157c
...
...
@@ -17,14 +17,13 @@ class Terminal(models.Model):
is_bound_ip
=
models
.
BooleanField
(
default
=
False
,
verbose_name
=
_
(
'Is bound ip'
))
heatbeat_interval
=
models
.
IntegerField
(
default
=
60
,
verbose_name
=
_
(
'Heatbeat interval'
))
type
=
models
.
CharField
(
choices
=
TYPE_CHOICES
,
max_length
=
2
,
verbose_name
=
_
(
'Terminal type'
))
ssh_host
=
models
.
CharField
(
max_length
=
100
,
verbose_name
=
_
(
'SSH host'
))
ssh_port
=
models
.
IntegerField
(
verbose_name
=
_
(
'SSH port'
))
url
=
models
.
CharField
(
max_length
=
100
,
verbose_name
=
_
(
'URL to login'
))
mail_to
=
models
.
ManyToManyField
(
User
,
verbose_name
=
_
(
'Mail to'
))
date_created
=
models
.
DateTimeField
(
auto_now_add
=
True
)
comment
=
models
.
TextField
(
verbose_name
=
_
(
'Comment'
))
class
Meta
:
db_table
=
'
terminal
'
db_table
=
'
apps
'
ordering
=
[
'name'
]
...
...
apps/apps/serializers.py
0 → 100644
View file @
4531157c
# -*- coding: utf-8 -*-
#
from
rest_framework
import
serializers
from
.models
import
Terminal
class
TerminalSerializer
(
serializers
.
ModelSerializer
):
class
Meta
:
model
=
Terminal
fields
=
[
'name'
,
'ip'
,
'type'
,
'url'
,
'comment'
,
'is_active'
,
'get_type_display'
]
if
__name__
==
'__main__'
:
pass
apps/apps/templates/terminal/terminal_list.html
0 → 100644
View file @
4531157c
{% extends '_base_list.html' %}
{% load i18n static %}
{% block custom_head_css_js %}
{{ block.super }}
<style>
div
.dataTables_wrapper
div
.dataTables_filter
,
.dataTables_length
{
float
:
right
!important
;
}
div
.dataTables_wrapper
div
.dataTables_filter
{
margin-left
:
15px
;
}
</style>
{% endblock %}
{% block table_search %}{% endblock %}
{% block table_container %}
{#
<div
class=
"uc pull-left m-l-5 m-r-5"
><a
href=
"{% url "
users:user-create
"
%}"
class=
"btn btn-sm btn-primary"
>
{% trans "Create user" %}
</a></div>
#}
<table
class=
"table table-striped table-bordered table-hover "
id=
"terminal_list_table"
>
<thead>
<tr>
<th
class=
"text-center"
>
<div
class=
"checkbox checkbox-default"
>
<input
type=
"checkbox"
class=
"ipt_check_all"
>
</div>
</th>
<th
class=
"text-center"
>
{% trans 'Name' %}
</th>
<th
class=
"text-center"
>
{% trans 'IP' %}
</th>
<th
class=
"text-center"
>
{% trans 'Type' %}
</th>
<th
class=
"text-center"
>
{% trans 'url' %}
</th>
<th
class=
"text-center"
>
{% trans 'Active' %}
</th>
<th
class=
"text-center"
>
{% trans 'Action' %}
</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
{% endblock %}
{% block content_bottom_left %}{% endblock %}
{% block custom_foot_js %}
<script
src=
"{% static 'js/jquery.form.min.js' %}"
></script>
<script>
$
(
document
).
ready
(
function
(){
var
options
=
{
ele
:
$
(
'#terminal_list_table'
),
{
#
columnDefs
:
[
#
}
{
#
{
targets
:
1
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
#
}
{
#
var
detail_btn
=
'<a href="{% url "users:user-detail" pk=99991937 %}">'
+
cellData
+
'</a>'
;
#
}
{
#
$
(
td
).
html
(
detail_btn
.
replace
(
'99991937'
,
rowData
.
id
));
#
}
{
#
}}
#
}
{
#
{
targets
:
4
,
createdCell
:
function
(
td
,
cellData
)
{
#
}
{
#
var
innerHtml
=
cellData
.
length
>
8
?
cellData
.
substring
(
0
,
8
)
+
'...'
:
cellData
;
#
}
{
#
$
(
td
).
html
(
'<a href="javascript:void(0);" data-toggle="tooltip" title="'
+
cellData
+
'">'
+
innerHtml
+
'</a>'
);
#
}
{
#
}},
#
}
{
#
{
targets
:
6
,
createdCell
:
function
(
td
,
cellData
)
{
#
}
{
#
if
(
!
cellData
)
{
#
}
{
#
$
(
td
).
html
(
'<i class="fa fa-times text-danger"></i>'
)
#
}
{
#
}
else
{
#
}
{
#
$
(
td
).
html
(
'<i class="fa fa-check text-navy"></i>'
)
#
}
{
#
}
#
}
{
#
}},
#
}
{
#
{
targets
:
7
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
#
}
{
#
var
update_btn
=
'<a href="{% url "users:user-update" pk=99991937 %}" class="btn btn-xs btn-info">{% trans "Update" %}</a>'
.
replace
(
'99991937'
,
cellData
);
#
}
{
#
var
del_btn
=
'<a class="btn btn-xs btn-danger m-l-xs btn_user_delete" data-uid="99991937">{% trans "Delete" %}</a>'
.
replace
(
'99991937'
,
cellData
);
#
}
{
#
if
(
rowData
.
id
===
1
)
{
#
}
{
#
$
(
td
).
html
(
update_btn
)
#
}
{
#
}
else
{
#
}
{
#
$
(
td
).
html
(
update_btn
+
del_btn
)
#
}
{
#
}}],
#
}
{
#
],
#
}
ajax_url
:
'{% url "apps:apps-list-create-api" %}'
,
columns
:
[{
data
:
function
(){
return
""
}},
{
data
:
"name"
},
{
data
:
"ip"
},
{
data
:
"get_type_display"
},
{
data
:
"url"
},
{
data
:
"is_active"
},
{
data
:
"ip"
}],
op_html
:
$
(
'#actions'
).
html
()
};
jumpserver
.
initDataTable
(
options
);
})
</script>
{% endblock %}
apps/
terminal
/tests.py
→
apps/
apps
/tests.py
View file @
4531157c
File moved
apps/apps/urls.py
0 → 100644
View file @
4531157c
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
from
django.conf.urls
import
url
import
views
import
api
app_name
=
'apps'
urlpatterns
=
[
url
(
r'^apps$'
,
views
.
TerminalListView
.
as_view
(),
name
=
'apps-list'
),
]
urlpatterns
+=
[
url
(
r'^v1/apps/$'
,
api
.
TerminalApi
.
as_view
(),
name
=
'apps-list-create-api'
),
]
apps/apps/views.py
0 → 100644
View file @
4531157c
# ~*~ coding: utf-8 ~*~
#
from
django.views.generic
import
ListView
from
django.utils.translation
import
ugettext
as
_
from
.models
import
Terminal
class
TerminalListView
(
ListView
):
model
=
Terminal
template_name
=
'apps/terminal_list.html'
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
(
TerminalListView
,
self
)
.
get_context_data
(
**
kwargs
)
context
.
update
({
'app'
:
_
(
'Terminal'
),
'action'
:
_
(
'Terminal list'
)})
return
context
apps/assets/models.py
View file @
4531157c
...
...
@@ -366,7 +366,7 @@ class Asset(models.Model):
class
Tag
(
models
.
Model
):
name
=
models
.
CharField
(
max_length
=
64
,
unique
=
True
,
verbose_name
=
_
(
'Name'
))
created_time
=
models
.
DateTimeField
(
auto_now_add
_add
=
True
,
verbose_name
=
_
(
'Create time'
))
created_time
=
models
.
DateTimeField
(
auto_now_add
=
True
,
verbose_name
=
_
(
'Create time'
))
created_by
=
models
.
CharField
(
max_length
=
32
,
null
=
True
,
blank
=
True
,
verbose_name
=
_
(
'Created by'
))
def
__unicode__
(
self
):
...
...
apps/jumpserver/settings.py
View file @
4531157c
...
...
@@ -54,10 +54,10 @@ INSTALLED_APPS = [
'users.apps.UsersConfig'
,
'assets.apps.AssetsConfig'
,
'perms.apps.PermsConfig'
,
'terminal.apps.TerminalConfig'
,
'ops.apps.OpsConfig'
,
'audits.apps.AuditsConfig'
,
'common.apps.CommonConfig'
,
'apps.apps.TerminalConfig'
,
'rest_framework'
,
'rest_framework.authtoken'
,
'bootstrapform'
,
...
...
apps/jumpserver/urls.py
View file @
4531157c
...
...
@@ -26,6 +26,7 @@ urlpatterns = [
url
(
r'^assets/'
,
include
(
'assets.urls'
)),
url
(
r'^perms/'
,
include
(
'perms.urls'
)),
url
(
r'^(api/)?audits/'
,
include
(
'audits.urls'
)),
url
(
r'^(api/)?apps/'
,
include
(
'apps.urls'
)),
]
...
...
apps/static/js/record.js
View file @
4531157c
...
...
@@ -121,7 +121,7 @@ NgApp.controller('TerminalRecordCtrl', function ($scope, $http) {
timelist
=
timelist
.
sort
(
function
(
a
,
b
){
return
a
-
b
});
totalTime
=
totalTime
*
1000
;
document
.
getElementById
(
"afterScrubberText"
).
innerHTML
=
buildTimeString
(
totalTime
);
term
.
open
(
document
.
getElementById
(
'
terminal
'
));
term
.
open
(
document
.
getElementById
(
'
apps
'
));
timer
=
setInterval
(
advance
,
TICK
);
})
...
...
apps/static/js/term.js
View file @
4531157c
...
...
@@ -588,7 +588,7 @@ Terminal.bindKeys = function(document) {
},
true
);
// If we click somewhere other than a
//
terminal, unfocus the terminal
.
//
apps, unfocus the apps
.
on
(
document
,
'mousedown'
,
function
(
ev
)
{
if
(
!
Terminal
.
focus
)
return
;
...
...
@@ -742,7 +742,7 @@ Terminal.insertStyle = function(document, bg, fg) {
// textContent doesn't work well with IE for <style> elements.
style
.
innerHTML
=
''
+
'.
terminal
{
\
n'
+
'.
apps
{
\
n'
+
' float: left;
\
n'
+
' border: '
+
bg
+
' solid 5px;
\
n'
+
' font-family: "DejaVu Sans Mono", "Liberation Mono", monospace;
\
n'
...
...
@@ -751,7 +751,7 @@ Terminal.insertStyle = function(document, bg, fg) {
+
' background: '
+
bg
+
';
\
n'
+
'}
\
n'
+
'
\
n'
+
'.
terminal
-cursor {
\
n'
+
'.
apps
-cursor {
\
n'
+
' color: '
+
bg
+
';
\
n'
+
' background: '
+
fg
+
';
\
n'
+
'}
\
n'
;
...
...
@@ -802,7 +802,7 @@ Terminal.prototype.open = function(parent) {
this
.
isMSIE
=
!!~
this
.
context
.
navigator
.
userAgent
.
indexOf
(
'MSIE'
);
}
// Create our main
terminal
element.
// Create our main
apps
element.
this
.
element
=
this
.
document
.
createElement
(
'div'
);
this
.
element
.
className
=
'terminal'
;
this
.
element
.
style
.
outline
=
'none'
;
...
...
@@ -811,7 +811,7 @@ Terminal.prototype.open = function(parent) {
this
.
element
.
style
.
backgroundColor
=
this
.
colors
[
256
];
this
.
element
.
style
.
color
=
this
.
colors
[
257
];
// Create the lines for our
terminal
.
// Create the lines for our
apps
.
this
.
children
=
[];
for
(;
i
<
this
.
rows
;
i
++
)
{
div
=
this
.
document
.
createElement
(
'div'
);
...
...
@@ -1020,7 +1020,7 @@ Terminal.prototype.open = function(parent) {
if
(
!
(
'useMouse'
in
this
.
options
)
||
this
.
options
.
useMouse
)
{
// Listen for mouse events and translate
// them into
terminal
mouse protocols.
// them into
apps
mouse protocols.
this
.
bindMouse
();
}
...
...
@@ -1549,7 +1549,7 @@ Terminal.prototype.refresh = function(start, end) {
}
if
(
data
!==
this
.
defAttr
)
{
if
(
data
===
-
1
)
{
out
+=
'<span class="reverse-video
terminal
-cursor">'
;
out
+=
'<span class="reverse-video
apps
-cursor">'
;
}
else
{
out
+=
'<span style="'
;
...
...
@@ -1660,7 +1660,7 @@ Terminal.prototype.refresh = function(start, end) {
}
if
(
this
.
_textarea
)
{
var
cursorElement
=
this
.
element
.
querySelector
(
'.
terminal
-cursor'
);
var
cursorElement
=
this
.
element
.
querySelector
(
'.
apps
-cursor'
);
if
(
cursorElement
){
var
cursor_x
=
cursorElement
.
offsetLeft
;
var
cursor_y
=
cursorElement
.
offsetTop
;
...
...
@@ -2474,7 +2474,7 @@ Terminal.prototype.write = function(data) {
// break;
// CSI > Ps p Set pointer mode.
// CSI ! p Soft
terminal
reset (DECSTR).
// CSI ! p Soft
apps
reset (DECSTR).
// CSI Ps$ p
// Request ANSI mode (DECRQM).
// CSI ? Ps$ p
...
...
@@ -3959,7 +3959,7 @@ Terminal.prototype.HPositionRelative = function(params) {
};
// CSI Ps c Send Device Attributes (Primary DA).
// Ps = 0 or omitted -> request attributes from
terminal
. The
// Ps = 0 or omitted -> request attributes from
apps
. The
// response depends on the decTerminalID resource setting.
// -> CSI ? 1 ; 2 c (``VT100 with Advanced Video Option'')
// -> CSI ? 1 ; 0 c (``VT101 with No Options'')
...
...
@@ -3967,7 +3967,7 @@ Terminal.prototype.HPositionRelative = function(params) {
// -> CSI ? 6 0 ; 1 ; 2 ; 6 ; 8 ; 9 ; 1 5 ; c (``VT220'')
// The VT100-style response parameters do not mean anything by
// themselves. VT220 parameters do, telling the host what fea-
// tures the
terminal
supports:
// tures the
apps
supports:
// Ps = 1 -> 132-columns.
// Ps = 2 -> Printer.
// Ps = 6 -> Selective erase.
...
...
@@ -3978,12 +3978,12 @@ Terminal.prototype.HPositionRelative = function(params) {
// Ps = 2 9 -> ANSI text locator (i.e., DEC Locator mode).
// CSI > Ps c
// Send Device Attributes (Secondary DA).
// Ps = 0 or omitted -> request the
terminal
's identification
// Ps = 0 or omitted -> request the
apps
's identification
// code. The response depends on the decTerminalID resource set-
// ting. It should apply only to VT220 and up, but xterm extends
// this to VT100.
// -> CSI > Pp ; Pv ; Pc c
// where Pp denotes the
terminal
type
// where Pp denotes the
apps
type
// Pp = 0 -> ``VT100''.
// Pp = 1 -> ``VT220''.
// and Pv is the firmware version (for xterm, this was originally
...
...
@@ -3992,7 +3992,7 @@ Terminal.prototype.HPositionRelative = function(params) {
// always zero.
// More information:
// xterm/charproc.c - line 2012, for more information.
// vim responds with ^[[?0c or ^[[?1c after the
terminal
's response (?)
// vim responds with ^[[?0c or ^[[?1c after the
apps
's response (?)
Terminal
.
prototype
.
sendDeviceAttributes
=
function
(
params
)
{
if
(
params
[
0
]
>
0
)
return
;
...
...
@@ -4217,19 +4217,19 @@ Terminal.prototype.setMode = function(params) {
// focusout: ^[[O
this
.
sendFocus
=
true
;
break
;
case
1005
:
// utf8
ext
mode mouse
case
1005
:
// utf8
apps
mode mouse
this
.
utfMouse
=
true
;
// for wide terminals
// simply encodes large values as utf8 characters
break
;
case
1006
:
// sgr
ext
mode mouse
case
1006
:
// sgr
apps
mode mouse
this
.
sgrMouse
=
true
;
// for wide terminals
// does not add 32 to fields
// press: ^[[<b;x;yM
// release: ^[[<b;x;ym
break
;
case
1015
:
// urxvt
ext
mode mouse
case
1015
:
// urxvt
apps
mode mouse
this
.
urxvtMouse
=
true
;
// for wide terminals
// numbers for fields
...
...
@@ -4406,13 +4406,13 @@ Terminal.prototype.resetMode = function(params) {
case
1004
:
// send focusin/focusout events
this
.
sendFocus
=
false
;
break
;
case
1005
:
// utf8
ext
mode mouse
case
1005
:
// utf8
apps
mode mouse
this
.
utfMouse
=
false
;
break
;
case
1006
:
// sgr
ext
mode mouse
case
1006
:
// sgr
apps
mode mouse
this
.
sgrMouse
=
false
;
break
;
case
1015
:
// urxvt
ext
mode mouse
case
1015
:
// urxvt
apps
mode mouse
this
.
urxvtMouse
=
false
;
break
;
case
25
:
// hide cursor
...
...
@@ -4622,7 +4622,7 @@ Terminal.prototype.setPointerMode = function(params) {
;
};
// CSI ! p Soft
terminal
reset (DECSTR).
// CSI ! p Soft
apps
reset (DECSTR).
// http://vt100.net/docs/vt220-rm/table4-10.html
Terminal
.
prototype
.
softReset
=
function
(
params
)
{
this
.
cursorHidden
=
false
;
...
...
@@ -4870,7 +4870,7 @@ Terminal.prototype.enableFilterRectangle = function(params) {
// CSI Ps x Request Terminal Parameters (DECREQTPARM).
// if Ps is a "0" (default) or "1", and xterm is emulating VT100,
// the control sequence elicits a response of the same form whose
// parameters describe the
terminal
:
// parameters describe the
apps
:
// Ps -> the given Ps incremented by 2.
// Pn = 1 <- no parity.
// Pn = 1 <- eight bits.
...
...
@@ -6113,7 +6113,7 @@ function inherits(child, parent) {
}
// if bold is broken, we can't
// use it in the
terminal
.
// use it in the
apps
.
function
isBoldBroken
(
document
)
{
var
body
=
document
.
getElementsByTagName
(
'body'
)[
0
];
var
terminal
=
document
.
createElement
(
'div'
);
...
...
apps/static/js/webterminal.js
View file @
4531157c
...
...
@@ -13,7 +13,7 @@ WSSHClient.prototype._generateEndpoint = function (options) {
var
protocol
=
'ws://'
;
}
var
endpoint
=
protocol
+
document
.
URL
.
match
(
RegExp
(
'//(.*?)/'
))[
1
]
+
'/ws/
terminal
'
+
document
.
URL
.
match
(
/
(\?
.*
)
/
);
var
endpoint
=
protocol
+
document
.
URL
.
match
(
RegExp
(
'//(.*?)/'
))[
1
]
+
'/ws/
apps
'
+
document
.
URL
.
match
(
/
(\?
.*
)
/
);
return
endpoint
;
};
WSSHClient
.
prototype
.
connect
=
function
(
options
)
{
...
...
@@ -81,7 +81,7 @@ function openTerminal(options) {
term
.
on
(
'data'
,
function
(
data
)
{
client
.
send
(
data
)
});
$
(
'.
terminal
'
).
detach
().
appendTo
(
'#term'
);
$
(
'.
apps
'
).
detach
().
appendTo
(
'#term'
);
//term.resize(colWidth, rowHeight);
term
.
write
(
'Connecting...'
);
client
.
connect
(
$
.
extend
(
options
,
{
...
...
@@ -100,13 +100,13 @@ function openTerminal(options) {
term
.
write
(
data
);
}
}));
//rowHeight = 0.0 + 1.00 * $('.
terminal
').height() / 24;
//colWidth = 0.0 + 1.00 * $('.
terminal
').width() / 80;
//rowHeight = 0.0 + 1.00 * $('.
apps
').height() / 24;
//colWidth = 0.0 + 1.00 * $('.
apps
').width() / 80;
return
{
'term'
:
term
,
'client'
:
client
};
}
//function resize() {
// $('.
terminal
').css('width', window.innerWidth - 25);
// $('.
apps
').css('width', window.innerWidth - 25);
// console.log(window.innerWidth);
// console.log(window.innerWidth - 10);
// var rows = Math.floor(window.innerHeight / rowHeight) - 2;
...
...
@@ -145,10 +145,10 @@ $(document).ready(function () {
term_client
.
client
.
send
({
'resize'
:
{
'rows'
:
row
,
'cols'
:
col
}});
$
(
'#ssh'
).
show
();
});
$
(
".
terminal
"
).
mouseleave
(
function
()
{
$
(
".
apps
"
).
mouseleave
(
function
()
{
$
(
".termChangBar"
).
slideDown
();
});
$
(
".
terminal
"
).
mouseenter
(
function
()
{
$
(
".
apps
"
).
mouseenter
(
function
()
{
$
(
".termChangBar"
).
slideUp
();
})
});
\ No newline at end of file
apps/static/js/wssh.js
View file @
4531157c
...
...
@@ -47,7 +47,7 @@ WSSHClient.prototype._generateEndpoint = function(options) {
var
protocol
=
'ws://'
;
}
var
endpoint
=
protocol
+
window
.
location
.
host
+
':8080'
+
'/
terminal
'
;
var
endpoint
=
protocol
+
window
.
location
.
host
+
':8080'
+
'/
apps
'
;
return
endpoint
;
};
...
...
apps/templates/_nav.html
View file @
4531157c
...
...
@@ -32,11 +32,13 @@
<li
id=
"asset-permission"
>
<a
href=
"{% url 'perms:asset-permission-list' %}"
>
{% trans 'Asset permission' %}
</a>
</li>
{#
<li
id=
"user-group"
>
#}
{#
<a
href=
""
>
{% trans 'User group perm' %}
</a>
#}
{#
</li>
#}
</ul>
</li>
<li
id=
""
>
<a
href=
"{% url 'apps:apps-list' %}"
>
<i
class=
"fa fa-desktop"
></i><span
class=
"nav-label"
>
{% trans 'Terminal' %}
</span><span
class=
"label label-info pull-right"
></span>
</a>
</li>
<li
id=
""
>
<a
href=
""
>
<i
class=
"fa fa-files-o"
></i><span
class=
"nav-label"
>
{% trans 'Audits' %}
</span><span
class=
"label label-info pull-right"
></span>
...
...
apps/terminal/views.py
deleted
100644 → 0
View file @
26a8bce2
from
django.shortcuts
import
render
# Create your views here.
apps/users/api.py
View file @
4531157c
...
...
@@ -89,8 +89,8 @@ class UserListUpdateApi(BulkDeleteApiMixin, ListBulkCreateUpdateDestroyAPIView):
serializer_class
=
UserBulkUpdateSerializer
permission_classes
=
(
IsSuperUserOrAppUser
,)
def
get
(
self
,
request
,
*
args
,
**
kwargs
):
return
super
(
UserListUpdateApi
,
self
)
.
get
(
request
,
*
args
,
**
kwargs
)
#
def get(self, request, *args, **kwargs):
#
return super(UserListUpdateApi, self).get(request, *args, **kwargs)
class
GroupListUpdateApi
(
BulkDeleteApiMixin
,
ListBulkCreateUpdateDestroyAPIView
):
...
...
apps/users/templates/users/user_list.html
View file @
4531157c
...
...
@@ -23,12 +23,12 @@ div.dataTables_wrapper div.dataTables_filter {
<th
class=
"text-center"
>
<div
class=
"checkbox checkbox-default"
><input
id=
""
type=
"checkbox"
class=
"ipt_check_all"
><label></label></div>
</th>
<th
class=
"text-center"
>
{% trans 'Name' %}
</
a></
th>
<th
class=
"text-center"
>
{% trans 'Username' %}
</
a></
th>
<th
class=
"text-center"
>
{% trans 'Name' %}
</th>
<th
class=
"text-center"
>
{% trans 'Username' %}
</th>
<th
class=
"text-center"
>
{% trans 'Role' %}
</th>
<th
class=
"text-center"
>
{% trans 'User group' %}
</th>
<th
class=
"text-center"
>
{% trans 'Asset num' %}
</th>
<th
class=
"text-center"
>
{% trans 'Active' %}
</
a></
th>
<th
class=
"text-center"
>
{% trans 'Active' %}
</th>
<th
class=
"text-center"
>
{% trans 'Action' %}
</th>
</tr>
</thead>
...
...
@@ -165,7 +165,7 @@ $(document).ready(function(){
var
fail
=
function
()
{
var
msg
=
"{% trans 'User Deleting failed.' %}"
;
swal
(
"{% trans 'User Delete' %}"
,
msg
,
"error"
);
}
}
;
APIUpdateAttr
({
url
:
the_url
,
body
:
JSON
.
stringify
(
body
),
...
...
@@ -208,15 +208,15 @@ $(document).ready(function(){
post_list
.
push
(
content
);
});
if
(
post_list
===
[])
{
return
false
;
}
;
return
false
}
var
the_url
=
"{% url 'users:user-bulk-update-api' %}"
;
var
success
=
function
()
{
var
msg
=
"{% trans 'The selected users has been updated successfully.' %}"
;
swal
(
"{% trans 'User Updated' %}"
,
msg
,
"success"
);
$
(
'#user_list_table'
).
DataTable
().
ajax
.
reload
();
jumpserver
.
checked
=
false
;
}
}
;
APIUpdateAttr
({
url
:
the_url
,
method
:
'PATCH'
,
body
:
JSON
.
stringify
(
post_list
),
success
:
success
});
$
(
'#user_bulk_update_modal'
).
modal
(
'hide'
);
}).
on
(
'click'
,
'#btn_user_import'
,
function
()
{
...
...
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