fix: [Flask] remove hardcoded url

pull/282/head
Terrtia 2018-09-25 16:46:06 +02:00
parent b3923428e5
commit 3a72f1548d
No known key found for this signature in database
GPG Key ID: 1E1B1F50D84613D0
12 changed files with 39 additions and 39 deletions

View File

@ -32,7 +32,7 @@
<div class="row">
<!-- /.col-lg-12 -->
<form action="/PasteSubmit/submit" id="pasteSubmitForm" method="post" enctype=multipart/form-data onsubmit="submitPaste()">
@ -128,7 +128,7 @@
var ltagsgalaxies
$(document).ready(function(){
$.getJSON('/Tags/get_all_tags_taxonomies',
$.getJSON("{{ url_for('Tags.get_all_tags_taxonomies') }}",
function(data) {
ltags = $('#ltags').tagSuggest({
@ -138,7 +138,7 @@
});
});
$.getJSON('/Tags/get_all_tags_galaxies',
$.getJSON("{{ url_for('Tags.get_all_tags_galaxy') }}",
function(data) {
ltagsgalaxies = $('#ltagsgalaxies').tagSuggest({
@ -165,7 +165,7 @@ function submitPaste(){
<script>
jQuery("#all-tags-taxonomies").click(function(e){
//change input tags list
$.getJSON('/Tags/get_all_tags_taxonomies',
$.getJSON("{{ url_for('Tags.get_all_tags_taxonomies') }}",
function(data) {
ltags.setData(data)
});
@ -174,7 +174,7 @@ function submitPaste(){
</script>
<script>
jQuery("#all-tags-galaxies").click(function(e){
$.getJSON('/Tags/get_all_tags_galaxies',
$.getJSON("{{ url_for('Tags.get_all_tags_galaxy') }}",
function(data) {
ltagsgalaxies.setData(data)
});
@ -182,7 +182,7 @@ function submitPaste(){
{% for taxo in active_taxonomies %}
jQuery("#{{ taxo }}-id{{ loop.index0 }}").click(function(e){
$.getJSON('/Tags/get_tags_taxonomie?taxonomie={{ taxo }}',
$.getJSON("{{ url_for('Tags.get_tags_taxonomie') }}?taxonomie={{ taxo }}",
function(data) {
ltags.setData(data)
});
@ -192,7 +192,7 @@ function submitPaste(){
<script>
{% for galaxy in active_galaxies %}
jQuery("#{{ galaxy }}-idgalax{{ loop.index0 }}").click(function(e){
$.getJSON('/Tags/get_tags_galaxy?galaxy={{ galaxy }}',
$.getJSON("{{ url_for('Tags.get_tags_galaxy') }}?galaxy={{ galaxy }}",
function(data) {
ltagsgalaxies.setData(data)
});

View File

@ -12,7 +12,7 @@
<link href="{{ url_for('static', filename='css/bootstrap.min.css') }}" rel="stylesheet">
<link href="{{ url_for('static', filename='font-awesome/css/font-awesome.css') }}" rel="stylesheet">
<link href="{{ url_for('static', filename='css/sb-admin-2.css') }}" rel="stylesheet">
<link href="/static//css/dataTables.bootstrap.css" rel="stylesheet" type="text/css" />
<link href="{{ url_for('static', filename='css/dataTables.bootstrap.css') }}" rel="stylesheet" type="text/css" />
<!-- JS -->
<script type="text/javascript" src="{{ url_for('static', filename='js/dygraph-combined.js') }}"></script>
<script language="javascript" src="{{ url_for('static', filename='js/jquery.js')}}"></script>

View File

@ -205,7 +205,7 @@
var ltagsgalaxies
$(document).ready(function(){
$.getJSON('/Tags/get_all_tags_taxonomies',
$.getJSON("{{ url_for('Tags.get_all_tags_taxonomies') }}",
function(data) {
ltags = $('#ltags').tagSuggest({
@ -215,7 +215,7 @@
});
});
$.getJSON('/Tags/get_all_tags_galaxies',
$.getJSON("{{ url_for('Tags.get_all_tags_galaxy') }}",
function(data) {
ltagsgalaxies = $('#ltagsgalaxies').tagSuggest({
@ -242,7 +242,7 @@ function submitPaste(){
<script>
jQuery("#all-tags-taxonomies").click(function(e){
//change input tags list
$.getJSON('/Tags/get_all_tags_taxonomies',
$.getJSON("{{ url_for('Tags.get_all_tags_taxonomies') }}",
function(data) {
ltags.setData(data)
});
@ -251,7 +251,7 @@ function submitPaste(){
</script>
<script>
jQuery("#all-tags-galaxies").click(function(e){
$.getJSON('/Tags/get_all_tags_galaxies',
$.getJSON("{{ url_for('Tags.get_all_tags_galaxy') }}",
function(data) {
ltagsgalaxies.setData(data)
});
@ -259,7 +259,7 @@ function submitPaste(){
{% for taxo in active_taxonomies %}
jQuery("#{{ taxo }}-id{{ loop.index0 }}").click(function(e){
$.getJSON('/Tags/get_tags_taxonomie?taxonomie={{ taxo }}',
$.getJSON("{{ url_for('Tags.get_tags_taxonomie') }}?taxonomie={{ taxo }}",
function(data) {
ltags.setData(data)
});
@ -269,7 +269,7 @@ function submitPaste(){
<script>
{% for galaxy in active_galaxies %}
jQuery("#{{ galaxy }}-idgalax{{ loop.index0 }}").click(function(e){
$.getJSON('/Tags/get_tags_galaxy?galaxy={{ galaxy }}',
$.getJSON("{{ url_for('Tags.get_tags_galaxy') }}?galaxy={{ galaxy }}",
function(data) {
ltagsgalaxies.setData(data)
});
@ -283,7 +283,7 @@ function submitPaste(){
$(".progress-bar").css("width", i + "%").text(i + " %");
function makeProgress(){
$.getJSON('/PasteSubmit/submit_status?UUID={{ UUID }}',
$.getJSON("{{ url_for('PasteSubmit.submit_status') }}?UUID={{ UUID }}",
function(data) {
var end = data.end;

View File

@ -85,7 +85,7 @@
activePage = "page-Tags"
$("#"+activePage).addClass("active");
$.getJSON('/Tags/get_all_tags',
$.getJSON("{{ url_for('Tags.get_all_tags') }}",
function(data) {
ltags = $('#ltags').tagSuggest({

View File

@ -12,7 +12,7 @@
<link href="{{ url_for('static', filename='css/bootstrap.min.css') }}" rel="stylesheet">
<link href="{{ url_for('static', filename='font-awesome/css/font-awesome.css') }}" rel="stylesheet">
<link href="{{ url_for('static', filename='css/sb-admin-2.css') }}" rel="stylesheet">
<link href="/static//css/dataTables.bootstrap.css" rel="stylesheet" type="text/css" />
<link href="{{ url_for('static', filename='css/dataTables.bootstrap.css') }}" rel="stylesheet" type="text/css" />
<!-- JS -->
<script type="text/javascript" src="{{ url_for('static', filename='js/dygraph-combined.js') }}"></script>
<script language="javascript" src="{{ url_for('static', filename='js/jquery.js')}}"></script>

View File

@ -12,7 +12,7 @@
<link href="{{ url_for('static', filename='css/bootstrap.min.css') }}" rel="stylesheet">
<link href="{{ url_for('static', filename='font-awesome/css/font-awesome.css') }}" rel="stylesheet">
<link href="{{ url_for('static', filename='css/sb-admin-2.css') }}" rel="stylesheet">
<link href="/static//css/dataTables.bootstrap.css" rel="stylesheet" type="text/css" />
<link href="{{ url_for('static', filename='css/dataTables.bootstrap.css') }}" rel="stylesheet" type="text/css" />
<!-- JS -->
<script type="text/javascript" src="{{ url_for('static', filename='js/dygraph-combined.js') }}"></script>
<script language="javascript" src="{{ url_for('static', filename='js/jquery.js')}}"></script>

View File

@ -12,7 +12,7 @@
<link href="{{ url_for('static', filename='css/bootstrap.min.css') }}" rel="stylesheet">
<link href="{{ url_for('static', filename='font-awesome/css/font-awesome.css') }}" rel="stylesheet">
<link href="{{ url_for('static', filename='css/sb-admin-2.css') }}" rel="stylesheet">
<link href="/static//css/dataTables.bootstrap.css" rel="stylesheet" type="text/css" />
<link href="{{ url_for('static', filename='css/dataTables.bootstrap.css') }}" rel="stylesheet" type="text/css" />
<!-- JS -->
<script type="text/javascript" src="{{ url_for('static', filename='js/dygraph-combined.js') }}"></script>
<script language="javascript" src="{{ url_for('static', filename='js/jquery.js')}}"></script>

View File

@ -178,7 +178,7 @@ $(document).ready(function(){
$("#nbr_entry").hide();
$("#loading_gif_browse").hide();
$.getJSON('/Tags/get_all_tags',
$.getJSON("{{ url_for('Tags.get_all_tags') }}",
function(data) {
activePage = "page-Tags"
$("#"+activePage).addClass("active");

View File

@ -12,7 +12,7 @@
<link href="{{ url_for('static', filename='css/bootstrap.min.css') }}" rel="stylesheet">
<link href="{{ url_for('static', filename='font-awesome/css/font-awesome.css') }}" rel="stylesheet">
<link href="{{ url_for('static', filename='css/sb-admin-2.css') }}" rel="stylesheet">
<link href="/static//css/dataTables.bootstrap.css" rel="stylesheet" type="text/css" />
<link href="{{ url_for('static', filename='css/dataTables.bootstrap.css') }}" rel="stylesheet" type="text/css" />
<!-- JS -->
<script type="text/javascript" src="{{ url_for('static', filename='js/dygraph-combined.js') }}"></script>
<script language="javascript" src="{{ url_for('static', filename='js/jquery.js')}}"></script>

View File

@ -244,11 +244,11 @@
});
{% if type %}
chart.stackBarChart =barchart_type_stack('/hashDecoded/hash_by_type_json?type={{type}}', 'id');
chart.stackBarChart =barchart_type_stack("{{ url_for('hashDecoded.hash_by_type_json') }}?type={{type}}", 'id');
{% elif daily_type_chart %}
chart.stackBarChart =barchart_type_stack('/hashDecoded/range_type_json?date_from={{daily_date}}&date_to={{daily_date}}', 'id');
chart.stackBarChart =barchart_type_stack("{{ url_for('hashDecoded.range_type_json') }}?date_from={{daily_date}}&date_to={{daily_date}}", 'id');
{% else %}
chart.stackBarChart = barchart_type_stack("/hashDecoded/range_type_json?date_from={{date_from}}&date_to={{date_to}}", 'id')
chart.stackBarChart = barchart_type_stack("{{ url_for('hashDecoded.range_type_json') }}?date_from={{date_from}}&date_to={{date_to}}", 'id')
{% endif %}
chart.onResize();
@ -260,7 +260,7 @@
<script>
function updateVTReport(hash) {
//updateReport
$.getJSON('/hashDecoded/update_vt_result?hash='+hash,
$.getJSON("{{ url_for('hashDecoded.update_vt_result') }}?hash="+hash,
function(data) {
content = '<span class="glyphicon glyphicon-refresh"></span> ' +data['report_vt']
$( "#report_vt_"+hash ).html(content);
@ -269,7 +269,7 @@
function sendFileToVT(hash) {
//send file to vt
$.getJSON('/hashDecoded/send_file_to_vt_js?hash='+hash,
$.getJSON("{{ url_for('hashDecoded.send_file_to_vt_js') }}?hash="+hash,
function(data) {
var content = '<a id="submit_vt_'+hash+'" class="btn btn-primary" target="_blank" href="'+ data['vt_link'] +'"><i class="fa fa-link"> '+ ' VT Report' +'</i></a>';
$('#submit_vt_'+hash).remove();
@ -528,7 +528,7 @@ var arc_pie = d3.arc()
.innerRadius(0)
.outerRadius(radius_pie);
d3.json("/hashDecoded/decoder_type_json?date_from={{date_from}}&date_to={{date_to}}&type={{type}}")
d3.json("{{ url_for('hashDecoded.decoder_type_json') }}?date_from={{date_from}}&date_to={{date_to}}&type={{type}}")
.then(function(data){
var pie_pie = d3.pie()

View File

@ -245,8 +245,8 @@
$(document).ready(function(){
sparklines("sparkline", {{ sparkline_values }})
all_graph.node_graph = create_graph('/hashDecoded/hash_graph_node_json?hash={{hash}}');
all_graph.line_chart = create_line_chart('graph_line', '/hashDecoded/hash_graph_line_json?hash={{hash}}');
all_graph.node_graph = create_graph("{{ url_for('hashDecoded.hash_graph_node_json') }}?hash={{hash}}");
all_graph.line_chart = create_line_chart('graph_line', "{{ url_for('hashDecoded.hash_graph_line_json') }}?hash={{hash}}");
all_graph.onResize();
});
@ -257,7 +257,7 @@
<script>
function sendFileToVT(hash) {
//send file to vt
$.getJSON('/hashDecoded/send_file_to_vt_js?hash='+hash,
$.getJSON("{{ url_for('hashDecoded.send_file_to_vt_js') }}?hash="+hash,
function(data) {
var content = '<a id="submit_vt_b" class="btn btn-primary" target="_blank" href="'+ data['vt_link'] +'"><i class="fa fa-link"> '+ ' VT Report' +'</i></a>';
$('#submit_vt_b').remove();
@ -267,7 +267,7 @@
function updateVTReport(hash) {
//updateReport
$.getJSON('/hashDecoded/update_vt_result?hash='+hash,
$.getJSON("{{ url_for('hashDecoded.update_vt_result') }}?hash="+hash,
function(data) {
var content = '<span class="glyphicon glyphicon-refresh"></span> ' +data['report_vt'];
$( "#report_vt_b" ).html(content);

View File

@ -433,7 +433,7 @@
var ltagsgalaxies
$(document).ready(function(){
$.getJSON('/Tags/get_all_tags_taxonomies',
$.getJSON("{{ url_for('Tags.get_all_tags_taxonomies') }}",
function(data) {
ltags = $('#ltags').tagSuggest({
@ -443,7 +443,7 @@
});
});
$.getJSON('/Tags/get_all_tags_galaxies',
$.getJSON("{{ url_for('Tags.get_all_tags_galaxy') }}",
function(data) {
ltagsgalaxies = $('#ltagsgalaxies').tagSuggest({
@ -465,7 +465,7 @@
<script>
function updateVTReport(hash) {
//updateReport
$.getJSON('/hashDecoded/update_vt_result?hash='+hash,
$.getJSON("{{ url_for('hashDecoded.update_vt_result') }}?hash="+hash,
function(data) {
content = '<span class="glyphicon glyphicon-refresh"></span> ' +data['report_vt']
$( "#report_vt_"+hash ).html(content);
@ -474,7 +474,7 @@
function sendFileToVT(hash) {
//send file to vt
$.getJSON('/hashDecoded/send_file_to_vt_js?hash='+hash,
$.getJSON("{{ url_for('hashDecoded.send_file_to_vt_js') }}?hash="+hash,
function(data) {
var content = '<a id="submit_vt_'+hash+'" class="btn btn-primary" target="_blank" href="'+ data['vt_link'] +'"><i class="fa fa-link"> '+ ' VT Report' +'</i></a>';
$('#submit_vt_'+hash).remove();
@ -487,7 +487,7 @@
<script>
jQuery("#all-tags-taxonomies").click(function(e){
//change input tags list
$.getJSON('/Tags/get_all_tags_taxonomies',
$.getJSON("{{ url_for('Tags.get_all_tags_taxonomies') }}",
function(data) {
ltags.setData(data)
});
@ -496,7 +496,7 @@
</script>
<script>
jQuery("#all-tags-galaxies").click(function(e){
$.getJSON('/Tags/get_all_tags_galaxies',
$.getJSON("{{ url_for('Tags.get_all_tags_galaxy') }}",
function(data) {
ltagsgalaxies.setData(data)
});
@ -517,7 +517,7 @@
<script>
{% for taxo in active_taxonomies %}
jQuery("#{{ taxo }}-id{{ loop.index0 }}").click(function(e){
$.getJSON('/Tags/get_tags_taxonomie?taxonomie={{ taxo }}',
$.getJSON("{{ url_for('Tags.get_tags_taxonomie') }}?taxonomie={{ taxo }}",
function(data) {
ltags.setData(data)
});
@ -527,7 +527,7 @@
<script>
{% for galaxy in active_galaxies %}
jQuery("#{{ galaxy }}-idgalax{{ loop.index0 }}").click(function(e){
$.getJSON('/Tags/get_tags_galaxy?galaxy={{ galaxy }}',
$.getJSON("{{ url_for('Tags.get_tags_galaxy') }}?galaxy={{ galaxy }}",
function(data) {
ltagsgalaxies.setData(data)
});