Permalink
Browse files

upgrade foreman to rails 3.2.13

This commit updates from rails 3.0.x to 3.2.x, main changes include:

* Asset pipline support
* cleanup of existing assets (javascript, css, images)

Users who uses foreman in production, make sure that you now compile
your assets, e.g

rake assets:precompile

Paired-with: Joseph Mitchell Magen <jmagen@redhat.com>
Paired-with: Ohad Levy <ohadlevy@gmail.com>

Signed-off-by: Ohad Levy <ohadlevy@gmail.com>
  • Loading branch information...
1 parent dbc1ee9 commit feacea35f07f362d9e2c694a83516bbc902321a0 @abenari abenari committed with ohadlevy Mar 13, 2013
Showing with 954 additions and 3,391 deletions.
  1. +1 −0 .gitignore
  2. +2 −3 Gemfile
  3. BIN {public → app/assets}/images/Archlinux.png
  4. BIN {public → app/assets}/images/Centos.png
  5. BIN {public → app/assets}/images/Darwin.png
  6. BIN {public → app/assets}/images/Debian.png
  7. BIN {public → app/assets}/images/Fedora.png
  8. BIN {public → app/assets}/images/Redhat.png
  9. BIN {public → app/assets}/images/SLC.png
  10. BIN {public → app/assets}/images/Scientific.png
  11. BIN {public → app/assets}/images/Solaris.png
  12. BIN {public → app/assets}/images/Suse.png
  13. BIN {public → app/assets}/images/Ubuntu.png
  14. BIN {public → app/assets}/images/Windows.png
  15. BIN {public → app/assets}/images/bullet_toggle_plus.png
  16. BIN {public → app/assets}/images/false.png
  17. BIN {public → app/assets}/images/foreman.png
  18. BIN {public → app/assets}/images/foreman_background.png
  19. BIN {public → app/assets}/images/foreman_large.png
  20. BIN {public → app/assets}/images/pie_chart_icon.png
  21. BIN {public → app/assets}/images/spinner.gif
  22. BIN {public → app/assets}/images/switch.png
  23. BIN {public → app/assets}/images/toggle_check.png
  24. BIN {public → app/assets}/images/true.png
  25. BIN {public → app/assets}/images/user.jpg
  26. +37 −16 {public → app/assets}/javascripts/application.js
  27. +1 −4 {public → app/assets}/javascripts/charts.js
  28. +5 −11 {public → app/assets}/javascripts/compute_resource.js
  29. +1 −1 {public → app/assets}/javascripts/config_template.js
  30. +1 −1 {public → app/assets}/javascripts/host_checkbox.js
  31. +27 −47 {public → app/assets}/javascripts/host_edit.js
  32. 0 {public → app/assets}/javascripts/lookup_keys.js
  33. 0 {public → app/assets}/javascripts/nfs_visibility.js
  34. 0 {public → app/assets}/javascripts/noVNC.js
  35. 0 {public → app/assets}/javascripts/reports.js
  36. 0 {public → app/assets}/javascripts/spice.js
  37. 0 {public → app/assets}/javascripts/taxonomy.js
  38. 0 {public → app/assets}/javascripts/trends.js
  39. 0 {public → app/assets}/stylesheets/.gitkeep
  40. +105 −164 public/stylesheets/style.css → app/assets/stylesheets/application.scss
  41. +19 −0 app/assets/stylesheets/bootstrap_and_overrides.scss
  42. +60 −0 app/assets/stylesheets/wizard.scss
  43. +3 −5 app/controllers/concerns/api/taxonomy_scope.rb
  44. +64 −67 app/controllers/concerns/api/v2/taxonomies_controller.rb
  45. +1 −1 app/controllers/domains_controller.rb
  46. +1 −1 app/controllers/environments_controller.rb
  47. +2 −2 app/controllers/hostgroups_controller.rb
  48. +24 −40 app/controllers/hosts_controller.rb
  49. +1 −1 app/controllers/models_controller.rb
  50. +1 −1 app/controllers/operatingsystems_controller.rb
  51. +1 −1 app/controllers/puppetclasses_controller.rb
  52. +4 −12 app/controllers/subnets_controller.rb
  53. +1 −1 app/controllers/unattended_controller.rb
  54. +0 −10 app/controllers/users_controller.rb
  55. +11 −25 app/helpers/application_helper.rb
  56. +1 −1 app/helpers/layout_helper.rb
  57. +1 −12 app/helpers/users_helper.rb
  58. +2 −2 app/models/bookmark.rb
  59. +1 −1 app/models/config_template.rb
  60. +1 −3 app/models/host.rb
  61. +4 −2 app/models/host/base.rb
  62. +9 −26 app/models/host/managed.rb
  63. +5 −11 app/models/host_mailer.rb
  64. +1 −1 app/models/host_parameter.rb
  65. +1 −1 app/models/host_template_helpers.rb
  66. +1 −0 app/models/hostgroup_class.rb
  67. +1 −1 app/models/location.rb
  68. +4 −1 app/models/lookup_key.rb
  69. +2 −2 app/models/nic.rb
  70. +1 −1 app/models/organization.rb
  71. +2 −2 app/models/role.rb
  72. +0 −10 app/models/taxonomix.rb
  73. +7 −6 app/models/taxonomy.rb
  74. +1 −1 app/models/user.rb
  75. 0 app/views/common/{403.rhtml → 403.html.erb}
  76. 0 app/views/common/{404.rhtml → 404.html.erb}
  77. +2 −2 app/views/common/{500.rhtml → 500.html.erb}
  78. +2 −2 app/views/common/_domain.html.erb
  79. +2 −1 app/views/common/_domain_subnet.html.erb
  80. +2 −4 app/views/common/_searchbar.erb
  81. +1 −1 app/views/compute_resources/form/_ec2.html.erb
  82. +1 −1 app/views/compute_resources/form/_libvirt.html.erb
  83. +1 −1 app/views/compute_resources/form/_openstack.html.erb
  84. +1 −1 app/views/compute_resources/form/_ovirt.html.erb
  85. +1 −1 app/views/compute_resources/form/_rackspace.html.erb
  86. +1 −1 app/views/compute_resources/form/_vmware.html.erb
  87. +2 −2 app/views/compute_resources/show.html.erb
  88. +2 −2 app/views/compute_resources_vms/form/_ovirt.html.erb
  89. 0 app/views/home/{_location_dropdown.rhtml → _location_dropdown.html.erb}
  90. 0 app/views/home/{_organization_dropdown.rhtml → _organization_dropdown.html.erb}
  91. 0 app/views/home/{_topbar.rhtml → _topbar.html.erb}
  92. 0 app/views/home/{_user_dropdown.rhtml → _user_dropdown.html.erb}
  93. +1 −1 app/views/hostgroups/_form.html.erb
  94. +3 −3 app/views/hosts/_form.html.erb
  95. +2 −2 app/views/hosts/_interfaces.html.erb
  96. +1 −1 app/views/hosts/_list.html.erb
  97. +2 −1 app/views/hosts/_unattended.html.erb
  98. +4 −2 app/views/hosts/console/vnc.html.erb
  99. +4 −5 app/views/layouts/application.html.erb
  100. +2 −2 app/views/puppetclasses/_classes.html.erb
  101. 0 app/views/reports/{_metrics.rhtml → _metrics.html.erb}
  102. 0 app/views/reports/{show.rhtml → show.html.erb}
  103. +2 −2 app/views/roles/{_form.rhtml → _form.html.erb}
  104. 0 app/views/roles/{edit.rhtml → edit.html.erb}
  105. 0 app/views/roles/{new.rhtml → new.html.erb}
  106. 0 app/views/roles/{report.rhtml → report.html.erb}
  107. 0 app/views/tasks/{_list.rhtml → _list.html.erb}
  108. 0 app/views/tasks/{show.rhtml → show.html.erb}
  109. 0 app/views/unattended/{jumpstart.rhtml → jumpstart.html.erb}
  110. 0 app/views/unattended/{jumpstart_finish.rhtml → jumpstart_finish.html.erb}
  111. 0 app/views/unattended/{kickstart.rhtml → kickstart.html.erb}
  112. 0 app/views/unattended/{preseed.rhtml → preseed.html.erb}
  113. 0 app/views/unattended/{preseed_finish.rhtml → preseed_finish.html.erb}
  114. +2 −2 app/views/users/_filters.html.erb
  115. +1 −1 app/views/users/_form.html.erb
  116. +9 −0 bundler.d/assets.rb
  117. +1 −1 bundler.d/mysql2.rb
  118. +8 −3 bundler.d/test.rb
  119. +21 −11 config/application.rb
  120. +1 −2 config/boot.rb
  121. +12 −0 config/environments/development.rb
  122. +56 −1 config/environments/production.rb
  123. +7 −0 config/environments/test.rb
  124. +0 −19 config/initializers/procs_for_default_scope.rb
  125. +13 −0 config/initializers/wrap_parameters.rb
  126. +4 −4 config/routes.rb
  127. +1 −1 db/migrate/20090714132448_create_hosts.rb
  128. +1 −1 db/migrate/20110725142054_add_suse_templates.rb
  129. +0 −43 lib/core_extensions.rb
  130. +2 −1 lib/foreman/controller/auto_complete_search.rb
  131. +3 −3 lib/foreman/controller/host_details.rb
  132. +36 −38 lib/foreman/controller/smart_proxy_auth.rb
  133. +127 −130 lib/foreman/controller/taxonomies_controller.rb
  134. +34 −36 lib/foreman/controller/taxonomy_multiple.rb
  135. BIN public/images/1downarrow.png
  136. BIN public/images/1uparrow.png
  137. BIN public/images/2downarrow.png
  138. BIN public/images/2uparrow.png
  139. BIN public/images/add.png
  140. BIN public/images/application_cascade.png
  141. BIN public/images/bookmark.png
  142. BIN public/images/bullet_toggle_minus.png
  143. BIN public/images/button_left.png
  144. BIN public/images/button_right.png
  145. BIN public/images/close_hl.png
  146. BIN public/images/delete.png
  147. BIN public/images/edit-hover.png
  148. BIN public/images/edit.png
  149. BIN public/images/glyphicons-halflings-white.png
  150. BIN public/images/glyphicons-halflings.png
  151. BIN public/images/grid.png
  152. BIN public/images/header_bg.png
  153. BIN public/images/hosts/Darwin.jpg
  154. BIN public/images/hosts/Linux.jpg
  155. BIN public/images/hosts/SunOS.jpg
  156. BIN public/images/hosts/attention_required.png
  157. BIN public/images/hosts/warning.png
  158. BIN public/images/link.png
  159. BIN public/images/message.png
  160. BIN public/images/sort_asc.png
  161. BIN public/images/sort_asc_disabled.png
  162. BIN public/images/sort_both.png
  163. BIN public/images/sort_desc.png
  164. BIN public/images/sort_desc_disabled.png
  165. BIN public/images/ui-bg_flat_0_aaaaaa_40x100.png
  166. BIN public/images/ui-bg_glass_55_fbf9ee_1x400.png
  167. BIN public/images/ui-bg_glass_65_ffffff_1x400.png
  168. BIN public/images/ui-bg_glass_75_dadada_1x400.png
  169. BIN public/images/ui-bg_glass_75_e6e6e6_1x400.png
  170. BIN public/images/ui-bg_glass_75_ffffff_1x400.png
  171. BIN public/images/ui-bg_highlight-soft_75_cccccc_1x100.png
  172. BIN public/images/ui-bg_inset-soft_95_fef1ec_1x100.png
  173. BIN public/images/ui-icons_222222_256x240.png
  174. BIN public/images/ui-icons_2e83ff_256x240.png
  175. BIN public/images/ui-icons_454545_256x240.png
  176. BIN public/images/ui-icons_888888_256x240.png
  177. BIN public/images/ui-icons_cd0a0a_256x240.png
  178. BIN public/images/ui-icons_f6cf3b_256x240.png
  179. BIN public/images/warning.png
  180. +0 −6 public/javascripts/bootstrap.min.js
  181. +0 −781 public/javascripts/jquery-ui.js
  182. +0 −4 public/javascripts/jquery.js
  183. +0 −367 public/javascripts/jquery_ujs.js
  184. +0 −1 public/javascripts/jrails.js
  185. +0 −43 public/javascripts/noVNC/vnc.js
  186. +0 −19 public/javascripts/spice/setup.js
  187. +0 −9 public/stylesheets/bootstrap-responsive.min.css
  188. +0 −9 public/stylesheets/bootstrap.min.css
  189. +0 −1,151 public/stylesheets/jquery-ui.css
  190. +0 −59 public/stylesheets/wizard.css
  191. +0 −1 test/fixtures/config_templates.yml
  192. +0 −2 test/fixtures/nics.yml
  193. +3 −3 test/functional/api/v2/domains_controller_test.rb
  194. +21 −22 test/functional/hosts_controller_test.rb
  195. +5 −4 test/functional/unattended_controller_test.rb
  196. +1 −2 test/lib/proxy_api_bmc_test.rb
  197. +1 −1 test/test_helper.rb
  198. +2 −4 test/unit/domain_test.rb
  199. +1 −1 test/unit/host_mailer_test.rb
  200. +3 −3 test/unit/host_test.rb
  201. +8 −3 test/unit/hostgroup_test.rb
  202. +11 −11 test/unit/location_test.rb
  203. +2 −2 test/unit/orchestration/dhcp_test.rb
  204. +11 −11 test/unit/organization_test.rb
  205. +3 −3 test/unit/parameter_test.rb
  206. +14 −10 test/unit/subnet_test.rb
  207. 0 {public → vendor/assets}/javascripts/ace/ace.js
  208. 0 {public → vendor/assets}/javascripts/ace/cockpit.js
  209. 0 {public → vendor/assets}/javascripts/ace/ext-static_highlight.js
  210. 0 {public → vendor/assets}/javascripts/ace/ext-textarea.js
  211. 0 {public → vendor/assets}/javascripts/ace/keybinding-emacs.js
  212. 0 {public → vendor/assets}/javascripts/ace/keybinding-vim.js
  213. 0 {public → vendor/assets}/javascripts/ace/mode-diff.js
  214. 0 {public → vendor/assets}/javascripts/ace/mode-ruby.js
  215. 0 {public → vendor/assets}/javascripts/ace/mode-sh.js
  216. 0 {public → vendor/assets}/javascripts/ace/theme-clouds.js
  217. 0 {public → vendor/assets}/javascripts/ace/theme-dawn.js
  218. 0 {public → vendor/assets}/javascripts/ace/theme-textmate.js
  219. 0 {public → vendor/assets}/javascripts/ace/theme-twilight.js
  220. 0 {public → vendor/assets}/javascripts/ace/worker-coffee.js
  221. 0 {public → vendor/assets}/javascripts/ace/worker-css.js
  222. 0 {public → vendor/assets}/javascripts/ace/worker-javascript.js
  223. 0 {public → vendor/assets}/javascripts/ace/worker-json.js
  224. 0 {public → vendor/assets}/javascripts/ace/worker-xquery.js
  225. 0 {public → vendor/assets}/javascripts/diff.js
  226. 0 {public → vendor/assets}/javascripts/highcharts.js
  227. 0 {public → vendor/assets}/javascripts/jquery.cookie.js
  228. +1 −0 {public → vendor/assets}/javascripts/jquery.dataTables.bootstrap-paging.js
  229. 0 {public → vendor/assets}/javascripts/jquery.dataTables.min.js
  230. 0 {public → vendor/assets}/javascripts/jquery.jeditable.js
  231. 0 {public → vendor/assets}/javascripts/jquery.jnotify.js
  232. 0 {public → vendor/assets}/javascripts/jquery.multi-select.js
  233. 0 {public → vendor/assets}/javascripts/noVNC/base64.js
  234. 0 {public → vendor/assets}/javascripts/noVNC/des.js
  235. 0 {public → vendor/assets}/javascripts/noVNC/display.js
  236. 0 {public → vendor/assets}/javascripts/noVNC/input.js
  237. 0 {public → vendor/assets}/javascripts/noVNC/jsunzip.js
  238. 0 {public → vendor/assets}/javascripts/noVNC/logo.js
  239. 0 {public → vendor/assets}/javascripts/noVNC/playback.js
  240. 0 {public → vendor/assets}/javascripts/noVNC/rfb.js
  241. 0 {public → vendor/assets}/javascripts/noVNC/ui.js
  242. 0 {public → vendor/assets}/javascripts/noVNC/util.js
  243. 0 {public → vendor/assets}/javascripts/noVNC/web-socket-js/README.txt
  244. 0 {public → vendor/assets}/javascripts/noVNC/web-socket-js/swfobject.js
  245. 0 {public → vendor/assets}/javascripts/noVNC/web-socket-js/web_socket.js
  246. 0 {public → vendor/assets}/javascripts/noVNC/websock.js
  247. 0 {public → vendor/assets}/javascripts/noVNC/webutil.js
  248. 0 {public → vendor/assets}/javascripts/spice/atKeynames.js
  249. 0 {public → vendor/assets}/javascripts/spice/bitmap.js
  250. 0 {public → vendor/assets}/javascripts/spice/cursor.js
  251. 0 {public → vendor/assets}/javascripts/spice/display.js
  252. 0 {public → vendor/assets}/javascripts/spice/enums.js
  253. +13 −13 {public → vendor/assets}/javascripts/spice/inputs.js
  254. 0 {public → vendor/assets}/javascripts/spice/lz.js
  255. 0 {public → vendor/assets}/javascripts/spice/main.js
  256. 0 {public → vendor/assets}/javascripts/spice/png.js
  257. 0 {public → vendor/assets}/javascripts/spice/quic.js
  258. +25 −0 vendor/assets/javascripts/spice/setup.js
  259. 0 {public → vendor/assets}/javascripts/spice/spiceconn.js
  260. 0 {public → vendor/assets}/javascripts/spice/spicedataview.js
  261. 0 {public → vendor/assets}/javascripts/spice/spicemsg.js
  262. 0 {public → vendor/assets}/javascripts/spice/spicetype.js
  263. 0 {public → vendor/assets}/javascripts/spice/thirdparty/jsbn.js
  264. 0 {public → vendor/assets}/javascripts/spice/thirdparty/prng4.js
  265. 0 {public → vendor/assets}/javascripts/spice/thirdparty/rng.js
  266. 0 {public → vendor/assets}/javascripts/spice/thirdparty/rsa.js
  267. 0 {public → vendor/assets}/javascripts/spice/thirdparty/sha1.js
  268. 0 {public → vendor/assets}/javascripts/spice/ticket.js
  269. 0 {public → vendor/assets}/javascripts/spice/utils.js
  270. 0 {public → vendor/assets}/javascripts/spice/wire.js
  271. +6 −0 vendor/assets/javascripts/vendor.js
  272. 0 {public → vendor/assets}/stylesheets/jquery.jnotify.css
  273. +24 −13 public/stylesheets/multi-select.css → vendor/assets/stylesheets/multi-select.scss
  274. +3 −0 vendor/assets/stylesheets/vendor.css
