[Kimchi-devel] [PATCH] Display guest IP address for each network interface

Aline Manera alinefm at linux.vnet.ibm.com
Tue Nov 17 13:11:26 UTC 2015



On 17/11/2015 04:21, Socorro Stoppler wrote:
> Aline also had some comments on this patch.  She suggested putting 
> 'unavailable' when VM is not running.

Not only when the VM is not running but when the IP list is empty by any 
reason.

> Currently, I'm just displaying what is given back to me by the backend 
> (w/out the brackets).  Assuming we go this route, are you suggesting 
> the brackets get added?

No! Keep displaying the IPs without the brackets

>   Please advise on which solution is more desirable. Thanks!
>
> On 11/16/2015 07:52 PM, Rodrigo Trujillo wrote:
>>
>>
>> On 11/13/2015 08:37 PM, Socorro Stoppler wrote:
>>> Display guest IP address for each network interface configured
>>> This was based off of Samuel's branch.
>>>
>>> Signed-off-by: Socorro Stoppler <socorro at linux.vnet.ibm.com>
>>> ---
>>>   src/wok/plugins/ginger                                     | 2 +-
>>>   src/wok/plugins/kimchi/ui/js/src/kimchi.guest_edit_main.js | 6 ++++--
>>>   src/wok/plugins/kimchi/ui/pages/guest-edit.html.tmpl       | 4 ++++
>>>   3 files changed, 9 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/src/wok/plugins/ginger b/src/wok/plugins/ginger
>>> index 76cbf86..84f36db 160000
>>> --- a/src/wok/plugins/ginger
>>> +++ b/src/wok/plugins/ginger
>>> @@ -1 +1 @@
>>> -Subproject commit 76cbf8698674142daa41a105ce50bb213471104e
>>> +Subproject commit 84f36dbbfe63869fa97cd68e9abdeaffdf1846d9
>>> diff --git 
>>> a/src/wok/plugins/kimchi/ui/js/src/kimchi.guest_edit_main.js 
>>> b/src/wok/plugins/kimchi/ui/js/src/kimchi.guest_edit_main.js
>>> index 44dd1fd..5fcf76f 100644
>>> --- a/src/wok/plugins/kimchi/ui/js/src/kimchi.guest_edit_main.js
>>> +++ b/src/wok/plugins/kimchi/ui/js/src/kimchi.guest_edit_main.js
>>> @@ -122,7 +122,7 @@ kimchi.guest_edit_main = function() {
>>>               };
>>>
>>>               kimchi.replaceVMStorage(settings, function(result) {
>>> -                wok.topic('kimchi/vmCDROMReplaced').publish({
>>> + wok.topic('kimchi/vmCDROMReplace:w:wd').publish({
>>>                       result: result
>>>                   });
>>>               }, function(result) {
>>> @@ -145,6 +145,7 @@ kimchi.guest_edit_main = function() {
>>>               addItem({
>>>                   id: -1,
>>>                   mac: "",
>>> +                ips: "",
>>>                   network: "",
>>>                   type: "network",
>>>                   viewMode: "hide",
>>> @@ -188,7 +189,8 @@ kimchi.guest_edit_main = function() {
>>>                   var interface = {
>>>                       network: $("select", item).val(),
>>>                       type: "network",
>>> -                    mac: $(":text", item).val()
>>> +                    mac: $(":text", item).val(),
>>> +                    ips: $(".ipText", item).val()
>> Notice that IPs values come as a list of IPs "[192.168.0.2, 
>> 192.168.0.3, ...]", or an empty list "[]" .
>> So, seems that you are going to show the brackets in the screen.
>>>                   };
>>>                   var postUpdate = function(mac){
>>>                       $("#label-network-" + data.id, 
>>> item).text(interface.network);
>>> diff --git a/src/wok/plugins/kimchi/ui/pages/guest-edit.html.tmpl 
>>> b/src/wok/plugins/kimchi/ui/pages/guest-edit.html.tmpl
>>> index 098f409..868dd4d 100644
>>> --- a/src/wok/plugins/kimchi/ui/pages/guest-edit.html.tmpl
>>> +++ b/src/wok/plugins/kimchi/ui/pages/guest-edit.html.tmpl
>>> @@ -78,6 +78,7 @@
>>>                       <span class="cell">$_("Network")</span>
>>>                       <span class="cell">$_("Type")</span>
>>>                       <span class="cell">$_("MAC Address")</span>
>>> +                    <span class="cell">$_("IP Address")</span>
>>>                   </div>
>>>                   <div class="body"></div>
>>>               </form>
>>> @@ -203,6 +204,9 @@
>>>               <input class="{editMode}" type="text"
>>>                  id="edit-mac-{id}" name="{mac}" value="{mac}" />
>>>           </span>
>>> +        <span class="cell">
>>> +            <span class=ipText>{ips}</span>
>>> +        </span>
>>>           <span class="action-area {editMode}">
>>>               <button class="save"></button><button 
>>> class="cancel"></button>
>>>           </span>
>>
>




More information about the Kimchi-devel mailing list