diff --git a/index.html b/index.html index 7a6b4d9..10d9699 100644 --- a/index.html +++ b/index.html @@ -118,34 +118,13 @@ - + All - - - - - OCK 1 - - - - - - - OCK 2 - - - - - - - OCK 3 - -
diff --git a/js/timelaps.js b/js/timelaps.js index a468279..bdcccc2 100644 --- a/js/timelaps.js +++ b/js/timelaps.js @@ -1,44 +1,67 @@ -var api_url = 'http://127.0.0.1:8000/api/v1/'; +var api_url = 'http://timelaps.local:8000/api/v1/'; function getParams() { } -function getKarts() { - console.log("getKarts"); +function showKarts() { $.ajax({ type: 'GET', crossDomain: true, url: api_url + 'karts/', dataType: 'json', - success : function(data, status){ // code_html contient le HTML renvoyé - - console.log("OK!"); + success: function (data, status) { console.log(data); - console.log(status); + $('#dataTable_kart_list').DataTable({ + data: data, + columns: [ + { + data: "id", + render: function (data, type, row, meta) { + return ' '; + } + }, + { + data: "name" + }, + { + data: "autonomy" + } + ] + }); }, - error : function(data, status){ // code_html contient le HTML renvoyé - - console.log("KO!"); - console.log(data); - console.log(status); + error: function (xhr) { + alert('Request Status: ' + xhr.status + ' Status Text: ' + xhr.statusText + ' ' + xhr.responseText); }, }); -/* - $.get(api_url + 'karts', function (data, status) { - console.log("OK!"); - console.log(data); - console.log(status); - }); - */ +} +function getKartsMenu() { + $.ajax({ + type: 'GET', + crossDomain: true, + url: api_url + 'karts/', + dataType: 'json', + success: function (data, status) { + console.log(data); + $.each(data, function (index, value) { + console.log(index); + console.log(value.name); + $('#link_all').after("" + + " \n" + + " \n" + + " \n" + + "\n" + + " "+value.name+"" + + " "); + }); + }, + error: function (xhr) { + alert('Request Status: ' + xhr.status + ' Status Text: ' + xhr.statusText + ' ' + xhr.responseText); + }, + }); } function getPilotsByKart() { } - -$(document).ready(function () { - console.log("ready!"); - getKarts(); -}); diff --git a/karts.html b/karts.html index 502c97b..510cd21 100644 --- a/karts.html +++ b/karts.html @@ -3,169 +3,106 @@
- - - - - + + + + + -
+
- - - + + + - - + + + + +
diff --git a/params.html b/params.html index 7da873f..5364ced 100644 --- a/params.html +++ b/params.html @@ -3,169 +3,103 @@
- - - - - + + + + + -
+
- - - + + + - - + +
diff --git a/pilots.html b/pilots.html index 8478432..2275d1c 100644 --- a/pilots.html +++ b/pilots.html @@ -3,169 +3,101 @@
- - - - - + + + + + -
+
- - - + + - - + +