From 280bd18b4b6ece253516014d306047c6d692ba76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Ga=C5=82czy=C5=84ski?= Date: Fri, 4 Dec 2015 11:52:47 +0100 Subject: [PATCH] use datatables for list - paging - search - sort --- web/app.js | 76 +++++++++++++++++++++++++++++++++++++------------- web/index.html | 63 ++++++++++++++++++++++++++++++----------- 2 files changed, 103 insertions(+), 36 deletions(-) diff --git a/web/app.js b/web/app.js index 3c7f4d2..c53ffd6 100644 --- a/web/app.js +++ b/web/app.js @@ -2,22 +2,60 @@ /* App Module */ -var app = angular.module('app', [ - 'ngRoute', -]); - - -app.controller('main', function ($scope, $http) { - $http.get('logs/index.json').then(function(response) { - $scope.packages = response.data; - }); - - $scope.show = function(item) { - item[1].show = !item[1].show; - $http.get("logs/" + item[0] + ".txt", { - cache: false - }).then(function(response) { - item[1].log = response.data; - }); - }; -}); +// var app = angular.module('app', [ +// 'ngRoute', +// ]); + + +// app.controller('main', function ($scope, $http) { +// $http.get('logs/index.json').then(function(response) { +// $scope.packages = response.data; +// }); + +// $scope.show = function(item) { +// item[1].show = !item[1].show; +// $http.get("logs/" + item[0] + ".txt", { +// cache: false +// }).then(function(response) { +// item[1].log = response.data; +// }); +// }; +// }); + + +$(document).ready(function() { + var ptable = $('#ptable').DataTable( { + "ajax": { + "url": "logs/index.json", + "dataSrc": "" + }, + + "columnDefs": [ + { + "render": function ( data, type, row ) { + return row[1].count; + }, + "targets": 1 + }, + { + "render": function ( data, type, row ) { + if(!row[1].status){ + return 'Success'; + } + return 'Issue'; + }, + "targets": 2 + }, + ] + } ); + + $('#ptable tbody').on('click', 'tr', function () { + var data = ptable.row( this ).data(); + var fname = data[1].log; + $.get( "logs/" + fname, function( data ) { + $("#log-content").html(data); + $('.modal').modal('show'); + }); + } ); + +} ); diff --git a/web/index.html b/web/index.html index f5f732b..0f0e41c 100644 --- a/web/index.html +++ b/web/index.html @@ -10,11 +10,17 @@ PyPy - packages - - + + + + + + + + @@ -23,33 +29,56 @@
-

PyPy's Python packages compatibility

- - +

PyPy's Python packages compatibility

+ +
- +

PyPy is a fast, compliant alternative implementation of the Python language. Nearly all Python packages install properly on PyPy. This page shows what happens - when you use pip to install the 1000 most-downloaded package from pypi.python.org. + when you use pip to install the 1000 most-downloaded package from pypi.python.org. This list is done automatically, however we can make manual overrides as well as add additional info and install additional packages. Issue a pull request or get in touch using email.

-
-
-

- {{ item[0] }} - downloads: {{ item[1].count }} -

-
{{ item[1].log }}
-
-
+ + + + + + + + + + + + + + + + +
PackageDownloadsStatus
PackageDownloadsStatus
+
+ + +