mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-15 14:03:02 +00:00
Handle NULL created column of api_tokens table
This commit is contained in:
@@ -12,7 +12,7 @@ require(["jquery", "jhapi", "moment"], function($, JHAPI, moment) {
|
||||
// convert ISO datestamps to nice momentjs ones
|
||||
el = $(el);
|
||||
let m = moment(new Date(el.text().trim()));
|
||||
el.text(m.isValid() ? m.fromNow() : "Never");
|
||||
el.text(m.isValid() ? m.fromNow() : el.text());
|
||||
});
|
||||
|
||||
$("#request-token-form").submit(function() {
|
||||
|
@@ -73,7 +73,11 @@
|
||||
{%- endif -%}
|
||||
</td>
|
||||
<td class="time-col col-sm-3">
|
||||
{%- if token.created -%}
|
||||
{{ token.created.isoformat() + 'Z' }}
|
||||
{%- else -%}
|
||||
N/A
|
||||
{%- endif -%}
|
||||
</td>
|
||||
<td class="col-sm-1 text-center">
|
||||
<button class="revoke-token-btn btn btn-xs btn-danger">revoke</button>
|
||||
@@ -118,7 +122,11 @@
|
||||
{%- endif -%}
|
||||
</td>
|
||||
<td class="time-col col-sm-3">
|
||||
{%- if client['created'] -%}
|
||||
{{ client['created'].isoformat() + 'Z' }}
|
||||
{%- else -%}
|
||||
N/A
|
||||
{%- endif -%}
|
||||
</td>
|
||||
<td class="col-sm-1 text-center">
|
||||
<button class="revoke-token-btn btn btn-xs btn-danger">revoke</a>
|
||||
|
Reference in New Issue
Block a user