remove chunked header from opkg. Fix chunking in Google Chrome. queue top refresh button

git-svn-id: file:///root/webif/svn/pkg/webif/trunk@3708 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
hummypkg 2017-02-04 22:33:55 +00:00
parent 8e7d14efc4
commit bd5bb64b13
9 changed files with 41 additions and 30 deletions

View File

@ -1,7 +1,7 @@
Package: webif
Priority: optional
Section: web
Version: 1.4.0-5
Version: 1.4.0-6
Architecture: mipsel
Maintainer: af123@hpkg.tv
Depends: tcpfix,webif-channelicons(>=1.1.25),lighttpd(>=1.4.39-1),jim(>=0.77),jim-oo(>=0.77),jim-sqlite3(>=0.76),jim-cgi(>=0.7-1),jim-binary(>=0.76),service-control(>=2.3),busybox(>=1.20.2-1),lsof(>=4.87),epg(>=1.2.5),hmt(>=2.0.10),ssmtp,cron-daemon(>=1.18.3-3),at(>=3.1.18),anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.1.10),webif-charts(>=1.2-1),stripts(>=1.2.5-3),tmenu(>=1.21-2),ffmpeg,id3v2,multienv(>=1.6),tcpping(>=1.1),e2fsprogs,wireless-tools(>=29-1),dbupdate,recmon(>=2.0.7),hwctl,nugget(>=0.95),sqlite3(>=3.15.1)

View File

@ -25,7 +25,10 @@ proc opkg {cmd} {
putsf ""
}
httpheader "text/plain" 0 "Transfer-Encoding: chunked\r\n"
# Google Chrome won't render chunks with text/plain!
# https://bugs.chromium.org/p/chromium/issues/detail?id=156023
#httpheader "text/plain"
httpheader "application/octet-stream"
set cmdargs [lassign $cmd cmd]

19
webif/html/diag/dump.jim Executable file
View File

@ -0,0 +1,19 @@
#!/mod/bin/jimsh
source /mod/webif/lib/setup
package require cgi
puts "<h1>CGI</h1><pre>"
cgi_input
cgi_dump
puts "</pre>"
flush stdout
#sleep 5
puts "<h1>ENV</h1><pre>"
foreach {var val} [env] {
puts "$var = $val"
}
puts "</pre>"

View File

@ -15,7 +15,11 @@ puts {
Queued Tasks
</h3>
<fieldset class=cleft>
<legend>Queued Tasks</legend>
<legend>
Queued Tasks
<button class="refresh small">Refresh</button>
<span class=isloading><img src=/img/spin.gif></span>
</legend>
<div id=loading>
<img src=/img/spin.gif> Loading queue data...
@ -48,8 +52,8 @@ There are no tasks in the queue.
<button id=selcomplete class=needsdata>Select Completed</button>
<button id=selall class=needsdata>Select All</button>
<button id=selnone class=needsdata>Select None</button>
<button id=refresh>Refresh</button>
<span id=isloading><img src=/img/spin.gif></span>
<button class=refresh id=refresh>Refresh</button>
<span class=isloading><img src=/img/spin.gif></span>
</div>
<div id=lastscan>Last media scan: <span id=autolast>retrieving...</span> -
scanning every <span id=autofreq>TBC</span> minutes.</div>

View File

@ -15,7 +15,7 @@ function dirname(path)
function load()
{
$('#isloading').show();
$('span.isloading').show();
$.getJSON('fetch.jim', function(data) {
$('#queuetab > tbody').empty();
@ -74,7 +74,7 @@ function load()
});
$('input.qid').first().trigger('change');
$('#loading,#isloading').hide('slow');
$('#loading,span.isloading').hide('slow');
});
}
@ -145,7 +145,7 @@ $('#selcomplete').button({icons:{primary:"ui-icon-check"}})
.trigger('change');
});
$('#refresh').button({icons:{primary:"ui-icon-refresh"}})
$('button.refresh').button({icons:{primary:"ui-icon-refresh"}})
.on('click', function() {
load();
});

View File

@ -45,3 +45,8 @@ div#loading, div#nodata
padding-top: 2px;
}
button.small
{
padding: .1em .5em .1em .1em;
}

View File

@ -22,7 +22,7 @@ puts {
</h1>
<button class="hidden va" id=opkgupdate>
Update package list from Internet
Check for updates
</button>
<button class="hidden va" id=opkgupgradeall>

View File

@ -1,21 +0,0 @@
proc chunk {chk} {
puts -nonewline [format "%x\r\n" [string length $chk]]
puts -nonewline "$chk\r\n"
flush stdout
}
proc chunk_pad {{len 256}} {
incr len
chunk [string repeat " " $len]
}
proc start_chunked {{type "text/html"}} {
httpheader $type 0 "Transfer-Encoding: chunked\r\n"
#chunk_pad
}
proc end_chunked {} {
puts -nonewline "0\r\n\r\n\r\n"
}

View File

@ -23,6 +23,7 @@ if {![exists -proc require]} {
alias case switch
proc httpredirect {url {extra ""}} {
puts -nonewline "Status: 302 redirect\r\n"
puts -nonewline "Location: $url\r\n"
if {$extra ne ""} {
puts -nonewline "$extra\r\n"