On Oct 29, 10:32 am, Gabor <
glas...@gmail.com> wrote:
> > Looking forwards to hearing from you your requirements since I do not have a
> > hosting company. I am not pretty sure about all of the features.
>
> - On the main container list page a visual container status (red for
> failcnt incremented since $short_time, yellow for $long_time, green
> otherwise, for me $short_time=1day, $long_time=7days, but it should be
> configurable).
> - More compact container list page (you could gather start/stop,
> restart, migrate, create backup and Change Owner into a drop-down menu
> at the end of the row) - I have several dozen containers and I have to
> keep scrolling around :)
So call me impatient, I messed around with the app/views/container/
list_vps.rhtml a little, here is my version (the icons are 24x24):
<%= render :partial => 'links' %>
<h3> You have <%= pluralize(@rows.size, "#{@status} container") %> </
h3>
<table>
<th> Distro</th> <th> Cnt ID </th> <th> Name </th> <th> No. Ps </th>
<th> Status </th> <th> IP Address </th> <th> Hostname </th> <th> Owner
</th>
<% i = 1 %>
<% z = 0 %>
<% for row in @rows -%>
<% i = 1 -i%>
<tr id="<%= "color"+i.to_s %>">
<td> <%= link_to image_tag("icons/"+row[5].downcase+".png", :border
=> 0) , :controller => :inside_vps, :action => :view_vps, :vps_id =>
row[0] unless row[5].blank? %> </td>
<td> <%=link_to row[0],:controller => :inside_vps, :action
=> :view_vps, :vps_id => row[0]%> </td>
<td> <%= @names[z] %> <% z = z + 1 %> </td>
<td> <%=link_to row[1],:controller => :inside_vps, :action
=> :running_processes, :vps_id =>row[0]%> </td>
<td>
<% if row[2].include?("running") %>
<%= link_to image_tag("stop.png", :alt => "stop", :border =>
"0"), :action => :stop_vps, :vps_id => row[0] %>
<%= link_to image_tag("restart.png", :alt => "restart", :border =>
"0") , :action => :restart_vps, :vps_id => row[0] %>
<% else %>
<%= link_to image_tag("start.png", :alt => "start", :border =>
"0"), :action => :start_vps, :vps_id => row[0] %>
<% if session[:permission] == "admin" %>
<%= link_to image_tag("destroy.png", :alt =>
"destroy", :border => "0"), {:action => :destroy_vps, :vps_id =>
row[0]}, :confirm => "Are you sure?", :method => :post %>
<% end %>
<% end %>
</td>
<td> <%=row[3]%> </td>
<td> <%=row[4]%> </td>
<td>
<% vps = Vps.find_by_cnt_id(row[0]) %>
<% if vps %>
<%= link_to
vps.user.name, :action => :vpses_of_user, :user_id =>
vps.user.id %>
<% else %>
<%= link_to "Assign to Owner", :action
=> :assign_to_owner, :vps_id =>row[0] %>
<% end %>
</td>
<td>
<% if session[:permission] == "admin" %>
<%= link_to image_tag("migrate.png", :alt => "migrate", :border =>
"0"), :action => :migrate_vps, :vps_id => row[0] %>
<%= link_to image_tag("backup.png", :alt => "backup", :border =>
"0"), :action => :create_backup, :vps_id => row[0] %>
<% end %>
<%= link_to image_tag("owner.png", :alt => "Change Owner", :border
=> "0"), :action => :assign_to_owner, :vps_id =>row[0] %>
</td></tr>
<% end -%>
</table>
Regards
Gabor