diff --git a/webbuild/html/scripts/socialbox.js b/webbuild/html/scripts/socialbox.js index 0b0cdc5..84d7525 100644 --- a/webbuild/html/scripts/socialbox.js +++ b/webbuild/html/scripts/socialbox.js @@ -1,4 +1,10 @@ -var url = "/cgi-bin/webbuild" +var url = "/cgi-bin/webbuild.cgi" + +/*function socialbox_refresh_times() { + socialbox_refresh_times(false); +}*/ + +var socialbox_fullrefresh_count = 0; function socialbox_refresh_times() { var times = document.getElementsByName("socialtime"); @@ -12,20 +18,28 @@ function socialbox_refresh_times() { var socialtime = times[i].attributes[1].value; } var timeago = utcnow - socialtime; - var daysago = parseInt(timeago / 86400); - var hoursago = parseInt(timeago / 3600 % 24); - var minutesago = parseInt(timeago / 60 % 60); - var secondsago = parseInt(timeago % 60); - times[i].innerHTML = "("; - if (daysago > 1) times[i].innerHTML += daysago + " days"; - else if (daysago == 1) times[i].innerHTML += "1 day, " + hoursago + " hours"; - else if (hoursago > 1) times[i].innerHTML += hoursago + " hours"; - else if (hoursago == 1) times[i].innerHTML += "1 hour, " + minutesago + " minutes"; - else if (minutesago > 1) times[i].innerHTML += minutesago + " minutes"; - else if (minutesago == 1) times[i].innerHTML += "1 minute, " + secondsago + " seconds"; - else times[i].innerHTML += secondsago + " seconds"; - times[i].innerHTML += " ago) "; + if ((times[i].innerHTML == "") || + (timeago <= 120) || // update every 15 secs if < 2 min + (timeago <= 7200 && (socialbox_fullrefresh_count % 4 == 0)) || // update every minute if < 120 min + (timeago <= 86400 && (socialbox_fullrefresh_count % 120 == 0)) || // update every thirty minutes if < 1 day + (socialbox_fullrefresh_count >= 240)) // else update all every hour + { + var daysago = parseInt(timeago / 86400); + var hoursago = parseInt(timeago / 3600 % 24); + var minutesago = parseInt(timeago / 60 % 60); + var secondsago = parseInt(timeago % 60); + times[i].innerHTML = "("; + if (daysago > 1) times[i].innerHTML += daysago + " days"; + else if (daysago == 1) times[i].innerHTML += "1 day, " + hoursago + " hours"; + else if (hoursago > 1) times[i].innerHTML += hoursago + " hours"; + else if (hoursago == 1) times[i].innerHTML += "1 hour, " + minutesago + " minutes"; + else if (minutesago > 1) times[i].innerHTML += minutesago + " minutes"; + else if (minutesago == 1) times[i].innerHTML += "1 minute, " + secondsago + " seconds"; + else times[i].innerHTML += secondsago + " seconds"; + times[i].innerHTML += " ago) "; + } } + if (socialbox_fullrefresh_count++ >= 240) socialbox_fullrefresh_count = 0; } var socialbox_interval = null; @@ -72,6 +86,7 @@ function ajax_getvalues_refresh(request,user,user_email,secret) { } if (xmldoc.getElementsByTagName("processes")[0] != undefined) { document.getElementById("processes").innerHTML = xmldoc.getElementsByTagName("processes")[0].childNodes[0].nodeValue; + $(function() { $('.scroll-pane3').jScrollPane({scrollbarWidth:10}); }); } $(function() { $('.scroll-pane').jScrollPane({scrollbarWidth:10}); }); // lastupdate = (+new Date()); diff --git a/webbuild/html/scripts/webbuild.js b/webbuild/html/scripts/webbuild.js index 4fe09f3..3a1b818 100644 --- a/webbuild/html/scripts/webbuild.js +++ b/webbuild/html/scripts/webbuild.js @@ -31,16 +31,24 @@ function checkEnter(event) { return false; } +function checkMinLength(st,len) { + if (st.length >= len) return true; + return false; + return false; +} + function suggestSpecName(url) { var version=""; var url=document.getElementById("speccreateurl").value; - if (url.indexOf('&') > 0) url=url.substring(0,url.indexOf('&')+1); + if (url.indexOf('?') > 0) url=url.substring(0,url.indexOf('?')); var specname=url.substring(url.lastIndexOf('/')+1); + var extension; while (i=specname.lastIndexOf('.')) { e=specname.substring(i); if (e != ".tar" && e != ".gz" && e != ".zip" && e != ".bz2" && e != ".xz" && e != ".tgz" && e != ".zip" && e != ".src" && - e != ".orig") break; + e != ".orig" && e != ".gem" ) break; + extension=specname.substring(i+1); specname=specname.substring(0,i); } i=specname.lastIndexOf('_'); @@ -59,16 +67,24 @@ function suggestSpecName(url) { document.getElementById("speccreateurl").value=url; if (url.search("cpan.org") >= 0) { specname="perl-"+specname; + } else if (url.search("haskell.org") >= 0) { + specname="ghc-"+specname; + } else if (extension == "gem") { + specname="ruby-"+specname; } else { specname=specname.toLowerCase(); } - if (url.search("git://") >= 0) { + if ((url.search("git://") >= 0) || (url.indexOf(".git", url.length - 4) != -1)) { document.getElementById("speccreategitbranch").disabled=false; } else { document.getElementById("speccreategitbranch").disabled=true; + document.getElementById("speccreateversion").value=version; + } + if (url.indexOf(".git", url.length - 4) != -1) { + document.getElementById("speccreategitbranch").value="master"; + specname=specname.substring(0,specname.lastIndexOf('.git')); } document.getElementById("speccreatename").value=specname; - document.getElementById("speccreateversion").value=version; if (url) { document.getElementById("speccreatename").disabled=false; document.getElementById("speccreateversion").disabled=false; @@ -80,7 +96,12 @@ function suggestSpecName(url) { document.getElementById("speccreatetype").disabled=true; document.getElementById("speccreatebutton").disabled=true; } - if (specname.search("perl-") >= 0) { + if (extension == "gem") { + for (var j=0;j= 0) { for (var j=0;j= 0) { for (var j=0;j" +# echo -n "
" echo -n "Webbuild jobs: " if [ "$STATE_JOBSSHOWALL" != "1" ]; then echo "[ Show all ]" @@ -414,7 +415,7 @@ if [ "$REQUEST" = "refresh" -o "$REQUEST" = "refreshjobs" ]; then else echo -n "\"" - echo -n "$cmdline\" " + echo -n "$cmdline\" (`date -r $5 +\"%F %T\"`)" if [ $RETCODE -eq 256 ]; then $SUDO_WRAPPER finishprocess $1 "$USER" $5 RETCODE=$? @@ -433,8 +434,8 @@ if [ "$REQUEST" = "refresh" -o "$REQUEST" = "refreshjobs" ]; then echo -n "]" fi echo -n "
" - done < $WEBBUILD_STATEDIR/processes - [ $numprocess -gt 0 ] && echo -n "
" + done +# [ $numprocess -gt 0 ] && echo -n "" echo -n "]]>" exit fi @@ -901,10 +902,13 @@ if [ "$MAINTAINERMODE" = "true" -o ! "${AUTOPORT_UPDATE[$ENVIRONMENT]}" ]; then echo -n "MAINTAINERMODE=\"+getElementById('maintain').checked+\"&" fi echo -n "PACKAGE=\"+encodeURIComponent(getSelectedValueById('package'))); $SRPMBUTTONDISABLED>" - if [ "${AUTOPORT_PORT[$ENVIRONMENT]}" ]; then + if [ "${AUTOPORT_PORT_REPOSITORY[$ENVIRONMENT]}" ]; then echo -n "$PACKAGE new package in `print_environment_descr $ENVIRONMENT` environment\" STIME=`date +%s`" @@ -1206,17 +1210,19 @@ if [ "$MAINTAINERMODE" != "true" ]; then echo -n "
Send to:" echo -n "