summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormichael pereira2011-04-15 15:27:50 +0200
committermichael pereira2011-04-15 15:27:50 +0200
commit542374744d60c8cd0fc934e932f8b32b383e87d5 (patch)
tree11b91ad4c6478032ce342714c13b39dc9f4c63ca
parent#213 404 wird geschickt wenn die resource nicht auf dem server liegt (diff)
parentDownloadstatus der Dateien in der FBGui (diff)
downloadpbs2-542374744d60c8cd0fc934e932f8b32b383e87d5.tar.gz
pbs2-542374744d60c8cd0fc934e932f8b32b383e87d5.tar.xz
pbs2-542374744d60c8cd0fc934e932f8b32b383e87d5.zip
Merge branch 'master' of openslx.org:lsfks/master-teamprojekt/pbs2
-rw-r--r--application/modules/fbgui/controllers/IndexController.php22
-rw-r--r--application/modules/fbgui/views/scripts/auth/login.phtml7
-rw-r--r--application/modules/fbgui/views/scripts/index/index.phtml45
-rw-r--r--application/modules/fbgui/views/scripts/index/start.phtml57
-rw-r--r--application/modules/fbgui/views/scripts/person/selectmembership.phtml7
-rw-r--r--public/media/css/fbgui.css14
-rw-r--r--public/media/css/style.css3
-rw-r--r--public/media/img/keyboard.pngbin0 -> 323 bytes
-rw-r--r--public/media/img/os/login.pngbin0 -> 8437 bytes
-rw-r--r--public/media/img/os/login_small.pngbin0 -> 4943 bytes
10 files changed, 119 insertions, 36 deletions
diff --git a/application/modules/fbgui/controllers/IndexController.php b/application/modules/fbgui/controllers/IndexController.php
index aba88db..119c810 100644
--- a/application/modules/fbgui/controllers/IndexController.php
+++ b/application/modules/fbgui/controllers/IndexController.php
@@ -25,11 +25,9 @@ class Fbgui_IndexController extends Zend_Controller_Action
{
$mySession = new Zend_Session_Namespace('pbs');
- if(!isset($mySession->postdata))
+ if(count($mySession->postdata)<=0)
$mySession->postdata = $_POST;
- print_a($mySession->postdata);
-
$d = new Pbs_Debug();
$d->debug(array('FBGuiIndexController',$_SERVER['REMOTE_ADDR'],implode("\t",$mySession->postdata)));
@@ -104,14 +102,18 @@ class Fbgui_IndexController extends Zend_Controller_Action
$bootmenuentriesMapper = new Application_Model_BootMenuEntriesMapper();
$res = $bootmenuentriesMapper->findBy(array('bootmenuID' => $bootmenuID),false);
$this->view->entries = $res;
- if (!Zend_Auth::getInstance()->hasIdentity()) {
- #echo "<a href='/fbgui/auth/login/'>Goto Login to get your Bootmenu</a>";
- $pbsNotifier = new Pbs_Notifier();
- $this->view->notification = $pbsNotifier->notify("This is not your Bootmenu. You have to login to get your own Bootmenu.<br />Click here to <a href='/fbgui/auth/login/'>login</a>",'info');
+ #print_a(Zend_Auth::getInstance()->hasIdentity(),$bm->MembershipID ,$this->membership->getID());
+ if (!Zend_Auth::getInstance()->hasIdentity()) {
+ #$pbsNotifier = new Pbs_Notifier();
+ #$this->view->notification = $pbsNotifier->notify("This is not your Bootmenu. You have to login to get your own Bootmenu.<br />Click here to <a href='/fbgui/auth/login/'>login</a>",'info');
+ $this->view->loginmenu = true;
}
- if(Zend_Auth::getInstance()->hasIdentity() && $bm->MembershipID != $this->membership->getID() ){
+ if(Zend_Auth::getInstance()->hasIdentity()){
+ if($bm->MembershipID != '' && $bm->MembershipID == $this->membership->getID()){}
+ else{
$pbsNotifier = new Pbs_Notifier();
- $this->view->notification = $pbsNotifier->notify("This is not your Bootmenu. There is currently a BootMenu with a higher priority active.",'info');
+ $this->view->notification = $pbsNotifier->notify("This is not your Bootmenu. There is currently a BootMenu with a higher priority active.",'info');
+ }
}
}
else{
@@ -129,7 +131,7 @@ class Fbgui_IndexController extends Zend_Controller_Action
}
}
else{
- $this->_redirect('/fbgui/index/error/serialresult/noserial');
+ #$this->_redirect('/fbgui/index/error/serialresult/noserial');
}
}
diff --git a/application/modules/fbgui/views/scripts/auth/login.phtml b/application/modules/fbgui/views/scripts/auth/login.phtml
index 7bd6183..09724d4 100644
--- a/application/modules/fbgui/views/scripts/auth/login.phtml
+++ b/application/modules/fbgui/views/scripts/auth/login.phtml
@@ -3,4 +3,9 @@
$this->loginForm->setAction($this->url());
echo $this->loginForm;
?>
-<a href='#' onclick='toggleKeyboard();return false;'>show/hide on-screen keyboard</a>
+<button class='keyboardbutton' onclick='toggleKeyboard();return false;'>Show/Hide on-screen keyboard</button>
+<script>
+$(document).ready(function(){
+ $("#email").focus();
+});
+</script>
diff --git a/application/modules/fbgui/views/scripts/index/index.phtml b/application/modules/fbgui/views/scripts/index/index.phtml
index d5fc8f6..38967fa 100644
--- a/application/modules/fbgui/views/scripts/index/index.phtml
+++ b/application/modules/fbgui/views/scripts/index/index.phtml
@@ -1,21 +1,30 @@
<?php if($this->notification != ''){echo $this->notification;} ?>
+<?php if($this->loginmenu):?>
+<div class="fbguilogin selectswitch" style=''>
+ <div style='font-size:16px;font-weight:bold;margin-bottom:5px;'>Login</div>
+ <i>This is not your Bootmenu. Select this to get your own Bootmenu.</i>
+ <input type="hidden" class="id" value="login"/>
+</div>
+<?php endif; ?>
<?php if(isset($this->entries)):?>
<script type="text/javascript">
var activeElement = 0;
$(document).ready(function(){
- $('.menu').click(function(){
- $('.menu').removeClass('selected');
+ $('.selectswitch').click(function(){
+ $('.selectswitch').removeClass('selected');
$(this).addClass('selected');
$("#selectedBootOs").val($(this).find('.id').val());
$("#startball").attr('src','/media/img/button-green.png');
+ $("#startbutton").focus();
});
- $('.menu').eq(activeElement).click();
+ $('.bootmenu .selectswitch').eq(activeElement).click();
$('#startbutton').focus();
- $('.menu').dblclick(function(){
- $('.menu').removeClass('selected');
+ $('.selectswitch').dblclick(function(){
+ $('.selectswitch').removeClass('selected');
$(this).addClass('selected');
$("#selectedBootOs").val($(this).find('.id').val());
$("#startball").attr('src','/media/img/button-green.png');
+ $("#startbutton").focus();
start();
});
@@ -25,12 +34,12 @@
// up
if(activeElement >=1)
activeElement = activeElement-1;
- $('.menu').eq(activeElement).click();
+ $('.selectswitch').eq(activeElement).click();
} else if (event.keyCode == 40) {
// Down
- if(activeElement < $('.menu').length-1 )
+ if(activeElement < $('.selectswitch').length-1 )
activeElement = activeElement+1;
- $('.menu').eq(activeElement).click();
+ $('.selectswitch').eq(activeElement).click();
}
});
});
@@ -38,7 +47,11 @@
});
function start(){
if($('#selectedBootOs').val() != ''){
- window.location='/fbgui/index/start/bme/'+$('#selectedBootOs').val()+'/a/<?php echo $this->alphasessionID;?>';
+ if($('#selectedBootOs').val() == 'login'){
+ window.location='/fbgui/auth/login/a/<?php echo $this->alphasessionID;?>'
+ } else{
+ window.location='/fbgui/index/start/bme/'+$('#selectedBootOs').val()+'/a/<?php echo $this->alphasessionID;?>';
+ }
}
else{
alert('You have to select a BootOs');
@@ -46,15 +59,16 @@
}
</script>
<h1><?php echo $this->title;?></h1>
- <?php $first = true; ?>
- <?php foreach($this->entries as $entry):?>
+ <div class='bootmenu'>
+ <?php $first = true;
+ ?>
+ <?php foreach($this->entries as $k=>$entry):?>
<?php
$bootosMapper = new Application_Model_BootOsMapper();
$bootos = new Application_Model_BootOs();
- $bootos = $bootosMapper->find($entry->getBootosID());
-
+ $bootos = $bootosMapper->find($entry->getBootosID());
?>
- <div id="menu_item_1" class="menu" class="flexbox">
+ <div id="menu_item_<?php echo $k;?>" class="menu selectswitch" class="flexbox">
<img src="/media/img/os/ubuntu.png" />
<h2><?php echo $entry->getTitle(); ?></h2>
<i>BootOs-Name: <?php echo $bootos->getTitle();?></i>
@@ -62,8 +76,11 @@
<input type="hidden" class="id" value="<?php echo $entry->getID();?>"/>
</div>
<?php endforeach; ?>
+ </div>
<input style="display:none;" type='text' id="selectedBootOs" />
<button style='cursor:pointer;float:right;margin-top:10px;' id='startbutton' onClick="start();"><img id='startball' src='/media/img/button-red.png'> <span style='font-size:14px;'>Start System</span></button>
<div class='clear'></div>
<?php if($this->notificationbot != ''){echo $this->notificationbot;} ?>
+
+
<?php endif;?>
diff --git a/application/modules/fbgui/views/scripts/index/start.phtml b/application/modules/fbgui/views/scripts/index/start.phtml
index 6737fc5..e6a7936 100644
--- a/application/modules/fbgui/views/scripts/index/start.phtml
+++ b/application/modules/fbgui/views/scripts/index/start.phtml
@@ -68,6 +68,20 @@
from {-webkit-transform:scale(0.5) rotate(0deg);}
to {-webkit-transform:scale(0.5) rotate(360deg);}
} */
+#downloadinfo .downloadelement{
+ clear:both;
+ padding-top:10px;
+ padding-bottom:10px;
+}
+#downloadinfo .downloadelement .label{
+ float:left;
+ padding:5px;
+ width:200px;
+}
+#downloadinfo .downloadelement .status{
+ margin-left:205px;
+ padding:5px;
+}
</style>
<script type="text/javascript">
@@ -86,15 +100,40 @@
}
window.setTimeout(rotate, 100);
+function bytesToSize(bytes) {
+ var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
+ if (bytes == 0) return 'n/a';
+ var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));
+ return Math.round(bytes / Math.pow(1024, i), 2) + ' ' + sizes[[i]];
+}
function updateProgress(p, s, u){
- if (p >= 0 && p <= 100)
- $("#progressbar").progressbar({ value: p });
- else
- $("#progressbar").progressbar({ value: 0 });
+ if (p >= 0 && p <= 100){
+ $(".progressbar:last").progressbar({ value: p });
+ $(".downloadelement .status:last").html("Downloading...<br>"+p+"% - "+s+" "+u);
+ }else{
+ $(".progressbar:last").progressbar({ value: 0 });
+ }
+}
+function downloadInfo(filename, filesize){
+ $(".downloadelement .status").html("Complete");
+ $(".progressbar:last").progressbar({ value: 100});
+ $("#downloadinfo").append("<div class='downloadelement'>"+
+ '<div class="progressbar" style="height: 15px;"></div>'+
+ "<div class='label'>"+
+ "<div><b>File: </b>"+filename+"</div>"+
+ "<div><b>Filesize:</b> "+bytesToSize(filesize)+"</div>"+
+ "</div>"+
+ "<div class='status'>Downloading...</div>"+
+ "</div>");
+ $(".progressbar:last").progressbar({ value: 0 });
}
+function allComplete(){
+ $(".downloadelement .status").html("Complete");
+ $(".progressbar").progressbar({ value: 100});
+}
+
$(document).ready(function() {
- $("#progressbar").progressbar({ value: 0 });
});
</script>
@@ -109,16 +148,20 @@ function updateProgress(p, s, u){
<div class="bar7"></div>
<div class="bar8"></div>
</div>
-<a href='/fbgui'>back</a>
-<div id="progressbar" style="height: 15px;"></div>
<h1>Downloading</h1>
+<div id='downloadinfo'>
+
+</div>
+
<script type="text/javascript">
fbgui.setCallbackOnFinished('foo();');
fbgui.startDownload('http://<?php echo $this->host; ?>/resource/getkernel/alpha/<?php echo $this->alphasessionID; ?>/file/kernel');
fbgui.startDownload('http://<?php echo $this->host; ?>/resource/getinitramfs/alpha/<?php echo $this->alphasessionID; ?>/file/initramfs');
fbgui.startDownload('http://<?php echo $this->host; ?>/resource/getkcl/alpha/<?php echo $this->alphasessionID; ?>/file/kcl');
function foo(){
+ allComplete();
fbgui.quit();
+
}
</script>
diff --git a/application/modules/fbgui/views/scripts/person/selectmembership.phtml b/application/modules/fbgui/views/scripts/person/selectmembership.phtml
index 5f7e5bf..e226b82 100644
--- a/application/modules/fbgui/views/scripts/person/selectmembership.phtml
+++ b/application/modules/fbgui/views/scripts/person/selectmembership.phtml
@@ -2,4 +2,9 @@
<?php
$this->membershipSelectForm->setAction($this->url());
echo $this->membershipSelectForm;
-?> \ No newline at end of file
+?>
+<script>
+$(document).ready(function(){
+ $("#membershipID").focus();
+});
+</script>
diff --git a/public/media/css/fbgui.css b/public/media/css/fbgui.css
index ceae559..5546bb1 100644
--- a/public/media/css/fbgui.css
+++ b/public/media/css/fbgui.css
@@ -23,11 +23,11 @@ div.menu>img {
}
.selected {
- border: 1px solid #9999FF;
+ border: 1px solid #9999FF !important;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
border-radius: 6px;
- background-color: #F2F2FF;
+ background-color: #F2F2FF !important;
}
.right{
@@ -44,4 +44,12 @@ div.menu>img {
width:100%;
text-align: left;
}
-
+.fbguilogin{
+ background: url("/media/img/os/login_small.png") no-repeat scroll 5px center #FFFFFF;
+ padding:5px 5px 5px 45px;
+ color:#777777;
+ border:1px solid #CCCCCC;
+ -moz-border-radius:6px;
+ -webkit-border-radius: 6px;
+ border-radius:6px;
+}
diff --git a/public/media/css/style.css b/public/media/css/style.css
index 3cbe1e3..80b504c 100644
--- a/public/media/css/style.css
+++ b/public/media/css/style.css
@@ -329,6 +329,9 @@ div.dsf{
.searchbutton:before {
content: url(/media/img/search.png) ' ';
}
+.keyboardbutton:before {
+ content: url(/media/img/keyboard.png) ' ';
+}
.rightbutton {
float: right;
diff --git a/public/media/img/keyboard.png b/public/media/img/keyboard.png
new file mode 100644
index 0000000..83ef47d
--- /dev/null
+++ b/public/media/img/keyboard.png
Binary files differ
diff --git a/public/media/img/os/login.png b/public/media/img/os/login.png
new file mode 100644
index 0000000..0767c42
--- /dev/null
+++ b/public/media/img/os/login.png
Binary files differ
diff --git a/public/media/img/os/login_small.png b/public/media/img/os/login_small.png
new file mode 100644
index 0000000..29048f0
--- /dev/null
+++ b/public/media/img/os/login_small.png
Binary files differ