Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
0623def3
authored
Jun 29, 2017
by
Czémán Arnold
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'clipboard_button' into 'master'
Copy to clipboard support See merge request
!394
parents
c177b3e8
393afbe5
Pipeline
#506
passed with stage
in 0 seconds
Changes
5
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
18 deletions
+33
-18
circle/bower.json
+2
-1
circle/circle/settings/base.py
+1
-0
circle/dashboard/models.py
+7
-4
circle/dashboard/static/dashboard/vm-details.js
+11
-3
circle/dashboard/templates/dashboard/vm-detail.html
+12
-10
No files found.
circle/bower.json
View file @
0623def3
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
"intro.js"
:
"0.9.0"
,
"intro.js"
:
"0.9.0"
,
"favico.js"
:
"~0.3.5"
,
"favico.js"
:
"~0.3.5"
,
"datatables"
:
"~1.10.4"
,
"datatables"
:
"~1.10.4"
,
"chart.js"
:
"2.3.0"
"chart.js"
:
"2.3.0"
,
"clipboard"
:
"~1.6.1"
}
}
}
}
circle/circle/settings/base.py
View file @
0623def3
...
@@ -227,6 +227,7 @@ PIPELINE_JS = {
...
@@ -227,6 +227,7 @@ PIPELINE_JS = {
"output_filename"
:
"all.js"
,
"output_filename"
:
"all.js"
,
},
},
"vm-detail"
:
{
"source_filenames"
:
(
"vm-detail"
:
{
"source_filenames"
:
(
"clipboard/dist/clipboard.min.js"
,
"dashboard/vm-details.js"
,
"dashboard/vm-details.js"
,
"no-vnc/include/util.js"
,
"no-vnc/include/util.js"
,
"no-vnc/include/webutil.js"
,
"no-vnc/include/webutil.js"
,
...
...
circle/dashboard/models.py
View file @
0623def3
...
@@ -212,15 +212,16 @@ class Profile(Model):
...
@@ -212,15 +212,16 @@ class Profile(Model):
commands
=
self
.
user
.
command_set
.
filter
(
commands
=
self
.
user
.
command_set
.
filter
(
access_method
=
instance
.
access_method
)
access_method
=
instance
.
access_method
)
if
commands
.
count
()
<
1
:
if
commands
.
count
()
<
1
:
return
[
single_command
]
return
[
{
'id'
:
0
,
'cmd'
:
single_command
}
]
else
:
else
:
return
[
return
[{
command
.
template
%
{
'id'
:
command
.
id
,
'cmd'
:
command
.
template
%
{
'port'
:
instance
.
get_connect_port
(
use_ipv6
=
use_ipv6
),
'port'
:
instance
.
get_connect_port
(
use_ipv6
=
use_ipv6
),
'host'
:
instance
.
get_connect_host
(
use_ipv6
=
use_ipv6
),
'host'
:
instance
.
get_connect_host
(
use_ipv6
=
use_ipv6
),
'password'
:
instance
.
pw
,
'password'
:
instance
.
pw
,
'username'
:
'cloud'
,
'username'
:
'cloud'
,
}
for
command
in
commands
]
}
}
for
command
in
commands
]
else
:
else
:
return
[]
return
[]
...
@@ -320,6 +321,7 @@ def get_or_create_profile(self):
...
@@ -320,6 +321,7 @@ def get_or_create_profile(self):
obj
,
created
=
GroupProfile
.
objects
.
get_or_create
(
group_id
=
self
.
pk
)
obj
,
created
=
GroupProfile
.
objects
.
get_or_create
(
group_id
=
self
.
pk
)
return
obj
return
obj
Group
.
profile
=
property
(
get_or_create_profile
)
Group
.
profile
=
property
(
get_or_create_profile
)
...
@@ -338,6 +340,7 @@ def create_profile(user):
...
@@ -338,6 +340,7 @@ def create_profile(user):
def
create_profile_hook
(
sender
,
user
,
request
,
**
kwargs
):
def
create_profile_hook
(
sender
,
user
,
request
,
**
kwargs
):
return
create_profile
(
user
)
return
create_profile
(
user
)
user_logged_in
.
connect
(
create_profile_hook
)
user_logged_in
.
connect
(
create_profile_hook
)
if
hasattr
(
settings
,
'SAML_ORG_ID_ATTRIBUTE'
):
if
hasattr
(
settings
,
'SAML_ORG_ID_ATTRIBUTE'
):
...
...
circle/dashboard/static/dashboard/vm-details.js
View file @
0623def3
...
@@ -70,12 +70,12 @@ $(function() {
...
@@ -70,12 +70,12 @@ $(function() {
});
});
/* for js fallback */
/* for js fallback */
$
(
"
#vm-details-pw-show
"
).
parent
(
"div"
).
children
(
"input"
).
prop
(
"type"
,
"password"
);
$
(
"
.vm-details-show-password
"
).
parent
(
"div"
).
children
(
"input"
).
prop
(
"type"
,
"password"
);
/* show password */
/* show password */
$
(
"
#vm-details-pw-show
"
).
click
(
function
()
{
$
(
"
.vm-details-show-password
"
).
click
(
function
()
{
var
input
=
$
(
this
).
parent
(
"div"
).
children
(
"input"
);
var
input
=
$
(
this
).
parent
(
"div"
).
children
(
"input"
);
var
eye
=
$
(
this
).
children
(
"
#vm-details-pw
-eye"
);
var
eye
=
$
(
this
).
children
(
"
.vm-details-password
-eye"
);
var
span
=
$
(
this
);
var
span
=
$
(
this
);
span
.
tooltip
(
"destroy"
);
span
.
tooltip
(
"destroy"
);
...
@@ -252,4 +252,12 @@ $(function() {
...
@@ -252,4 +252,12 @@ $(function() {
return
e
.
preventDefault
();
return
e
.
preventDefault
();
});
});
// Clipboard for connection strings
if
(
Clipboard
.
isSupported
())
{
new
Clipboard
(
".vm-details-connection-string-copy"
,
{
text
:
function
(
trigger
)
{
return
$
(
$
(
trigger
).
data
(
"clipboard-target"
)).
val
();
}
});
}
});
});
circle/dashboard/templates/dashboard/vm-detail.html
View file @
0623def3
...
@@ -133,9 +133,9 @@
...
@@ -133,9 +133,9 @@
<div
class=
"input-group"
>
<div
class=
"input-group"
>
<input
type=
"text"
id=
"vm-details-pw-input"
class=
"form-control input-sm input-tags"
<input
type=
"text"
id=
"vm-details-pw-input"
class=
"form-control input-sm input-tags"
value=
"{{ instance.pw }}"
spellcheck=
"false"
autocomplete=
"new-password"
/>
value=
"{{ instance.pw }}"
spellcheck=
"false"
autocomplete=
"new-password"
/>
<span
class=
"input-group-addon
input-tags"
id=
"vm-details-pw-show
"
<span
class=
"input-group-addon
btn btn-default input-tags vm-details-show-password
"
title=
"{% trans "
Show
password
"
%}"
data-container=
"body"
>
title=
"{% trans "
Show
password
"
%}"
data-container=
"body"
>
<i
class=
"fa fa-eye
"
id=
"vm-details-pw
-eye"
></i>
<i
class=
"fa fa-eye
vm-details-password
-eye"
></i>
</span>
</span>
</div>
</div>
</dd>
</dd>
...
@@ -158,22 +158,24 @@
...
@@ -158,22 +158,24 @@
<div
class=
"input-group dashboard-vm-details-connect-command"
>
<div
class=
"input-group dashboard-vm-details-connect-command"
>
<span
class=
"input-group-addon input-tags"
>
{% trans "Command" %}
</span>
<span
class=
"input-group-addon input-tags"
>
{% trans "Command" %}
</span>
<input
type=
"text"
spellcheck=
"false"
<input
type=
"text"
spellcheck=
"false"
value=
"{{ c }}"
value=
"{{ c.cmd }}"
id=
"vm-details-connection-string"
class=
"form-control input-tags"
/>
id=
"vm-details-connection-string-{{ c.id }}"
class=
"form-control input-tags"
/>
<span
class=
"input-group-addon input-tags vm-details-connection-string-copy"
<span
class=
"input-group-addon btn btn-default input-tags vm-details-show-password"
title=
"{% trans "
Select
all
"
%}"
data-container=
"body"
>
title=
"{% trans "
Show
password
"
%}"
data-container=
"body"
>
<i
class=
"fa fa-eye vm-details-password-eye"
></i>
</span>
<span
class=
"input-group-addon input-tags btn btn-default vm-details-connection-string-copy"
title=
"{% trans "
Copy
to
clipboard
"
%}"
data-container=
"body"
data-clipboard-target=
"#vm-details-connection-string-{{ c.id }}"
>
<i
class=
"fa fa-copy"
></i>
<i
class=
"fa fa-copy"
></i>
</span>
</span>
</div>
</div>
{% empty %}
{% empty %}
<div
class=
"input-group dashboard-vm-details-connect-command"
>
<div
class=
"input-group dashboard-vm-details-connect-command"
>
<span
class=
"input-group-addon input-tags"
>
{% trans "Command" %}
</span>
<span
class=
"input-group-addon input-tags"
>
{% trans "Command" %}
</span>
<input
type=
"text"
spellcheck=
"false"
value=
"{% trans "
Connection
is
not
possible
."
%}"
<input
type=
"text"
spellcheck=
"false"
value=
"{% trans "
Connection
is
not
possible
."
%}"
id=
"vm-details-connection-string"
class=
"form-control input-tags"
/>
id=
"vm-details-connection-string"
class=
"form-control input-tags"
/>
<span
class=
"input-group-addon input-tags"
id=
"vm-details-connection-string-copy"
>
<i
class=
"fa fa-copy"
title=
"{% trans "
Select
all
"
%}"
></i>
</span>
</div>
</div>
{% endfor %}
{% endfor %}
{% if instance.get_connect_uri %}
{% if instance.get_connect_uri %}
...
...
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