[Libcloud-list] [PATCH server] Give dcloud its own db.
by jason.guiditta
Also, clean up directions for creating w/ postgres
so you can actually use rake db* commands properly.
Signed-off-by: Jason Guiditta <jason.guiditta(a)gmail.com>
---
src/config/database.yml | 24 +++++++++---------------
1 files changed, 9 insertions(+), 15 deletions(-)
diff --git a/src/config/database.yml b/src/config/database.yml
index 5de15c9..70771e1 100644
--- a/src/config/database.yml
+++ b/src/config/database.yml
@@ -5,14 +5,8 @@
# sudo /sbin/service postgresql initdb
# sudo /sbin/service postgresql start
# sudo su - postgres
-# $ psql ovirt
-# $-# CREATE USER ovirt WITH PASSWORD 'v23zj59an';
-# $-# CREATE DATABASE ovirt_development;
-# $-# GRANT ALL PRIVILEGES ON DATABASE ovirt_development to ovirt;
-# $-# CREATE DATABASE ovirt_test;
-# $-# GRANT ALL PRIVILEGES ON DATABASE ovirt_test to ovirt;
-# $-# CREATE DATABASE ovirt;
-# $-# GRANT ALL PRIVILEGES ON DATABASE ovirt to ovirt;
+# $ psql
+# $-# CREATE USER dcloud WITH PASSWORD 'v23zj59an' CREATEDB;
# $-# \q
# $ exit
#
@@ -23,7 +17,7 @@
# rake db:migrate
# rake db:test:prepare
#
-# And when there are changes to the database, simple run:
+# And when there are changes to the database, simply run:
#
# rake db:migrate
# rake db:test:prepare
@@ -36,23 +30,23 @@
development:
adapter: postgresql
- database: ovirt_development
- username: ovirt
+ database: dcloud_development
+ username: dcloud
password: v23zj59an
host: localhost
# Warning: The database defined as 'test' will be erased and
-# re-generated from your development database when you run 'rake'.
+# re-generated from your development database when you run 'rake test'.
# Do not set this db to the same as development or production.
test:
adapter: postgresql
- database: ovirt_test
+ database: dcloud_test
username: postgres
host: localhost
production:
adapter: postgresql
- database: ovirt
- username: ovirt
+ database: dcloud
+ username: dcloud
password: v23zj59an
host: localhost
--
1.6.2.5
14 years, 10 months
[Libcloud-list] [PATCH server] Clear out some layout detritus.
by jason.guiditta
Signed-off-by: Jason Guiditta <jason.guiditta(a)gmail.com>
---
src/app/views/layouts/_alertbox.rhtml | 8 --
.../views/layouts/_hardware_pool_type_list.rhtml | 17 -----
src/app/views/layouts/_quick_stats.rhtml | 33 ---------
src/app/views/layouts/_side_toolbar.rhtml | 41 -----------
src/app/views/layouts/ovirt-layout.rhtml | 74 --------------------
5 files changed, 0 insertions(+), 173 deletions(-)
delete mode 100644 src/app/views/layouts/_alertbox.rhtml
delete mode 100644 src/app/views/layouts/_hardware_pool_type_list.rhtml
delete mode 100644 src/app/views/layouts/_quick_stats.rhtml
delete mode 100644 src/app/views/layouts/_side_toolbar.rhtml
delete mode 100644 src/app/views/layouts/ovirt-layout.rhtml
diff --git a/src/app/views/layouts/_alertbox.rhtml b/src/app/views/layouts/_alertbox.rhtml
deleted file mode 100644
index 960f458..0000000
--- a/src/app/views/layouts/_alertbox.rhtml
+++ /dev/null
@@ -1,8 +0,0 @@
-<div class = "alertbox">
-<%- for name in [:notice, :errmsg] -%>
- <%- if flash[name] -%>
- <%= "<div class=\"flash\" id=\"#{name}\">#{flash[name]} #{link_to_function image_tag('closebox-11.png'), 'closeFlash();', { :class => 'flash-close' }}</div>" -%>
- <%= timeout_flash name -%>
- <%- end -%>
-<%- end -%>
-</div>
diff --git a/src/app/views/layouts/_hardware_pool_type_list.rhtml b/src/app/views/layouts/_hardware_pool_type_list.rhtml
deleted file mode 100644
index d4dee4c..0000000
--- a/src/app/views/layouts/_hardware_pool_type_list.rhtml
+++ /dev/null
@@ -1,17 +0,0 @@
-<div class="inside">
- <%- if defined? hardware_pools and ! hardware_pools.nil? -%>
- <div class="data-table-column">
- <strong class="header">Hardware Pools (<%= hardware_pools.size -%>)</strong>
- <%= render :partial => "/hardware/list", :locals => { :hardware_pools => hardware_pools } %>
- </div> <!-- end .data-table-column -->
- <%- end -%>
-
- <%- if defined? vm_resource_pools and ! vm_resource_pools.nil? -%>
- <div class="data-table-column">
- <strong class="header">VM Resource Pools (<%= vm_resource_pools.size -%>)</strong>
- <%= render :partial => "/resources/list", :locals => { :vm_resource_pools => vm_resource_pools } %>
- </div> <!-- end .data-table-column -->
- <%- end -%>
-
-</div> <!-- end #data-table.inside -->
-
diff --git a/src/app/views/layouts/_quick_stats.rhtml b/src/app/views/layouts/_quick_stats.rhtml
deleted file mode 100644
index 280224d..0000000
--- a/src/app/views/layouts/_quick_stats.rhtml
+++ /dev/null
@@ -1,33 +0,0 @@
-<div class="dataTable">
-
- <div class="inside">
-
- <%- if hpool -%>
- <div class="data-table-column">
- <strong>Active Hosts</strong>
- <div><strong><%= hpool.hosts.size %></strong> Hosts</div>
- <div><strong><%= hpool.hosts.total_cpus %></strong> CPUs</div>
- </div>
- <%- end -%>
-
- <%- if hpool -%>
- <div class="data-table-column">
- <strong>Active Storage</strong>
- <div><strong><%= hpool.storage_pools.size %></strong> Storage Pools</div>
- <div><strong><%= hpool.total_storage_volumes %></strong> Storage Volumes</div>
- <div><strong><%= hpool.storage_pools.total_size_in_gb %></strong> GB</div>
- </div>
- <%- end -%>
-
- <%- if vms -%>
- <div class="data-table-column">
- <strong>Active VMs</strong>
- <div><strong><%= vms.size %></strong> Virtual Machines</div>
- </div>
- <%- end -%>
-
- </div> <!-- end #data-table.inside -->
-
-</div> <!-- end .dataTable -->
-
-<%= render :partial => '/layouts/alertbox' %>
diff --git a/src/app/views/layouts/_side_toolbar.rhtml b/src/app/views/layouts/_side_toolbar.rhtml
deleted file mode 100644
index b4fbe86..0000000
--- a/src/app/views/layouts/_side_toolbar.rhtml
+++ /dev/null
@@ -1,41 +0,0 @@
-<% pool = @current_pool_id ? Pool.find(@current_pool_id) : nil %>
-<% if pool and pool[:type]=="HardwarePool"
- delete_url = url_for(:controller => "hardware", :action => "destroy")
- elsif pool and pool[:type]=="VmResourcePool"
- delete_url = url_for(:controller => "resources", :action => "destroy")
- elsif pool and pool[:type]=="SmartPool"
- delete_url = url_for(:controller => "smart_pools", :action => "destroy")
- else
- delete_url = ""
- end %>
-
-<%if pool -%>
- <%if pool[:type]=="HardwarePool" and @can_modify -%>
- <div class="toolbar" style="float:left;">
- <a href="<%= url_for :controller => :hardware, :action => 'new', :parent_id => pool %>" rel="facebox[.bolder]">
- <%=image_tag "toolbar_add_hdwarepool.png", :title=>"Add Hardware Pool" %>
- </a>
- </div>
- <div class="toolbar" style="float:left;">
- <a href="<%= url_for :controller => 'resources', :action => 'new', :parent_id => pool %>" rel="facebox[.bolder]">
- <%= image_tag "toolbar_add_vmpool.png", :title=>"Add Virtual Machine Pool" %>
- </a>
- </div>
- <% end -%>
-<% end -%>
-<div class="toolbar" style="float:left;">
- <a href="<%= url_for :controller => :smart_pools, :action => 'new' %>" rel="facebox[.bolder]">
- <%=image_tag "toolbar_add_smartpool.png", :title=>"Add Smart Pool" %>
- </a>
-</div>
-<%if pool and @can_modify -%>
- <div class="toolbar" style="float:left;">
- <a href="#conf_nav_delete_pool" rel="facebox[.bolder]">
- <%= image_tag "toolbar_delete.png", :title=>"Delete Selected Pool" %>
- </a>
- </div>
- <div class="toolbar" style="display:none;">
- <%= confirmation_dialog("conf_nav_delete_pool", "Are you sure?", "delete_pool('#{delete_url}', #{pool.id})") %>
- </div>
-<% end -%>
-<div class="toolbar"></div>
diff --git a/src/app/views/layouts/ovirt-layout.rhtml b/src/app/views/layouts/ovirt-layout.rhtml
deleted file mode 100644
index 96d817a..0000000
--- a/src/app/views/layouts/ovirt-layout.rhtml
+++ /dev/null
@@ -1,74 +0,0 @@
-<html xmlns="http://ww.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
-
- <head>
-
- <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
-
- <!-- dynamically filled in page title -->
- <title>ovirt: <%= @page_title %></title>
-
- <link rel="stylesheet" href="/style.css" type="text/css" />
-
- </head>
-
- <body class="<%= @body_class %>">
-
- <div id="topbar">
-
- <div id="page-title">
-
- <!-- dynamically filled in page title -->
- <span id="title-text">ovirt</span>
- </div>
- </div>
- <div id="pageLogin">
- <span>
- Logged in as: <%= @request.env["HTTP_X_FORWARDED_USER"] %>
- </span>
- </div>
-
- <!-- navbar -->
- <%= ApplicationHelper.menubar(@primary,@secondary) unless @primary.nil? %>
-
- <!-- fill in main page content -->
- <h1 class="page-title"><%= @page_title %></h1>
- <!-- secondary informational section, if applicable -->
- <% if flash[:notice] or flash[:errmsg] %>
-
- <div class = "alertbox">
-
- <% if flash[:notice] %>
- <%= flash[:notice] %>
- <% end %>
-
- <% if flash[:notice] and flash[:errmsg] %>
- <br/>
- <% end %>
-
- <% if flash[:errmsg] %>
- <%= flash[:errmsg] %>
- <% end %>
-
- </div>
-
- <% end %>
- <%= yield %>
-
- <br/>
-
- <!-- if any fields are invalid, turn them red -->
- <!-- fixme: should also mention reasons later -->
- <% if flash[:invalid_fields] %>
- <SCRIPT LANGUAGE="Javascript">
-
- <% flash[:invalid_fields].each do |field, reason| %>
- document.getElementById("form_<%= field.to_s() %>").style.backgroundColor='red';
- <% end %>
-
- </SCRIPT>
- <% end %>
-
- </body>
-
-</html>
-
--
1.6.2.5
14 years, 10 months
[Libcloud-list] [PATCH server] Prep to get UI heading toward dcloud look.
by jason.guiditta
Lay groundwork for upcoming controllers/further cleanups.
Signed-off-by: Jason Guiditta <jason.guiditta(a)gmail.com>
---
src/app/controllers/application_controller.rb | 4 +-
src/app/views/dashboard/index.html.erb | 8 +--
src/app/views/layouts/_header.rhtml | 10 +++
src/app/views/layouts/_header_redux.rhtml | 12 ---
src/app/views/layouts/_navigation_tabs.rhtml | 18 -----
src/app/views/layouts/dcloud.rhtml | 87 ++++++++++++++++++++++
src/app/views/layouts/redux.rhtml | 98 -------------------------
src/public/images/dcloud.png | Bin 0 -> 746 bytes
src/public/stylesheets/components.css | 11 ---
src/public/stylesheets/layout.css | 2 +-
10 files changed, 101 insertions(+), 149 deletions(-)
create mode 100644 src/app/views/layouts/_header.rhtml
delete mode 100644 src/app/views/layouts/_header_redux.rhtml
create mode 100644 src/app/views/layouts/dcloud.rhtml
delete mode 100644 src/app/views/layouts/redux.rhtml
create mode 100644 src/public/images/dcloud.png
diff --git a/src/app/controllers/application_controller.rb b/src/app/controllers/application_controller.rb
index 7e2041f..973b4fb 100644
--- a/src/app/controllers/application_controller.rb
+++ b/src/app/controllers/application_controller.rb
@@ -39,9 +39,9 @@ class ApplicationController < ActionController::Base
def choose_layout
if(params[:component_layout])
- return (ENV["RAILS_ENV"] != "production")?'components/' << params[:component_layout]:'redux'
+ return (ENV["RAILS_ENV"] != "production")?'components/' << params[:component_layout]:'dcloud'
end
- return 'redux'
+ return 'dcloud'
end
def is_logged_in
diff --git a/src/app/views/dashboard/index.html.erb b/src/app/views/dashboard/index.html.erb
index c361e55..9856d4b 100644
--- a/src/app/views/dashboard/index.html.erb
+++ b/src/app/views/dashboard/index.html.erb
@@ -1,7 +1 @@
- <%= render :partial => "/task/show", :locals => { :task_types => @task_types,
- :task_states => @task_states,
- :task_type => @task_type,
- :task_state => @task_state,
- :tasks => @tasks,
- :action => 'index',
- :pool => nil } %>
+<!-- Content to come soon. -->
\ No newline at end of file
diff --git a/src/app/views/layouts/_header.rhtml b/src/app/views/layouts/_header.rhtml
new file mode 100644
index 0000000..76f9e73
--- /dev/null
+++ b/src/app/views/layouts/_header.rhtml
@@ -0,0 +1,10 @@
+<div class="header_logo"><%= image_tag "dcloud.png" %></div>
+
+<div class="header_info">
+ <div id="hi-username">Hi, <%= @user %></div>
+ <form method="POST" id="search-form" action="<%= url_for :controller => "search", :action => 'results' %>">
+ <input id="textfield_effect" name="terms" value="Search" onkeypress="" onfocus="if( this.value == this.defaultValue ) this.value='';" type="text">
+ <input id="searchbox-button" src="<%= image_path "icon_search.png"%>" title="Search" type="image"> |
+ </form>
+ <%= link_to 'Log out', { :controller => "login", :action => "logout"}%>
+</div>
\ No newline at end of file
diff --git a/src/app/views/layouts/_header_redux.rhtml b/src/app/views/layouts/_header_redux.rhtml
deleted file mode 100644
index c1a1df1..0000000
--- a/src/app/views/layouts/_header_redux.rhtml
+++ /dev/null
@@ -1,12 +0,0 @@
-<div class="header_logo"><%= image_tag "logo_ovirt.png" %></div>
-
-<div class="header_info">
- <div id="hi-username">Hi, <%= @user %></div>
- <form method="POST" id="search-form" action="<%= url_for :controller => "search", :action => 'results' %>">
- <input id="textfield_effect" name="terms" value="Search" onkeypress="" onfocus="if( this.value == this.defaultValue ) this.value='';" type="text">
- <input id="searchbox-button" src="<%= image_path "icon_search.png"%>" title="Search" type="image"> |
- </form>
- <%= link_to 'Log out', { :controller => "login", :action => "logout"}%>
-</div>
-
-<div class="header_titlebar">Resource Pools</div>
diff --git a/src/app/views/layouts/_navigation_tabs.rhtml b/src/app/views/layouts/_navigation_tabs.rhtml
index 70af098..2fe2ee8 100644
--- a/src/app/views/layouts/_navigation_tabs.rhtml
+++ b/src/app/views/layouts/_navigation_tabs.rhtml
@@ -51,22 +51,4 @@
<ul id="search_nav_tabs" class="ui-tabs-nav">
<li id="nav_search" class="ui-tabs-selected"><a href="#">Search Results</a></li>
</ul>
-<% elsif controller.controller_name == "dashboard" %>
- <script>
- $(document).ready(function(){
- $tabs = $("#dashboard_nav_tabs").tabs();
- });
- </script>
- <ul id="dashboard_nav_tabs" class="ui-tabs-nav">
- <li id="nav_summary" class="ui-tabs-selected"><%= link_to "Tasks", {:action => 'index', :nolayout => :true}, :title => "content area" %></li>
- </ul>
-<% elsif controller.controller_name == "network" %>
- <script>
- $(document).ready(function(){
- $tabs = $("#network_nav_tabs").tabs();
- });
- </script>
- <ul id="network_nav_tabs" class="ui-tabs-nav">
- <li id="nav_summary" class="ui-tabs-selected"><%= link_to "Networks", {:action => 'list', :nolayout => :true}, :title => "content area" %></li>
- </ul>
<% end %>
\ No newline at end of file
diff --git a/src/app/views/layouts/dcloud.rhtml b/src/app/views/layouts/dcloud.rhtml
new file mode 100644
index 0000000..0f98f25
--- /dev/null
+++ b/src/app/views/layouts/dcloud.rhtml
@@ -0,0 +1,87 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+
+<head>
+ <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
+ <title>dCloud <%= yield :title -%></title>
+ <!--%= stylesheet_link_tag 'default' %--> <%# remove me %>
+ <%= stylesheet_link_tag 'layout' %>
+ <%= stylesheet_link_tag 'components' %>
+ <!--[if IE]>
+ <%= stylesheet_link_tag 'ie' %>
+ <![endif]-->
+ <%= stylesheet_link_tag '/javascripts/jquery-treeview/ovirt.treeview.css' %>
+ <%= stylesheet_link_tag 'flexigrid/flexigrid.css' %>
+ <%= stylesheet_link_tag 'facebox' %>
+ <%= stylesheet_link_tag 'jquery.jgrowl.css' %>
+ <%= stylesheet_link_tag 'ovirt-tree/tree' %>
+
+ <%= javascript_include_tag "jquery-1.2.6.min.js" -%>
+ <%= javascript_include_tag "jquery-treeview/jquery.treeview.js" -%>
+ <%= javascript_include_tag "jquery-treeview/jquery.treeview.async.js" -%>
+ <%= javascript_include_tag "flexigrid.js" -%>
+ <%= javascript_include_tag "facebox.js" -%>
+ <%= javascript_include_tag "jquery.livequery.min.js" -%>
+ <%= javascript_include_tag "jquery.form.js" -%>
+ <%= javascript_include_tag "jquery.jgrowl.js" -%>
+
+ <%= javascript_include_tag "jquery.ui-1.5.2/ui/packed/ui.core.packed.js" -%>
+ <%= javascript_include_tag "jquery.ui-1.5.2/ui/packed/ui.tabs.packed.js" -%>
+
+ <!-- ovirt-specific functions defined here -->
+ <%= javascript_include_tag "ovirt.js" -%>
+ <script type="text/javascript">
+ var $tabs, selected_tab;
+ $(document).ready(function(){
+ $.ajaxSetup({error: function(xhr) {$.jGrowl(xhr.status + ' ' + xhr.statusText);}});
+ $('a[rel*=facebox]').livequery(function(){$(this).facebox();},function(){});
+ $('.dialog_tab_nav a').livequery(function(){
+ $(this).bind('click', function(){
+ $('.dialog_tab_nav li').removeClass('current');
+ $(this).parent().addClass('current');
+ $.ajax({
+ url: $(this).attr('href'),
+ type: 'GET',
+ data: {ajax:true},
+ dataType: 'html',
+ success: function(data) {
+ var wrapped_data = $(data).find('div').filter('[id=dialog-content-area]');
+ var my_parent = $(this).parent();
+ $('#dialog-content-area').html($(data));
+ $('#facebox').css('left', $(window).width() / 2 - ($('#facebox table').width() / 2));
+ },
+ error: function(xhr) {$.jGrowl(xhr.status + ' ' + xhr.statusText);}
+ });
+ return false;})},function(){});
+ });
+ </script>
+ <%= yield :scripts -%>
+ </head>
+
+ <body>
+
+ <div id="header">
+ <%= render :partial => '/layouts/header' %>
+ </div>
+
+ <div id="side">
+ fred <%#= render :partial => '/layouts/tree' %>
+ </div>
+
+ <div id="tabs-and-content-container">
+
+ <div id="navigation-tabs" style="position:absolute; top:40px; left:250px;">
+ <%= render :partial => '/layouts/navigation_tabs' %>
+ </div>
+ <div id="main">
+ <div id="content_area">
+
+ <%= yield %> <%# the rest of the center and right hand side %>
+ </div>
+ </div>
+ </div>
+
+ </body>
+</html>
diff --git a/src/app/views/layouts/redux.rhtml b/src/app/views/layouts/redux.rhtml
deleted file mode 100644
index 12458df..0000000
--- a/src/app/views/layouts/redux.rhtml
+++ /dev/null
@@ -1,98 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-
-<head>
- <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
- <title><%= yield :title -%></title>
- <!--%= stylesheet_link_tag 'default' %--> <%# remove me %>
- <%= stylesheet_link_tag 'layout' %>
- <%= stylesheet_link_tag 'components' %>
- <!--[if IE]>
- <%= stylesheet_link_tag 'ie' %>
- <![endif]-->
- <%= stylesheet_link_tag '/javascripts/jquery-treeview/ovirt.treeview.css' %>
- <%= stylesheet_link_tag 'flexigrid/flexigrid.css' %>
- <%= stylesheet_link_tag 'facebox' %>
- <%= stylesheet_link_tag 'jquery.jgrowl.css' %>
- <%= stylesheet_link_tag 'ovirt-tree/tree' %>
-
- <%= javascript_include_tag "jquery-1.2.6.min.js" -%>
- <%= javascript_include_tag "jquery-treeview/jquery.treeview.js" -%>
- <%= javascript_include_tag "jquery-treeview/jquery.treeview.async.js" -%>
- <%= javascript_include_tag "flexigrid.js" -%>
- <%= javascript_include_tag "facebox.js" -%>
- <%#= javascript_include_tag "jquery.timers.js" -%>
- <%= javascript_include_tag "jquery-svg/jquery.svg.pack.js" -%>
- <!--%= javascript_include_tag "jquery-svg/jquery.svgfilter.js" -%-->
- <%= javascript_include_tag "jquery-svg/jquery.svggraph.js" -%>
- <%= javascript_include_tag "jquery.cookie.js" -%>
- <%= javascript_include_tag "jquery.livequery.min.js" -%>
- <%= javascript_include_tag "jquery.form.js" -%>
- <%= javascript_include_tag "jquery.jgrowl.js" -%>
-
- <%= javascript_include_tag "jquery.ui-1.5.2/ui/packed/ui.core.packed.js" -%>
- <%= javascript_include_tag "jquery.ui-1.5.2/ui/packed/ui.tabs.packed.js" -%>
- <%= javascript_include_tag "trimpath-template-1.0.38.js" %>
- <%= javascript_include_tag "ovirt.tree.js" %>
-
- <!-- ovirt-specific functions defined here -->
- <%= javascript_include_tag "ovirt.js" -%>
- <script type="text/javascript">
- var $tabs, selected_tab;
- $(document).ready(function(){
- $.ajaxSetup({error: function(xhr) {$.jGrowl(xhr.status + ' ' + xhr.statusText);}});
- $('a[rel*=facebox]').livequery(function(){$(this).facebox();},function(){});
- $('.dialog_tab_nav a').livequery(function(){
- $(this).bind('click', function(){
- $('.dialog_tab_nav li').removeClass('current');
- $(this).parent().addClass('current');
- $.ajax({
- url: $(this).attr('href'),
- type: 'GET',
- data: {ajax:true},
- dataType: 'html',
- success: function(data) {
- var wrapped_data = $(data).find('div').filter('[id=dialog-content-area]');
- var my_parent = $(this).parent();
- $('#dialog-content-area').html($(data));
- $('#facebox').css('left', $(window).width() / 2 - ($('#facebox table').width() / 2));
- },
- error: function(xhr) {$.jGrowl(xhr.status + ' ' + xhr.statusText);}
- });
- return false;})},function(){});
- });
- </script>
- <%= yield :scripts -%>
- </head>
-
- <body>
-
- <div id="header">
- <%= render :partial => '/layouts/header_redux' %>
- </div>
-
- <div id="side">
- <%= render :partial => '/layouts/tree' %>
- </div>
-
- <div id="side-toolbar" class="header_menu_wrapper">
- <%= render :partial => '/layouts/side_toolbar' %>
- </div>
-
- <div id="tabs-and-content-container">
-
- <div id="navigation-tabs" style="position:absolute; top:40px; left:250px;">
- <%= render :partial => '/layouts/navigation_tabs' %>
- </div>
- <div id="main">
- <div id="content_area">
-
- <%= yield %> <%# the rest of the center and right hand side %>
- </div>
- </div>
- </div>
-
- </body>
-</html>
diff --git a/src/public/images/dcloud.png b/src/public/images/dcloud.png
new file mode 100644
index 0000000000000000000000000000000000000000..b8224d7800f42c7871daca615af7a85cd617dbcd
GIT binary patch
literal 746
zcmV<G0u}v<P)<h;3K|Lk000e1NJLTq001}u000jN1^@s6vH1)O0000PbVXQnQ*UN;
zcVTj606}DLVr3vnZDD6+Qe|Oed2z{QJOBU!j7da6RCwCVSHEx5Ko~V41DU871|)>!
zwcVVN(H&WkoC$Swc9wXgoBbywD@;^kDwDmEDc%rUEg>Y37-Hz;t-L4RMOR}dO(;rF
z`gFeQci(;Q`|&RA&*yXJe~h0`hY9C{FN@gO!@&I+rnA1;IQshXszW#a^yF>YIP77X
zKmv%T?E;cRQh=&3`_6s`earjS#taf^KC|}A1~@v-=(y4~f9HO<uZ(q#6+mQZj4bjq
zq~ll@EopZJj$;Tgg>%P8&t4FuvX=pDTZu)=T)Hbb1Sx_nAXktjWU9b5b+V4LZTpFA
z(PpM9`x_uYMXFu517u*8^Df}nw^Q}&h=G#LtO3%s?sC@ci_9kS=~%Y2Yb6RGrt~~r
zI@6jUhsbPcH?BxzTX4LC&dhLrZ0)mRE>s=qmNpI9&8*(fv0v$~RR$B0#E6UusT5&X
z25yVh95L-`z_C(M4{yt+?ENWGWslLz0W7!ru~a`s()rh6o|Crh@A|B`9X1QQ2mOvH
z*owZj_U}4#+AY-E@+<+msPSNjdpGrMxkX8C>dn9gXtLDS17RbR<_AF1r1l$(yv<43
z3EC>CC6Hc+O}|U;{_|HK>PMIF2L!_zQv7)MqDJ45Tu#Vr=*M#^Klt^ntPdU!1U$rd
z4RIkJB%na&BX#k8qBCzaS2{bv{2fADhax!6BkJgEEnXPlyU-nm2nWzRl}*}tCSOXd
zKO-pg?X~(d?}<=iQ8Ym<^}93?xVTZ@T*opnHP4B@y$!u#?xF4yvM}r|HZ^*M^g=x$
z7uFNj9AlODJ3jQXotl!rXa6@Lwp<a4o{M$0?psV&-1L1^S@LYP?iZ2XIZ9~<V1qB$
c{P-=v0J_06={A}>YXATM07*qoM6N<$f(fT#&Hw-a
literal 0
HcmV?d00001
diff --git a/src/public/stylesheets/components.css b/src/public/stylesheets/components.css
index 2cda65d..af9c85e 100644
--- a/src/public/stylesheets/components.css
+++ b/src/public/stylesheets/components.css
@@ -17,17 +17,6 @@
background: #CCCCCC;
}
-.header_titlebar {
- color: #4e4e4e;
- text-transform: uppercase;
- background: #979797;
- float: left;
- height: 25px;
- margin: 40px 0 0 0;
- padding: 8px 0 0 10px;
- width: 220px;
-}
-
.header_menu {
padding: 5px 0 0 10px;
margin: 1px;
diff --git a/src/public/stylesheets/layout.css b/src/public/stylesheets/layout.css
index 9ecfe44..f90ee47 100644
--- a/src/public/stylesheets/layout.css
+++ b/src/public/stylesheets/layout.css
@@ -62,7 +62,7 @@ a { color:#000000; text-decoration: none;}
position: absolute;
top: 70px;
left: 0px;
- bottom: 35px;
+ bottom: 0px;
overflow: auto;
width: 224px;
background-color:#FFFFFF;
--
1.6.2.5
14 years, 10 months
[Libcloud-list] [PATCH server] Give dcloud its own db.
by jason.guiditta
Also, clean up directions for creating w/ postgres
so you can actually use rake db* commands properly.
Signed-off-by: Jason Guiditta <jason.guiditta(a)gmail.com>
---
src/config/database.yml | 24 +++++++++---------------
1 files changed, 9 insertions(+), 15 deletions(-)
diff --git a/src/config/database.yml b/src/config/database.yml
index 5de15c9..70771e1 100644
--- a/src/config/database.yml
+++ b/src/config/database.yml
@@ -5,14 +5,8 @@
# sudo /sbin/service postgresql initdb
# sudo /sbin/service postgresql start
# sudo su - postgres
-# $ psql ovirt
-# $-# CREATE USER ovirt WITH PASSWORD 'v23zj59an';
-# $-# CREATE DATABASE ovirt_development;
-# $-# GRANT ALL PRIVILEGES ON DATABASE ovirt_development to ovirt;
-# $-# CREATE DATABASE ovirt_test;
-# $-# GRANT ALL PRIVILEGES ON DATABASE ovirt_test to ovirt;
-# $-# CREATE DATABASE ovirt;
-# $-# GRANT ALL PRIVILEGES ON DATABASE ovirt to ovirt;
+# $ psql
+# $-# CREATE USER dcloud WITH PASSWORD 'v23zj59an' CREATEDB;
# $-# \q
# $ exit
#
@@ -23,7 +17,7 @@
# rake db:migrate
# rake db:test:prepare
#
-# And when there are changes to the database, simple run:
+# And when there are changes to the database, simply run:
#
# rake db:migrate
# rake db:test:prepare
@@ -36,23 +30,23 @@
development:
adapter: postgresql
- database: ovirt_development
- username: ovirt
+ database: dcloud_development
+ username: dcloud
password: v23zj59an
host: localhost
# Warning: The database defined as 'test' will be erased and
-# re-generated from your development database when you run 'rake'.
+# re-generated from your development database when you run 'rake test'.
# Do not set this db to the same as development or production.
test:
adapter: postgresql
- database: ovirt_test
+ database: dcloud_test
username: postgres
host: localhost
production:
adapter: postgresql
- database: ovirt
- username: ovirt
+ database: dcloud
+ username: dcloud
password: v23zj59an
host: localhost
--
1.6.2.5
14 years, 10 months
[Libcloud-list] API XML and Client Examples
by Bob McWhirter
Howdy guys--
I've made some good progress on the API, and Hugh suggested I punt
some examples to the list.
First, we have "Flavors" which denote types of VM that can be spun up,
with their capabilities:
<flavor href="http://localhost:3000/api/flavors/m1-large">
<id>m1-large</id>
<memory>7.5</memory>
<storage>850</storage>
<architecture>x86_64</architecture>
</flavor>
Next, we have images (templates in RHEV-M terminology):
<image href="http://localhost:3000/api/images/img1">
<id>img1</id>
<description>Fedora 10</description>
<owner_id>fedoraproject</owner_id>
<architecture>x86_64</architecture>
</image>
From there we can spin up instances, actual running VMs based upon an
image:
<instance href="http://localhost:3000/api/instances/inst1">
<id>inst1</id>
<public-address>img3.inst1.public.com</public-address>
<image>http://localhost:3000/api/images/img3</image>
<private-address>img3.inst1.private.com</private-address>
<state>RUNNING</state>
<owner_id>mockuser</owner_id>
<flavor>http://localhost:3000/api/flavors/m1-small</flavor>
</instance>
Storage volumes and snapshots are still works-in-progress.
The whole API is based upon discovery from a root URL, which gives
entry-points into the sub-collections.
<api version="1.0">
<link rel="flavors">http://localhost:3000/api/flavors</link>
<link rel="images">http://localhost:3000/api/images</link>
<link rel="instances">http://localhost:3000/api/instances</link>
<link rel="storage_volumes">http://localhost:3000/api/storage/volumes
</link>
<link rel="storage_snapshots">http://localhost:3000/api/storage/snapshots
</link>
</api>
I'm writing a Ruby client library also, which tries to be easy to use,
and exposes a rich object model to the caller, with navigable and lazy-
loaded references between
it "should allow navigation from instance to image" do
DeltaCloud.new( API_NAME, API_PASSWORD, API_URL ) do |client|
instances = client.instances
instances.should_not be_empty
instance = instances.first
instance.image.should_not be_nil
instance.image.description.should_not be_nil
instance.image.description.should be_a(String)
end
end
Models are defined here:
http://github.com/bobmcwhirter/deltacloud-client-ruby/blob/master/lib/mod...
For instance, instance:
http://github.com/bobmcwhirter/deltacloud-client-ruby/blob/master/lib/mod...
I'm also hacking together a "mock" driver, so that even folks without
EC2 access can fire up a driver to test against. This is still a work-
in-progress also (isn't everything?)
-Bob
14 years, 10 months
[Libcloud-list] deltacloud driver SPI changes
by Bob McWhirter
Howdy folks (particularly Bryan)--
I've changed the SPI between framework and driver slightly. We now
are using app/models/**.rb. These are *not* ActiveRecord models.
Where a driver previously returned a hash, just wrap it in an instance
of the appropriate class.
ie
return {
:id=>'ami-42'
}
becomes
return Image.new( {
:id=>'ami-42'
} )
Simple change.
*** Attribute changes...
:public_address and :private_address have been removed and replaced
with :public_addresses and :private_addresses. Both are an array of
strings.
:actions should now exist, as an array (possibly empty) of appropriate
actions, based upon the :state. An array of symbols is pretty, such
as :actions=>[ :reboot ]
*** XML changes...
Due to the pluralizing of <public-addresses> and <private-addresses>,
they now look like
<public-addresses>
<address>instance42.public.cloudcorp.com</address>
<address>instance42-nic2.public.cloudcorp.com</address>
</public-addresses>
Actions are exposed through the XML like
<actions>
<link rel="reboot" href="...."/>
</actions>
Anywhere a URL exists to another resource, the URL has been moved from
the text content of the tag to an href attribute.
ie,
<image>http://...../ami-42</image>
becomes
<image href="http://...../ami-42"/>
*** Other driver changes...
To help with filtering, there's a filter_on(...) method now available.
If you have a collection of items, along with the opts hash
collection = filter_on( collection, :architecture, opts )
filter_on handles the cases where opts[:architecture] is a single
value and when it's an array value. Or if opts is nil. or if
opts[:architecture] is nil. It's fairly smart, and always safe to
apply.
Every plural (instances(), images(), flavors()) should allow filtering
based upon 'id'. The client requires this functionality.
Thus
http://localhost:3000/images?id=ami-42
should return an array with 1 item, matching image with the id of
ami-42.
Some methods, such as reboot_instance(creds, opts) has been renamed to
reboot_instance(creds, id). If we need parameters to reboot, let me
suggest reboot_instance(creds, id, opts={}). Keep 'id' parameter
distinct.
*** Changes to the code
I've updated the framework, mock and ec2 drivers, along with the
client. All are pushed to their repos.
Bryan, I have not updated the RHEV-M driver. I don't know where it
lives, and I can't test it.
-Bob
14 years, 10 months
[Libcloud-list] first stab at portal AR model
by Scott Seago
Based on Bob's xml api examples and prior discussions with lutter and
Hugh on the portal AR model, I've come up with an initial model
specification. At this point I've only included those attributes that
Bob has already identified.
Once we've nailed down the attributes, associations and validation rules
for this stuff we can start integrating it into the controllers and UI bits.
Scott
>From 167ad82f42742a310be6c7787d21c0c711a37f65 Mon Sep 17 00:00:00 2001
From: Scott Seago <sseago(a)redhat.com>
Date: Wed, 5 Aug 2009 21:18:46 +0000
Subject: [PATCH server] first stab at dcloud portal model.
Signed-off-by: Scott Seago <sseago(a)redhat.com>
---
src/app/models/cloud_account.rb | 16 ++++++++++++++++
src/app/models/flavor.rb | 16 ++++++++++++++++
src/app/models/image.rb | 13 +++++++++++++
src/app/models/instance.rb | 14 ++++++++++++++
src/app/models/portal_pool.rb | 11 +++++++++++
src/app/models/provider.rb | 11 +++++++++++
src/db/migrate/20090731200741_create_providers.rb | 15 +++++++++++++++
.../20090801045212_create_cloud_accounts.rb | 15 +++++++++++++++
.../migrate/20090803141507_create_portal_pools.rb | 14 ++++++++++++++
src/db/migrate/20090804135630_create_flavors.rb | 17 +++++++++++++++++
src/db/migrate/20090804140143_create_images.rb | 16 ++++++++++++++++
src/db/migrate/20090804142049_create_instances.rb | 18 ++++++++++++++++++
12 files changed, 176 insertions(+), 0 deletions(-)
create mode 100644 src/app/models/cloud_account.rb
create mode 100644 src/app/models/flavor.rb
create mode 100644 src/app/models/image.rb
create mode 100644 src/app/models/instance.rb
create mode 100644 src/app/models/portal_pool.rb
create mode 100644 src/app/models/provider.rb
create mode 100644 src/db/migrate/20090731200741_create_providers.rb
create mode 100644 src/db/migrate/20090801045212_create_cloud_accounts.rb
create mode 100644 src/db/migrate/20090803141507_create_portal_pools.rb
create mode 100644 src/db/migrate/20090804135630_create_flavors.rb
create mode 100644 src/db/migrate/20090804140143_create_images.rb
create mode 100644 src/db/migrate/20090804142049_create_instances.rb
diff --git a/src/app/models/cloud_account.rb b/src/app/models/cloud_account.rb
new file mode 100644
index 0000000..29b9ccf
--- /dev/null
+++ b/src/app/models/cloud_account.rb
@@ -0,0 +1,16 @@
+class CloudAccount < ActiveRecord::Base
+ belongs_to :provider
+ has_many :portal_pools
+
+ # what form does the account quota take?
+
+ # we aren't yet defining the local user object
+ # has_many :portal_users
+
+
+ validates_presence of :provider_id
+
+ validates_presence_of :username
+ validates_uniqueness_of :username, :scope => provider_id
+ validates_presence_of :password
+end
diff --git a/src/app/models/flavor.rb b/src/app/models/flavor.rb
new file mode 100644
index 0000000..473546c
--- /dev/null
+++ b/src/app/models/flavor.rb
@@ -0,0 +1,16 @@
+class Flavor < ActiveRecord::Base
+ has_many :instances
+ belongs_to :provider
+
+ validates_presence_of :provider_id
+
+ validates_presence_of :name
+ validates_uniqueness_of :name, :scope => :provider_id
+
+ validates_presence_of :storage
+ validates_numericality_of :storage
+ validates_presence_of :memory
+ validates_numericality_of :memory
+
+ validates_presence_of :architecture
+end
diff --git a/src/app/models/image.rb b/src/app/models/image.rb
new file mode 100644
index 0000000..15f4ccb
--- /dev/null
+++ b/src/app/models/image.rb
@@ -0,0 +1,13 @@
+class Image < ActiveRecord::Base
+ has_many :instances
+ belongs_to :provider
+
+ validates_presence_of :provider_id
+
+ validates_presence_of :name
+ validates_uniqueness_of :name, :scope => :provider_id
+
+ validates_presence_of :description
+ validates_presence_of :architecture
+
+end
diff --git a/src/app/models/instance.rb b/src/app/models/instance.rb
new file mode 100644
index 0000000..a1e185c
--- /dev/null
+++ b/src/app/models/instance.rb
@@ -0,0 +1,14 @@
+class Instance < ActiveRecord::Base
+ belongs_to :portal_pool
+ belongs_to :flavor
+ belongs_to :image
+
+ validates_presence_of :portal_pool_id
+
+ validates_presence_of :name
+ validates_uniqueness_of :name, :scope => :portal_pool_id
+
+ validates_presence_of :flavor_id
+ validates_presence_of :image_id
+
+end
diff --git a/src/app/models/portal_pool.rb b/src/app/models/portal_pool.rb
new file mode 100644
index 0000000..b6af405
--- /dev/null
+++ b/src/app/models/portal_pool.rb
@@ -0,0 +1,11 @@
+class PortalPool < ActiveRecord::Base
+ belongs_to :cloud_account
+ has_many :instances
+
+ # what form does the pool quota take?
+
+ validates_presence_of :cloud_account_id
+
+ validates_presence_of :name
+ validates_uniqueness_of :name, :scope => :cloud_account_id
+end
diff --git a/src/app/models/provider.rb b/src/app/models/provider.rb
new file mode 100644
index 0000000..866f741
--- /dev/null
+++ b/src/app/models/provider.rb
@@ -0,0 +1,11 @@
+class Provider < ActiveRecord::Base
+ has_many :cloud_accounts
+ has_many :flavors
+ has_many :images
+
+ validates_presence_of :name
+ validates_uniqueness_of :name
+
+ validates_presence_of :cloud_type
+
+end
diff --git a/src/db/migrate/20090731200741_create_providers.rb b/src/db/migrate/20090731200741_create_providers.rb
new file mode 100644
index 0000000..1a4e41e
--- /dev/null
+++ b/src/db/migrate/20090731200741_create_providers.rb
@@ -0,0 +1,15 @@
+class CreateProviders < ActiveRecord::Migration
+ def self.up
+ create_table :providers do |t|
+ t.string :name, :null => false
+ t.string :cloud_type, :null => false
+ t.string :url
+ t.integer :lock_version, :default => 0
+ t.timestamps
+ end
+ end
+
+ def self.down
+ drop_table :providers
+ end
+end
diff --git a/src/db/migrate/20090801045212_create_cloud_accounts.rb b/src/db/migrate/20090801045212_create_cloud_accounts.rb
new file mode 100644
index 0000000..7d960e3
--- /dev/null
+++ b/src/db/migrate/20090801045212_create_cloud_accounts.rb
@@ -0,0 +1,15 @@
+class CreateCloudAccounts < ActiveRecord::Migration
+ def self.up
+ create_table :cloud_accounts do |t|
+ t.string :username, :null => false
+ t.string :password, :null => false
+ t.integer :provider_id, :null => false
+ t.integer :lock_version, :default => 0
+ t.timestamps
+ end
+ end
+
+ def self.down
+ drop_table :cloud_accounts
+ end
+end
diff --git a/src/db/migrate/20090803141507_create_portal_pools.rb b/src/db/migrate/20090803141507_create_portal_pools.rb
new file mode 100644
index 0000000..0714d1c
--- /dev/null
+++ b/src/db/migrate/20090803141507_create_portal_pools.rb
@@ -0,0 +1,14 @@
+class CreatePortalPools < ActiveRecord::Migration
+ def self.up
+ create_table :portal_pools do |t|
+ t.string :name, :null => false
+ t.integer :cloud_account_id, :null => false
+ t.integer :lock_version, :default => 0
+ t.timestamps
+ end
+ end
+
+ def self.down
+ drop_table :portal_pools
+ end
+end
diff --git a/src/db/migrate/20090804135630_create_flavors.rb b/src/db/migrate/20090804135630_create_flavors.rb
new file mode 100644
index 0000000..cdc34e3
--- /dev/null
+++ b/src/db/migrate/20090804135630_create_flavors.rb
@@ -0,0 +1,17 @@
+class CreateFlavors < ActiveRecord::Migration
+ def self.up
+ create_table :flavors do |t|
+ t.string :name, :null => false
+ t.integer :memory, :null => false
+ t.integer :storage, :null => false
+ t.string :architecture, :null => false
+ t.integer :provider_id, :null => false
+ t.integer :lock_version, :default => 0
+ t.timestamps
+ end
+ end
+
+ def self.down
+ drop_table :flavors
+ end
+end
diff --git a/src/db/migrate/20090804140143_create_images.rb b/src/db/migrate/20090804140143_create_images.rb
new file mode 100644
index 0000000..0163ec7
--- /dev/null
+++ b/src/db/migrate/20090804140143_create_images.rb
@@ -0,0 +1,16 @@
+class CreateImages < ActiveRecord::Migration
+ def self.up
+ create_table :images do |t|
+ t.string :name, :null => false
+ t.string :description, :null => false
+ t.string :architecture, :null => false
+ t.integer :provider_id, :null => false
+ t.integer :lock_version, :default => 0
+ t.timestamps
+ end
+ end
+
+ def self.down
+ drop_table :images
+ end
+end
diff --git a/src/db/migrate/20090804142049_create_instances.rb b/src/db/migrate/20090804142049_create_instances.rb
new file mode 100644
index 0000000..6c3bc5a
--- /dev/null
+++ b/src/db/migrate/20090804142049_create_instances.rb
@@ -0,0 +1,18 @@
+class CreateInstances < ActiveRecord::Migration
+ def self.up
+ create_table :instances do |t|
+ t.string :name, :null => false
+ t.integer :flavor_id, :null => false
+ t.integer :image_id, :null => false
+ t.integer :portal_pool_id, :null => false
+ t.string :public_address
+ t.string :private_address
+ t.integer :lock_version, :default => 0
+ t.timestamps
+ end
+ end
+
+ def self.down
+ drop_table :instances
+ end
+end
--
1.6.0.6
14 years, 10 months
[Libcloud-list] Driver SPI
by Bryan Kearney
I would like to discuss the driver SPI. It is a bit too EC2ish (I think):
the images call is
images(credentials,ids)
where ids can be either a ownerid or an image id.
For the RHEVM driver, I need to know which I am looking at. Can we
either make this a hashmap or a
images (credentials, owner=null, id=null)
so that I can do different things based on the content? I think the
former is better because you can then make calls such as
images (creds, :id => "Foo") or
images (creds, :owner => "Bar")
And it will be clear on both sides.
-- bk
14 years, 10 months
[Libcloud-list] check it!
by Bryan Kearney
See attached photo.
Bob.. do you have a a stick and ball diagra of hte various objects? I am
curious what a flavor is.. what has owners..etc.
Thanks!
-- bk
14 years, 10 months