ref: refs/heads/dmacvicar_log_viewer
commit 4a5acc0d4a967c274809fecb98960d70a6d53569
Author: Martin Vidner
Date: Fri Aug 21 15:25:08 2009 +0200
Restarted network: it shows the hostname.
FIXME: It needs permissions for
org.opensuse.yast.modules.yapi.network.hostname
but the intent is that they all share the same o.o.y.m.y.network
permissions.
---
.../network/app/controllers/network_controller.rb | 61 ++++----------------
plugins/network/app/views/network/index.html.erb | 26 +++++----
2 files changed, 25 insertions(+), 62 deletions(-)
diff --git a/plugins/network/app/controllers/network_controller.rb b/plugins/network/app/controllers/network_controller.rb
index 615e3f0..a9fff36 100644
--- a/plugins/network/app/controllers/network_controller.rb
+++ b/plugins/network/app/controllers/network_controller.rb
@@ -4,6 +4,7 @@ class NetworkController < ApplicationController
before_filter :login_required
layout 'main'
+ include ProxyLoader
private
def network_permissions
@@ -25,18 +26,17 @@ class NetworkController < ApplicationController
# GET /users
# GET /users.xml
def index
- return unless network_permissions
- @networks = []
- begin
- @networks = @network.find(:all)
- rescue ActiveResource::ClientError => e
- flash[:error] = YaST::ServiceResource.error(e)
- end
-
- respond_to do |format|
- format.html # index.html.erb
- format.xml { render :xml => @networks }
+ hn = load_proxy "org.opensuse.yast.modules.yapi.network.hostname"
+ return false unless hn
+
+ unless @permissions[:read]
+ flash[:warning] = _("No permissions for hostname module")
+ redirect_to root_path
+ return false
end
+
+ @name = hn.name
+ @domain = hn.domain
end
# GET /users/new
@@ -65,19 +65,6 @@ class NetworkController < ApplicationController
end
end
- # GET /users/1/exportssh
-# def exportssh
-# return unless client_permissions
-# @user = @client.find(params[:id])
-# @user.type = ""
-# @user.id = @user.login_name
-# logger.debug "exportssh: #{@user.inspect}"
-# respond_to do |format|
-# format.html # exportssh.html.erb
-# format.xml { render :xml => @user, :location => "none" }
-# end
-# end
-
# GET /users/1/edit
def edit
return unless network_permissions
@@ -98,32 +85,6 @@ class NetworkController < ApplicationController
# end
end
- # POST /users/1/sshexport
-# def sshexport
-# return unless client_permissions
-
-# @user = @client.find(params["user"]["login_name"])
-# @user.id = @user.login_name
-# logger.debug "sshexportssh: #{@user.inspect}"
-# @user.sshkey = params["user"]["sshkey"]
-# response = true
-# begin
-# response = @user.save
-# rescue ActiveResource::ClientError => e
-# flash[:error] = YaST::ServiceResource.error(e)
-# response = false
-# end
-# logger.debug "sshexportssh: #{response}"
-# respond_to do |format|
-# if response
-# flash[:notice] = _('SSH-Key was successfully exported.')
-# format.html { redirect_to(users_url) }
-# else
-# format.html { render :action => "exportssh" }
-# format.xml { render :xml => @user.errors, :status => :unprocessable_entity }
-# end
-# end
-# end
# POST /users
diff --git a/plugins/network/app/views/network/index.html.erb b/plugins/network/app/views/network/index.html.erb
index 2934f1a..9f2dc79 100644
--- a/plugins/network/app/views/network/index.html.erb
+++ b/plugins/network/app/views/network/index.html.erb
@@ -1,19 +1,21 @@
<div class='plugin-icon'><img src='/icons/yast-network.png'/></div>
<div class='plugin-content'>
-<h2><%=_("Network Device")%></h2>
+<h2><%=_("Network")%></h2>
-<table class="list">
- <tr>
- <th class="first" ><%=_("Login")%></th>
- </tr>
- <% for network in @networks %>
- <tr>
- <td><strong><%=h network.name %></strong></td>
- <td><%= html_edit_link(network.id) %></td>
- </tr>
- <% end %>
-</table>
+<!-- TODO translations -->
+<h3>IP Address</h3>
+
+<p>Configuration Mode: <%=h "TODO" %></p>
+<p>IP Address: <%=h "TODO" %></p>
+<p>Netmask: <%=h "TODO" %></p>
+
+<h3>DNS</h3>
+<p>Hostname: <%=h @name %></p>
+<p>Domain: <%=h @domain %></p>
+
+<h3>Routing</h3>
+<p>Default Route: <%=h "TODO" %></p>
<a href="/" class="button"><%=_("Back")%></a>
</div>
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org