Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gutyán Gábor
/
circlestack
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
70996b00
authored
Sep 01, 2014
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: remove application field
parent
0bb60732
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
29 additions
and
26 deletions
+29
-26
circle/dashboard/forms.py
+1
-1
circle/dashboard/migrations/0016_auto__del_field_connectcommand_application__add_field_connectcommand_n.py
+0
-0
circle/dashboard/models.py
+3
-8
circle/dashboard/static/dashboard/dashboard.css
+7
-0
circle/dashboard/tables.py
+10
-10
circle/dashboard/templates/dashboard/connect-command-list/column-command-actions.html
+2
-2
circle/dashboard/templates/dashboard/profile_form.html
+2
-1
circle/dashboard/urls.py
+3
-3
circle/dashboard/views.py
+1
-1
No files found.
circle/dashboard/forms.py
View file @
70996b00
...
...
@@ -1041,7 +1041,7 @@ class UserKeyForm(forms.ModelForm):
class
ConnectCommandForm
(
forms
.
ModelForm
):
class
Meta
:
fields
=
(
'
access_method'
,
'application
'
,
'template'
)
fields
=
(
'
name'
,
'access_method
'
,
'template'
)
model
=
ConnectCommand
@property
...
...
circle/dashboard/migrations/0016_auto__del_field_connectcommand_application__add_field_connectcommand_n.py
0 → 100644
View file @
70996b00
This diff is collapsed.
Click to expand it.
circle/dashboard/models.py
View file @
70996b00
...
...
@@ -106,19 +106,15 @@ class ConnectCommand(Model):
access_method
=
CharField
(
max_length
=
10
,
choices
=
ACCESS_METHODS
,
verbose_name
=
_
(
'access method'
),
help_text
=
_
(
'Type of the remote access method.'
))
application
=
CharField
(
max_length
=
"128"
,
verbose_name
=
_
(
'application'
),
help_text
=
_
(
'Name of the application used for '
'remote connection. '
'This will be the value of the '
'
%(app)
s parameter.'
))
name
=
CharField
(
max_length
=
"128"
,
verbose_name
=
_
(
'name'
),
blank
=
False
,
help_text
=
_
(
"Name of your custom command."
))
template
=
CharField
(
blank
=
True
,
null
=
True
,
max_length
=
256
,
verbose_name
=
_
(
'command template'
),
help_text
=
_
(
'Template for connection command string. '
'Available parameters are: '
'username, password, '
'host, port, app. Example: sshpass '
'-p
%(password)
s
%(app)
s
-o '
'-p
%(password)
s
ssh
-o '
'StrictHostKeyChecking=no
%(username)
s@'
'
%(host)
s -p
%(port)
s'
))
...
...
@@ -169,7 +165,6 @@ class Profile(Model):
'port'
:
instance
.
get_connect_port
(
use_ipv6
=
use_ipv6
),
'host'
:
instance
.
get_connect_host
(
use_ipv6
=
use_ipv6
),
'password'
:
instance
.
pw
,
'app'
:
command
.
application
,
'username'
:
'cloud'
,
}
for
command
in
commands
]
else
:
...
...
circle/dashboard/static/dashboard/dashboard.css
View file @
70996b00
...
...
@@ -867,3 +867,10 @@ textarea[name="list-new-namelist"] {
border-bottom
:
1px
dotted
#aaa
;
padding
:
5px
0px
;
}
#profile-key-list-table
td
:last-child
,
#profile-key-list-table
th
:last-child
,
#profile-command-list-table
td
:last-child
,
#profile-command-list-table
th
:last-child
,
#profile-command-list-table
td
:nth-child
(
2
),
#profile-command-list-table
th
:nth-child
(
2
)
{
text-align
:
center
;
vertical-align
:
middle
;
}
circle/dashboard/tables.py
View file @
70996b00
...
...
@@ -249,28 +249,27 @@ class UserKeyListTable(Table):
class
Meta
:
model
=
UserKey
attrs
=
{
'class'
:
(
'table table-bordered table-striped table-hover'
)}
attrs
=
{
'class'
:
(
'table table-bordered table-striped table-hover'
),
'id'
:
"profile-key-list-table"
}
fields
=
(
'name'
,
'fingerprint'
,
'created'
,
'actions'
)
prefix
=
"key-"
empty_text
=
_
(
"You haven't added any public keys yet."
)
class
ConnectCommandListTable
(
Table
):
access_method
=
Column
(
verbose_name
=
_
(
"Access method"
),
name
=
LinkColumn
(
'dashboard.views.connect-command-detail'
,
args
=
[
A
(
'pk'
)],
attrs
=
{
'th'
:
{
'data-sort'
:
"string"
}}
)
application
=
Column
(
verbose_name
=
_
(
"Application"
),
access_method
=
Column
(
verbose_name
=
_
(
"Access method"
),
attrs
=
{
'th'
:
{
'data-sort'
:
"string"
}}
)
template
=
Column
(
verbose_name
=
_
(
"Template"
),
attrs
=
{
'th'
:
{
'data-sort'
:
"string"
}}
)
actions
=
TemplateColumn
(
verbose_name
=
_
(
"Actions"
),
template_name
=
(
"dashboard/connect-command-list/column-command"
...
...
@@ -280,8 +279,9 @@ class ConnectCommandListTable(Table):
class
Meta
:
model
=
ConnectCommand
attrs
=
{
'class'
:
(
'table table-bordered table-striped table-hover'
)}
fields
=
(
'access_method'
,
'application'
,
'template'
,
'actions'
)
attrs
=
{
'class'
:
(
'table table-bordered table-striped table-hover'
),
'id'
:
"profile-command-list-table"
}
fields
=
(
'name'
,
'access_method'
,
'template'
,
'actions'
)
prefix
=
"cmd-"
empty_text
=
_
(
"You don't have any custom connection string, the "
"default ones will be used."
)
circle/dashboard/templates/dashboard/connect-command-list/column-command-actions.html
View file @
70996b00
{% load i18n %}
<a
href=
"{% url "
dashboard
.
views
.
connectcommand-detail
"
pk=
record.pk%}"
id=
"template-list-edit-button"
class=
"btn btn-default btn-xs"
title=
"{% trans "
Edit
"
%}"
>
<a
href=
"{% url "
dashboard
.
views
.
connect
-
command-detail
"
pk=
record.pk%}"
id=
"template-list-edit-button"
class=
"btn btn-default btn-xs"
title=
"{% trans "
Edit
"
%}"
>
<i
class=
"fa fa-edit"
></i>
</a>
<a
data-template-pk=
"{{ record.pk }}"
href=
"{% url "
dashboard
.
views
.
connectcommand-delete
"
pk=
record.pk
%}"
class=
"btn btn-danger btn-xs template-delete"
title=
"{% trans "
Delete
"
%}"
>
<a
data-template-pk=
"{{ record.pk }}"
href=
"{% url "
dashboard
.
views
.
connect
-
command-delete
"
pk=
record.pk
%}"
class=
"btn btn-danger btn-xs template-delete"
title=
"{% trans "
Delete
"
%}"
>
<i
class=
"fa fa-times"
></i>
</a>
circle/dashboard/templates/dashboard/profile_form.html
View file @
70996b00
...
...
@@ -70,7 +70,8 @@
<div
class=
"col-md-12"
>
<div
class=
"panel panel-default"
>
<div
class=
"panel-heading"
>
<a
href=
"{% url "
dashboard
.
views
.
connectcommand-create
"
%}"
class=
"pull-right btn btn-success btn-xs"
style=
"margin-right: 10px;"
>
<a
href=
"{% url "
dashboard
.
views
.
connect-command-create
"
%}"
class=
"pull-right btn btn-success btn-xs"
style=
"margin-right: 10px;"
>
<i
class=
"fa fa-plus"
></i>
{% trans "add command template" %}
</a>
<h3
class=
"no-margin"
><i
class=
"fa fa-code"
></i>
{% trans "Command templates" %}
</h3>
...
...
circle/dashboard/urls.py
View file @
70996b00
...
...
@@ -183,13 +183,13 @@ urlpatterns = patterns(
url
(
r'^conncmd/delete/(?P<pk>\d+)/$'
,
ConnectCommandDelete
.
as_view
(),
name
=
"dashboard.views.connectcommand-delete"
),
name
=
"dashboard.views.connect
-
command-delete"
),
url
(
r'^conncmd/(?P<pk>\d+)/$'
,
ConnectCommandDetail
.
as_view
(),
name
=
"dashboard.views.connectcommand-detail"
),
name
=
"dashboard.views.connect
-
command-detail"
),
url
(
r'^conncmd/create/$'
,
ConnectCommandCreate
.
as_view
(),
name
=
"dashboard.views.connectcommand-create"
),
name
=
"dashboard.views.connect
-
command-create"
),
url
(
r'^autocomplete/'
,
include
(
'autocomplete_light.urls'
)),
...
...
circle/dashboard/views.py
View file @
70996b00
...
...
@@ -3194,7 +3194,7 @@ class ConnectCommandDetail(LoginRequiredMixin, SuccessMessageMixin,
return
super
(
ConnectCommandDetail
,
self
)
.
get
(
request
,
*
args
,
**
kwargs
)
def
get_success_url
(
self
):
return
reverse_lazy
(
"dashboard.views.connectcommand-detail"
,
return
reverse_lazy
(
"dashboard.views.connect
-
command-detail"
,
kwargs
=
self
.
kwargs
)
def
post
(
self
,
request
,
*
args
,
**
kwargs
):
...
...
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