Mailinglist Archive: yast-commit (1914 mails)

< Previous Next >
[yast-commit] <web-client> basesystem : Display interface settings (still faked, REST is not ready).
  • From: Martin Vidner <mvidner@xxxxxxx>
  • Date: Thu, 3 Sep 2009 16:49:21 +0200
  • Message-id: <E1Mlexn-0003sk-FD@xxxxxxxxxxxxxxxx>
ref: refs/heads/basesystem
commit bd734bbd1b52e3e77d0221a4709b9a4f19d10795
Author: Martin Vidner <mvidner@xxxxxxx>
Date: Thu Sep 3 16:49:21 2009 +0200

Display interface settings (still faked, REST is not ready).
---
.../network/app/controllers/network_controller.rb | 13 +++++++++++--
plugins/network/app/views/network/index.html.erb | 7 ++++---
.../test/functional/network_controller_test.rb | 4 ++++
3 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/plugins/network/app/controllers/network_controller.rb
b/plugins/network/app/controllers/network_controller.rb
index 7690aac..6626bba 100644
--- a/plugins/network/app/controllers/network_controller.rb
+++ b/plugins/network/app/controllers/network_controller.rb
@@ -23,9 +23,12 @@ class NetworkController < ApplicationController
def initialize
end

- # GET /users
- # GET /users.xml
+ # GET /network
def index
+ @iface = "eth0"
+ # ifc = load_proxy "org.opensuse.yast.modules.yapi.network.interfaces",
@iface
+ # return false unless ifc
+
hn = load_proxy "org.opensuse.yast.modules.yapi.network.hostname"
return false unless hn

@@ -42,6 +45,12 @@ class NetworkController < ApplicationController
return false
end

+ # @conf_mode = ifc. ?
+ # @ip, @netmask = ifc.ipaddr.split "/"
+ @conf_mode = "fake-dhcp"
+ @ip = "fake-ip"
+ @netmask = "fake-netmask"
+
@name = hn.name
@domain = hn.domain
# @nameservers = dns.dnsservers
diff --git a/plugins/network/app/views/network/index.html.erb
b/plugins/network/app/views/network/index.html.erb
index d9b08bd..1d9e1ed 100644
--- a/plugins/network/app/views/network/index.html.erb
+++ b/plugins/network/app/views/network/index.html.erb
@@ -6,9 +6,10 @@

<h3>IP Address</h3>

-<p>Configuration Mode: <%=h "TODO" %></p>
-<p>IP Address: <%=h "TODO" %></p>
-<p>Netmask: <%=h "TODO" %></p>
+<p>Interface: <%=h @iface %></p>
+<p>Configuration Mode: <%=h @conf_mode %></p>
+<p>IP Address: <%=h @ip %></p>
+<p>Netmask: <%=h @netmask %></p>

<h3>DNS</h3>
<p>Hostname: <%=h @name %></p>
diff --git a/plugins/network/test/functional/network_controller_test.rb
b/plugins/network/test/functional/network_controller_test.rb
index 2e5384c..b4f05b8 100644
--- a/plugins/network/test/functional/network_controller_test.rb
+++ b/plugins/network/test/functional/network_controller_test.rb
@@ -27,6 +27,9 @@ class NetworkControllerTest < ActionController::TestCase
NetworkController.any_instance.stubs(:login_required)

# stub what the REST is supposed to return
+ @if_proxy = ProxyN.new
+ @if_proxy.result = OpenStruct.new("ipaddr" => '10.20.30.42/24')
+
@hn_proxy = Proxy1.new
@hn_proxy.result = OpenStruct.new("name" => "Arthur, king of the Britons")

@@ -39,6 +42,7 @@ class NetworkControllerTest < ActionController::TestCase
def x # a shorthand. return another stub
YaST::ServiceResource.stubs(:proxy_for)
end
+
x.with('org.opensuse.yast.modules.yapi.network.interfaces').returns(@if_proxy)

x.with('org.opensuse.yast.modules.yapi.network.hostname').returns(@hn_proxy)
x.with('org.opensuse.yast.modules.yapi.network.dns').returns(@dns_proxy)
x.with('org.opensuse.yast.modules.yapi.network.routes').returns(@rt_proxy)
--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages