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
4855e86a
Commit
4855e86a
authored
8 years ago
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add asset group view
parent
246fcb8e
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
20 additions
and
15 deletions
+20
-15
models.py
apps/assets/models.py
+4
-0
assetgroup_add.html
apps/assets/templates/assets/assetgroup_add.html
+3
-3
assetgroup_list.html
apps/assets/templates/assets/assetgroup_list.html
+6
-6
urls.py
apps/assets/urls.py
+1
-1
views.py
apps/assets/views.py
+1
-0
_header_bar.html
apps/templates/_header_bar.html
+1
-1
django.po
apps/users/locale/zh_CN/LC_MESSAGES/django.po
+1
-1
_user.html
apps/users/templates/users/_user.html
+1
-1
forget_password.html
apps/users/templates/users/forget_password.html
+1
-1
user_list.html
apps/users/templates/users/user_list.html
+1
-1
No files found.
apps/assets/models.py
View file @
4855e86a
...
...
@@ -130,8 +130,12 @@ class Asset(models.Model):
def
__unicode__
(
self
):
return
self
.
ip
def
initial
(
self
):
pass
class
Meta
:
db_table
=
'asset'
index_together
=
(
'ip'
,
'port'
)
class
Label
(
models
.
Model
):
...
...
This diff is collapsed.
Click to expand it.
apps/assets/templates/assets/assetgroup_add.html
View file @
4855e86a
...
...
@@ -36,7 +36,7 @@
<div
class=
"col-sm-9"
>
<select
name=
"assets"
id=
"assets"
data-placeholder=
"{% trans 'Select asset' %}"
class=
"select2 form-control m-b"
multiple
tabindex=
"2"
>
{% for asset in assets %}
<option
value=
"{{ asset.id }}"
>
{{ asset.
hostname
}}
</option>
<option
value=
"{{ asset.id }}"
>
{{ asset.
ip }}:{{ asset.port
}}
</option>
{% endfor %}
</select>
</div>
...
...
@@ -46,8 +46,8 @@
<div
class=
"form-group"
>
<div
class=
"col-sm-4 col-sm-offset-2"
>
<button
class=
"btn btn-white"
type=
"reset"
>
取消
</button>
<button
id=
"submit_button"
class=
"btn btn-primary"
type=
"submit"
>
确认保存
</button>
<button
class=
"btn btn-white"
type=
"reset"
>
{% trans 'Reset' %}
</button>
<button
id=
"submit_button"
class=
"btn btn-primary"
type=
"submit"
>
{% trans 'Submit' %}
</button>
</div>
</div>
</form>
...
...
This diff is collapsed.
Click to expand it.
apps/assets/templates/assets/assetgroup_list.html
View file @
4855e86a
...
...
@@ -19,18 +19,18 @@
{% for assetgroup in assetgroups %}
<tr
class=
"gradeX"
>
<td
class=
"text-center"
>
<input
type=
"checkbox"
name=
"checked"
value=
"{{
user
.id }}"
>
<input
type=
"checkbox"
name=
"checked"
value=
"{{
assetgroup
.id }}"
>
</td>
<td
class=
"text-center"
>
<a
href=
"{% url 'assets:assetgroup-detail' pk=
user
.id %}"
>
<a
href=
"{% url 'assets:assetgroup-detail' pk=
assetgroup
.id %}"
>
{{ assetgroup.name }}
</a>
</td>
<td
class=
"text-center"
>
{{ assetgroup.
comme
nt }}
</td>
<td
class=
"text-center"
>
{{ assetgroup.
asset_set.cou
nt }}
</td>
<td
class=
"text-center"
>
{{ assetgroup.comment }}
</td>
<td
class=
"text-center"
>
<a
href=
"{% url '
users:user-edit' pk=user
.id %}"
class=
"btn btn-xs btn-info"
>
{% trans 'Edit' %}
</a>
<a
href=
"{% url '
users:user-delete' pk=user.id %}"
class=
"btn btn-xs btn-danger del {% if user.id == request.user.id or user.username == 'admin' %} disabled {% endif %}
"
>
{% trans 'Delete' %}
</a>
<a
href=
"{% url '
assets:assetgroup-edit' pk=assetgroup
.id %}"
class=
"btn btn-xs btn-info"
>
{% trans 'Edit' %}
</a>
<a
href=
"{% url '
assets:assetgroup-delete' pk=assetgroup.id %}"
class=
"btn btn-xs btn-danger del
"
>
{% trans 'Delete' %}
</a>
</td>
</tr>
{% endfor %}
...
...
@@ -48,7 +48,7 @@
<div
class=
"input-group-btn pull-left"
style=
"padding-left: 5px;"
>
<button
id=
'search_btn'
type=
"submit"
style=
"height: 32px;"
class=
"btn btn-sm btn-primary"
>
{% trans '
Com
mit' %}
{% trans '
Sub
mit' %}
</button>
</div>
...
...
This diff is collapsed.
Click to expand it.
apps/assets/urls.py
View file @
4855e86a
...
...
@@ -22,7 +22,7 @@ urlpatterns = [
url
(
r'^assetgroup$'
,
views
.
AssetGroupListView
.
as_view
(),
name
=
'assetgroup-list'
),
url
(
r'^assetgroup/add$'
,
views
.
AssetGroupAddView
.
as_view
(),
name
=
'assetgroup-add'
),
url
(
r'^assetgroup/(?P<pk>[0-9]+)$'
,
views
.
AssetGroupDetailView
.
as_view
(),
name
=
'assetgroup-detail'
),
url
(
r'^assetgroup/(?P<pk>[0-9]+)
$/edit
'
,
views
.
AssetGroupEditView
.
as_view
(),
name
=
'assetgroup-edit'
),
url
(
r'^assetgroup/(?P<pk>[0-9]+)
/edit$
'
,
views
.
AssetGroupEditView
.
as_view
(),
name
=
'assetgroup-edit'
),
url
(
r'^assetgroup/(?P<pk>[0-9]+)/delete$'
,
views
.
AssetGroupDeleteView
.
as_view
(),
name
=
'assetgroup-delete'
),
# url(r'^api/v1.0/', include(router.urls)),
]
This diff is collapsed.
Click to expand it.
apps/assets/views.py
View file @
4855e86a
...
...
@@ -52,6 +52,7 @@ class AssetGroupAddView(CreateView):
model
=
AssetGroup
form_class
=
AssetGroupForm
template_name
=
'assets/assetgroup_add.html'
success_url
=
reverse_lazy
(
'assets:assetgroup-list'
)
def
get_context_data
(
self
,
**
kwargs
):
context
=
{
...
...
This diff is collapsed.
Click to expand it.
apps/templates/_header_bar.html
View file @
4855e86a
...
...
@@ -11,7 +11,7 @@
</div>
<ul
class=
"nav navbar-top-links navbar-right"
>
<li>
<span
class=
"m-r-sm text-muted welcome-message"
>
{% trans 'Welcome use Jumpserver system' %}
</span>
<span
class=
"m-r-sm text-muted welcome-message"
>
{% trans 'Welcome
to
use Jumpserver system' %}
</span>
</li>
<li
class=
"dropdown"
>
<a
class=
"dropdown-toggle count-info"
data-toggle=
"dropdown"
href=
"#"
>
...
...
This diff is collapsed.
Click to expand it.
apps/users/locale/zh_CN/LC_MESSAGES/django.po
View file @
4855e86a
...
...
@@ -135,7 +135,7 @@ msgstr ""
#: users/templates/users/_user.html:70
#: users/templates/users/forget_password.html:44
#: users/templates/users/user_list.html:63
msgid "
Com
mit"
msgid "
Sub
mit"
msgstr ""
#: users/templates/users/forget_password.html:26
...
...
This diff is collapsed.
Click to expand it.
apps/users/templates/users/_user.html
View file @
4855e86a
...
...
@@ -67,7 +67,7 @@
<div
class=
"form-group"
>
<div
class=
"col-sm-4 col-sm-offset-2"
>
<button
class=
"btn btn-white"
type=
"reset"
>
{% trans 'Reset' %}
</button>
<button
id=
"submit_button"
class=
"btn btn-primary"
type=
"submit"
>
{% trans '
Com
mit' %}
</button>
<button
id=
"submit_button"
class=
"btn btn-primary"
type=
"submit"
>
{% trans '
Sub
mit' %}
</button>
</div>
</div>
</form>
...
...
This diff is collapsed.
Click to expand it.
apps/users/templates/users/forget_password.html
View file @
4855e86a
...
...
@@ -41,7 +41,7 @@
<input
type=
"email"
name=
"email"
class=
"form-control"
placeholder=
"Email address"
required=
""
>
</div>
<button
type=
"submit"
class=
"btn btn-primary block full-width m-b"
>
{% trans '
Com
mit' %}
</button>
<button
type=
"submit"
class=
"btn btn-primary block full-width m-b"
>
{% trans '
Sub
mit' %}
</button>
</form>
</div>
...
...
This diff is collapsed.
Click to expand it.
apps/users/templates/users/user_list.html
View file @
4855e86a
...
...
@@ -60,7 +60,7 @@
<div
class=
"input-group-btn pull-left"
style=
"padding-left: 5px;"
>
<button
id=
'search_btn'
type=
"submit"
style=
"height: 32px;"
class=
"btn btn-sm btn-primary"
>
{% trans '
Com
mit' %}
{% trans '
Sub
mit' %}
</button>
</div>
...
...
This diff is collapsed.
Click to expand it.
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