From 7c100f4030ce346add3bcb636505e2e24fa2278f Mon Sep 17 00:00:00 2001
From: bastantoine <bastien.antoine69+github@gmail.com>
Date: Fri, 18 Nov 2022 19:29:46 +0100
Subject: use a table to display the data

---
 src/tools/jwt-parser/jwt-parser.vue | 32 +++++++++++++++++++++++---------
 1 file changed, 23 insertions(+), 9 deletions(-)

(limited to 'src/tools/jwt-parser/jwt-parser.vue')

diff --git a/src/tools/jwt-parser/jwt-parser.vue b/src/tools/jwt-parser/jwt-parser.vue
index 003bd03..9dbfb35 100644
--- a/src/tools/jwt-parser/jwt-parser.vue
+++ b/src/tools/jwt-parser/jwt-parser.vue
@@ -4,14 +4,24 @@
       <n-input v-model:value="raw_jwt" type="textarea" placeholder="Put your token here..." rows="5" />
     </n-form-item>
 
-    <p>Header</p>
-    <ul>
-      <li v-for="(value, key) in decodedJWT.header" :key="key">{{ key }}: {{ value }}</li>
-    </ul>
-    <p>Payload</p>
-    <ul>
-      <li v-for="(value, key) in decodedJWT.payload" :key="key">{{ key }}: {{ value }}</li>
-    </ul>
+    <n-table>
+      <tbody>
+        <td colspan="2" class="table-header"><b>Header</b></td>
+        <tr v-for="(value, key) in decodedJWT.header" :key="key">
+          <td>
+            <i>{{ key }}</i>
+          </td>
+          <td>{{ value }}</td>
+        </tr>
+        <td colspan="2" class="table-header"><b>Payload</b></td>
+        <tr v-for="(value, key) in decodedJWT.payload" :key="key">
+          <td>
+            <i>{{ key }}</i>
+          </td>
+          <td>{{ value }}</td>
+        </tr>
+      </tbody>
+    </n-table>
   </n-card>
 </template>
 
@@ -39,4 +49,8 @@ const validation = useValidation({
 });
 </script>
 
-<style lang="less" scoped></style>
+<style lang="less" scoped>
+.table-header {
+  text-align: center;
+}
+</style>
-- 
cgit v1.2.3

