Browse Source

add referer

Sniperovitch 8 years ago
parent
commit
cae2f05eae
2 changed files with 6 additions and 15 deletions
  1. 5 14
      lib/Bartender.pm
  2. 1 1
      public/index.html

+ 5 - 14
lib/Bartender.pm

@@ -5,20 +5,10 @@ use POSIX ();
 
 
 our $VERSION = '0.1';
 our $VERSION = '0.1';
 
 
-get '/' => sub {
-    send_file '/index.html';
-};
-
+#get '/' => sub {
+#    send_file '/index.html';
+#};
 
 
-=pod
-$VAR1 = {
-          'projetId' => 'abro-tele2',
-          'projetPadPrincipal' => 'https://pad.exegetes.eu.org/p/g.DSXI1kGFT1gjor66$Abro-REP-Tele2-Principal/export/txt',
-          'projetPadGarde' => 'https://pad.exegetes.eu.org/p/g.DSXI1kGFT1gjor66$Abro-REP-Tele2-Garde/export/txt',
-          'projetPadAutre1' => '',
-          'dossier' => 'abroretention'
-        };
-=cut
 
 
 get '/shake' => sub {
 get '/shake' => sub {
     my %param = params;
     my %param = params;
@@ -29,7 +19,8 @@ get '/shake' => sub {
     my $opt_projet = $param{projetId};
     my $opt_projet = $param{projetId};
 
 
     system("/home/sniperovitch/cocktail/cocktail -d $opt_dossier -b '$opt_base' -g '$opt_garde' -p $opt_projet &");
     system("/home/sniperovitch/cocktail/cocktail -d $opt_dossier -b '$opt_base' -g '$opt_garde' -p $opt_projet &");
-    send_file '/index.html';
+     redirect request-referer;
+#    send_file '/index.html';
 };
 };
 
 
 
 

+ 1 - 1
public/index.html

@@ -79,7 +79,7 @@
     <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
     <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
 <script>
 <script>
 $(document).ready(function() {
 $(document).ready(function() {
-    jQuery.get('/status?dossier=abroretention&projetId=abro-tele2', function(data) {
+    jQuery.get('/bartender//status?dossier=abroretention&projetId=abro-tele2', function(data) {
         $("#statusmsg").html(data["text"]);
         $("#statusmsg").html(data["text"]);
     });
     });
 });
 });