add token lists to token page

This commit is contained in:
Min RK
2018-04-14 17:49:13 +02:00
parent b629e520a9
commit 034147f604
3 changed files with 147 additions and 2 deletions

View File

@@ -1,13 +1,20 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
require(["jquery", "jhapi"], function ($, JHAPI) {
require(["jquery", "jhapi", "moment"], function ($, JHAPI, moment) {
"use strict";
var base_url = window.jhdata.base_url;
var user = window.jhdata.user;
var api = new JHAPI(base_url);
$(".time-col").map(function (i, el) {
// convert ISO datestamps to nice momentjs ones
el = $(el);
let m = moment(new Date(el.text().trim()));
el.text(m.isValid() ? m.fromNow() : "Never");
});
$("#request-token").click(function () {
api.request_token({
success: function (reply) {