Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add region id to subscription
Browse files Browse the repository at this point in the history
ZitaNemeckova committed Oct 6, 2017
1 parent b43b994 commit 9ea2e05
Showing 3 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -300,6 +300,7 @@ ManageIQ.angular.app.controller('pglogicalReplicationFormController', ['$http',

function getPgLogicalFormData(response) {
var data = response.data;
debugger;

$scope.pglogicalReplicationModel.replication_type = data.replication_type;
$scope.pglogicalReplicationModel.subscriptions = angular.copy(data.subscriptions);
2 changes: 2 additions & 0 deletions app/controllers/ops_controller/settings/common.rb
Original file line number Diff line number Diff line change
@@ -192,6 +192,7 @@ def pglogical_save_subscriptions
if replication_type == :global
MiqRegion.replication_type = replication_type
subscriptions_to_save = []
binding.pry
params[:subscriptions].each do |_, subscription_params|
subscription = find_or_new_subscription(subscription_params['id'])
if subscription.id && subscription_params['remove'] == "true"
@@ -202,6 +203,7 @@ def pglogical_save_subscriptions
end
end
begin
binding.pry
PglogicalSubscription.save_all!(subscriptions_to_save)
rescue StandardError => bang
add_flash(_("Error during replication configuration save: %{message}") %
6 changes: 6 additions & 0 deletions app/views/ops/_settings_replication_tab.html.haml
Original file line number Diff line number Diff line change
@@ -36,6 +36,7 @@
%th= _('Username')
%th= _('Password')
%th= _('Port')
%th= _('Region')
%th= _('Backlog')
%th{:colspan => 2}=_('Actions')
%tbody
@@ -74,6 +75,11 @@
"id" => "port",
"name" => "port",
"ng-model" => "pglogicalReplicationModel.port"}
%td
%input.form-control{"type" => "text",
"id" => "region",
"name" => "region",
"ng-model" => "pglogicalReplicationModel.region"}
%td
%td{:class => "action-cell"}
%button.btn.btn-default.btn-block.btn-sm{:type => "button", "ng-disabled" => "!subscriptionValid()", "ng-click" => "addSubscription()"}= _('Accept')

0 comments on commit 9ea2e05

Please sign in to comment.