309 |
FROM backups |
FROM backups |
310 |
INNER JOIN shares ON backups.shareID=shares.ID |
INNER JOIN shares ON backups.shareID=shares.ID |
311 |
INNER JOIN hosts ON backups.hostID = hosts.ID |
INNER JOIN hosts ON backups.hostID = hosts.ID |
312 |
LEFT OUTER JOIN archive_backup ON archive_backup.backup_id = backups.id AND archive_backup.backup_id IS NULL |
LEFT OUTER JOIN archive_backup ON archive_backup.backup_id = backups.id |
313 |
WHERE backups.size > 0 |
WHERE backups.size > 0 AND archive_backup.backup_id IS NULL |
314 |
GROUP BY |
GROUP BY |
315 |
backups.hostID, |
backups.hostID, |
316 |
hosts.name, |
hosts.name, |
352 |
<style> |
<style> |
353 |
<!-- |
<!-- |
354 |
|
|
355 |
div#fixedBox |
div#fixedBox { |
356 |
{ |
position: absolute; |
357 |
position: absolute; |
bottom: 1em; |
358 |
bottom: 1em; |
left: 0.5em; |
359 |
left: 0.5em; |
padding: 0.5em; |
360 |
padding: 0.5em; |
width: 10em; |
361 |
width: 10em; |
background: #e0f0e0; |
362 |
background: #e0f0e0; |
border: 1px solid #00ff00; |
363 |
border: 1px solid #00ff00; |
} |
364 |
} |
@media screen { |
365 |
@media screen |
div#fixedBox { |
366 |
{ |
position: fixed; |
367 |
div#fixedBox |
} |
368 |
{ |
/* Don't do this at home */ |
369 |
position: fixed; |
* html { |
370 |
} |
overflow-y: hidden; |
371 |
/* Don't do this at home */ |
} |
372 |
* html |
* html body { |
373 |
{ |
overflow-y: auto; |
374 |
overflow-y: hidden; |
height: 100%; |
375 |
} |
padding: 0 1em 0 12em; |
376 |
* html body |
font-size: 100%; |
377 |
{ |
} |
378 |
overflow-y: auto; |
* html div#fixedBox { |
379 |
height: 100%; |
position: absolute; |
380 |
padding: 0 1em 0 12em; |
} |
381 |
font-size: 100%; |
/* All done. */ |
382 |
} |
} |
383 |
* html div#fixedBox |
|
384 |
{ |
#mContainer { |
385 |
position: absolute; |
position: relative; |
386 |
} |
width: 100%; |
387 |
/* All done. */ |
height: 1.1em; |
388 |
} |
padding: 0px; |
389 |
|
border: 1px solid #000000; |
390 |
|
} |
391 |
|
|
392 |
|
#gradient { |
393 |
|
position: absolute; |
394 |
|
top: 0px; |
395 |
|
left: 0px; |
396 |
|
width: 100%; |
397 |
|
height: 100%; |
398 |
|
display: block; |
399 |
|
background-color: #ffff00; |
400 |
|
} |
401 |
|
|
402 |
|
#mask { |
403 |
|
position: absolute; |
404 |
|
top: 0px; |
405 |
|
left: 0px; |
406 |
|
width: 100%; |
407 |
|
height: 100%; |
408 |
|
display: block; |
409 |
|
font-size: 1px; |
410 |
|
background-color: #FFFFFF; |
411 |
|
overflow: hidden; |
412 |
|
} |
413 |
|
|
414 |
|
#progressIndicator { |
415 |
|
position: absolute; |
416 |
|
top: 0px; |
417 |
|
left: 0px; |
418 |
|
width: 100%; |
419 |
|
height: 100%; |
420 |
|
display: block; |
421 |
|
font-weight: bold; |
422 |
|
color: #404040; |
423 |
|
font-size: 10pt; |
424 |
|
text-align: center; |
425 |
|
} |
426 |
|
|
427 |
--> |
--> |
428 |
</style> |
</style> |
430 |
<!-- |
<!-- |
431 |
|
|
432 |
var debug_div = null; |
var debug_div = null; |
433 |
|
var media_size = 4400 * 1024; |
434 |
|
|
435 |
function debug(msg) { |
function debug(msg) { |
436 |
// return; // Disable debugging |
// return; // Disable debugging |
462 |
function checkAll(location) { |
function checkAll(location) { |
463 |
var len = element_id('forma').elements.length; |
var len = element_id('forma').elements.length; |
464 |
var check_all = element_id('allFiles'); |
var check_all = element_id('allFiles'); |
465 |
|
var suma = 0; |
466 |
|
|
467 |
for (var i = 0; i < len; i++) { |
for (var i = 0; i < len; i++) { |
468 |
|
|
469 |
var e = element_id('forma').elements[i]; |
var e = element_id('forma').elements[i]; |
470 |
if ((e.checked || !e.checked) && e.name != 'all') { |
if (e.name != 'all' && e.name.substr(0,3) == 'fcb') { |
471 |
if (check_all.checked) { |
if (check_all.checked) { |
472 |
e.checked = true; |
var el = element_id("fss" + e.name.substr(3)); |
473 |
|
var size = parseInt(el.value) || 0; |
474 |
|
debug('suma: '+suma+' size: '+size); |
475 |
|
if ((suma + size) < media_size) { |
476 |
|
suma += size; |
477 |
|
e.checked = true; |
478 |
|
} else { |
479 |
|
break; |
480 |
|
} |
481 |
} else { |
} else { |
482 |
e.checked = false; |
e.checked = false; |
483 |
} |
} |
484 |
} |
} |
485 |
} |
} |
486 |
|
update_sum(suma); |
487 |
|
} |
488 |
|
|
489 |
sumiraj(); |
function update_sum(suma) { |
490 |
|
element_id('forma').totalsize.value = suma; |
491 |
|
pbar_set(suma, media_size); |
492 |
|
debug('total size: '+suma); |
493 |
} |
} |
494 |
|
|
495 |
function sumiraj(e) { |
function sumiraj(e) { |
496 |
var suma = parseInt(element_id('forma').totalsize.value) || 0; |
var suma = parseInt(element_id('forma').totalsize.value) || 0; |
497 |
var len = element_id('forma').elements.length; |
var len = element_id('forma').elements.length; |
512 |
} |
} |
513 |
} |
} |
514 |
} |
} |
515 |
element_id('forma').totalsize.value = suma; |
update_sum(suma); |
|
debug('total size: '+suma); |
|
516 |
return suma; |
return suma; |
517 |
} |
} |
518 |
|
|
519 |
|
/* progress bar */ |
520 |
|
|
521 |
|
var _pbar_width = 0; |
522 |
|
var _pbar_warn = 10; // change color in last 10% |
523 |
|
|
524 |
|
function pbar_reset() { |
525 |
|
element_id("mask").style.left = "0px"; |
526 |
|
_pbar_width = element_id("mContainer").offsetWidth - 2; |
527 |
|
element_id("mask").style.width = _pbar_width + "px"; |
528 |
|
element_id("progressIndicator").style.zIndex = 10; |
529 |
|
element_id("mask").style.display = "block"; |
530 |
|
element_id("progressIndicator").innerHTML = "0"; |
531 |
|
} |
532 |
|
|
533 |
|
function dec2hex(d) { |
534 |
|
var hch="0123456789ABCDEF"; |
535 |
|
var a=d%16; |
536 |
|
var q=(d-a)/16; |
537 |
|
return hch.charAt(q)+hch.charAt(a); |
538 |
|
} |
539 |
|
|
540 |
|
|
541 |
|
function pbar_set(amount, max) { |
542 |
|
|
543 |
|
debug('pbar_set( '+amount+' , '+max+' )'); |
544 |
|
|
545 |
|
curWidth = parseInt(element_id("mask").offsetWidth); |
546 |
|
curLeft = parseInt(element_id("mask").offsetLeft); |
547 |
|
|
548 |
|
|
549 |
|
var pcnt = Math.floor( amount * 100 / max ); |
550 |
|
var p90 = 100 - _pbar_warn; |
551 |
|
var pcol = pcnt - p90; |
552 |
|
if (pcol < _pbar_warn) { |
553 |
|
if (pcol < 0) pcol = 0; |
554 |
|
var e = element_id("submitBurner"); |
555 |
|
if (e && e.disabled) { |
556 |
|
debug('enable_button'); |
557 |
|
var a = e.getAttributeNode('disabled') || null; |
558 |
|
if (a) e.removeAttributeNode(a); |
559 |
|
} |
560 |
|
} else if (pcol > _pbar_warn) { |
561 |
|
debug('disable button'); |
562 |
|
pcol = _pbar_warn; |
563 |
|
var e = element_id("submitBurner"); |
564 |
|
if (! e.disabled) e.disabled = true; |
565 |
|
} |
566 |
|
var col_g = Math.floor( ( _pbar_warn - pcol ) * 255 / _pbar_warn ); |
567 |
|
var col = '#ff' + dec2hex( col_g ) + '00'; |
568 |
|
|
569 |
|
//debug('pcol: '+pcol+' g:'+col_g+' _pbar_warn:'+ _pbar_warn + ' color: '+col); |
570 |
|
element_id("gradient").style.backgroundColor = col; |
571 |
|
|
572 |
|
var size = parseInt( _pbar_width * amount / max ); |
573 |
|
|
574 |
|
curWidth = _pbar_width - size; |
575 |
|
curLeft = size ; |
576 |
|
|
577 |
|
//debug('size: '+size+' curWidth '+curWidth+' curLeft: '+curLeft); |
578 |
|
|
579 |
|
element_id("progressIndicator").innerHTML = pcnt + '%'; |
580 |
|
//element_id("progressIndicator").innerHTML = amount; |
581 |
|
|
582 |
|
if (curLeft > _pbar_width) { |
583 |
|
element_id("mask").style.display = "none"; |
584 |
|
return; |
585 |
|
} else { |
586 |
|
element_id("mask").style.display = ""; |
587 |
|
} |
588 |
|
|
589 |
|
//if(parseInt(element_id("mask").offsetWidth)>10) |
590 |
|
element_id("mask").style.width = curWidth + "px"; |
591 |
|
element_id("mask").style.left = curLeft + "px"; |
592 |
|
|
593 |
|
} |
594 |
|
|
595 |
if (!self.body) self.body = new Object(); |
if (!self.body) self.body = new Object(); |
596 |
self.onload = self.document.onload = self.body.onload = function() { |
self.onload = self.document.onload = self.body.onload = function() { |
597 |
|
pbar_reset(); |
598 |
sumiraj(); |
sumiraj(); |
599 |
} |
} |
600 |
|
|
604 |
|
|
605 |
Size: |
Size: |
606 |
<input type="text" name="totalsize" size="7" readonly> |
<input type="text" name="totalsize" size="7" readonly> |
607 |
|
|
608 |
|
<div id="mContainer"> |
609 |
|
<div id="gradient"></div> |
610 |
|
<div id="mask"></div> |
611 |
|
<div id="progressIndicator"> </div> |
612 |
|
</div> |
613 |
|
|
614 |
<br/> |
<br/> |
615 |
Note: |
Note: |
616 |
<br/> |
<br/> |
617 |
<textarea name="note" cols="10" rows="5"> |
<textarea name="note" cols="10" rows="5"> |
618 |
</textarea> |
</textarea> |
619 |
<br/> |
<br/> |
620 |
<input type="submit" value="Burn selected" name="submitBurner"> |
<input type="submit" id="submitBurner" value="Burn selected" name="submitBurner"> |
621 |
|
|
622 |
</div> |
</div> |
623 |
<div id="debug" style="float: right; width: 10em; border: 1px #ff0000 solid; background-color: #ffe0e0; -moz-opacity: 0.7;"> |
<div id="debug" style="float: right; width: 10em; border: 1px #ff0000 solid; background-color: #ffe0e0; -moz-opacity: 0.7;"> |
660 |
'<tr' . $color[$i %2 ] . '> |
'<tr' . $color[$i %2 ] . '> |
661 |
<td class="fview">'; |
<td class="fview">'; |
662 |
# FIXME |
# FIXME |
663 |
#$backup->{'fs_size'} = int($backup->{'size'} * 1024); |
$backup->{'fs_size'} = int($backup->{'size'} * 1024); |
664 |
if (($backup->{'fs_size'} || 0) > 0) { |
if (($backup->{'fs_size'} || 0) > 0) { |
665 |
$retHTML .= ' |
$retHTML .= ' |
666 |
<input type="checkbox" name="fcb' . |
<input type="checkbox" name="fcb' . |