View
@@ -14,6 +14,7 @@ bundler.d/Gemfile.local.rb
.idea
*.pyc
public/apipie-cache
+public/assets
.DS_Store
foreman_client
doc/apidoc*
View
@@ -2,14 +2,13 @@ require File.expand_path('../config/settings', __FILE__)
require File.expand_path('../lib/regexp_extensions', __FILE__)
source 'http://rubygems.org'
-gem 'rails', '3.0.20'
-gem "jquery-rails"
+gem 'rails', '3.2.13'
gem 'json'
gem 'rest-client', :require => 'rest_client'
gem "audited-activerecord", "3.0.0.rc1"
gem "will_paginate", "~> 3.0.2"
gem "ancestry", "~> 1.3"
-gem 'scoped_search', '>= 2.4'
+gem 'scoped_search', '>= 2.5'
gem 'net-ldap'
gem 'uuidtools'
gem "apipie-rails", '0.0.16'
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
@@ -1,8 +1,19 @@
+//= require jquery
+//= require jquery_ujs
+//= require jquery.ui.autocomplete
+//= require scoped_search
+//= require twitter/bootstrap
+//= require charts
+//= require vendor
+//= require_self
+
$(function() {
onContentLoad();
});
function onContentLoad(){
+ $('.autocomplete-input').scopedSearch();
+
$('.flash.error').hide().each(function(index, item) {
if ($('.alert-message.alert-error.base').length == 0) {
if ($('#host-conflicts-modal').length == 0) {
@@ -95,9 +106,19 @@ function add_fields(link, association, content) {
$(link).before(content.replace(regexp, new_id));
}
-function checkAll (id, checked) {
- $(id).attr('checked',checked);
-}
+$(document).ready(function() {
+ $("#check_all_roles").click(function(e) {
+ e.preventDefault();
+ $(".role_checkbox").prop('checked', true);
+
+ });
+
+ $("#uncheck_all_roles").click(function(e) {
+ e.preventDefault();
+ $(".role_checkbox").prop('checked', false);
+ });
+});
+
function toggleCheckboxesBySelector(selector) {
boxes = $(selector);
@@ -130,7 +151,7 @@ function template_info(div, url) {
hostgroup_id = $("#host_hostgroup_id :selected").attr("value");
build = $('input:radio[name$="[provision_method]"]:checked').val();
- $(div).html('<img src="/images/spinner.gif" alt="Wait" />');
+ $(div).html('<img src="/assets/spinner.gif" alt="Wait" />');
$(div).load(url + "?operatingsystem_id=" + os_id + "&hostgroup_id=" + hostgroup_id + "&environment_id=" + env_id+"&provisioning="+build,
function(response, status, xhr) {
if (status == "error") {
@@ -142,7 +163,7 @@ function template_info(div, url) {
$(document).ready(function() {
var common_settings = {
method : 'PUT',
- indicator : "<img src='../images/spinner.gif' />",
+ indicator : "<img src='/assets/spinner.gif' />",
tooltip : 'Click to edit..',
placeholder : 'Click to edit..',
submitdata : {authenticity_token: AUTH_TOKEN, format : "json"},
@@ -207,9 +228,9 @@ $(function() {
function magic_line(id, combo) {
var $el, leftPos, newWidth, $mainNav = $(id);
-
$mainNav.append("<li class='magic-line'></li>");
var $magicLine = $(id + " .magic-line");
+ if ($magicLine.size() == 0) return;
if ($('[data-toggle=collapse]:visible').length > 0){
$magicLine.hide();
}else{$magicLine.show();}
@@ -304,14 +325,14 @@ function filter_by_level(item){
}
function auth_source_selected(){
- var auth_source_id = $('#user_auth_source_id').attr('value');
- if (auth_source_id == '') return false;
- $.ajax({
- type:'get',
- url:'/users/auth_source_selected',
- data:'auth_source_id=' + auth_source_id
- })
+ var auth_source_id = $('#user_auth_source_id').val();
+ if (auth_source_id == '') {
+ $("#password").hide();
+ } else {
+ $("#password").show();
+ }
}
+
function show_release(element){
var os_family = $(element).val();
if (os_family == 'Debian' || os_family == 'Solaris') {
@@ -359,9 +380,9 @@ $(function() {
function update_puppetclasses(element) {
var host_id = $(element).attr('data-host-id');
- var env_id = $('*[id*=environment_id]').attr('value');
+ var env_id = $('*[id*=environment_id]').val();
var url = $(element).attr('data-url');
- var hostgroup_id = $('*[id*=hostgroup_id]').attr('value');
+ var hostgroup_id = $('*[id*=hostgroup_id]').val();
if (env_id == "") return;
$.ajax({
type: 'post',
@@ -370,10 +391,10 @@ function update_puppetclasses(element) {
success: function(request) {
$('#puppet_klasses').html(request);
reload_params();
+ $('[rel="twipsy"]').tooltip();
},
complete: function() {
$('#hostgroup_indicator').hide();
- $('[rel="twipsy"]').tooltip();
}
})
}
@@ -3,12 +3,9 @@ $(function(){
var el = $(element);
var name = el.attr('chart-name');
var title = el.attr('chart-title');
- var border = $.parseJSON(el.attr('border'));
var expandable = el.attr('expandable');
- var show_title = $.parseJSON(el.attr('show_title'));
var data = $.parseJSON(el.attr('chart-data'));
-
- stat_pie(name, title, data, border, expandable, show_title);
+ stat_pie(name, title, data, false, expandable, false);
});
$(".statistics_bar").each(function(index, element){
@@ -21,15 +21,8 @@ function providerSelected(item)
}
$("[type=submit]").attr("disabled",false);
var url = $(item).attr('data-url');
- $.ajax({
- type:'post',
- url: url,
- data:'provider=' + provider,
- success: function(result){
- $('#compute_connection').html($(result).find("#compute_connection"));
- $('#compute_connection').append($(result).find(".alert-message"));
- }
- });
+ var data = 'provider=' + provider;
+ $('#compute_connection').load(url + ' div#compute_connection', data);
}
function testConnection(item) {
@@ -40,8 +33,9 @@ function testConnection(item) {
url: $(item).attr('data-url'),
data: $('form').serialize(),
success:function (result) {
- $('#compute_connection').html($(result).find("#compute_connection"));
- $('#compute_connection').prepend($(result).find(".alert-message"));
+ var res = $('<div>' + result + '</div>');
+ $('#compute_connection').html(res.find("#compute_connection"));
+ $('#compute_connection').prepend(res.find(".alert-message"));
},
complete:function (result) {
$('#test_connection_indicator').hide();
@@ -2,7 +2,7 @@ var $editor
$(function() {
var template_text = $(".template_text");
- if ($.browser.msie && $.browser.version.slice(0,1) < 10) {
+ if ($.browser && $.browser.msie && $.browser.version.slice(0,1) < 10) {
$('.subnav').hide();
if ($('.diffMode').size() >0) {
IE_diff_mode(template_text);
@@ -107,7 +107,7 @@ $(function() {
var title = $(this).attr('data-original-title') + ' - The following hosts are about to be changed';
var url = $(this).attr('href') + "?" + $.param({host_ids: $.foremanSelectedHosts});
$('#confirmation-modal .modal-header h3').text(title);
- $('#confirmation-modal .modal-body').empty().append("<img class='modal-loading' src='/images/spinner.gif'>");
+ $('#confirmation-modal .modal-body').empty().append("<img class='modal-loading' src='/assets/spinner.gif'>");
$('#confirmation-modal').modal({show: "true", backdrop: "static"});
$("#confirmation-modal .modal-body").load(url + " #content",
function(response, status, xhr) {
@@ -1,7 +1,6 @@
function computeResourceSelected(item){
var compute = $(item).val();
var attrs = attribute_hash(['architecture_id', 'compute_resource_id', 'operatingsystem_id']);
- var label = $(item).children(":selected").text();
if(compute=='') { //Bare Metal
$('#mac_address').show();
$("#model_name").show();
@@ -151,7 +150,7 @@ function add_puppet_class(item){
var link = content.children('a');
link.attr('onclick', 'remove_puppet_class(this)');
link.attr('data-original-title', 'Click to undo adding this class');
- link.removeClass('ui-icon-plus').addClass('ui-icon-minus').tooltip();
+ link.removeClass('icon-plus-sign').addClass('icon-remove-sign').tooltip();
$('#selected_classes').append(content);
@@ -185,7 +184,7 @@ function load_puppet_class_parameters(item) {
if (url == undefined) return; // no parameters
var placeholder = $('<tr id="puppetclass_'+id+'_params_loading">'+
- '<td colspan="5"><p><img src="/images/spinner.gif" alt="Wait" /> Loading parameters...</p></td>'+'</tr>');
+ '<td colspan="5"><p><img src="/assets/spinner.gif" alt="Wait" /> Loading parameters...</p></td>'+'</tr>');
$('#inherited_puppetclasses_parameters').append(placeholder);
$.ajax({
url: url,
@@ -201,64 +200,39 @@ function load_puppet_class_parameters(item) {
}
function hostgroup_changed(element) {
- var host_id = $(element).attr('data-host-id');
- var url = $(element).attr('data-url');
- var attrs = attribute_hash(['hostgroup_id', 'compute_resource_id', 'organization_id', 'location_id']);
- if (attrs["hostgroup_id"] == undefined) attrs["hostgroup_id"] = $('#hostgroup_parent_id').attr('value');
- $('#hostgroup_indicator').show();
+ var host_id = $(element).data('host-id');
if (!host_id){ // a new host
- $.ajax({
- type:'post',
- url: url,
- data:attrs,
- complete: function(){
- $('#hostgroup_indicator').hide();
- $('[rel="twipsy"]').tooltip();
- update_provisioning_image();
- reload_params();
- }
- })
+ update_form(element);
} else { // edit host
update_puppetclasses(element);
}
}
function organization_changed(element) {
- var url = $(element).attr('data-url');
- var data = $('form').serialize().replace('method=put', 'method=post');
- $('#organization_indicator').show();
- $.ajax({
- type: 'post',
- url: url,
- data: data,
- success: function(response) {
- $('#organization_indicator').hide();
- $('form').html(response);
- onContentLoad();
- },
- complete: function(){
- $('#organization_indicator').hide();
- $('[rel="twipsy"]').tooltip();
- }
- })
+ update_form(element);
}
function location_changed(element) {
- var url = $(element).attr('data-url');
+ update_form(element);
+}
+
+
+function update_form(element) {
+ var url = $(element).data('url');
var data = $('form').serialize().replace('method=put', 'method=post');
- $('#location_indicator').show();
+ var indicator = $(element).parent().find('img');
+ indicator.show();
$.ajax({
type: 'post',
url: url,
data: data,
success: function(response) {
- $('#location_indicator').hide();
$('form').html(response);
+ $("[id$='subnet_id']").first().change();
onContentLoad();
},
complete: function(){
- $('#location_indicator').hide();
- $('[rel="twipsy"]').tooltip();
+ indicator.hide();
}
})
}
@@ -276,11 +250,15 @@ function subnet_selected(element){
}
var attrs = attribute_hash(["subnet_id", "host_mac", 'organization_id', 'location_id']);
$('#subnet_indicator').show();
+ var url = $(element).data('url');
$.ajax({
data: attrs,
type:'post',
- url: foreman_url('/subnets/freeip'),
- complete: function(){$('#subnet_indicator').hide()}
+ url: url,
+ complete: function(){$('#subnet_indicator').hide()},
+ success: function(data){
+ $('#host_ip').val(data.ip);
+ }
})
}
@@ -302,11 +280,13 @@ function _to_int(str){
function domain_selected(element){
var attrs = attribute_hash(['domain_id', 'organization_id', 'location_id']);
- var url = $(element).attr('data-url');
+ var url = $(element).data('url');
+ $('#domain_indicator').show();
$.ajax({
data: attrs,
type:'post',
url: url,
+ complete: function(){$('#domain_indicator').hide()},
success: function(request) {
$('#subnet_select').html(request);
reload_params();
@@ -434,18 +414,18 @@ function override_class_param(item){
}
function reload_params(){
- var url = $('#params-tab').attr('data-url');
+ var url = $('#params-tab').data('url');
var data = $("[data-submit='progress_bar']").serialize().replace('method=put', 'method=post');
load_with_placeholder('inherited_parameters', url, data)
- var url2 = $('#params-tab').attr('data-url2');
+ var url2 = $('#params-tab').data('url2');
load_with_placeholder('inherited_puppetclasses_parameters', url2, data)
}
function load_with_placeholder(target, url, data){
if(url==undefined) return;
var placeholder = $('<tr id="' + target + '_loading" >'+
- '<td colspan="4"><p><img src="/images/spinner.gif" alt="Wait" /> Loading parameters...</p></td></tr>');
+ '<td colspan="4"><p><img src="/assets/spinner.gif" alt="Wait" /> Loading parameters...</p></td></tr>');
$('#' + target + ' tbody').replaceWith(placeholder);
$.ajax({
type:'post',
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.

0 comments on commit feacea3

Please sign in to comment.