[Ovirt-devel] [Patch] move app root to /ovirt for ovirt-wui
Hugh O. Brock
hbrock at redhat.com
Fri Mar 28 18:17:48 UTC 2008
On Fri, Mar 28, 2008 at 01:47:01PM -0400, Scott Seago wrote:
> diff --git a/wui/conf/ovirt-wui b/wui/conf/ovirt-wui
> index 2ad7bf1..07d7acc 100644
> --- a/wui/conf/ovirt-wui
> +++ b/wui/conf/ovirt-wui
> @@ -14,6 +14,7 @@ ADDR=127.0.0.1
> RAILS_ENVIRONMENT=production
> USER=ovirt
> GROUP=ovirt
> +PREFIX=/ovirt
> export RAILS_GEM_VERSION=2.0.1
>
> RETVAL=0
> @@ -23,7 +24,7 @@ RETVAL=0
> start() {
> echo -n "Starting ovirt-wui: "
>
> - mongrel_rails start -c $OVIRT_DIR -l $MONGREL_LOG -P $MONGREL_PID -a $ADDR -e $RAILS_ENVIRONMENT --user $USER --group $GROUP -d
> + mongrel_rails start -c $OVIRT_DIR -l $MONGREL_LOG -P $MONGREL_PID -a $ADDR -e $RAILS_ENVIRONMENT --user $USER --group $GROUP -d --prefix=$PREFIX
> RETVAL=$?
> if [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ovirt-wui ; then
> echo_success
> diff --git a/wui/conf/ovirt-wui.conf b/wui/conf/ovirt-wui.conf
> index 99aa74f..df09c33 100644
> --- a/wui/conf/ovirt-wui.conf
> +++ b/wui/conf/ovirt-wui.conf
> @@ -12,9 +12,9 @@ ProxyRequests Off
> Krb5KeyTab /etc/httpd/conf/ipa.keytab
> KrbSaveCredentials on
> Require valid-user
> - ErrorDocument 401 /errors/401.html
> - ErrorDocument 404 /errors/404.html
> - ErrorDocument 500 /errors/500.html
> + ErrorDocument 401 /ovirt/errors/401.html
> + ErrorDocument 404 /ovirt/errors/404.html
> + ErrorDocument 500 /ovirt/errors/500.html
> RewriteEngine on
> Order deny,allow
> Allow from all
> @@ -29,17 +29,17 @@ ProxyRequests Off
> # RequestHeader unset Authorization
> </Proxy>
>
> -Alias /stylesheets "/usr/share/ovirt-wui/public/stylesheets"
> -Alias /images "/usr/share/ovirt-wui/public/images"
> -Alias /errors "/usr/share/ovirt-wui/public/"
> +Alias /ovirt/stylesheets "/usr/share/ovirt-wui/public/stylesheets"
> +Alias /ovirt/images "/usr/share/ovirt-wui/public/images"
> +Alias /ovirt/errors "/usr/share/ovirt-wui/public/"
>
> -ProxyPass /images !
> -ProxyPass /stylesheets !
> -ProxyPass /errors !
> -ProxyPass / http://localhost:3000/
> -ProxyPassReverse / http://localhost:3000/
> -ProxyPassReverse /images !
> -ProxyPassReverse /stylesheets !
> -ProxyPassReverse /errors !
> +ProxyPass /ovirt/images !
> +ProxyPass /ovirt/stylesheets !
> +ProxyPass /ovirt/errors !
> +ProxyPass /ovirt http://localhost:3000/ovirt
> +ProxyPassReverse /ovirt http://localhost:3000/ovirt
> +ProxyPassReverse /ovirt/images !
> +ProxyPassReverse /ovirt/stylesheets !
> +ProxyPassReverse /ovirt/errors !
>
> </VirtualHost>
> diff --git a/wui/src/app/views/library/list.rhtml b/wui/src/app/views/library/list.rhtml
> index 867682f..ada16dd 100644
> --- a/wui/src/app/views/library/list.rhtml
> +++ b/wui/src/app/views/library/list.rhtml
> @@ -19,7 +19,7 @@ function confirm_and_submit(item){
> <div class="inside">
>
> <div class="data-table-column">
> -<form action="/library/vm_actions" name="vm_actions" method="post">
> +<% form_tag( {:controller => 'library', :action => 'vm_actions'}, {:name => "vm_actions", :method => "post"}) do -%>
> <%= tag :input, { "type" => "submit", "name" => "vm_actions[#{VmTask::ACTION_START_VM}]", "value" => "Start"} %>
> <%= tag :input, { "type" => "submit", "name" => "vm_actions[#{VmTask::ACTION_SHUTDOWN_VM}]", "value" => "Stop"} %>
> <select onchange="return confirm_and_submit(this)" name="vm_actions[other_actions]">
> @@ -35,7 +35,7 @@ function confirm_and_submit(item){
> <br/><br/>
>
> <%= render :partial => "/vm/list", :locals => { :vms => @vms } %>
> -</form>
> +<% end -%>
> </div>
>
> </div> <!-- end #data-table.inside -->
> diff --git a/wui/src/app/views/library/show.rhtml b/wui/src/app/views/library/show.rhtml
> index ca5c566..d431ab7 100644
> --- a/wui/src/app/views/library/show.rhtml
> +++ b/wui/src/app/views/library/show.rhtml
> @@ -10,7 +10,7 @@
>
> <div class="data-table-column">
>
> - <form action="/library/vm_actions" name="vm_actions" method="post">
> + <% form_tag( {:controller => 'library', :action => 'vm_actions'}, {:name => "vm_actions", :method => "post"}) do -%>
> <%= tag :input, { "type" => "hidden", "name" => "vm_actions[vm_library_id]", "value" => "@vm_library.id"} %>
> <%= tag :input, { "type" => "submit", "name" => "vm_actions[#{VmTask::ACTION_START_VM}]", "value" => "Start"} %>
> <%= tag :input, { "type" => "submit", "name" => "vm_actions[#{VmTask::ACTION_SHUTDOWN_VM}]", "value" => "Stop"} %>
> @@ -29,7 +29,7 @@
> <br/>
>
> <%= render :partial => "/vm/list", :locals => { :vms => @vm_library.vms } %>
> - </form>
> + <% end -%>
>
> </div>
>
> diff --git a/wui/src/public/401.html b/wui/src/public/401.html
> index c206487..ffcfc9b 100644
> --- a/wui/src/public/401.html
> +++ b/wui/src/public/401.html
> @@ -5,15 +5,15 @@
> <head>
> <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
> <title>Authorization Required</title>
> - <link href="/stylesheets/default.css" media="screen" rel="Stylesheet" type="text/css" />
> - <script src="/javascripts/prototype.js" type="text/javascript"></script>
> + <link href="/ovirt/stylesheets/default.css" media="screen" rel="Stylesheet" type="text/css" />
> + <script src="/ovirt/javascripts/prototype.js" type="text/javascript"></script>
> </head>
> <body>
>
> <div id="top_bar"></div>
> <div id="content">
> <div id="header">
> -<a href="/"><img alt="Ovirt" class="logo" src="/images/ovirt-red-logo133x56.png" /></a>
> +<a href="/"><img alt="Ovirt" class="logo" src="/ovirt/images/ovirt-red-logo133x56.png" /></a>
> </div>
>
> <div class = "alertbox"></div>
ACK, looks good...
--H
More information about the ovirt-devel
mailing list