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
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
Commit
dc494113
authored
Nov 13, 2012
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
connect only if booted
parent
4dd1f4cc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
20 deletions
+6
-20
one/templates/show.html
+4
-19
one/views.py
+2
-1
No files found.
one/templates/show.html
View file @
dc494113
...
...
@@ -3,23 +3,8 @@
{% block js %}
<script
type=
"text/javascript"
>
{
%
if
state
==
"PENDING"
%
}
setTimeout
(
"location.reload(true);"
,
1500
)
{
%
endif
%
}
{
%
if
state
==
"ACTIVE"
%
}
{
%
if
age
<
15
%
}
setTimeout
(
"document.getElementById('wait').style.display='none';document.getElementById('connect').style.display='block';"
,
15000
-
{{
age
}}
000
);
{
%
endif
%
}
var
meloading
=
false
;
function
connectbutton
()
{
if
(
meloading
)
{
return
false
;
}
meloading
=
true
;
setTimeout
(
"document.getElementById('connecting').style.display='none';meloading=false;"
,
15000
);
document
.
getElementById
(
'connecting'
).
style
.
display
=
'inline'
;
return
true
;
}
{
%
if
booting
%
}
setTimeout
(
"location.reload(true);"
,
2000
);
{
%
endif
%
}
</script>
{% endblock %}
...
...
@@ -29,14 +14,14 @@
<div
class=
"contentblock"
id=
"state"
>
<h2>
{{name}}
</h2>
<div
class=
"content"
>
{% if state == "PENDING" %}
{% if state == "PENDING"
or state == "ACTIVE" and booting
%}
<p
style=
"font-size:25px; line-height:2em;text-align:center;"
><img
src=
"/static/load-2.gif"
/>
Gép indítása..
</p>
<p
style=
"font-size:25px; line-height:2em;text-align:center;"
>
<form
action=
"{% url vm_delete id %}"
method=
"post"
onsubmit=
"return confirm('Biztosan törli a gépet?')"
>
{% csrf_token %}
<input
type=
"submit"
class=
"icon-delete"
value=
"Törlés"
/></form>
<a
href=
"/"
><img
src=
"/static/icons/Go-home.png"
alt=
"<-"
/></a>
</p>
{% endif %}
{% if state == "ACTIVE" %}
{% if state == "ACTIVE"
and not booting
%}
{% if age
<
15
%}
<
p
id=
"wait"
style=
"font-size:25px; line-height:2em;text-align:center;"
><img
src=
"/static/load-2.gif"
/>
Gép indítása...
</p>
<p
id=
"connect"
style=
"display:none; font-size:25px; line-height:2em;text-align:center;"
>
...
...
one/views.py
View file @
dc494113
...
...
@@ -105,7 +105,8 @@ def vm_show(request, iid):
'id'
:
iid
,
'age'
:
inst
.
get_age
(),
'instances'
:
_list_instances
(
request
),
'i'
:
inst
'i'
:
inst
,
'booting'
:
inst
.
active_since
,
}))
class
VmDeleteView
(
View
):
...
...
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