Mailinglist Archive: opensuse-buildservice (354 mails)

< Previous Next >
Re: [opensuse-buildservice] HTML encoding and build log (PATCH)
  • From: Dirk Stoecker <opensuse@xxxxxxxxxxxx>
  • Date: Fri, 16 Feb 2007 14:21:31 +0100 (CET)
  • Message-id: <Pine.LNX.4.64.0702161415100.26170@xxxxxxxxxxxxxxxxx>
On Fri, 16 Feb 2007, David Mayr wrote:

> > > attached is a patch, which does entity encoding for the pre-formatted
> > > text in build log display (blame on you it as not already there! :-).
> >
> > Something wrong with this patch or only overlooked?
>
> now applied (rev. 1263).
> sorry for the late reply, I just overlooked your mail...

No problem. It's normal on mailinglists. Therefore we have bug and patch
trackers. Thought mailinglist is usually easier.

As weekend comes and I want to cleanup my week's work I attached two other
changes in my working directory:

buildlog.diff
- Changes the JavaScript code on the live buildlog a bit, so now Start/Stop
button appear when necessary and the buttons are also below the text. Now
clicking on autoscroll+refresh below the text is possible. Would be nice
to have both in one button, but I don't know how to do this.

https.diff:
- There are still some http accesses in the code. I changed them to https
and found no negative effects (but also no positive yet). I think the
http://'s are wrong, but leave it to you :-)

Ciao
--
http://www.dstoecker.eu/ (PGP key available)Index: app/views/package/live_build_log.rhtml
===================================================================
--- app/views/package/live_build_log.rhtml (Revision 1263)
+++ app/views/package/live_build_log.rhtml (Arbeitskopie)
@@ -9,12 +9,30 @@
-%>

<script language="javascript">
+function setscrollmode(mode) {
+ if(mode == 'on')
+ {
+ document.getElementById('stop_scroll').innerHTML
+ = '<a href="javascript:stop_autoscroll()">[Stop Autoscroll]</a>';
+ document.getElementById('start_scroll').innerHTML = '';
+ }
+ else
+ {
+ var txt = '<a href="javascript:start_autoscroll()">[Start Autoscroll]</a>';
+ document.getElementById('stop_scroll').innerHTML = txt;
+ document.getElementById('start_scroll').innerHTML = txt;
+ }
+}
function start_autoscroll() {
+ setscrollmode('on');
+ autoscroll();
+}
+function autoscroll() {
window.scrollBy( 0,50 );
- scrolldelay = setTimeout( 'start_autoscroll()',100 );
+ scrolldelay = setTimeout( 'autoscroll()',100 );
}
-
function stop_autoscroll() {
+ setscrollmode('off');
clearTimeout( scrolldelay );
}
</script>
@@ -22,14 +40,13 @@
<b>Repository:</b> <%=h @repo%><br/>
<b>Architecture:</b> <%=h @arch%>
<p>
-<a href="javascript:start_autoscroll()">[Start Autoscroll]</a>
+<div id="start_scroll"></div>
</p>
-<div id="start_link">
-<%= link_to_remote( "[Start Refreshing]",
- :url => {:action => :update_build_log, :package => @package, :project => @project, :arch => @arch, :repository => @repo, :offset => @offset},
- :after => "new Effect.Fade('start_link')",
- :complete => evaluate_remote_response )%>
-</div>
+<div id="start_link"><%= link_to_remote( "[Start Refreshing]",
+ :url => {:action => :update_build_log, :package => @package,
+ :project => @project, :arch => @arch, :repository => @repo, :offset => @offset},
+ :after => "new Effect.Fade('start_link');new Effect.Fade('start_linkend')",
+ :complete => evaluate_remote_response )%></div>
<p>
<b>Status:</b> <span id="status">Live Log not started</span>
</p>
@@ -43,5 +60,13 @@
</form>
</p>
<p>
-<a href="javascript:stop_autoscroll()">[Stop Autoscroll]</a>
+<div id="stop_scroll"></div>
</p>
+<p>
+<div id="start_linkend"><%= link_to_remote( "[Start Refreshing]",
+ :url => {:action => :update_build_log, :package => @package,
+ :project => @project, :arch => @arch, :repository => @repo, :offset => @offset},
+ :after => "new Effect.Fade('start_link');new Effect.Fade('start_linkend')",
+ :complete => evaluate_remote_response )%></div>
+</p>
+<script>setscrollmode('off')</script>
Index: app/helpers/package_helper.rb
===================================================================
--- app/helpers/package_helper.rb (Revision 1263)
+++ app/helpers/package_helper.rb (Arbeitskopie)
@@ -3,7 +3,7 @@
# because it is used for the internal connection bypassing ichain
# and is not accessible from outside
def build_log_url( project, package, platform, arch )
- "http://api.opensuse.org/result/#{project}/#{platform}/#{package}/#{arch}/log";
+ "https://api.opensuse.org/result/#{project}/#{platform}/#{package}/#{arch}/log";
end

