Changeset 157
- Timestamp:
- 11/02/07 19:54:40 (14 months ago)
- Location:
- trunk
- Files:
-
- 5 modified
-
CHANGELOG (modified) (1 diff)
-
index.php (modified) (1 diff)
-
js/hellaworld.php (modified) (3 diffs)
-
templates/default.php (modified) (3 diffs)
-
templates/json.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/CHANGELOG
r155 r157 28 28 change has added options to the configuration file, please see the 29 29 README for details 30 31 * Added further automatic refresh support for remaining data that wasn't 32 already being refreshed by the 15 second automatic refresher [ticket:17] 30 33 31 34 1.8 -
trunk/index.php
r156 r157 174 174 case 11: 175 175 $c->shutdown(); 176 throw new Exception('HellaNZB Has been shut down'); 176 177 } 177 178 header('Location: ' . $protocol . '://' . $_SERVER['HTTP_HOST'] . $self); -
trunk/js/hellaworld.php
r153 r157 75 75 76 76 function updateData(json) { 77 var status = "<h1>HellaWorld</h1>"; 78 status += '<div><p><?php printf(_('HellaNZB %s - Uptime: %s'), "' + json.status.version + '", "' + json.status.uptime + '"); ?></p>'; 79 status += '<p><?php printf(_('Downloaded: %s files in %s segments totalling %sMB via %s NZB files'), "' + json.status.files + '", "' + json.status.segments + '", "' + json.status.totalmb + '", "' + json.status.totalnzbs + '"); ?></p></div>'; 80 $('#masthead').html(status); 77 81 var info = "<h2><?php echo _('Currently Downloading'); ?></h2>"; 78 82 if (json.downloading != null) { … … 99 103 } 100 104 $('#info').html(info); 105 status = '<?php printf(_('Queued: %s items totalling %sMB'), "' + json.queuelength + '", "' + json.queuesize + '"); ?>'; 106 $('#queuestatus').html(status) 107 var queue = ''; 101 108 if (json.queuelength > 0) { 102 var queue = '';103 109 for (i = 0; i < json.queuelength; i ++) { 104 110 queue += '<li id="order_' + json.queue[i].id + '" class="queuebox">'; … … 112 118 queue += '</div>'; 113 119 } 114 queue += '</li>'; 115 } 116 $('#queue').html(queue); 117 makeSortable(); 118 } else { 119 $('#queue').html(''); 120 } 121 if (json.finished && json.finished.length > 0) { 120 queue += '</li>'; 121 } 122 } else { 123 queue += '<li class="queuebox" style="text-align: center; font-weight: bold;"><?php echo _('Queue is empty'); ?></li>'; 124 } 125 $('#queue').html(queue); 126 makeSortable(); 127 if (json.showfinished) { 128 $('#finishedcount').html('<?php printf(_('Finished items: %s'), "' + json.finishedlength + '"); ?>'); 129 } 130 if (json.showfinished) { 122 131 var finished = ''; 123 for (i = 0; i < json.finished.length; i++) { 124 finished += '<li class="queuebox ' + json.finished[i].type + '">'; 125 finished += '<div class="queuetitle">' + json.finished[i].archiveName + '</div>'; 126 finished += '<ul class="queuecontrols"><li class="control"><a href="index.php?removefinished=' + json.finished[i].index + '"><?php echo _('Remove'); ?></a></li></ul>'; 127 finished += '<div class="queuestats"><?php printf(_('Finished on: %s Processing Time: %s'), "' + json.finished[i].finishedTime + '", "' + json.finished[i].elapsedTime"); ?>; 128 if (json.finished[i].parMessage != '') { 129 finished += '<?php printf(_(' Par message: %s'), "' + json.finished[i].parMessage"); ?>; 132 if (json.finished.length > 0) { 133 for (i = 0; i < json.finished.length; i++) { 134 finished += '<li class="queuebox ' + json.finished[i].type + '">'; 135 finished += '<div class="queuetitle">' + json.finished[i].archiveName + '</div>'; 136 finished += '<ul class="queuecontrols"><li class="control"><a href="index.php?removefinished=' + json.finished[i].index + '"><?php echo _('Remove'); ?></a></li></ul>'; 137 finished += '<div class="queuestats"><?php printf(_('Finished on: %s Processing Time: %s'), "' + json.finished[i].finishedTime + '", "' + json.finished[i].elapsedTime"); ?>; 138 if (json.finished[i].parMessage != '') { 139 finished += '<?php printf(_(' Par message: %s'), "' + json.finished[i].parMessage"); ?>; 140 } 141 finished += '</div></li>'; 130 142 } 131 finished += '</div></li>'; 143 } else { 144 finished += '<li class="queuebox" style="text-align: center; font-weight: bold;"><?php echo _('No Finished Items'); ?></li>'; 132 145 } 133 146 $('#finished').html(finished); -
trunk/templates/default.php
r152 r157 117 117 </div> 118 118 <div id="content"> 119 <div class="queuebox first">119 <div id="queuestatus" class="queuebox first"> 120 120 <?php printf(_('Queued: %s items totalling %sMB'), $c->queueLength, $c->queueSize); ?> 121 121 </div> 122 <?php if ($c->queueLength > 0): ?>123 122 <form method="post" action="<?php echo $self; ?>" onsubmit="confirmorder(this)"> 124 123 <ul id="queue"> 124 <?php if ($c->queueLength == 0): ?> 125 <li class="queuebox" style="text-align: center; font-weight: bold;"><?php echo _('Queue is empty'); ?></li> 126 <?php endif; ?> 125 127 <?php $i = 0; foreach ($c->queue as $queue): $i++ ?> 126 128 <li class="queuebox" id="order_<?php echo $queue['id']; ?>"> … … 134 136 <?php endforeach; ?> 135 137 </ul> 136 <?php endif; ?>137 138 <div id="controls"> 138 139 <span id="refresher"> 139 140 <input type="checkbox" name="refresh" id="refresh" onclick="if (this.checked) { createCookie('HHRefresh', 1, 30);startRefresher(); } else { createCookie('HHRefresh', 0, 30);stopRefresher(); }" /> <label for="refresh" class="refresher"><?php echo _('Refresh every 15 seconds'); ?></label> <input type="button" value="<?php echo _('Refresh Now'); ?>" onclick="refreshNow();" /> 140 141 </span> 141 <?php if ($c->queueLength > 0): ?>142 142 <input type="submit" name="reorder" value="<?php echo _('Reorder Items'); ?>" /> <?php echo _('by'); ?> <select name="sorttype" id="sorttype" onchange="showstatus(this);"><option value="1"><?php echo _('Provided Order'); ?></option><option value="2"><?php echo _('Name'); ?></option><option value="3"><?php echo _('Size'); ?></option></select> <select name="sortdirection" id="sortdirection"><option value="1"><?php echo _('Ascending'); ?></option><option value="2"><?php echo _('Descending'); ?></option></select> 143 <?php endif; ?>144 143 </div> 145 <?php if ($c->queueLength > 0): ?>146 144 </form> 147 <?php endif; ?>148 145 </div> 149 146 </div> … … 168 165 </div> 169 166 </form> 170 <?php if ($finishedcount > 0): ?>171 167 <ul id="finished"> 172 <?php $i = 0; foreach($x->item as $item): $i++; ?> 173 <li class="queuebox <?php echo (((string)$item->type == 'SUCCESS') ? 'good' : 'bad'); ?>"> 174 <div class="queuetitle"> 175 <?php echo (string)$item->archiveName; ?> 176 </div> 177 <ul class="queuecontrols"> 178 <li class="control"><a href="<?php echo $self; ?>?removefinished=<?php echo $i; ?>"><?php echo _('Remove'); ?></a></li> 179 </ul> 180 <div class="queuestats"><?php printf(_('Finished on: %s Processing Time: %s'), date('M dS - H:i:s', (int)$item->finishedTime), (string)$item->elapsedTime); if (trim((string)$item->parMessage) != ''): printf(_(' Par message: %s'), (string)$item->parMessage); endif; ?></div> 181 </li> 182 <?php endforeach; ?> 168 <?php if ($finishedcount == 0): ?> 169 <li class="queuebox" style="text-align: center; font-weight: bold;"><?php echo _('No Finished Items'); ?></li> 170 <?php else: ?> 171 <?php $i = 0; foreach($x->item as $item): $i++; ?> 172 <li class="queuebox <?php echo (((string)$item->type == 'SUCCESS') ? 'good' : 'bad'); ?>"> 173 <div class="queuetitle"> 174 <?php echo (string)$item->archiveName; ?> 175 </div> 176 <ul class="queuecontrols"> 177 <li class="control"><a href="<?php echo $self; ?>?removefinished=<?php echo $i; ?>"><?php echo _('Remove'); ?></a></li> 178 </ul> 179 <div class="queuestats"><?php printf(_('Finished on: %s Processing Time: %s'), date('M dS - H:i:s', (int)$item->finishedTime), (string)$item->elapsedTime); if (trim((string)$item->parMessage) != ''): printf(_(' Par message: %s'), (string)$item->parMessage); endif; ?></div> 180 </li> 181 <?php endforeach; ?> 182 <?php endif; ?> 183 183 </ul> 184 <?php endif; ?>185 184 </div> 186 185 </div> -
trunk/templates/json.php
r151 r157 39 39 40 40 $hellainfo = array(); 41 42 41 $hellainfo['path'] = $self; 42 $hellainfo['status']['version'] = $c->version; 43 $hellainfo['status']['uptime'] = $c->uptime; 44 $hellainfo['status']['files'] = $c->totalFiles; 45 $hellainfo['status']['segments'] = $c->totalSegments; 46 $hellainfo['status']['totalmb'] = $c->totalMB; 47 $hellainfo['status']['totalnzbs'] = $c->totalNZBs; 43 48 if ($c->downloadCount > 0) { 44 49 $hellainfo['downloading'] = htmlspecialchars($c->downloads[0]['nzbName']); … … 57 62 } 58 63 $hellainfo['queuelength'] = $c->queueLength; 64 $hellainfo['queuesize'] = $c->queueSize; 59 65 $i = 0; 60 66 $hellainfo['queue'] = array(); … … 69 75 } 70 76 if ($config['showfinished']) { 77 $hellainfo['showfinished'] = true; 71 78 $hellainfo['finished'] = array(); 72 79 $i = 0; … … 82 89 $hellainfo['finished'][] = $tmp; 83 90 } 91 $hellainfo['finishedlength'] = $i; 84 92 } else { 85 $hellainfo[' finished'] = false;93 $hellainfo['showfinished'] = false; 86 94 } 87 95 $hellainfo['log'] = $c->log;
