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
6069b894
Commit
6069b894
authored
Sep 09, 2016
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Start asset extend
parent
c58725db
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
1 deletion
+27
-1
models.py
apps/assets/models.py
+18
-1
urls.py
apps/assets/urls.py
+9
-0
No files found.
apps/assets/models.py
View file @
6069b894
...
...
@@ -61,7 +61,24 @@ class AssetExtend(models.Model):
comment
=
models
.
TextField
(
blank
=
True
,
verbose_name
=
_
(
'Comment'
))
def
__unicode__
(
self
):
return
self
.
name
return
'
%(key)
s:
%(value)
s'
%
{
'key'
:
self
.
key
,
'value'
:
self
.
value
}
@classmethod
def
initial
(
cls
):
for
k
,
v
in
(
(
_
(
'status'
),
_
(
'In use'
)),
(
_
(
'status'
),
_
(
'Out of use'
)),
(
_
(
'type'
),
_
(
'Server'
)),
(
_
(
'type'
),
_
(
'VM'
)),
(
_
(
'type'
),
_
(
'Switch'
)),
(
_
(
'type'
),
_
(
'Router'
)),
(
_
(
'type'
),
_
(
'Firewall'
)),
(
_
(
'type'
),
_
(
'Storage'
)),
(
_
(
'env'
),
_
(
'Production'
)),
(
_
(
'env'
),
_
(
'Development'
)),
(
_
(
'env'
),
_
(
'Testing'
)),
):
cls
.
objects
.
create
(
key
=
k
,
value
=
v
,
created_by
=
'System'
)
class
Meta
:
db_table
=
'asset_extend'
...
...
apps/assets/urls.py
View file @
6069b894
...
...
@@ -12,27 +12,36 @@ import views
app_name
=
'assets'
urlpatterns
=
[
# Resource asset url
url
(
r'^$'
,
views
.
AssetListView
.
as_view
(),
name
=
'asset-index'
),
url
(
r'^asset$'
,
views
.
AssetListView
.
as_view
(),
name
=
'asset-list'
),
url
(
r'^asset/create$'
,
views
.
AssetCreateView
.
as_view
(),
name
=
'asset-create'
),
url
(
r'^asset/(?P<pk>[0-9]+)$'
,
views
.
AssetDetailView
.
as_view
(),
name
=
'asset-detail'
),
url
(
r'^asset/(?P<pk>[0-9]+)/update'
,
views
.
AssetUpdateView
.
as_view
(),
name
=
'asset-update'
),
url
(
r'^asset/(?P<pk>[0-9]+)/delete$'
,
views
.
AssetDeleteView
.
as_view
(),
name
=
'asset-delete'
),
# Resource asset group url
url
(
r'^asset-group$'
,
views
.
AssetGroupListView
.
as_view
(),
name
=
'asset-group-list'
),
url
(
r'^asset-group/create$'
,
views
.
AssetGroupCreateView
.
as_view
(),
name
=
'asset-group-create'
),
url
(
r'^asset-group/(?P<pk>[0-9]+)$'
,
views
.
AssetGroupDetailView
.
as_view
(),
name
=
'asset-group-detail'
),
url
(
r'^asset-group/(?P<pk>[0-9]+)/update$'
,
views
.
AssetGroupUpdateView
.
as_view
(),
name
=
'asset-group-update'
),
url
(
r'^asset-group/(?P<pk>[0-9]+)/delete$'
,
views
.
AssetGroupDeleteView
.
as_view
(),
name
=
'asset-group-delete'
),
# Resource idc url
url
(
r'^idc$'
,
views
.
IDCListView
.
as_view
(),
name
=
'idc-list'
),
url
(
r'^idc/create$'
,
views
.
IDCCreateView
.
as_view
(),
name
=
'idc-create'
),
url
(
r'^idc/(?P<pk>[0-9]+)$'
,
views
.
IDCDetailView
.
as_view
(),
name
=
'idc-detail'
),
url
(
r'^idc/(?P<pk>[0-9]+)/update'
,
views
.
IDCUpdateView
.
as_view
(),
name
=
'idc-update'
),
url
(
r'^idc/(?P<pk>[0-9]+)/delete$'
,
views
.
IDCDeleteView
.
as_view
(),
name
=
'idc-delete'
),
# Resource admin user url
url
(
r'^admin-user$'
,
views
.
AdminUserListView
.
as_view
(),
name
=
'admin-user-list'
),
url
(
r'^admin-user/create$'
,
views
.
AdminUserCreateView
.
as_view
(),
name
=
'admin-user-create'
),
url
(
r'^admin-user/(?P<pk>[0-9]+)$'
,
views
.
AdminUserDetailView
.
as_view
(),
name
=
'admin-user-detail'
),
url
(
r'^admin-user/(?P<pk>[0-9]+)/update'
,
views
.
AdminUserUpdateView
.
as_view
(),
name
=
'admin-user-update'
),
url
(
r'^admin-user/(?P<pk>[0-9]+)/delete$'
,
views
.
AdminUserDeleteView
.
as_view
(),
name
=
'admin-user-delete'
),
# Resource system user url
url
(
r'^system-user$'
,
views
.
SystemUserListView
.
as_view
(),
name
=
'system-user-list'
),
url
(
r'^system-user/create$'
,
views
.
SystemUserCreateView
.
as_view
(),
name
=
'system-user-create'
),
url
(
r'^system-user/(?P<pk>[0-9]+)$'
,
views
.
SystemUserDetailView
.
as_view
(),
name
=
'system-user-detail'
),
...
...
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