Blame SOURCES/bz1189857-07-web-UI-fixes.patch

71541a
From c601e0f7e93db3e136eb9080fc2d4f4a0c999360 Mon Sep 17 00:00:00 2001
71541a
From: Ondrej Mular <omular@redhat.com>
71541a
Date: Mon, 21 Sep 2015 17:53:51 +0200
71541a
Subject: [PATCH] web UI fixes
71541a
71541a
- fix loading resource optional argument form
71541a
- fix master/slave resource status from old pcsd
71541a
- fix status of failed resource
71541a
---
71541a
 pcsd/cluster_entity.rb | 10 ++++++----
71541a
 pcsd/public/js/pcsd.js |  4 +++-
71541a
 pcsd/views/main.erb    |  2 ++
71541a
 3 files changed, 11 insertions(+), 5 deletions(-)
71541a
71541a
diff --git a/pcsd/cluster_entity.rb b/pcsd/cluster_entity.rb
71541a
index 8f29a40..c746544 100644
71541a
--- a/pcsd/cluster_entity.rb
71541a
+++ b/pcsd/cluster_entity.rb
71541a
@@ -191,6 +191,7 @@ module ClusterEntity
71541a
             mi =  ClusterEntity::Clone.new
71541a
           else
71541a
             mi = ClusterEntity::MasterSlave.new
71541a
+            mi.masters_unknown = true
71541a
           end
71541a
           mi.id = mi_id
71541a
           mi.meta_attr = ClusterEntity::get_meta_attr_from_status_v1(
71541a
@@ -539,7 +540,7 @@ module ClusterEntity
71541a
         status = ClusterEntity::ResourceStatus.new(:disabled)
71541a
       elsif running > 0
71541a
         status = ClusterEntity::ResourceStatus.new(:running)
71541a
-      elsif failed > 0
71541a
+      elsif failed > 0 or @error_list.length > 0
71541a
         status = ClusterEntity::ResourceStatus.new(:failed)
71541a
       else
71541a
         status = ClusterEntity::ResourceStatus.new(:blocked)
71541a
@@ -854,10 +855,11 @@ module ClusterEntity
71541a
 
71541a
 
71541a
   class MasterSlave < MultiInstance
71541a
-    attr_accessor :masters, :slaves
71541a
+    attr_accessor :masters, :slaves, :masters_unknown
71541a
 
71541a
     def initialize(master_cib_element=nil, crm_dom=nil, rsc_status=nil, parent=nil, operations=nil)
71541a
       super(master_cib_element, crm_dom, rsc_status, parent, operations)
71541a
+      @masters_unknown = false
71541a
       @class_type = 'master'
71541a
       @masters = []
71541a
       @slaves = []
71541a
@@ -869,7 +871,7 @@ module ClusterEntity
71541a
           primitive_list = @member.members
71541a
         end
71541a
         @masters, @slaves = get_masters_slaves(primitive_list)
71541a
-        if (@masters.empty? and
71541a
+        if (@masters.empty? and !@masters_unknown and
71541a
           @status != ClusterEntity::ResourceStatus.new(:disabled)
71541a
         )
71541a
           @warning_list << {
71541a
@@ -913,7 +915,7 @@ module ClusterEntity
71541a
           primitive_list = @member.members
71541a
         end
71541a
         @masters, @slaves = get_masters_slaves(primitive_list)
71541a
-        if (@masters.empty? and
71541a
+        if (@masters.empty? and !@masters_unknown and
71541a
           @member.status == ClusterEntity::ResourceStatus.new(:running)
71541a
         )
71541a
           @status = ClusterEntity::ResourceStatus.new(:partially_running)
71541a
diff --git a/pcsd/public/js/pcsd.js b/pcsd/public/js/pcsd.js
71541a
index 23fd316..04bee0f 100644
71541a
--- a/pcsd/public/js/pcsd.js
71541a
+++ b/pcsd/public/js/pcsd.js
71541a
@@ -2010,7 +2010,9 @@ function tree_view_onclick(resource_id, auto) {
71541a
 
71541a
   tree_view_select(resource_id);
71541a
 
71541a
-  load_agent_form(resource_id, resource_obj.get('stonith'));
71541a
+  Ember.run.next(Pcs, function() {
71541a
+    load_agent_form(resource_id, resource_obj.get('stonith'));
71541a
+  });
71541a
 }
71541a
 
71541a
 function tree_view_select(element_id) {
71541a
diff --git a/pcsd/views/main.erb b/pcsd/views/main.erb
71541a
index e7e611d..b7260ad 100644
71541a
--- a/pcsd/views/main.erb
71541a
+++ b/pcsd/views/main.erb
71541a
@@ -277,8 +277,10 @@
71541a
     {{#if stonith}}
71541a
       
71541a
     {{else}}
71541a
+    {{#if resource.is_primitive}}
71541a
       
71541a
     {{/if}}
71541a
+    {{/if}}
71541a
   {{else}}
71541a
     {{#if stonith}}
71541a
       NO FENCE DEVICE IN CLUSTER
71541a
-- 
71541a
1.9.1
71541a