[Kimchi-devel] [PATCH] Display guest IP address for each network interface
Socorro Stoppler
socorro at linux.vnet.ibm.com
Tue Nov 17 16:23:19 UTC 2015
After thinking about this some more, I propose that we display depending
on what we get back from the backend rather than the state of the VM.
From what I've seen in my testing, sometimes we get an undefined for VM
state but it still has the IP. Therefore, when there's an IP or set of
IPs, UI will display [<IP(s)>]; otherwise, it'll state 'unavailable'.
Let me know if there are any objections to this.
Thanks!
-Socorro
On 11/16/2015 10:21 PM, Socorro Stoppler wrote:
> Aline also had some comments on this patch. She suggested putting
> 'unavailable' when VM is not running. 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?
> 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