+ Parameter | | Barrier | limit |
+
+
+ Number of TCP Sockets |
+ : |
+ <% v = @conf_file["NUMTCPSOCK"].split(":") %>
+ <%= text_field "conf", "NUMTCPSOCK1", :value => v[0].gsub("\"", ""), :size => "20"%> |
+ <%= text_field "conf", "NUMTCPSOCK2", :value => v[1].gsub("\"", ""), :size => "20"%> |
+
+
+ TCP Send Buffer Size |
+ : |
+ <% v = @conf_file["TCPSNDBUF"].split(":") %>
+ <%= text_field "conf", "TCPSNDBUF1", :value => v[0].gsub("\"", ""), :size => "20"%> |
+ <%= text_field "conf", "TCPSNDBUF2", :value => v[1].gsub("\"", ""), :size => "20"%> |
+
+
+ TCP Recieve Buffer Size |
+ : |
+ <% v = @conf_file["TCPRCVBUF"].split(":") %>
+ <%= text_field "conf", "TCPRCVBUF1", :value => v[0].gsub("\"", ""), :size => "20"%> |
+ <%= text_field "conf", "TCPRCVBUF2", :value => v[1].gsub("\"", ""), :size => "20"%> |
+
+
+ Other Socket Buffer Size |
+ : |
+ <% v = @conf_file["OTHERSOCKBUF"].split(":") %>
+ <%= text_field "conf", "OTHERSOCKBUF1", :value => v[0].gsub("\"", ""), :size => "20"%> |
+ <%= text_field "conf", "OTHERSOCKBUF2", :value => v[1].gsub("\"", ""), :size => "20"%> |
+
+
+ UDP Recieve Buffer Size |
+ : |
+ <% v = @conf_file["DGRAMRCVBUF"].split(":") %>
+ <%= text_field "conf", "DGRAMRCVBUF1", :value => v[0].gsub("\"", ""), :size => "20"%> |
+ <%= text_field "conf", "DGRAMRCVBUF2", :value => v[1].gsub("\"", ""), :size => "20"%> |
+
+
+ Number of Other Sockets |
+ : |
+ <% v = @conf_file["NUMOTHERSOCK"].split(":") %>
+ <%= text_field "conf", "NUMOTHERSOCK1", :value => v[0].gsub("\"", ""), :size => "20"%> |
+ <%= text_field "conf", "NUMOTHERSOCK2", :value => v[1].gsub("\"", ""), :size => "20"%> |
+
+
+
+ Disk Space (KByte) |
+ : |
+ <% v = @conf_file["DISKSPACE"].split(":") %>
+ <%= text_field "conf", "DISKSPACE1", :value => v[0].gsub("\"", ""), :size => "20"%> |
+ <%= text_field "conf", "DISKSPACE2", :value => v[1].gsub("\"", ""), :size => "20"%> |
+
+
+
+ Disk Inodes |
+ : |
+ <% v = @conf_file["DISKINODES"].split(":") %>
+ <%= text_field "conf", "DISKINODES1", :value => v[0].gsub("\"", ""), :size => "20"%> |
+ <%= text_field "conf", "DISKINODES2", :value => v[1].gsub("\"", ""), :size => "20"%> |
+
+
+ Quota Time |
+ : |
+ <%= text_field "conf", "QUOTATIME", :value => @conf_file["QUOTATIME"].gsub("\"", ""), :size => "20" unless @conf_file["QUOTATIME"].blank?%> |
+
+
+
+ Guaranteed Minimum CPU |
+ : |
+ <%= text_field "conf", "CPUUNITS", :value => @conf_file["CPUUNITS"].gsub("\"", ""), :size => "20"%> |
+
+
+
+ Number of processes |
+ : |
+ <% v = @conf_file["NUMPROC"].split(":") %>
+ <%= text_field "conf", "NUMPROC1", :value => v[0].gsub("\"", ""), :size => "20"%> |
+ <%= text_field "conf", "NUMPROC2", :value => v[1].gsub("\"", ""), :size => "20"%> |
+
+
+
+ Kernel Memory Size |
+ : |
+ <% v = @conf_file["KMEMSIZE"].split(":") %>
+ <%= text_field "conf", "KMEMSIZE1", :value => v[0].gsub("\"", ""), :size => "20"%> |
+ <%= text_field "conf", "KMEMSIZE2", :value => v[1].gsub("\"", ""), :size => "20"%> |
+
+
+
+ Number of Locked Pages |
+ : |
+ <% v = @conf_file["LOCKEDPAGES"].split(":") %>
+ <%= text_field "conf", "LOCKEDPAGES1", :value => v[0].gsub("\"", ""), :size => "20"%> |
+ <%= text_field "conf", "LOCKEDPAGES2", :value => v[1].gsub("\"", ""), :size => "20"%> |
+
+
+ Private VM Pages |
+ : |
+ <% v = @conf_file["PRIVVMPAGES"].split(":") %>
+ <%= text_field "conf", "PRIVVMPAGES1", :value => v[0].gsub("\"", ""), :size => "20"%> |
+ <%= text_field "conf", "PRIVVMPAGES2", :value => v[1].gsub("\"", ""), :size => "20"%> |
+
+
+ Number of shm Pages |
+ : |
+ <% v = @conf_file["SHMPAGES"].split(":") %>
+ <%= text_field "conf", "SHMPAGES1", :value => v[0].gsub("\"", ""), :size => "20"%> |
+ <%= text_field "conf", "SHMPAGES2", :value => v[1].gsub("\"", ""), :size => "20"%> |
+
+
+ Physical Pages |
+ : |
+ <% v = @conf_file["PHYSPAGES"].split(":") %>
+ <%= text_field "conf", "PHYSPAGES1", :value => v[0].gsub("\"", ""), :size => "20"%> |
+ <%= text_field "conf", "PHYSPAGES2", :value => v[1].gsub("\"", ""), :size => "20"%> |
+
+
+ VM Guar Pages |
+ : |
+ <% v = @conf_file["VMGUARPAGES"].split(":") %>
+ <%= text_field "conf", "VMGUARPAGES1", :value => v[0].gsub("\"", ""), :size => "20"%> |
+ <%= text_field "conf", "VMGUARPAGES2", :value => v[1].gsub("\"", ""), :size => "20"%> |
+
+
+ OOM Guar Pages |
+ : |
+ <% v = @conf_file["OOMGUARPAGES"].split(":") %>
+ <%= text_field "conf", "OOMGUARPAGES1", :value => v[0].gsub("\"", ""), :size => "20"%> |
+ <%= text_field "conf", "OOMGUARPAGES2", :value => v[1].gsub("\"", ""), :size => "20"%> |
+
+
+
+ Disk Cache Size |
+ : |
+ <% v = @conf_file["DCACHESIZE"].split(":") %>
+ <%= text_field "conf", "DCACHESIZE1", :value => v[0].gsub("\"", ""), :size => "20"%> |
+ <%= text_field "conf", "DCACHESIZE2", :value => v[1].gsub("\"", ""), :size => "20"%> |
+
+
+
+ Number of files lock |
+ : |
+ <% v = @conf_file["NUMFLOCK"].split(":") %>
+ <%= text_field "conf", "NUMFLOCK1", :value => v[0].gsub("\"", ""), :size => "20"%> |
+ <%= text_field "conf", "NUMFLOCK2", :value => v[1].gsub("\"", ""), :size => "20"%> |
+
+
+
+ Number of PTYs |
+ : |
+ <% v = @conf_file["NUMPTY"].split(":") %>
+ <%= text_field "conf", "NUMPTY1", :value => v[0].gsub("\"", ""), :size => "20"%> |
+ <%= text_field "conf", "NUMPTY2", :value => v[1].gsub("\"", ""), :size => "20"%> |
+
+
+ Number of Open Files |
+ : |
+ <% v = @conf_file["NUMFILE"].split(":") %>
+ <%= text_field "conf", "NUMFILE1", :value => v[0].gsub("\"", ""), :size => "20"%> |
+ <%= text_field "conf", "NUMFILE2", :value => v[1].gsub("\"", ""), :size => "20"%> |
+
+
+ Number of SIGINFO |
+ : |
+ <% v = @conf_file["NUMSIGINFO"].split(":") %>
+ <%= text_field "conf", "NUMSIGINFO1", :value => v[0].gsub("\"", ""), :size => "20"%> |
+ <%= text_field "conf", "NUMSIGINFO2", :value => v[1].gsub("\"", ""), :size => "20"%> |
+
+
+ Number of IPTENT |
+ : |
+ <% v = @conf_file["NUMIPTENT"].split(":") %>
+ <%= text_field "conf", "NUMIPTENT1", :value => v[0].gsub("\"", ""), :size => "20"%> |
+ <%= text_field "conf", "NUMIPTENT2", :value => v[1].gsub("\"", ""), :size => "20"%> |
+
+
+
diff --git a/app/views/configfile/_conf_links.rhtml b/app/views/configfile/_conf_links.rhtml
new file mode 100644
index 0000000..f413723
--- /dev/null
+++ b/app/views/configfile/_conf_links.rhtml
@@ -0,0 +1,10 @@
+
+
diff --git a/app/views/configfile/edit_conf_file.rhtml b/app/views/configfile/edit_conf_file.rhtml
new file mode 100644
index 0000000..1203080
--- /dev/null
+++ b/app/views/configfile/edit_conf_file.rhtml
@@ -0,0 +1,14 @@
+<%= render :partial => 'conf_links' %>
+ Edit Configuration File
+
+<% form_tag :action => "create_new_conf_file" do %>
+
+<%= hidden_field "file", "name", :value => @file_name %>
+ <%= render :partial => 'conf_details' %>
+
+
+ <%= submit_tag "Create Configuration File"%> |
+
+
+<% end %>
+
diff --git a/app/views/configfile/list_conf_file.rhtml b/app/views/configfile/list_conf_file.rhtml
new file mode 100644
index 0000000..015e866
--- /dev/null
+++ b/app/views/configfile/list_conf_file.rhtml
@@ -0,0 +1,16 @@
+<%= render :partial => 'conf_links' %>
+
+
All Configuration Files
+
+
+<% for conf in @conf_names -%>
+
+ <%= conf %> | | |
+ <%= link_to "Edit", :action => :edit_conf_file , :conf_name => conf %> |
+ | |
+ <%= link_to "delete", {:action => :delete_conf_file , :conf_name => conf}, :confirm => "Are you sure?", :method => :post %> |
+
+<% end -%>
+
+
+
diff --git a/app/views/configfile/new_conf_file.rhtml b/app/views/configfile/new_conf_file.rhtml
new file mode 100644
index 0000000..bc5b2bf
--- /dev/null
+++ b/app/views/configfile/new_conf_file.rhtml
@@ -0,0 +1,21 @@
+<%= render :partial => 'conf_links' %>
+ Create New Configuration File
+
+<% form_tag :action => "create_new_conf_file" do %>
+
+
+
+ Name of the configuration file | : | <%= text_field "file", "name", :size => "20"%> |
+ note: space is not allowed |
+
+
+
+<%= render :partial => 'conf_details' %>
+
+
+ <%= submit_tag "Create Configuration File"%> |
+
+
+
+<% end %>
+
diff --git a/app/views/configfile/split_resources.rhtml b/app/views/configfile/split_resources.rhtml
new file mode 100644
index 0000000..2476748
--- /dev/null
+++ b/app/views/configfile/split_resources.rhtml
@@ -0,0 +1,27 @@
+<%= render :partial => 'conf_links' %>
+
diff --git a/app/views/container/_links.rhtml b/app/views/container/_links.rhtml
new file mode 100644
index 0000000..4169367
--- /dev/null
+++ b/app/views/container/_links.rhtml
@@ -0,0 +1,14 @@
+
diff --git a/app/views/container/_top.html.erb b/app/views/container/_top.html.erb
new file mode 100644
index 0000000..5be3a9a
--- /dev/null
+++ b/app/views/container/_top.html.erb
@@ -0,0 +1,4 @@
+<%= link_to "Backup All Containers", {:action => :backup_all_containers}, :confirm => "Are you sure you want to backup all the containers. \nCaution: This operation may take SEVERAL MINUTES." %>
+|
+<%= link_to "Backup User's Containers", :action => :backup_user_containers %>
+
diff --git a/app/views/container/assign_to_owner.html.erb b/app/views/container/assign_to_owner.html.erb
new file mode 100644
index 0000000..428d6bb
--- /dev/null
+++ b/app/views/container/assign_to_owner.html.erb
@@ -0,0 +1,14 @@
+<%= render :partial => 'links' %>
+
+ Assign or Change Ownership of Container <%= @vps_id %>
+
+<% if @owner %>
+ Current Owner is <%= @owner.user.name %>
+<% else %>
+ No owner
+<% end %>
+
+<% form_tag :action => :change_owner, :vps_id => @vps_id do %>
+ Owner of the container : <%= select("vps","user_id", @users, :prompt => "Choose Owner") %>
+ <%= submit_tag "Change Owner" %>
+<% end %>
diff --git a/app/views/container/backup_user_containers.html.erb b/app/views/container/backup_user_containers.html.erb
new file mode 100644
index 0000000..e8ba1c5
--- /dev/null
+++ b/app/views/container/backup_user_containers.html.erb
@@ -0,0 +1,11 @@
+<%= render :partial => 'links' %>
+<%= render :partial => 'top' %>
+ Backup User's Containers
+<% form_tag :action => :create_user_backup do %>
+ Choose the owner in order to backup all the containers that belong to him/her.
+ <%= select("dump","user_id", @users, :prompt => "Choose Owner") %>
+ <%= submit_tag "Backup" %>
+
+ Caution: This process may take several minutes.
+<% end %>
+
diff --git a/app/views/container/backups.html.erb b/app/views/container/backups.html.erb
new file mode 100644
index 0000000..b2d29f7
--- /dev/null
+++ b/app/views/container/backups.html.erb
@@ -0,0 +1,21 @@
+<%= render :partial => 'links' %>
+<%= render :partial => 'top' %>
+
+
+ All the dumped files
+
+ File Name | Owner |
+<% i = 1 %>
+<% for dump in @dumps %>
+
+ <% i = 1 - i %>
+ <%= dump[1] %> |
+ <% id = dump[1].gsub("vzdump-",'').gsub('.tar','').gsub("\n",'') %>
+ <% vps = Vps.find_by_cnt_id(id) %>
+ <%= vps.user.name if vps%> |
+ <%= link_to "delete", {:action => :delete_dump, :dump_id => id}, :confirm => "Are you sure?", :method => :post %> |
+ <%= link_to "restore", :action => :restore, :dump_id => id %> |
+
+<% end %>
+
+
diff --git a/app/views/container/list_vps.rhtml b/app/views/container/list_vps.rhtml
new file mode 100644
index 0000000..1579365
--- /dev/null
+++ b/app/views/container/list_vps.rhtml
@@ -0,0 +1,51 @@
+<%= render :partial => 'links' %>
+ You have <%= pluralize(@rows.size, "#{@status} container") %>
+
+
+ Distro | Cnt ID | Name | No. Ps | Status | IP Address | Hostname | Owner |
+<% i = 1 %>
+<% z = 0 %>
+<% for row in @rows -%>
+ <% i = 1 -i%>
+ ">
+ <%= 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? %> |
+ <%=link_to row[0],:controller => :inside_vps, :action => :view_vps, :vps_id => row[0]%> |
+
+ <%= @names[z] %> <% z = z + 1 %> |
+ <%=link_to row[1],:controller => :inside_vps, :action => :running_processes, :vps_id =>row[0]%> |
+ <%=row[2]%> |
+ <%=row[3]%> |
+ <%=row[4]%> |
+
+ <% 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 %>
+ |
+
+
+
+ ">
+ |
+ |
+ |
+ <% if row[2].include?("running") %>
+ <%= link_to "stop", :action => :stop_vps, :vps_id => row[0] %> |
+ <%= link_to "restart" , :action => :restart_vps, :vps_id => row[0] %> |
+ <% else %>
+ <%= link_to "start", :action => :start_vps, :vps_id => row[0] %> |
+ <% if session[:permission] == "admin" %>
+ <%= link_to "destroy", {:action => :destroy_vps, :vps_id => row[0]}, :confirm => "Are you sure?", :method => :post %> |
+ <% end %>
+ <% end %>
+ <% if session[:permission] == "admin" %>
+ <%= link_to "migrate", :action => :migrate_vps, :vps_id => row[0] %> |
+ <%= link_to "create backup", :action => :create_backup, :vps_id => row[0] %> |
+ <% end %>
+ <%= link_to "Change Owner", :action => :assign_to_owner, :vps_id =>row[0] %> |
+
+<% end -%>
+
+
diff --git a/app/views/container/migrate_vps.rhtml b/app/views/container/migrate_vps.rhtml
new file mode 100644
index 0000000..39ccea1
--- /dev/null
+++ b/app/views/container/migrate_vps.rhtml
@@ -0,0 +1,50 @@
+<%= render :partial => 'links' %>
+ Virtual Environment Migration
+<% form_tag :action => "vzmigrate", :vps_id => @vps_id do %>
+
+
+
+ Destination IP Address. | : | <%= text_field "vps", "ip", :size => 25 %> |
+
+
+
+ Remove VE area on source Host Node for the successfully migrated VE. | : |
+
+ Yes <%= radio_button "vps", "r", "yes" %>
+ No <%= radio_button "vps", "r", "no", :checked => true %>
+ |
+
+
+
+ Perform online (zero-downtime) migration. | : |
+
+ Yes <%= radio_button "vps", "online", "yes" %>
+ No <%= radio_button "vps", "online", "no" , :checked => true %>
+ |
+
+
+
+ Do not clean synced destination VE private area in case of some error. | : |
+
+ Yes <%= radio_button "vps", "keepdst", "yes" %>
+ No <%= radio_button "vps", "keepdst", "no", :checked => true %>
+ |
+
+
+ Show output details (verbose). | : |
+
+ Yes <%= radio_button "vps", "v", "yes" %>
+ No <%= radio_button "vps", "v", "no", :checked => true %>
+ |
+
+
+
+ <%= submit_tag "migrate" %>
+ |
+
+
+
+<% end %>
+
+ Warning: This operation may take several minutes, please wait.
+
diff --git a/app/views/container/new_vps.rhtml b/app/views/container/new_vps.rhtml
new file mode 100644
index 0000000..a3acf1b
--- /dev/null
+++ b/app/views/container/new_vps.rhtml
@@ -0,0 +1,14 @@
+<%= render :partial => 'links' %>
+ Create New Container
+<%= error_messages_for :vps %>
+
+
+<% form_tag :action => "create_vps" do %>
+
+ <%= render :partial => 'form' %>
+
+ <%= submit_tag "Create"%> |
+
+
+<% end %>
+
diff --git a/app/views/container/restore.html.erb b/app/views/container/restore.html.erb
new file mode 100644
index 0000000..e53f0c4
--- /dev/null
+++ b/app/views/container/restore.html.erb
@@ -0,0 +1,17 @@
+<%= render :partial => 'links' %>
+<%= render :partial => 'top' %>
+
+
+ Restore Container <%= @dump_id %>
+
+<% form_tag :action => :restore_dump, :dump_id => @dump_id do %>
+
+ Owner of the container: <%= select("dump","user_id", @users, :prompt => "Choose Owner") %>
+
+
+ New Container ID: <%= text_field("dump","id") %> NOTE: The ID Must be different from <%= @dump_id %> or any other used container ids
+
+
+ <%= submit_tag "Restore" %>
+
+<% end %>
diff --git a/app/views/inside_vps/_links.rhtml b/app/views/inside_vps/_links.rhtml
new file mode 100644
index 0000000..4c3b1c0
--- /dev/null
+++ b/app/views/inside_vps/_links.rhtml
@@ -0,0 +1,22 @@
+
diff --git a/app/views/inside_vps/adv_net.rhtml b/app/views/inside_vps/adv_net.rhtml
new file mode 100644
index 0000000..4df975a
--- /dev/null
+++ b/app/views/inside_vps/adv_net.rhtml
@@ -0,0 +1,58 @@
+<%= render :partial => 'links' %>
+
+
Advanced Network Configuration
+
+<% form_tag :action => "edit_adv_net", :vps_id => @vps_id do %>
+
+
+ Parameter | | Barrier | limit |
+
+
+ Number of TCP Sockets |
+ : |
+ <% v = @conf_file["NUMTCPSOCK"].split(":") %>
+ <%= text_field "conf", "NUMTCPSOCK1", :value => v[0].gsub("\"", ""), :size => "20"%> |
+ <%= text_field "conf", "NUMTCPSOCK2", :value => v[1].gsub("\"", ""), :size => "20"%> |
+
+
+ TCP Send Buffer Size |
+ : |
+ <% v = @conf_file["TCPSNDBUF"].split(":") %>
+ <%= text_field "conf", "TCPSNDBUF1", :value => v[0].gsub("\"", ""), :size => "20"%> |
+ <%= text_field "conf", "TCPSNDBUF2", :value => v[1].gsub("\"", ""), :size => "20"%> |
+
+
+ TCP Recieve Buffer Size |
+ : |
+ <% v = @conf_file["TCPRCVBUF"].split(":") %>
+ <%= text_field "conf", "TCPRCVBUF1", :value => v[0].gsub("\"", ""), :size => "20"%> |
+ <%= text_field "conf", "TCPRCVBUF2", :value => v[1].gsub("\"", ""), :size => "20"%> |
+
+
+ Other Socket Buffer Size |
+ : |
+ <% v = @conf_file["OTHERSOCKBUF"].split(":") %>
+ <%= text_field "conf", "OTHERSOCKBUF1", :value => v[0].gsub("\"", ""), :size => "20"%> |
+ <%= text_field "conf", "OTHERSOCKBUF2", :value => v[1].gsub("\"", ""), :size => "20"%> |
+
+
+ UDP Recieve Buffer Size |
+ : |
+ <% v = @conf_file["DGRAMRCVBUF"].split(":") %>
+ <%= text_field "conf", "DGRAMRCVBUF1", :value => v[0].gsub("\"", ""), :size => "20"%> |
+ <%= text_field "conf", "DGRAMRCVBUF2", :value => v[1].gsub("\"", ""), :size => "20"%> |
+
+
+ Number of Other Sockets |
+ : |
+ <% v = @conf_file["NUMOTHERSOCK"].split(":") %>
+ <%= text_field "conf", "NUMOTHERSOCK1", :value => v[0].gsub("\"", ""), :size => "20"%> |
+ <%= text_field "conf", "NUMOTHERSOCK2", :value => v[1].gsub("\"", ""), :size => "20"%> |
+
+
+ <%= submit_tag "Edit"%> |
+
+
+
+<% end %>
+
diff --git a/app/views/inside_vps/basic_net.rhtml b/app/views/inside_vps/basic_net.rhtml
new file mode 100644
index 0000000..f3030a8
--- /dev/null
+++ b/app/views/inside_vps/basic_net.rhtml
@@ -0,0 +1,77 @@
+<%= render :partial => 'links' %>
+
+
Basic Network Configuration
+
+
+<% form_tag :action => "edit_hostname", :vps_id => @vps_id do %>
+
+ Hostname | : |
+
+ <% unless @conf_file["HOSTNAME"].blank? %>
+ <%= text_field "conf", "HOSTNAME", :value => @conf_file["HOSTNAME"].gsub("\"", "") %>
+ <% else %>
+ <%= text_field "conf", "HOSTNAME" %>
+ <% end %>
+ |
+ <%= submit_tag "Edit"%> |
+<% end %>
+
+
+
+
+
+
+
+ IP Address(es) |
+
+ <% unless @conf_file["IP_ADDRESS"].blank? %>
+ <% addresses = @conf_file["IP_ADDRESS"].split(" ") %>
+ <% for address in addresses %>
+
+ <%= address.gsub("\"", "") %> |
+ <%= link_to "delete", {:action => :delete_ip, :ip => address.gsub("\"", ""), :vps_id => @vps_id}, :confirm => "Are you sure?", :method => :post %> |
+
+ <% end %>
+
+ New IP Address | : |
+ <% form_tag :action => "add_ip", :vps_id => @vps_id do %>
+ <%= text_field "conf", "IP_ADDRESS" %> |
+ <%= submit_tag "Add IP" %> |
+
+ <% end %>
+ <% else %>
+ No IP addresses have been assigned. |
+
+ New IP Address | : |
+ <% form_tag :action => "add_ip", :vps_id => @vps_id do %>
+ <%= text_field "conf", "IP_ADDRESS" %> |
+ <%= submit_tag "Add IP" %> |
+
+ <% end %>
+ <% end %>
+
+
+
+
+
+
+
+ Nameserver | : |
+
+ <% unless @conf_file["NAMESERVER"].blank? %>
+ <% form_tag :action => "edit_nameserver", :vps_id => @vps_id do %>
+ | <%= text_field "conf", "NAMESERVER", :value => @conf_file["NAMESERVER"].gsub("\"", "") %>
+ <%= submit_tag "edit nameserver" %>
+ |
+ <% end %>
+ <% else %>
+ <% form_tag :action => "edit_nameserver", :vps_id => @vps_id do %>
+ <%= text_field "conf", "NAMESERVER" %>
+ <%= submit_tag "edit nameserver" %>
+ |
+ <% end %>
+ <% end %>
+
+
+
+
diff --git a/app/views/inside_vps/booting.rhtml b/app/views/inside_vps/booting.rhtml
new file mode 100644
index 0000000..30dd374
--- /dev/null
+++ b/app/views/inside_vps/booting.rhtml
@@ -0,0 +1,28 @@
+<%= render :partial => 'links' %>
+
+ Enable/Disable Booting of Container <%= @vps_id %>
+
+
+
+<% form_tag :action => :edit_booting, :vps_id => @vps_id do %>
+
+ Enable booting on startup | : |
+
+ <% if @conf_file["ONBOOT"].include?("yes") %>
+ Yes <%= radio_button "conf", "booting", "yes", :checked => true %>
+ No <%= radio_button "conf", "booting", "no" %>
+ <% else %>
+ Yes <%= radio_button "conf", "booting", "yes" %>
+ No <%= radio_button "conf", "booting", "no", :checked => true %>
+ <% end %>
+ |
+
+
+
+ <%= submit_tag "Change" %> |
+
+<% end -%>
+
+
+
+
diff --git a/app/views/inside_vps/cpu_mgt.rhtml b/app/views/inside_vps/cpu_mgt.rhtml
new file mode 100644
index 0000000..4a0cff7
--- /dev/null
+++ b/app/views/inside_vps/cpu_mgt.rhtml
@@ -0,0 +1,30 @@
+<%= render :partial => 'links' %>
+
+
+
CPU Management Panel
+
+<% form_tag :action => "edit_cpu_mgt", :vps_id => @vps_id do %>
+
+
+ Parameter | | Value |
+
+
+ Guaranteed Minimum CPU |
+ : |
+ <%= text_field "conf", "CPUUNITS", :value => @conf_file["CPUUNITS"].gsub("\"", ""), :size => "20"%> |
+
+
+
+ Number of processes |
+ : |
+ <% v = @conf_file["NUMPROC"].split(":") %>
+ <%= text_field "conf", "NUMPROC1", :value => v[0].gsub("\"", ""), :size => "20"%> |
+ <%= text_field "conf", "NUMPROC2", :value => v[1].gsub("\"", ""), :size => "20"%> |
+
+
+ <%= submit_tag "Edit"%> |
+
+
+
+<% end %>
+
diff --git a/app/views/inside_vps/disk_mgt.rhtml b/app/views/inside_vps/disk_mgt.rhtml
new file mode 100644
index 0000000..bef237f
--- /dev/null
+++ b/app/views/inside_vps/disk_mgt.rhtml
@@ -0,0 +1,34 @@
+<%= render :partial => 'links' %>
+
+
+
Disk Management Panel
+<% form_tag :action => "edit_disk_mgt", :vps_id => @vps_id do %>
+
+ Parameter | | Barrier | limit |
+
+
+ Disk Space (KByte) |
+ : |
+ <% v = @conf_file["DISKSPACE"].split(":") %>
+ <%= text_field "conf", "DISKSPACE1", :value => v[0].gsub("\"", ""), :size => "20"%> |
+ <%= text_field "conf", "DISKSPACE2", :value => v[1].gsub("\"", ""), :size => "20"%> |
+
+
+
+ Disk Inodes |
+ : |
+ <% v = @conf_file["DISKINODES"].split(":") %>
+ <%= text_field "conf", "DISKINODES1", :value => v[0].gsub("\"", ""), :size => "20"%> |
+ <%= text_field "conf", "DISKINODES2", :value => v[1].gsub("\"", ""), :size => "20"%> |
+
+
+ Quota Time |
+ : |
+ <%= text_field "conf", "QUOTATIME", :value => @conf_file["QUOTATIME"].gsub("\"", ""), :size => "20" unless @conf_file["QUOTATIME"].blank?%> |
+
+
+ <%= submit_tag "Edit"%> |
+
+
+<% end -%>
+
diff --git a/app/views/inside_vps/edit_adv_net.rhtml b/app/views/inside_vps/edit_adv_net.rhtml
new file mode 100644
index 0000000..22aaa8e
--- /dev/null
+++ b/app/views/inside_vps/edit_adv_net.rhtml
@@ -0,0 +1,10 @@
+<%= @conf.inspect %>
+
+
+<%= @conf_file.inspect %>
+
+
+<%= @conf_file.size%>
+
+
+<%= @vps_id.inspect %>
diff --git a/app/views/inside_vps/execute_cmd.rhtml b/app/views/inside_vps/execute_cmd.rhtml
new file mode 100644
index 0000000..fafba01
--- /dev/null
+++ b/app/views/inside_vps/execute_cmd.rhtml
@@ -0,0 +1,19 @@
+<%= render :partial => 'links' %>
+
+ Execute Linux Commands in <%= @vps_id %>
+
+
+<% form_tag :action => :execute_cmd, :vps_id => @vps_id do %>
+<%= text_field "command", "line" , :size => "40"%>
+<%= submit_tag "RUN" %>
+<% end -%>
+
+
+
You executed: <%= @cmd %>
+
+
The output:
+
+
+ <%= @output.gsub(/\n/, ' ') %> |
+
+
diff --git a/app/views/inside_vps/memory_mgt.rhtml b/app/views/inside_vps/memory_mgt.rhtml
new file mode 100644
index 0000000..550dc7c
--- /dev/null
+++ b/app/views/inside_vps/memory_mgt.rhtml
@@ -0,0 +1,74 @@
+<%= render :partial => 'links' %>
+
+
+
Memeory Management Panel
+
+<% form_tag :action => "edit_memory", :vps_id => @vps_id do %>
+
+
+ Parameter | | Barrier | limit |
+
+
+ Kernel Memory Size |
+ : |
+ <% v = @conf_file["KMEMSIZE"].split(":") %>
+ <%= text_field "conf", "KMEMSIZE1", :value => v[0].gsub("\"", ""), :size => "20"%> |
+ <%= text_field "conf", "KMEMSIZE2", :value => v[1].gsub("\"", ""), :size => "20"%> |
+
+
+
+ Number of Locked Pages |
+ : |
+ <% v = @conf_file["LOCKEDPAGES"].split(":") %>
+ <%= text_field "conf", "LOCKEDPAGES1", :value => v[0].gsub("\"", ""), :size => "20"%> |
+ <%= text_field "conf", "LOCKEDPAGES2", :value => v[1].gsub("\"", ""), :size => "20"%> |
+
+
+ Private VM Pages |
+ : |
+ <% v = @conf_file["PRIVVMPAGES"].split(":") %>
+ <%= text_field "conf", "PRIVVMPAGES1", :value => v[0].gsub("\"", ""), :size => "20"%> |
+ <%= text_field "conf", "PRIVVMPAGES2", :value => v[1].gsub("\"", ""), :size => "20"%> |
+
+
+ Number of shm Pages |
+ : |
+ <% v = @conf_file["SHMPAGES"].split(":") %>
+ <%= text_field "conf", "SHMPAGES1", :value => v[0].gsub("\"", ""), :size => "20"%> |
+ <%= text_field "conf", "SHMPAGES2", :value => v[1].gsub("\"", ""), :size => "20"%> |
+
+
+ Physical Pages |
+ : |
+ <% v = @conf_file["PHYSPAGES"].split(":") %>
+ <%= text_field "conf", "PHYSPAGES1", :value => v[0].gsub("\"", ""), :size => "20"%> |
+ <%= text_field "conf", "PHYSPAGES2", :value => v[1].gsub("\"", ""), :size => "20"%> |
+
+
+ VM Guar Pages |
+ : |
+ <% v = @conf_file["VMGUARPAGES"].split(":") %>
+ <%= text_field "conf", "VMGUARPAGES1", :value => v[0].gsub("\"", ""), :size => "20"%> |
+ <%= text_field "conf", "VMGUARPAGES2", :value => v[1].gsub("\"", ""), :size => "20"%> |
+
+
+ OOM Guar Pages |
+ : |
+ <% v = @conf_file["OOMGUARPAGES"].split(":") %>
+ <%= text_field "conf", "OOMGUARPAGES1", :value => v[0].gsub("\"", ""), :size => "20"%> |
+ <%= text_field "conf", "OOMGUARPAGES2", :value => v[1].gsub("\"", ""), :size => "20"%> |
+
+
+ Disk Cache Size |
+ : |
+ <% v = @conf_file["DCACHESIZE"].split(":") %>
+ <%= text_field "conf", "DCACHESIZE1", :value => v[0].gsub("\"", ""), :size => "20"%> |
+ <%= text_field "conf", "DCACHESIZE2", :value => v[1].gsub("\"", ""), :size => "20"%> |
+
+
+ <%= submit_tag "Edit"%> |
+
+
+
+<% end %>
+
diff --git a/app/views/inside_vps/misc.rhtml b/app/views/inside_vps/misc.rhtml
new file mode 100644
index 0000000..41640d3
--- /dev/null
+++ b/app/views/inside_vps/misc.rhtml
@@ -0,0 +1,52 @@
+<%= render :partial => 'links' %>
+
+
Miscellaneous
+
+<% form_tag :action => "edit_misc", :vps_id => @vps_id do %>
+
+
+ Parameter | | Barrier | limit |
+
+
+ Number of files lock |
+ : |
+ <% v = @conf_file["NUMFLOCK"].split(":") %>
+ <%= text_field "conf", "NUMFLOCK1", :value => v[0].gsub("\"", ""), :size => "20"%> |
+ <%= text_field "conf", "NUMFLOCK2", :value => v[1].gsub("\"", ""), :size => "20"%> |
+
+
+
+ Number of PTYs |
+ : |
+ <% v = @conf_file["NUMPTY"].split(":") %>
+ <%= text_field "conf", "NUMPTY1", :value => v[0].gsub("\"", ""), :size => "20"%> |
+ <%= text_field "conf", "NUMPTY2", :value => v[1].gsub("\"", ""), :size => "20"%> |
+
+
+ Number of Open Files |
+ : |
+ <% v = @conf_file["NUMFILE"].split(":") %>
+ <%= text_field "conf", "NUMFILE1", :value => v[0].gsub("\"", ""), :size => "20"%> |
+ <%= text_field "conf", "NUMFILE2", :value => v[1].gsub("\"", ""), :size => "20"%> |
+
+
+ Number of SIGINFO |
+ : |
+ <% v = @conf_file["NUMSIGINFO"].split(":") %>
+ <%= text_field "conf", "NUMSIGINFO1", :value => v[0].gsub("\"", ""), :size => "20"%> |
+ <%= text_field "conf", "NUMSIGINFO2", :value => v[1].gsub("\"", ""), :size => "20"%> |
+
+
+ Number of IPTENT |
+ : |
+ <% v = @conf_file["NUMIPTENT"].split(":") %>
+ <%= text_field "conf", "NUMIPTENT1", :value => v[0].gsub("\"", ""), :size => "20"%> |
+ <%= text_field "conf", "NUMIPTENT2", :value => v[1].gsub("\"", ""), :size => "20"%> |
+
+
+ <%= submit_tag "Edit"%> |
+
+
+
+<% end %>
+
diff --git a/app/views/inside_vps/monitor_resources.rhtml b/app/views/inside_vps/monitor_resources.rhtml
new file mode 100644
index 0000000..db53545
--- /dev/null
+++ b/app/views/inside_vps/monitor_resources.rhtml
@@ -0,0 +1,23 @@
+<%= render :partial => 'links' %>
+
+
+
User Bean Counter for <%= @vps_id %>
+
+ Resource | Held | Max held | Barrier | Limit | Failcnt |
+<% for entry in @ubc -%>
+ <% values = entry.split(" ") %>
+ <% if values[5].to_i.zero? %>
+
+ <% else %>
+
+ <% end %>
+ <%= values[0] %> |
+ <%= values[1] %> |
+ <%= values[2] %> |
+ <%= values[3] %> |
+ <%= values[4] %> |
+ <%= values[5] %> |
+
+<% end -%>
+
+
diff --git a/app/views/inside_vps/run_command.rhtml b/app/views/inside_vps/run_command.rhtml
new file mode 100644
index 0000000..09d4c53
--- /dev/null
+++ b/app/views/inside_vps/run_command.rhtml
@@ -0,0 +1,9 @@
+<%= render :partial => 'links' %>
+
+
+
Execute Linux Commands in <%= @vps_id %>
+<% form_tag :action => :execute_cmd, :vps_id => @vps_id do %>
+<%= text_field "command", "line" , :size => "40"%>
+<%= submit_tag "RUN" %>
+<% end -%>
+
diff --git a/app/views/inside_vps/running_processes.rhtml b/app/views/inside_vps/running_processes.rhtml
new file mode 100644
index 0000000..e320d63
--- /dev/null
+++ b/app/views/inside_vps/running_processes.rhtml
@@ -0,0 +1,23 @@
+<%= render :partial => 'links' %>
+
+
+
Running Processes for <%= @vps_id %>
+
+ User | PID | %CPU | %MEM | VSZ | RSS | Stat | Start | Time | Command |
+ <% for entry in @procs -%>
+ <% values = entry.split(" ") %>
+
+ <%= values[0] %> |
+ <%= values[1] %> |
+ <%= values[2] %> |
+ <%= values[3] %> |
+ <%= values[4] %> |
+ <%= values[5] %> |
+ <%= values[7] %> |
+ <%= values[8] %> |
+ <%= values[9] %> |
+ <%= values[10] %> |
+
+ <% end -%>
+
+
diff --git a/app/views/inside_vps/services.html.erb b/app/views/inside_vps/services.html.erb
new file mode 100644
index 0000000..5f95218
--- /dev/null
+++ b/app/views/inside_vps/services.html.erb
@@ -0,0 +1,28 @@
+<%= render :partial => 'links' %>
+
+
All services in container <%= @vps_id %>
+
+
+ Name | Status | Operations |
+ <% for service in @all_services -%>
+
+ <%= service %> |
+ <% out = `vzctl exec #{@vps_id} /etc/init.d/#{service} status` %>
+ <%= out %> |
+
+ <% if out.include?('is running') %>
+ <%= link_to "stop", :action => :stop_service, :vps_id => @vps_id, :ser_name => service %>
+ | <%= link_to "restart", :action => :start_service, :vps_id => @vps_id, :ser_name => service %> |
+ <% elsif out.include?('is stopped') %>
+ <%= link_to "start", :action => :start_service, :vps_id => @vps_id, :ser_name => service %>
+
+ <% else %>
+
+ <%= link_to "stop", :action => :stop_service, :vps_id => @vps_id, :ser_name => service %>
+ | <%= link_to "restart", :action => :start_service, :vps_id => @vps_id, :ser_name => service %>
+ | <%= link_to "start", :action => :start_service, :vps_id => @vps_id, :ser_name => service %>
+ <% end -%>
+
+ <% end -%>
+
+
diff --git a/app/views/inside_vps/view_vps.rhtml b/app/views/inside_vps/view_vps.rhtml
new file mode 100644
index 0000000..7103e61
--- /dev/null
+++ b/app/views/inside_vps/view_vps.rhtml
@@ -0,0 +1,34 @@
+<%= render :partial => 'links' %>
+
+
+
General Information About Container <%= @vps_id %>
+
+
+ Container | : | <%= image_tag("icons/"+@line[5].downcase+".png", :border => 0) unless @line[5].blank? %> |
+
+
+ Container ID | : | <%= @vps_id %> |
+
+
+ Name | : |
+ <% form_tag :action => :change_name, :vps_id => @vps_id do %>
+ <%= text_field "vps", "new_name" , :size => "15", :value => @name %>
+ <%= submit_tag "Change" %> |
+ <% end -%>
+
+
+ Container Status | : | <%= @line[2] %> |
+
+
+ IP Address | : | <%= @line[3] %> |
+
+
+ Hostname | : | <%= @line[4] %> |
+
+
+ Uptime | : | <%= @uptime %> |
+
+
+
+
+
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb
new file mode 100644
index 0000000..34dfb9e
--- /dev/null
+++ b/app/views/layouts/application.html.erb
@@ -0,0 +1,58 @@
+
+WebVZ: OpenVZ Management Tool
+<%= stylesheet_link_tag 'webvz' %>
+
+
+
+ <%= link_to image_tag("webvz_small.jpg", :alt => "WebVZ logo", :width => "146", :height => "80", :border => "0"), :controller => :menu, :action => :index %>
+
+
+
+ <% if flash[:notice] %>
+
+
Notice
+
<%= flash[:notice].gsub("\n", "
") %>
+
+ <% end -%>
+
+
+
+ <%if session[:permission] == "admin" %>
+ - <%= link_to " Containers " , :controller => :container, :action => :list_vps, :status=> "all" %>
+ - <%= link_to " OS-Templates ", :controller => :ostemplate, :action => :list_templates%>
+ - <%= link_to "Configuration files ", :controller => :configfile, :action => :list_conf_file %>
+ - <%= link_to " OpenVZ" , :controller => :openvz, :action => :vz_status%>
+ - <%= link_to " Users ", :controller => :user, :action => :list %>
+ <% end -%>
+
+ <% if session[:permission] == "client" %>
+ - <%= link_to " Containers " , :controller => :user_containers, :action => :list_vps, :status=> "all", :id => session[:user_id] %>
+ - <%= link_to " Personalize ", :controller => :user_information, :action => :view_user_by_user, :id => session[:user_id] %>
+ <% end -%>
+
+ - <%= link_to " About ", :controller => :menu, :action => :about %>
+
+ <%if session[:permission] == nil -%>
+ - <%= link_to " Login ", :controller => :login, :action => :sign_in %>
+ <% end -%>
+
+ <% if session[:user_name] %>
+ - <%= link_to " Logout (#{session[:user_name]})", :controller => :login, :action => :logout%>
+ <% end %>
+
+
+
+
+ <%= yield %>
+
+
+ All Rights Reserved © Shuaib Zahda 2008
+
+
+