From 5af67dcd67f8b37ab720ab24d0758e03a5cd0235 Mon Sep 17 00:00:00 2001 From: Julien Simonet Date: Fri, 24 Jan 2014 20:18:49 +0100 Subject: [PATCH] [Detail] First version of double mode. There is two mode : easy mode and expert mode. - In expert mode, entire file is presented, and user can change it manually. - In easy mode, records informations are presented in a table. --- www/lib/DNSManager.pm | 26 +++++++++++-- www/views/details.tt | 87 ++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 104 insertions(+), 9 deletions(-) diff --git a/www/lib/DNSManager.pm b/www/lib/DNSManager.pm index 5dbab4f..9f34063 100644 --- a/www/lib/DNSManager.pm +++ b/www/lib/DNSManager.pm @@ -143,10 +143,28 @@ prefix '/domain' => sub { my $zone = $app->get_domain(session('login') , param('domain')); - template details => { - login => session('login') - , domain => param('domain') - , domain_zone => $zone->output() }; + if( param( 'expert' ) ) + { + template details => { + login => session('login') + , domain => param('domain') + , domain_zone => $zone->output() + , expert => true }; + } + else + { + # say dump( $zone->cname()); + template details => { + login => session('login') + , domain => param('domain') + , domain_zone => $zone->output() + , a => $zone->a() + , aaaa => $zone->aaaa() + , cname => $zone->cname() + , ptr => $zone->ptr() + , mx => $zone->mx() + , ns => $zone->ns() }; + } } diff --git a/www/views/details.tt b/www/views/details.tt index 487023b..8ea689f 100644 --- a/www/views/details.tt +++ b/www/views/details.tt @@ -5,11 +5,88 @@

Fichier de zone de <% domain %>

-
- -
- -
+ <% IF expert %> +
+ +
+ +
+ + Easy Mode + <% ELSE %> + + + + + + + + + + <% FOREACH address in ns %> + + + + + + + + <% END %> + + <% FOREACH address in a %> + + + + + + + + <% END %> + + <% FOREACH address in aaaa %> + + + + + + + + <% END %> + + <% FOREACH address in cname %> + + + + + + + + <% END %> + + <% FOREACH address in ptr %> + + + + + + + + <% END %> + + <% FOREACH address in mx %> + + + + + + + + <% END %> + +
+
NameClassTypeHostTTL
<% address.name %><% address.class %>NS<% address.host %><% address.ttl %>
<% address.name %><% address.class %>A<% address.host %><% address.ttl %>
<% address.name %><% address.class %>AAAA<% address.host %><% address.ttl %>
<% address.name %><% address.class %>CNAME<% address.host %><% address.ttl %>
<% address.name %><% address.class %>PTR<% address.host %><% address.ttl %>
<% address.name %><% address.class %>MX<% address.host %> (<% address.priority %>)<% address.ttl %>
+ Expert Mode + <% END %>