Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
client
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
2
Merge Requests
0
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
2d8c393f
authored
Jun 30, 2014
by
Csók Tamás
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfixes, +added custom url handler (Debian based systems)
parent
1dde927f
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
15 deletions
+34
-15
dist/cloud.desktop
+5
-3
dist/cloud.py
+11
-5
dist/install.sh
+7
-2
src/python/cloud.py
+11
-5
No files found.
dist/cloud.desktop
100644 → 100755
View file @
2d8c393f
[Desktop Entry]
Version=0.1
Encoding=UTF-8
Version=0.2
Type=Application
Name=Cloud GUI
Comment=Tool to use IK Cloud
Exec=cloud2
Exec=cloud2
%u
Icon=/usr/share/icons/cloud.svg
Terminal=true
Type=Application
MimeType=x-scheme-handler/rdp;x-scheme-handler/nx;x-scheme-handler/ssh;
Categories=Utility;Application;
dist/cloud.py
View file @
2d8c393f
...
...
@@ -30,6 +30,7 @@ class Struct:
def
pars_arguments
():
parser
=
argparse
.
ArgumentParser
();
parser
.
add_argument
(
"uri"
,
type
=
str
,
help
=
"Specific schema handler"
,
nargs
=
'?'
,
default
=
None
)
parser
.
add_argument
(
"-u"
,
"--username"
,
type
=
str
)
parser
.
add_argument
(
"-p"
,
"--password"
,
type
=
str
)
parser
.
add_argument
(
"-d"
,
"--driver"
,
help
=
"Select webdriver. Aside from Firefox, you have to install first the proper driver."
,
\
...
...
@@ -106,16 +107,16 @@ class Browser:
vm
=
Struct
()
driver
=
self
.
driver
driver
.
maximize_window
()
driver
.
get
(
"https://
demo.cloud.bme
.hu/"
)
driver
.
find_element_by_css_selector
(
"a[href*='/login/']"
)
.
click
()
self
.
login
()
driver
.
get
(
"https://
pc3.szgt.uni-miskolc
.hu/"
)
#
driver.find_element_by_css_selector("a[href*='/login/']").click()
#
self.login()
vm
.
state
,
vm
.
protocol
=
""
,
"NONE"
try
:
while
vm
.
state
.
upper
()[:
3
]
not
in
(
"FUT"
,
"RUN"
):
element
=
WebDriverWait
(
driver
,
7200
)
.
until
(
EC
.
presence_of_element_located
((
By
.
CSS_SELECTOR
,
"#vm-details-pw-eye.icon-eye-close"
)))
vm
.
state
=
driver
.
find_element_by_css_selector
(
"#vm-details-state > span"
)
.
text
#cl: connection string converted to list
cl
=
driver
.
find_element_by_css_selector
(
"#vm-
info-pane > input
"
)
.
get_attribute
(
"value"
)
.
split
()
cl
=
driver
.
find_element_by_css_selector
(
"#vm-
details-connection-string
"
)
.
get_attribute
(
"value"
)
.
split
()
if
cl
[
0
]
==
"sshpass"
:
vm
.
protocol
=
"SSH"
vm
.
user
,
vm
.
host
=
cl
[
6
]
.
split
(
"@"
)
...
...
@@ -140,6 +141,12 @@ class Browser:
def
main
():
args
=
pars_arguments
()
if
args
.
uri
is
not
None
:
vm
=
Struct
()
vm
.
protocol
,
vm
.
user
,
vm
.
password
,
vm
.
host
,
vm
.
port
=
args
.
uri
.
split
(
':'
,
4
)
vm
.
protocol
=
vm
.
protocol
.
upper
()
vm
.
state
=
"RUN"
else
:
browser
=
Browser
(
args
)
if
args
.
old
:
vm
=
browser
.
old_main
()
...
...
@@ -155,4 +162,3 @@ def main():
if
__name__
==
"__main__"
:
main
()
dist/install.sh
View file @
2d8c393f
#!/bin/bash
sudo
apt-get install sshpass python-pip remmina-plugin-nx remmina-plugin-rdp
sudo
apt-get install sshpass python-pip remmina-plugin-nx remmina-plugin-rdp
xdg-user-dirs
sudo
pip install selenium
if
[
"
$(
uname
-m
)
"
==
'x86_64'
]
;
then
...
...
@@ -8,6 +8,7 @@ if [ "$(uname -m)" == 'x86_64' ]; then
else
sudo
cp remminapasswd32 /usr/local/bin/remminapasswd
fi
sudo
chmod +x /usr/local/bin/remminapasswd
sudo
cp cloud2 /usr/local/bin/
sudo
chmod +x /usr/local/bin/cloud2
sudo
cp cloud.py /usr/local/bin/
...
...
@@ -15,7 +16,10 @@ sudo chmod +x /usr/local/bin/cloud.py
sudo
cp cloud_connect_from_linux.py /usr/local/bin/
sudo
chmod +x /usr/local/bin/cloud_connect_from_linux.py
sudo
cp cloud.svg /usr/share/icons/
sudo
cp cloud.desktop /usr/share/applications
sudo
chmod +x /usr/share/applications/cloud.desktop
sudo
update-desktop-database
cp cloud.desktop
$(
xdg-user-dir DESKTOP
)
sudo
chmod +x
$(
xdg-user-dir DESKTOP
)
/cloud.desktop
chmod +x
$(
xdg-user-dir DESKTOP
)
/cloud.desktop
remmina
\ No newline at end of file
src/python/cloud.py
View file @
2d8c393f
...
...
@@ -30,6 +30,7 @@ class Struct:
def
pars_arguments
():
parser
=
argparse
.
ArgumentParser
();
parser
.
add_argument
(
"uri"
,
type
=
str
,
help
=
"Specific schema handler"
,
nargs
=
'?'
,
default
=
None
)
parser
.
add_argument
(
"-u"
,
"--username"
,
type
=
str
)
parser
.
add_argument
(
"-p"
,
"--password"
,
type
=
str
)
parser
.
add_argument
(
"-d"
,
"--driver"
,
help
=
"Select webdriver. Aside from Firefox, you have to install first the proper driver."
,
\
...
...
@@ -106,16 +107,16 @@ class Browser:
vm
=
Struct
()
driver
=
self
.
driver
driver
.
maximize_window
()
driver
.
get
(
"https://
demo.cloud.bme
.hu/"
)
driver
.
find_element_by_css_selector
(
"a[href*='/login/']"
)
.
click
()
self
.
login
()
driver
.
get
(
"https://
pc3.szgt.uni-miskolc
.hu/"
)
#
driver.find_element_by_css_selector("a[href*='/login/']").click()
#
self.login()
vm
.
state
,
vm
.
protocol
=
""
,
"NONE"
try
:
while
vm
.
state
.
upper
()[:
3
]
not
in
(
"FUT"
,
"RUN"
):
element
=
WebDriverWait
(
driver
,
7200
)
.
until
(
EC
.
presence_of_element_located
((
By
.
CSS_SELECTOR
,
"#vm-details-pw-eye.icon-eye-close"
)))
vm
.
state
=
driver
.
find_element_by_css_selector
(
"#vm-details-state > span"
)
.
text
#cl: connection string converted to list
cl
=
driver
.
find_element_by_css_selector
(
"#vm-
info-pane > input
"
)
.
get_attribute
(
"value"
)
.
split
()
cl
=
driver
.
find_element_by_css_selector
(
"#vm-
details-connection-string
"
)
.
get_attribute
(
"value"
)
.
split
()
if
cl
[
0
]
==
"sshpass"
:
vm
.
protocol
=
"SSH"
vm
.
user
,
vm
.
host
=
cl
[
6
]
.
split
(
"@"
)
...
...
@@ -140,6 +141,12 @@ class Browser:
def
main
():
args
=
pars_arguments
()
if
args
.
uri
is
not
None
:
vm
=
Struct
()
vm
.
protocol
,
vm
.
user
,
vm
.
password
,
vm
.
host
,
vm
.
port
=
args
.
uri
.
split
(
':'
,
4
)
vm
.
protocol
=
vm
.
protocol
.
upper
()
vm
.
state
=
"RUN"
else
:
browser
=
Browser
(
args
)
if
args
.
old
:
vm
=
browser
.
old_main
()
...
...
@@ -155,4 +162,3 @@ def main():
if
__name__
==
"__main__"
:
main
()
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