You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by gu...@apache.org on 2023/03/08 06:07:15 UTC

[apisix-dashboard] branch master updated: fix: ssl table expiration time display (#2763)

This is an automated email from the ASF dual-hosted git repository.

guoqi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-dashboard.git


The following commit(s) were added to refs/heads/master by this push:
     new 53cfc4cf fix: ssl table expiration time display (#2763)
53cfc4cf is described below

commit 53cfc4cf35fbe5fe462b655f0e2b62f1f56195f8
Author: Baoyuan <ba...@gmail.com>
AuthorDate: Wed Mar 8 14:07:09 2023 +0800

    fix: ssl table expiration time display (#2763)
---
 web/src/helpers.tsx           | 8 ++++----
 web/src/pages/SSL/typing.d.ts | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/web/src/helpers.tsx b/web/src/helpers.tsx
index 0ee10503..bc9f5af3 100644
--- a/web/src/helpers.tsx
+++ b/web/src/helpers.tsx
@@ -18,6 +18,7 @@ import { FileTextOutlined, InfoCircleOutlined } from '@ant-design/icons';
 import type { MenuDataItem } from '@ant-design/pro-layout';
 import { notification } from 'antd';
 import yaml from 'js-yaml';
+import { isNumber } from 'lodash';
 import moment from 'moment';
 import React from 'react';
 import { history } from 'umi';
@@ -128,12 +129,11 @@ export const getUrlQuery: (key: string) => string | false = (key: string) => {
 };
 
 export const timestampToLocaleString = (timestamp: number) => {
-  if (!timestamp) {
-    // TODO: i18n
-    return 'None';
+  if (isNumber(timestamp)) {
+    return moment.unix(timestamp).format('YYYY-MM-DD HH:mm:ss');
   }
 
-  return moment.unix(timestamp).format('YYYY-MM-DD HH:mm:ss');
+  return 'None';
 };
 
 /**
diff --git a/web/src/pages/SSL/typing.d.ts b/web/src/pages/SSL/typing.d.ts
index 985e3051..3c9281cc 100644
--- a/web/src/pages/SSL/typing.d.ts
+++ b/web/src/pages/SSL/typing.d.ts
@@ -52,7 +52,7 @@ declare namespace SSLModule {
     snis: string[];
     status: number;
     update_time: number;
-    validity_start: number;
-    validity_end: number;
+    validity_start?: number;
+    validity_end?: number;
   };
 }