trafficcontrol-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dewr...@apache.org
Subject [incubator-trafficcontrol] 02/02: add back needed parts for go crconfig
Date Tue, 01 May 2018 14:42:56 GMT
This is an automated email from the ASF dual-hosted git repository.

dewrich pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git

commit 233aad4c2788093a88c0fcd049638dedd45df0ee
Author: Dan Kirkwood <dangogh@apache.org>
AuthorDate: Mon Apr 30 22:15:58 2018 +0000

    add back needed parts for go crconfig
---
 traffic_ops/app/lib/TrafficOpsRoutes.pm |  3 ++-
 traffic_ops/app/lib/UI/Tools.pm         | 22 +++++-----------------
 2 files changed, 7 insertions(+), 18 deletions(-)

diff --git a/traffic_ops/app/lib/TrafficOpsRoutes.pm b/traffic_ops/app/lib/TrafficOpsRoutes.pm
index 78b3e05..5c944b9 100644
--- a/traffic_ops/app/lib/TrafficOpsRoutes.pm
+++ b/traffic_ops/app/lib/TrafficOpsRoutes.pm
@@ -338,7 +338,8 @@ sub ui_routes {
 	$r->get('/tools/queue_updates')->over( authenticated => 1, not_ldap => 1 )->to(
'Tools#queue_updates', namespace => $namespace );
 	$r->get('/tools/snapshot_crconfig')->over( authenticated => 1, not_ldap => 1
)->to( 'Tools#snapshot_crconfig', namespace => $namespace );
 	$r->get('/tools/diff_crconfig/:cdn_name')->over( authenticated => 1, not_ldap =>
1 )->to( 'Tools#diff_crconfig_iframe', namespace => $namespace );
-	$r->get('/tools/write_crconfig/:cdn_name')->over( authenticated => 1, not_ldap
=> 1 )->to( 'Tools#write_crconfig', namespace => $namespace );
+	# flash_and_close is a helper for the traffic_ops_golang migration, to allow Go handlers
to intercept GUI routes, do their work, then redirect to this to perform the GUI operation
+	$r->get('/tools/flash_and_close/:msg')->over( authenticated => 1, not_ldap =>
1 )->to( 'Tools#flash_and_close', namespace => $namespace );
 	$r->get('/tools/invalidate_content/')->over( authenticated => 1, not_ldap =>
1 )->to( 'Tools#invalidate_content', namespace => $namespace );
 
 	# -- Topology - CCR Config, rewrote in json
diff --git a/traffic_ops/app/lib/UI/Tools.pm b/traffic_ops/app/lib/UI/Tools.pm
index 3ab70c1..639c9ff 100644
--- a/traffic_ops/app/lib/UI/Tools.pm
+++ b/traffic_ops/app/lib/UI/Tools.pm
@@ -105,23 +105,11 @@ sub diff_crconfig_iframe {
     );
 }
 
-sub write_crconfig {
-    my $self     = shift;
-    my $cdn_name = $self->param('cdn_name');
-    my ( $json, $error ) = UI::Topology::gen_crconfig_json( $self, $cdn_name );
-    if ( defined $error ) {
-        $self->flash( alertmsg => $error );
-    }
-    else {
-        if ( !&is_oper($self) ) {
-            $self->flash( alertmsg => "No can do. Get more privs." );
-        } else {
-            UI::Topology::write_crconfig_json_to_db( $self, $cdn_name, $json );
-            &log( $self, "Snapshot CRConfig created.", "OPER" );
-            $self->flash( alertmsg => "Successfully wrote CRConfig.json!" );
-        }
-    }
-    return $self->redirect_to('/utils/close_fancybox');
+sub flash_and_close {
+    my $self = shift;
+		my $msg = $self->param('msg');
+		$self->flash( alertmsg => $msg );
+		return $self->redirect_to('/utils/close_fancybox');
 }
 
 sub queue_updates {

-- 
To stop receiving notification emails like this one, please contact
dewrich@apache.org.

Mime
View raw message