Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
synnefo
Commits
838c1bfd
Commit
838c1bfd
authored
Mar 30, 2011
by
Georgios Gousios
Browse files
Merge branch 'master' of
https://code.grnet.gr/git/synnefo
parents
48f6d2f2
18ef8cf4
Changes
5
Hide whitespace changes
Inline
Side-by-side
DEVELOP.txt
View file @
838c1bfd
...
...
@@ -103,8 +103,22 @@ Install the postgres Python library
$ bin/pip install psycopg2
Configure a postgres db/account for synnefo
<TODO>
Become the postgres user, connect to PostgreSQL:
$ sudo su - postgres
$ psql
Run the following commands:
DROP DATABASE synnefo;
DROP USER username;
CREATE USER username WITH PASSWORD 'password';
CREATE DATABASE synnefo;
GRANT ALL PRIVILEGES ON DATABASE synnefo TO username;
ALTER DATABASE synnefo OWNER TO username;
ALTER USER username CREATEDB;
The last line enables the newly created user to create own databases. This is
needed for Django to create and drop the test_synnefo database for unit
testing.
4. At this point you should have a working DB. Now configure Django to access it:
Copy the default configuration file
...
...
ui/static/main.css
View file @
838c1bfd
...
...
@@ -518,7 +518,7 @@ div.machine {
div
.machine
div
.actions
{
float
:
right
;
width
:
70px
;
margin
:
-6
0px
-70px
0
0
;
margin
:
0px
-70px
0
0
;
font-weight
:
normal
;
}
...
...
@@ -933,9 +933,11 @@ div.action_error {
}
div
.confirm_multiple
{
width
:
690px
;
position
:
fixed
;
bottom
:
0
;
width
:
700px
;
height
:
30px
;
margin
:
0
0
1
0px
-3
0
px
;
margin
:
0
0
0px
-3
6
px
;
}
div
.confirm_multiple
p
{
...
...
@@ -1085,22 +1087,25 @@ div.list table #selection div.expand-icon {
top
:
-11px
;
}
div
.list
table
thead
tr
th
ul
{
ul
.dropdown-selector
{
background-color
:
#E6EEEE
;
position
:
absolute
;
margin-left
:
-4
px
;
margin-left
:
1
px
;
display
:
block
;
top
:
255px
;
font-size
:
9pt
;
width
:
40px
;
}
div
.list
table
thead
tr
th
ul
li
{
padding
:
5
px
;
ul
.dropdown-selector
li
{
padding
:
4
px
;
}
div
.list
table
thead
tr
th
ul
li
:hover
{
ul
.dropdown-selector
li
:hover
{
background-color
:
#87AADE
;
}
div
.list
table
thead
tr
th
ul
li
a
{
ul
.dropdown-selector
li
a
{
color
:
black
;
text-decoration
:
none
;
}
...
...
@@ -1146,7 +1151,10 @@ div.list table thead #name {
}
.wave
{
background
:
url("../static/wave.gif")
!important
;
border
:
none
;
margin
:
-5px
0px
0
0px
!important
;
float
:
right
!important
;
clear
:
both
;
}
.hidden
{
...
...
ui/static/wave.gif
View replaced file @
48f6d2f2
View file @
838c1bfd
4.7 KB
|
W:
|
H:
4.79 KB
|
W:
|
H:
2-up
Swipe
Onion skin
ui/templates/list.html
View file @
838c1bfd
...
...
@@ -25,12 +25,7 @@
<tr>
<th
id=
"selection"
class=
"select-running"
>
<input
type=
"checkbox"
/>
<div
class=
"expand-icon"
></div>
<ul
style=
"display: none"
>
<li
class=
"select-all"
><a
href=
"#"
>
all
</a></li>
<li
class=
"select-none"
><a
href=
"#"
>
none
</a></li>
<li
class=
"select-group"
><a
href=
"#"
>
group
</a></li>
</ul>
<div
class=
"expand-icon"
></div>
</th>
<th
id=
"os"
>
OS
</th>
<th
id=
"name"
>
Name
</th>
...
...
@@ -41,6 +36,11 @@
</thead>
<tbody
class=
"machines"
></tbody>
</table>
<ul
class=
"dropdown-selector"
style=
"display: none"
>
<li
class=
"select-all"
><a
href=
"#"
>
all
</a></li>
<li
class=
"select-none"
><a
href=
"#"
>
none
</a></li>
<li
class=
"select-group"
><a
href=
"#"
>
group
</a></li>
</ul>
</div>
<script>
...
...
@@ -54,33 +54,33 @@ $("table thead tr th#selection :checkbox").live('change', function() {
$
(
"
:checkbox
"
).
attr
(
"
checked
"
,
false
);
}
updateActions
();
return
false
;
});
// select all/none/group from drop down menu
$
(
"
table thead tr th#selection ul li
"
).
live
(
'
click
'
,
function
()
{
// all or none?
if
(
$
(
this
).
attr
(
"
class
"
)
==
"
select-all
"
||
$
(
this
).
attr
(
"
class
"
)
==
"
select-none
"
)
{
var
all
=
(
$
(
this
).
attr
(
"
class
"
)
==
"
select-all
"
);
// toggle checkboxes
$
(
"
:checkbox
"
).
attr
(
"
checked
"
,
all
);
}
else
if
(
$
(
this
).
attr
(
"
class
"
)
==
"
select-group
"
){
// TODO: This shoud select only the vms in the selected group
// right now the folowing has the functionality of select-all
$
(
"
:checkbox
"
).
attr
(
"
checked
"
,
true
);
}
// update actions
updateActions
();
return
false
;
// select all from drop down menu
$
(
"
ul.dropdown-selector li.select-all a
"
).
live
(
'
click
'
,
function
()
{
$
(
"
:checkbox
"
).
attr
(
"
checked
"
,
true
);
$
(
"
.dropdown-selector
"
).
slideToggle
(
'
medium
'
);
return
false
;
});
// menu toggle, running menu
$
(
"
table.list-machines thead tr th#selection div.expand-icon
"
).
live
(
'
click
'
,
function
()
{
$
(
"
table.list-machines thead tr th#selection ul
"
).
slideToggle
(
'
medium
'
);
return
false
;
// select none from drop down menu
$
(
"
ul.dropdown-selector li.select-none a
"
).
live
(
'
click
'
,
function
()
{
$
(
"
:checkbox
"
).
attr
(
"
checked
"
,
false
);
$
(
"
.dropdown-selector
"
).
slideToggle
(
'
medium
'
);
return
false
;
});
$
(
"
table.list-machines thead tr th#selection ul
"
).
live
(
'
click
'
,
function
()
{
$
(
"
table.list-machines thead tr th#selection ul
"
).
slideToggle
(
'
medium
'
);
// select group from drop down menu
$
(
"
ul.dropdown-selector li.select-group a
"
).
live
(
'
click
'
,
function
()
{
$
(
"
:checkbox
"
).
attr
(
"
checked
"
,
true
);
$
(
"
.dropdown-selector
"
).
slideToggle
(
'
medium
'
);
return
false
;
});
// menu toggle, running menu
$
(
"
table.list-machines thead tr th#selection .expand-icon
"
).
click
(
function
(
obj
)
{
$
(
"
.dropdown-selector
"
).
slideToggle
(
'
medium
'
);
return
false
;
});
...
...
@@ -175,7 +175,7 @@ function update_machines_view(data){
current
=
-
1
;
// check server status to select the appropriate OS icon
osTag
=
image_tags
[
server
.
imageRef
]
var
osIcon
=
osTag
+
"
.png
"
;
var
osIcon
=
osTag
+
"
.png
"
,
imgStr
;
// check if the server already exists in the datatable
tableData
.
forEach
(
function
(
row
,
index
){
...
...
@@ -199,12 +199,24 @@ function update_machines_view(data){
if
([
'
ERROR
'
,
'
STOPPED
'
].
indexOf
(
server
.
status
)
>=
0
)
{
osIcon
=
osTag
+
"
-off.png
"
;
}
if
(
tableData
[
current
][
5
].
indexOf
(
STATUS_MESSAGES
[
server
.
status
])
>
-
1
){
imgStr
=
"
<img class=list-logo src=static/os_logos/
"
+
osIcon
+
"
title=
"
+
osTag
+
"
height=16 width=16 />
"
;
}
else
{
imgStr
=
"
<img class=list-logo src=static/wave.gif height=16 width=16 />
"
;
}
tableData
[
current
][
1
]
=
"
<span class=imagetag>
"
+
osTag
+
"
</span><img class=list-logo src=static/os_logos/
"
+
osIcon
+
"
title=
"
+
osTag
+
"
height=16 width=16>
"
;
"
</span>
"
+
imgStr
;
tableData
[
current
][
5
]
=
"
<span class=status>
"
+
STATUS_MESSAGES
[
server
.
status
]
+
"
</span>
"
;
// TODO: update name & ip
vmTable
.
fnUpdate
(
tableData
[
current
],
current
);
imgStr
=
"
<img class=list-logo src=static/os_logos/
"
+
osIcon
+
"
title=
"
+
osTag
+
"
height=16 width=16 />
"
;
tableData
[
current
][
1
]
=
"
<span class=imagetag>
"
+
osTag
+
"
</span>
"
+
imgStr
;
setTimeout
(
vmTable
.
fnUpdate
,
2000
,
tableData
[
current
],
current
);
}
updateActions
();
}
else
if
(
server
.
status
!=
"
DELETED
"
)
{
// does not exist, we should create it
...
...
@@ -236,8 +248,7 @@ function update_machines_view(data){
}
function
display_success
(
serverID
)
{
//TODO
$
(
'
#
'
+
serverID
).
parent
().
parent
().
find
(
'
.list-logo
'
).
attr
(
'
src
'
,
'
static/wave.gif
'
);
// do nothing
}
// indicate that the requested action was not completed
...
...
ui/templates/standard.html
View file @
838c1bfd
...
...
@@ -5,13 +5,20 @@
<div
id=
"emptymachineslist"
>
{% trans "You have no virtual machines! Press Create New to create some!" %}
</div>
<div
id=
"spinner"
></div>
<div
class=
"machine"
id=
"machine-template"
style=
"display:none"
>
<div
class=
"actions"
>
<a
href=
"#"
class=
"action-start"
>
{% trans "Start" %}
</a>
<a
href=
"#"
class=
"action-reboot"
>
{% trans "Reboot" %}
</a>
<a
href=
"#"
class=
"action-shutdown"
>
{% trans "Shutdown" %}
</a>
<a
href=
"#"
class=
"more"
>
{% trans "more
…
" %}
</a>
</div>
<div
class=
"state"
>
<div
class=
"status"
>
{% trans "Running" %}
</div>
<div
class=
"indicator"
></div>
<div
class=
"indicator"
></div>
<div
class=
"indicator"
></div>
<div
class=
"indicator"
></div>
<div
class=
"spinner hidden"
></div>
<div
class=
"spinner"
style=
"display:none"
></div>
<img
class=
"wave"
src=
""
/>
</div>
<img
class=
"logo"
src=
""
/>
<a
href=
"#"
class=
"name"
>
...
...
@@ -23,12 +30,7 @@
<h5
class=
"settings"
>
{% trans "Show:" %}
<a
href=
"#"
>
{% trans "disks" %}
</a>
|
<a
href=
"#"
>
{% trans "networks" %}
</a>
|
<a
href=
"#"
>
{% trans "group" %}
</a>
</h5>
<div
class=
"actions"
>
<a
href=
"#"
class=
"action-start"
>
{% trans "Start" %}
</a>
<a
href=
"#"
class=
"action-reboot"
>
{% trans "Reboot" %}
</a>
<a
href=
"#"
class=
"action-shutdown"
>
{% trans "Shutdown" %}
</a>
<a
href=
"#"
class=
"more"
>
{% trans "more
…
" %}
</a>
</div>
<div
class=
"confirm_single"
>
<button
class=
"yes"
>
{% trans "Confirm" %}
</button>
<button
class=
"no"
>
{% trans "Cancel" %}
</button>
...
...
@@ -201,7 +203,11 @@ function update_machines_view(data){
existing
.
remove
();
existing
=
moved
;
existing
.
find
(
'
.spinner
'
).
hide
();
}
}
else
{
existing
.
find
(
'
.spinner
'
).
hide
();
existing
.
find
(
'
.wave
'
).
attr
(
'
src
'
,
'
static/wave.gif
'
);
setTimeout
(
"
$('#
"
+
server
.
id
+
"
.wave').attr('src','')
"
,
3000
);
}
existing
.
find
(
"
.status
"
).
text
(
STATUS_MESSAGES
[
server
.
status
]);
}
...
...
@@ -243,8 +249,7 @@ function update_machines_view(data){
// indicate that the requested action was succesfully completed
function
display_success
(
serverID
)
{
$
(
'
#
'
+
serverID
+
'
.spinner
'
).
addClass
(
'
wave
'
);
setTimeout
(
"
$('#
"
+
serverID
+
"
.spinner').hide();$('#
"
+
serverID
+
"
.wave').removeClass('wave')
"
,
5000
);
}
// indicate that the requested action was not completed
...
...
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