Browse Source

Separate Set and Edit IP links from group name

As part of #1609363, links was added to associate
fixed IP while creating member for each group.
As part of this bug, sepated IP address association
links from group name as mentioned below
To set IP address : <group name> [Click to Set IP]
To edit associated IP:
<group name> [<ip address>, Click to Edit IP]

Change-Id: Ia51224aeb23559dd2ff6d0faa3cf5c6b9d4e3097
Closes-Bug: #1611908
ank 2 years ago
parent
commit
ebd860e5ec
1 changed files with 11 additions and 10 deletions
  1. 11
    10
      gbpui/static/dashboard/js/member.js

+ 11
- 10
gbpui/static/dashboard/js/member.js View File

@@ -42,9 +42,9 @@ member = {
42 42
    **/
43 43
   generate_group_element: function(name, id, value, selected) {
44 44
     var $li = $('<li>');
45
-    ip_lable = '<strong></strong>'
45
+    ip_lable = '<span></span>'
46 46
     if (selected){
47
-      ip_lable = '<strong> <a>Set IP Address</a></strong>'
47
+      ip_lable = "<span> [<a style='font-size:80%;'>Click to Set IP</a>]</span>"
48 48
     }
49 49
     $li.attr('name', value).html(name + ip_lable + '<a href="#" class="btn btn-primary"></a>');
50 50
     return $li;
@@ -73,9 +73,9 @@ member = {
73 73
       });
74 74
       groupListId.find("input:checkbox").removeAttr('checked');
75 75
       active_groups.each(function(index, value){
76
-        ip_ele = $("#selected_network li[name^='"+ value +"'] strong")
76
+        ip_ele = $("#selected_network li[name^='"+ value +"'] span")
77 77
         if(ip_ele.text() == "" && $("#id_count").val() == 1){
78
-          ip_ele.html(" <a>Set IP Address</a>")
78
+          ip_ele.html(" [<a style='font-size:80%;'>Click to Set IP</a>]")
79 79
         }
80 80
         groupListId.find("input:checkbox[value^='" + value + "']")
81 81
           .prop('checked', true)
@@ -113,7 +113,7 @@ member = {
113 113
         $this.parent().appendTo(selected_group);
114 114
       } else if ($this.parents("ul#selected_network").length > 0) {
115 115
         $this.parent().appendTo(available_group);
116
-        $this.parent().find("strong").html("");
116
+        $this.parent().find("span").html("");
117 117
       }
118 118
       updateForm();
119 119
     });
@@ -160,7 +160,7 @@ member = {
160 160
       selected_element = $(".multiple-checkbox #id_network li input[value^='"+ ptg +"']");
161 161
       value = selected_element.val();
162 162
       values = value.split(':');
163
-      group = $(selected_group).clone().find('strong').remove().end().text();
163
+      group = $(selected_group).clone().find('span').remove().end().text();
164 164
       $("#group").text(group);
165 165
       subnets = values[1].split(";")
166 166
       $('#subnets_table tbody').empty();
@@ -206,7 +206,8 @@ member = {
206 206
             selected_element = $(".multiple-checkbox #id_network li input[value^='"+ ptg +"']");
207 207
             selected_element.val(value)
208 208
             if(fixed_ip){
209
-              $("#selected_network li[name^='"+ ptg +"'] strong").html(" ( "+fixed_ip +") <a>Edit IP</a>")
209
+              $("#selected_network li[name^='"+ ptg +"'] span").html(
210
+                " ["+fixed_ip + ", <a style='font-size:80%;'>Click to Edit IP</a>]")
210 211
             }
211 212
             $("ul#selected_network li[name^='"+ ptg +"']").css("background-color", "");
212 213
             $("#fixed_ip_div").hide()
@@ -229,7 +230,7 @@ member = {
229 230
     value = ptg + ":" + subnet
230 231
     selected_element = $(".multiple-checkbox #id_network li input[value^='"+ ptg +"']");
231 232
     selected_element.val(value)
232
-    $("#selected_network li[name^='"+ ptg +"'] strong").html(" <a>Set IP Address</a>")
233
+    $("#selected_network li[name^='"+ ptg +"'] span").html(" [<a style='font-size:80%;'>Click to Set IP</a>]")
233 234
     $("#fixed_ip_div").hide()
234 235
     $("ul#selected_network li").css("background-color", "");
235 236
     member.control_max_instances()
@@ -257,10 +258,10 @@ member = {
257 258
     help.attr("title", title)
258 259
     $(document).on('input', '#id_count',function(){
259 260
       if($("#id_count").val() > 1){
260
-        $("#selected_network li").find("strong").html("");
261
+        $("#selected_network li").find("span").html("");
261 262
       }
262 263
       else{
263
-        $("#selected_network li").find("strong").html(" <a>Set IP Address</a>")
264
+        $("#selected_network li").find("span").html(" [<a style='font-size:80%;'>Click to Set IP</a>]")
264 265
         $("#errors").hide().text("")
265 266
       }
266 267
       $("#fixed_ip_div").hide()

Loading…
Cancel
Save