juzhiyuan commented on a change in pull request #1434:
URL: https://github.com/apache/apisix-dashboard/pull/1434#discussion_r570783498



##########
File path: web/src/pages/ServerInfo/List.tsx
##########
@@ -51,58 +53,84 @@ const ServerInfo: React.FC = () => {
         setData(list[0]);
       }
     });
+
+    fetchVersion().then(({ commit_hash, version }) => {
+      setCommitHash(commit_hash);
+      setDashboardVersion(version);
+    })
   }, []);
 
   return (
-    <PageContainer title={formatMessage({ id: 
'page.serverinfo.pageContainer.title' })}>
-      <div className={styles.select}>
-        <Form form={form}>
-          <Form.Item wrapperCol={{ span: 5 }} style={{ marginBottom: 0 }} 
name="nodeId">
-            <Select
-              placeholder={formatMessage({ id: 
'page.serverinfo.select.placeholder' })}
-              onChange={(value) => {
-                setData(
-                  nodeList.find((item) => {
-                    return item.id === value;
-                  }),
-                );
-              }}
-            >
-              {nodeList.map((item) => (
-                <Option key={item.hostname} value={item.id}>
-                  {item.hostname}
-                </Option>
-              ))}
+    <PageContainer title={formatMessage({ id: 
'page.systemStatus.pageContainer.title' })}>
+      <Card title={formatMessage({ id: 'page.systemStatus.dashboardInfo' })} 
bodyStyle={{ padding: 0 }} style={{ marginBottom: 15 }}>
+        <div className={styles.wrap} >
+          {nodeList.length > 0 && (
+            <table className={styles.table}>
+              <tbody>
+                <tr>
+                  <td>commit_hash</td>

Review comment:
       ```suggestion
                     <td>Commit Hash</td>
   ```

##########
File path: web/src/pages/ServerInfo/List.tsx
##########
@@ -51,58 +53,84 @@ const ServerInfo: React.FC = () => {
         setData(list[0]);
       }
     });
+
+    fetchVersion().then(({ commit_hash, version }) => {
+      setCommitHash(commit_hash);
+      setDashboardVersion(version);
+    })
   }, []);
 
   return (
-    <PageContainer title={formatMessage({ id: 
'page.serverinfo.pageContainer.title' })}>
-      <div className={styles.select}>
-        <Form form={form}>
-          <Form.Item wrapperCol={{ span: 5 }} style={{ marginBottom: 0 }} 
name="nodeId">
-            <Select
-              placeholder={formatMessage({ id: 
'page.serverinfo.select.placeholder' })}
-              onChange={(value) => {
-                setData(
-                  nodeList.find((item) => {
-                    return item.id === value;
-                  }),
-                );
-              }}
-            >
-              {nodeList.map((item) => (
-                <Option key={item.hostname} value={item.id}>
-                  {item.hostname}
-                </Option>
-              ))}
+    <PageContainer title={formatMessage({ id: 
'page.systemStatus.pageContainer.title' })}>
+      <Card title={formatMessage({ id: 'page.systemStatus.dashboardInfo' })} 
bodyStyle={{ padding: 0 }} style={{ marginBottom: 15 }}>
+        <div className={styles.wrap} >
+          {nodeList.length > 0 && (
+            <table className={styles.table}>
+              <tbody>
+                <tr>
+                  <td>commit_hash</td>
+                  <td>{commitHash}</td>
+                </tr>
+                <tr>
+                  <td>dashboard_version</td>

Review comment:
       ```suggestion
                     <td>Version</td>
   ```

##########
File path: web/src/pages/ServerInfo/typing.d.ts
##########
@@ -24,4 +24,9 @@ declare namespace ServerInfoModule {
     hostname: string;
     version: string;
   };
+  
+  type DashboardInfo = {

Review comment:
       ```ts
   type T = Record<string, string>
   ```

##########
File path: web/src/pages/ServerInfo/List.tsx
##########
@@ -51,58 +53,84 @@ const ServerInfo: React.FC = () => {
         setData(list[0]);
       }
     });
+
+    fetchVersion().then(({ commit_hash, version }) => {

Review comment:
       We could use a loop

##########
File path: web/src/pages/ServerInfo/locales/en-US.ts
##########
@@ -15,8 +15,10 @@
  * limitations under the License.
  */
 export default {
-  'page.serverinfo.pageContainer.title': 'Server Info',
-  'page.serverinfo.select.placeholder': 'Please select node',
-  'page.serverinfo.desc': 'The relevant plugin need to be enabled to report 
server info.',
-  'page.serverinfo.link': 'How to enable?',
+  'page.systemStatus.pageContainer.title': 'System Status',
+  'page.systemStatus.select.placeholder': 'Please select node',
+  'page.systemStatus.desc': 'The relevant plugin need to be enabled to report 
server info.',

Review comment:
       ```suggestion
     'page.systemStatus.desc': 'The relevant plugin needs to be enabled to 
report server info.',
   ```

##########
File path: web/src/pages/ServerInfo/locales/en-US.ts
##########
@@ -15,8 +15,10 @@
  * limitations under the License.
  */
 export default {
-  'page.serverinfo.pageContainer.title': 'Server Info',
-  'page.serverinfo.select.placeholder': 'Please select node',
-  'page.serverinfo.desc': 'The relevant plugin need to be enabled to report 
server info.',
-  'page.serverinfo.link': 'How to enable?',
+  'page.systemStatus.pageContainer.title': 'System Status',
+  'page.systemStatus.select.placeholder': 'Please select node',

Review comment:
       ```suggestion
     'page.systemStatus.select.placeholder': 'Please select a apache apisix 
node',
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to