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
f1dfba6a
Commit
f1dfba6a
authored
Oct 31, 2016
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update some asset issues
parent
b36d7098
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
7 deletions
+8
-7
forms.py
apps/assets/forms.py
+4
-4
jumpserver.css
apps/static/css/jumpserver.css
+1
-1
forms.py
apps/users/forms.py
+1
-0
models.py
apps/users/models.py
+1
-1
_user.html
apps/users/templates/users/_user.html
+1
-1
No files found.
apps/assets/forms.py
View file @
f1dfba6a
...
...
@@ -38,16 +38,14 @@ class AssetCreateForm(forms.ModelForm):
self
.
instance
.
tags
.
clear
()
self
.
instance
.
tags
.
add
(
*
tuple
(
tags
))
class
Meta
:
model
=
Asset
tags
=
forms
.
ModelMultipleChoiceField
(
queryset
=
Tag
.
objects
.
all
())
fields
=
[
'hostname'
,
'ip'
,
'port'
,
'type'
,
'comment'
,
'admin_user'
,
'system_users'
,
'idc'
,
'groups'
,
'other_ip'
,
'remote_card_ip'
,
'mac_address'
,
'brand'
,
'cpu'
,
'memory'
,
'disk'
,
'os'
,
'cabinet_no'
,
'cabinet_pos'
,
'number'
,
'status'
,
'env'
,
'sn'
,
'tags'
,
'cabinet_pos'
,
'number'
,
'status'
,
'env'
,
'sn'
,
'tags'
,
]
tags
=
forms
.
ModelMultipleChoiceField
(
queryset
=
Tag
.
objects
.
all
())
widgets
=
{
'groups'
:
forms
.
SelectMultiple
(
attrs
=
{
'class'
:
'select2'
,
'data-placeholder'
:
_
(
'Select asset groups'
)}),
...
...
@@ -60,6 +58,7 @@ class AssetCreateForm(forms.ModelForm):
help_texts
=
{
'hostname'
:
'* required'
,
'ip'
:
'* required'
,
'admin_user'
:
_
(
'Admin user should be exist on asset already, And have sudo ALL permission'
),
'tags'
:
'最多5个标签,单个标签最长8个汉字,按回车确认'
}
...
...
@@ -264,6 +263,7 @@ class SystemUserForm(forms.ModelForm):
'auth_update'
:
'Auto update system user ssh key'
,
}
class
AssetTagForm
(
forms
.
ModelForm
):
assets
=
forms
.
ModelMultipleChoiceField
(
queryset
=
Asset
.
objects
.
all
(),
label
=
_
(
'Asset'
),
...
...
apps/static/css/jumpserver.css
View file @
f1dfba6a
...
...
@@ -34,7 +34,7 @@ th a {
}
.select2-container--default
.select2-results__option--highlighted
[
aria-selected
]
{
background-color
:
#1ab394
;
background-color
:
#1ab394
!important
;
color
:
white
;
}
...
...
apps/users/forms.py
View file @
f1dfba6a
...
...
@@ -27,6 +27,7 @@ class UserCreateForm(forms.ModelForm):
]
help_texts
=
{
'username'
:
'* required'
,
'name'
:
'* required'
,
'email'
:
'* required'
,
}
widgets
=
{
...
...
apps/users/models.py
View file @
f1dfba6a
...
...
@@ -72,7 +72,7 @@ class User(AbstractUser):
)
username
=
models
.
CharField
(
max_length
=
20
,
unique
=
True
,
verbose_name
=
_
(
'Username'
))
name
=
models
.
CharField
(
max_length
=
20
,
blank
=
True
,
verbose_name
=
_
(
'Name'
))
name
=
models
.
CharField
(
max_length
=
20
,
verbose_name
=
_
(
'Name'
))
email
=
models
.
EmailField
(
max_length
=
30
,
unique
=
True
,
verbose_name
=
_
(
'Email'
))
groups
=
models
.
ManyToManyField
(
UserGroup
,
related_name
=
'users'
,
blank
=
True
,
verbose_name
=
_
(
'User group'
))
role
=
models
.
CharField
(
choices
=
ROLE_CHOICES
,
default
=
'User'
,
max_length
=
10
,
blank
=
True
,
verbose_name
=
_
(
'Role'
))
...
...
apps/users/templates/users/_user.html
View file @
f1dfba6a
...
...
@@ -32,8 +32,8 @@
{% csrf_token %}
<h3>
{% trans 'Account' %}
</h3>
{% block username %} {% endblock %}
{{ form.email|bootstrap_horizontal }}
{{ form.name|bootstrap_horizontal }}
{{ form.email|bootstrap_horizontal }}
{{ form.groups|bootstrap_horizontal }}
<div
class=
"hr-line-dashed"
></div>
...
...
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