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

Aline Manera alinefm at linux.vnet.ibm.com
Mon Nov 16 21:32:23 UTC 2015



On 13/11/2015 20:37, 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({

Seems it is a typo. You can discard this change.

>                       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()

When guest is not running, it is not possible to determine its IP 
addresses. In that case, I suggest to display "unavailable" or 
"undefined" instead of leaving it in blank.
Just because leaving it in blank seems the information is missing for 
some reason.

>                   };
>                   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