ref: refs/heads/dmacvicar_log_viewer
commit 9c964cb9bf94c8516f0f878fc72c88e04e451ca1
Author: Martin Vidner
Date: Thu Sep 3 14:59:36 2009 +0200
Added DNS to the network view+controller.
It is faked because of API mismatch :(
---
.../network/app/controllers/network_controller.rb | 11 ++++++++++-
plugins/network/app/views/network/index.html.erb | 2 ++
webclient/config/initializers/inflections.rb | 2 +-
3 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/plugins/network/app/controllers/network_controller.rb b/plugins/network/app/controllers/network_controller.rb
index 8db1878..7690aac 100644
--- a/plugins/network/app/controllers/network_controller.rb
+++ b/plugins/network/app/controllers/network_controller.rb
@@ -29,17 +29,26 @@ class NetworkController < ApplicationController
hn = load_proxy "org.opensuse.yast.modules.yapi.network.hostname"
return false unless hn
+ dns = load_proxy "org.opensuse.yast.modules.yapi.network.dns"
+ return false unless dns
+
rt = load_proxy "org.opensuse.yast.modules.yapi.network.routes", "default"
return false unless rt
+ # FIXME mixed up by multiple load_proxy
unless @permissions[:read]
- flash[:warning] = _("No permissions for hostname module")
+ flash[:warning] = _("No permissions for network module")
redirect_to root_path
return false
end
@name = hn.name
@domain = hn.domain
+ # @nameservers = dns.dnsservers
+ # @searchdomains = dns.dnsdomains
+ @nameservers = ["fake-ns1", "fake-ns2"]
+ @searchdomains = ["fake-d1", "fake-d2"]
+
@default_route = rt.via
end
diff --git a/plugins/network/app/views/network/index.html.erb b/plugins/network/app/views/network/index.html.erb
index 367cbe8..d9b08bd 100644
--- a/plugins/network/app/views/network/index.html.erb
+++ b/plugins/network/app/views/network/index.html.erb
@@ -13,6 +13,8 @@
<h3>DNS</h3>
<p>Hostname: <%=h @name %></p>
<p>Domain: <%=h @domain %></p>
+<p>Name Servers: <%=h @nameservers %></p>
+<p>Search Domains: <%=h @searchdomains %></p>
<h3>Routing</h3>
<p>Default Route: <%=h @default_route %></p>
diff --git a/webclient/config/initializers/inflections.rb b/webclient/config/initializers/inflections.rb
index b36d1d5..a92f7a2 100644
--- a/webclient/config/initializers/inflections.rb
+++ b/webclient/config/initializers/inflections.rb
@@ -6,5 +6,5 @@
# inflect.plural /^(ox)$/i, '\1en'
# inflect.singular /^(ox)en/i, '\1'
# inflect.irregular 'person', 'people'
- inflect.uncountable %w( security )
+ inflect.uncountable %w( security dns )
end
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org