[Kimchi-devel] [PATCH v3] [Kimchi 4/8] Changing network API: UI changes

dhbarboza82 at gmail.com dhbarboza82 at gmail.com
Tue Feb 16 17:58:10 UTC 2016


From: Daniel Henrique Barboza <dhbarboza82 at gmail.com>

kimchi.network.js and kimchi.network_add_main.js are now considering
that the backend is working with an array called 'interfaces'.

Same UI behavior is kept by assigning the first element of this array
to the existing 'interface' parameter.

Copyright format changes were made too.

Signed-off-by: Daniel Henrique Barboza <dhbarboza82 at gmail.com>
---
 ui/js/src/kimchi.network.js          | 4 ++--
 ui/js/src/kimchi.network_add_main.js | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/ui/js/src/kimchi.network.js b/ui/js/src/kimchi.network.js
index 96c3fea..1e79f8d 100644
--- a/ui/js/src/kimchi.network.js
+++ b/ui/js/src/kimchi.network.js
@@ -1,7 +1,7 @@
 /*
  * Project Kimchi
  *
- * Copyright IBM, Corp. 2013-2015
+ * Copyright IBM Corp, 2013-2016
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -43,7 +43,7 @@ kimchi.initNetworkListView = function() {
             } else {
                 network.type = data[i].connection;
             }
-            network.interface = data[i].interface ? data[i].interface : null;
+            network.interface = data[i].interfaces ? data[i].interfaces[0] : null;
             network.addrSpace = data[i].subnet ? data[i].subnet : null;
             network.persistent = data[i].persistent;
             kimchi.addNetworkItem(network);
diff --git a/ui/js/src/kimchi.network_add_main.js b/ui/js/src/kimchi.network_add_main.js
index 0157df7..6beb115 100644
--- a/ui/js/src/kimchi.network_add_main.js
+++ b/ui/js/src/kimchi.network_add_main.js
@@ -1,7 +1,7 @@
 /*
  * Project Kimchi
  *
- * Copyright IBM, Corp. 2013-2016
+ * Copyright IBM Corp, 2013-2016
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -32,13 +32,13 @@ kimchi.startNetworkCreation = function() {
     var data = {
         name : network.name,
         connection: network.type,
-        interface: network.interface,
+        interfaces: [ network.interface ],
         vlan_id: network.vlan_id
     };
 
     kimchi.createNetwork(data, function(result) {
         network.state = result.state === "active" ? "up" : "down";
-        network.interface = result.interface ? result.interface : i18n["KCHNET6001M"];
+        network.interface = result.interfaces ? result.interfaces[0] : i18n["KCHNET6001M"];
         network.addrSpace = result.subnet ? result.subnet : i18n["KCHNET6001M"];
         network.persistent = result.persistent;
         $('#networkGrid').dataGrid('addRow', kimchi.addNetworkItem(network));
@@ -181,4 +181,4 @@ kimchi.loadInterfaces = function(interfaceFilterArray) {
         kimchi.setDefaultNetworkType(result.length!==0);
         kimchi.changeNetworkDestination();
     });
-};
\ No newline at end of file
+};
-- 
2.5.0




More information about the Kimchi-devel mailing list