def file_url( project, package, filename )
@@ -11,6 +11,6 @@
end

def rpm_url( project, package, repository, arch, filename )
- "http://api.opensuse.org/rpm/#{project}/#{repository}/#{package}/#{arch}/#{filename}";
+ "https://api.opensuse.org/rpm/#{project}/#{repository}/#{package}/#{arch}/#{filename}";
end
end
Index: config/environment.rb
===================================================================
--- config/environment.rb (Revision 1263)
+++ config/environment.rb (Arbeitskopie)
@@ -63,7 +63,7 @@

require 'activexml'

-#TRANSPORT = Suse::Frontend.new("http://#{FRONTEND_HOST}:#{FRONTEND_PORT}";)
+#TRANSPORT = Suse::Frontend.new("https://#{FRONTEND_HOST}:#{FRONTEND_PORT}";)

ActiveXML::Base.config do |conf|
conf.setup_transport do |map|
Index: lib/frontend_compat.rb
===================================================================
--- lib/frontend_compat.rb (Revision 1263)
+++ lib/frontend_compat.rb (Arbeitskopie)
@@ -14,7 +14,7 @@
extraparams << "&arch=#{opt[:arch]}" if opt[:arch]

logger.debug "CMD_PACKAGE #{cmd} ; extraparams = #{extraparams}"
- transport.direct_http URI("http:///source/#{project}/#{package}?cmd=#{cmd}#{extraparams}";),
+ transport.direct_http URI("https:///source/#{project}/#{package}?cmd=#{cmd}#{extraparams}";),
:method => "POST", :data => ""
end

@@ -26,28 +26,28 @@
path += "/#{opt[:filename]}" if opt[:filename]
logger.debug "--> get_source path: #{path}"

- transport.direct_http URI("http://#{path}";)
+ transport.direct_http URI("https://#{path}";)
end

def put_file( data, opt={} )
- transport.direct_http URI("http:///source/#{opt[:project]}/#{opt[:package]}/#{opt[:filename]}";),
+ transport.direct_http URI("https:///source/#{opt[:project]}/#{opt[:package]}/#{opt[:filename]}";),
:method => "PUT", :data => data
end

def delete_package( opt={} )
logger.debug "deleting: #{opt.inspect}"
- transport.direct_http URI("http:///source/#{opt[:project]}/#{opt[:package]}";), :method => "DELETE"
+ transport.direct_http URI("https:///source/#{opt[:project]}/#{opt[:package]}";), :method => "DELETE"
end

def delete_file( opt={} )
logger.debug "starting to delete file, opt: #{opt.inspect}"
- transport.direct_http URI("http:///source/#{opt[:project]}/#{opt[:package]}/#{opt[:filename]}";),
+ transport.direct_http URI("https:///source/#{opt[:project]}/#{opt[:package]}/#{opt[:filename]}";),
:method => "DELETE"
end

def get_log_chunk( project, package, repo, arch, offset=0 )
path = "/result/#{project}/#{repo}/#{package}/#{arch}/log?nostream=1&start=#{offset}"
- transport.direct_http URI("http://#{path}";)
+ transport.direct_http URI("https://#{path}";)
end

def transport
< Previous Next >
Follow Ups