UI update (#80)

* feat: ui

* fix: pwa not reload
This commit is contained in:
Dream Hunter
2024-03-28 16:37:41 +08:00
committed by GitHub
parent 30cd33b46a
commit 6c4ab67564
5 changed files with 96 additions and 77 deletions

View File

@@ -21,7 +21,8 @@
},
"devDependencies": {
"@vitejs/plugin-vue": "^4.6.2",
"vite": "^5.2.2",
"vite-plugin-pwa": "^0.19.6"
"vite": "^5.2.6",
"vite-plugin-pwa": "^0.19.7",
"workbox-window": "^7.0.0"
}
}

132
frontend/pnpm-lock.yaml generated
View File

@@ -36,13 +36,16 @@ dependencies:
devDependencies:
'@vitejs/plugin-vue':
specifier: ^4.6.2
version: 4.6.2(vite@5.2.2)(vue@3.4.21)
version: 4.6.2(vite@5.2.6)(vue@3.4.21)
vite:
specifier: ^5.2.2
version: 5.2.2
specifier: ^5.2.6
version: 5.2.6
vite-plugin-pwa:
specifier: ^0.19.6
version: 0.19.6(vite@5.2.2)(workbox-build@7.0.0)(workbox-window@7.0.0)
specifier: ^0.19.7
version: 0.19.7(vite@5.2.6)(workbox-build@7.0.0)(workbox-window@7.0.0)
workbox-window:
specifier: ^7.0.0
version: 7.0.0
packages:
@@ -1589,104 +1592,112 @@ packages:
rollup: 2.79.1
dev: true
/@rollup/rollup-android-arm-eabi@4.13.0:
resolution: {integrity: sha512-5ZYPOuaAqEH/W3gYsRkxQATBW3Ii1MfaT4EQstTnLKViLi2gLSQmlmtTpGucNP3sXEpOiI5tdGhjdE111ekyEg==}
/@rollup/rollup-android-arm-eabi@4.13.1:
resolution: {integrity: sha512-4C4UERETjXpC4WpBXDbkgNVgHyWfG3B/NKY46e7w5H134UDOFqUJKpsLm0UYmuupW+aJmRgeScrDNfvZ5WV80A==}
cpu: [arm]
os: [android]
requiresBuild: true
dev: true
optional: true
/@rollup/rollup-android-arm64@4.13.0:
resolution: {integrity: sha512-BSbaCmn8ZadK3UAQdlauSvtaJjhlDEjS5hEVVIN3A4bbl3X+otyf/kOJV08bYiRxfejP3DXFzO2jz3G20107+Q==}
/@rollup/rollup-android-arm64@4.13.1:
resolution: {integrity: sha512-TrTaFJ9pXgfXEiJKQ3yQRelpQFqgRzVR9it8DbeRzG0RX7mKUy0bqhCFsgevwXLJepQKTnLl95TnPGf9T9AMOA==}
cpu: [arm64]
os: [android]
requiresBuild: true
dev: true
optional: true
/@rollup/rollup-darwin-arm64@4.13.0:
resolution: {integrity: sha512-Ovf2evVaP6sW5Ut0GHyUSOqA6tVKfrTHddtmxGQc1CTQa1Cw3/KMCDEEICZBbyppcwnhMwcDce9ZRxdWRpVd6g==}
/@rollup/rollup-darwin-arm64@4.13.1:
resolution: {integrity: sha512-fz7jN6ahTI3cKzDO2otQuybts5cyu0feymg0bjvYCBrZQ8tSgE8pc0sSNEuGvifrQJWiwx9F05BowihmLxeQKw==}
cpu: [arm64]
os: [darwin]
requiresBuild: true
dev: true
optional: true
/@rollup/rollup-darwin-x64@4.13.0:
resolution: {integrity: sha512-U+Jcxm89UTK592vZ2J9st9ajRv/hrwHdnvyuJpa5A2ngGSVHypigidkQJP+YiGL6JODiUeMzkqQzbCG3At81Gg==}
/@rollup/rollup-darwin-x64@4.13.1:
resolution: {integrity: sha512-WTvdz7SLMlJpektdrnWRUN9C0N2qNHwNbWpNo0a3Tod3gb9leX+yrYdCeB7VV36OtoyiPAivl7/xZ3G1z5h20g==}
cpu: [x64]
os: [darwin]
requiresBuild: true
dev: true
optional: true
/@rollup/rollup-linux-arm-gnueabihf@4.13.0:
resolution: {integrity: sha512-8wZidaUJUTIR5T4vRS22VkSMOVooG0F4N+JSwQXWSRiC6yfEsFMLTYRFHvby5mFFuExHa/yAp9juSphQQJAijQ==}
/@rollup/rollup-linux-arm-gnueabihf@4.13.1:
resolution: {integrity: sha512-dBHQl+7wZzBYcIF6o4k2XkAfwP2ks1mYW2q/Gzv9n39uDcDiAGDqEyml08OdY0BIct0yLSPkDTqn4i6czpBLLw==}
cpu: [arm]
os: [linux]
requiresBuild: true
dev: true
optional: true
/@rollup/rollup-linux-arm64-gnu@4.13.0:
resolution: {integrity: sha512-Iu0Kno1vrD7zHQDxOmvweqLkAzjxEVqNhUIXBsZ8hu8Oak7/5VTPrxOEZXYC1nmrBVJp0ZcL2E7lSuuOVaE3+w==}
/@rollup/rollup-linux-arm64-gnu@4.13.1:
resolution: {integrity: sha512-bur4JOxvYxfrAmocRJIW0SADs3QdEYK6TQ7dTNz6Z4/lySeu3Z1H/+tl0a4qDYv0bCdBpUYM0sYa/X+9ZqgfSQ==}
cpu: [arm64]
os: [linux]
requiresBuild: true
dev: true
optional: true
/@rollup/rollup-linux-arm64-musl@4.13.0:
resolution: {integrity: sha512-C31QrW47llgVyrRjIwiOwsHFcaIwmkKi3PCroQY5aVq4H0A5v/vVVAtFsI1nfBngtoRpeREvZOkIhmRwUKkAdw==}
/@rollup/rollup-linux-arm64-musl@4.13.1:
resolution: {integrity: sha512-ssp77SjcDIUSoUyj7DU7/5iwM4ZEluY+N8umtCT9nBRs3u045t0KkW02LTyHouHDomnMXaXSZcCSr2bdMK63kA==}
cpu: [arm64]
os: [linux]
requiresBuild: true
dev: true
optional: true
/@rollup/rollup-linux-riscv64-gnu@4.13.0:
resolution: {integrity: sha512-Oq90dtMHvthFOPMl7pt7KmxzX7E71AfyIhh+cPhLY9oko97Zf2C9tt/XJD4RgxhaGeAraAXDtqxvKE1y/j35lA==}
/@rollup/rollup-linux-riscv64-gnu@4.13.1:
resolution: {integrity: sha512-Jv1DkIvwEPAb+v25/Unrnnq9BO3F5cbFPT821n3S5litkz+O5NuXuNhqtPx5KtcwOTtaqkTsO+IVzJOsxd11aQ==}
cpu: [riscv64]
os: [linux]
requiresBuild: true
dev: true
optional: true
/@rollup/rollup-linux-x64-gnu@4.13.0:
resolution: {integrity: sha512-yUD/8wMffnTKuiIsl6xU+4IA8UNhQ/f1sAnQebmE/lyQ8abjsVyDkyRkWop0kdMhKMprpNIhPmYlCxgHrPoXoA==}
/@rollup/rollup-linux-s390x-gnu@4.13.1:
resolution: {integrity: sha512-U564BrhEfaNChdATQaEODtquCC7Ez+8Hxz1h5MAdMYj0AqD0GA9rHCpElajb/sQcaFL6NXmHc5O+7FXpWMa73Q==}
cpu: [s390x]
os: [linux]
requiresBuild: true
dev: true
optional: true
/@rollup/rollup-linux-x64-gnu@4.13.1:
resolution: {integrity: sha512-zGRDulLTeDemR8DFYyFIQ8kMP02xpUsX4IBikc7lwL9PrwR3gWmX2NopqiGlI2ZVWMl15qZeUjumTwpv18N7sQ==}
cpu: [x64]
os: [linux]
requiresBuild: true
dev: true
optional: true
/@rollup/rollup-linux-x64-musl@4.13.0:
resolution: {integrity: sha512-9RyNqoFNdF0vu/qqX63fKotBh43fJQeYC98hCaf89DYQpv+xu0D8QFSOS0biA7cGuqJFOc1bJ+m2rhhsKcw1hw==}
/@rollup/rollup-linux-x64-musl@4.13.1:
resolution: {integrity: sha512-VTk/MveyPdMFkYJJPCkYBw07KcTkGU2hLEyqYMsU4NjiOfzoaDTW9PWGRsNwiOA3qI0k/JQPjkl/4FCK1smskQ==}
cpu: [x64]
os: [linux]
requiresBuild: true
dev: true
optional: true
/@rollup/rollup-win32-arm64-msvc@4.13.0:
resolution: {integrity: sha512-46ue8ymtm/5PUU6pCvjlic0z82qWkxv54GTJZgHrQUuZnVH+tvvSP0LsozIDsCBFO4VjJ13N68wqrKSeScUKdA==}
/@rollup/rollup-win32-arm64-msvc@4.13.1:
resolution: {integrity: sha512-L+hX8Dtibb02r/OYCsp4sQQIi3ldZkFI0EUkMTDwRfFykXBPptoz/tuuGqEd3bThBSLRWPR6wsixDSgOx/U3Zw==}
cpu: [arm64]
os: [win32]
requiresBuild: true
dev: true
optional: true
/@rollup/rollup-win32-ia32-msvc@4.13.0:
resolution: {integrity: sha512-P5/MqLdLSlqxbeuJ3YDeX37srC8mCflSyTrUsgbU1c/U9j6l2g2GiIdYaGD9QjdMQPMSgYm7hgg0551wHyIluw==}
/@rollup/rollup-win32-ia32-msvc@4.13.1:
resolution: {integrity: sha512-+dI2jVPfM5A8zme8riEoNC7UKk0Lzc7jCj/U89cQIrOjrZTCWZl/+IXUeRT2rEZ5j25lnSA9G9H1Ob9azaF/KQ==}
cpu: [ia32]
os: [win32]
requiresBuild: true
dev: true
optional: true
/@rollup/rollup-win32-x64-msvc@4.13.0:
resolution: {integrity: sha512-UKXUQNbO3DOhzLRwHSpa0HnhhCgNODvfoPWv2FCXme8N/ANFfhIPMGuOT+QuKd16+B5yxZ0HdpNlqPvTMS1qfw==}
/@rollup/rollup-win32-x64-msvc@4.13.1:
resolution: {integrity: sha512-YY1Exxo2viZ/O2dMHuwQvimJ0SqvL+OAWQLLY6rvXavgQKjhQUzn7nc1Dd29gjB5Fqi00nrBWctJBOyfVMIVxw==}
cpu: [x64]
os: [win32]
requiresBuild: true
@@ -1748,14 +1759,14 @@ packages:
resolution: {integrity: sha512-chv1CYAl8P32P3Ycwgd5+vw/OFNc2mtkKdb1Rw4T5IJmKy6GVDsoUKV3N2l208HATn7CCQphZtuPDdsm7K2kmA==}
dev: false
/@vitejs/plugin-vue@4.6.2(vite@5.2.2)(vue@3.4.21):
/@vitejs/plugin-vue@4.6.2(vite@5.2.6)(vue@3.4.21):
resolution: {integrity: sha512-kqf7SGFoG+80aZG6Pf+gsZIVvGSCKE98JbiWqcCV9cThtg91Jav0yvYFC9Zb+jKetNGF6ZKeoaxgZfND21fWKw==}
engines: {node: ^14.18.0 || >=16.0.0}
peerDependencies:
vite: ^4.0.0 || ^5.0.0
vue: ^3.2.25
dependencies:
vite: 5.2.2
vite: 5.2.6
vue: 3.4.21
dev: true
@@ -2003,7 +2014,7 @@ packages:
hasBin: true
dependencies:
caniuse-lite: 1.0.30001600
electron-to-chromium: 1.4.715
electron-to-chromium: 1.4.719
node-releases: 2.0.14
update-browserslist-db: 1.0.13(browserslist@4.23.0)
dev: true
@@ -2221,8 +2232,8 @@ packages:
jake: 10.8.7
dev: true
/electron-to-chromium@1.4.715:
resolution: {integrity: sha512-XzWNH4ZSa9BwVUQSDorPWAUQ5WGuYz7zJUNpNif40zFCiCl20t8zgylmreNmn26h5kiyw2lg7RfTmeMBsDklqg==}
/electron-to-chromium@1.4.719:
resolution: {integrity: sha512-FbWy2Q2YgdFzkFUW/W5jBjE9dj+804+98E4Pup78JBPnbdb3pv6IneY2JCPKdeKLh3AOKHQeYf+KwLr7mxGh6Q==}
dev: true
/entities@4.5.0:
@@ -3111,7 +3122,7 @@ packages:
jest-worker: 26.6.2
rollup: 2.79.1
serialize-javascript: 4.0.0
terser: 5.29.2
terser: 5.30.0
dev: true
/rollup@2.79.1:
@@ -3122,26 +3133,27 @@ packages:
fsevents: 2.3.3
dev: true
/rollup@4.13.0:
resolution: {integrity: sha512-3YegKemjoQnYKmsBlOHfMLVPPA5xLkQ8MHLLSw/fBrFaVkEayL51DilPpNNLq1exr98F2B1TzrV0FUlN3gWRPg==}
/rollup@4.13.1:
resolution: {integrity: sha512-hFi+fU132IvJ2ZuihN56dwgpltpmLZHZWsx27rMCTZ2sYwrqlgL5sECGy1eeV2lAihD8EzChBVVhsXci0wD4Tg==}
engines: {node: '>=18.0.0', npm: '>=8.0.0'}
hasBin: true
dependencies:
'@types/estree': 1.0.5
optionalDependencies:
'@rollup/rollup-android-arm-eabi': 4.13.0
'@rollup/rollup-android-arm64': 4.13.0
'@rollup/rollup-darwin-arm64': 4.13.0
'@rollup/rollup-darwin-x64': 4.13.0
'@rollup/rollup-linux-arm-gnueabihf': 4.13.0
'@rollup/rollup-linux-arm64-gnu': 4.13.0
'@rollup/rollup-linux-arm64-musl': 4.13.0
'@rollup/rollup-linux-riscv64-gnu': 4.13.0
'@rollup/rollup-linux-x64-gnu': 4.13.0
'@rollup/rollup-linux-x64-musl': 4.13.0
'@rollup/rollup-win32-arm64-msvc': 4.13.0
'@rollup/rollup-win32-ia32-msvc': 4.13.0
'@rollup/rollup-win32-x64-msvc': 4.13.0
'@rollup/rollup-android-arm-eabi': 4.13.1
'@rollup/rollup-android-arm64': 4.13.1
'@rollup/rollup-darwin-arm64': 4.13.1
'@rollup/rollup-darwin-x64': 4.13.1
'@rollup/rollup-linux-arm-gnueabihf': 4.13.1
'@rollup/rollup-linux-arm64-gnu': 4.13.1
'@rollup/rollup-linux-arm64-musl': 4.13.1
'@rollup/rollup-linux-riscv64-gnu': 4.13.1
'@rollup/rollup-linux-s390x-gnu': 4.13.1
'@rollup/rollup-linux-x64-gnu': 4.13.1
'@rollup/rollup-linux-x64-musl': 4.13.1
'@rollup/rollup-win32-arm64-msvc': 4.13.1
'@rollup/rollup-win32-ia32-msvc': 4.13.1
'@rollup/rollup-win32-x64-msvc': 4.13.1
fsevents: 2.3.3
dev: true
@@ -3346,8 +3358,8 @@ packages:
unique-string: 2.0.0
dev: true
/terser@5.29.2:
resolution: {integrity: sha512-ZiGkhUBIM+7LwkNjXYJq8svgkd+QK3UUr0wJqY4MieaezBSAIPgbSPZyIx0idM6XWK5CMzSWa8MJIzmRcB8Caw==}
/terser@5.30.0:
resolution: {integrity: sha512-Y/SblUl5kEyEFzhMAQdsxVHh+utAxd4IuRNJzKywY/4uzSogh3G219jqbDDxYu4MXO9CzY3tSEqmZvW6AoEDJw==}
engines: {node: '>=10'}
hasBin: true
dependencies:
@@ -3510,8 +3522,8 @@ packages:
vue: 3.4.21
dev: false
/vite-plugin-pwa@0.19.6(vite@5.2.2)(workbox-build@7.0.0)(workbox-window@7.0.0):
resolution: {integrity: sha512-3hoxgrDGRzh1vidcZ/GSKXBDiZqbL8DRHXkJgkbJ2Xp3+/P4nau6118L5XlJJsm/wXPpwc/JpDj6Mf073s69+A==}
/vite-plugin-pwa@0.19.7(vite@5.2.6)(workbox-build@7.0.0)(workbox-window@7.0.0):
resolution: {integrity: sha512-18TECxoGPQE7tVZzKxbf5Icrl5688n1JGMPSgGotTsh89vLDxevY7ICfD3CFVfonZXh8ckuyJXg0NXE5+FAl2A==}
engines: {node: '>=16.0.0'}
peerDependencies:
'@vite-pwa/assets-generator': ^0.2.4
@@ -3525,15 +3537,15 @@ packages:
debug: 4.3.4
fast-glob: 3.3.2
pretty-bytes: 6.1.1
vite: 5.2.2
vite: 5.2.6
workbox-build: 7.0.0
workbox-window: 7.0.0
transitivePeerDependencies:
- supports-color
dev: true
/vite@5.2.2:
resolution: {integrity: sha512-FWZbz0oSdLq5snUI0b6sULbz58iXFXdvkZfZWR/F0ZJuKTSPO7v72QPXt6KqYeMFb0yytNp6kZosxJ96Nr/wDQ==}
/vite@5.2.6:
resolution: {integrity: sha512-FPtnxFlSIKYjZ2eosBQamz4CbyrTizbZ3hnGJlh/wMtCrlp1Hah6AzBLjGI5I2urTfNnpovpHdrL6YRuBOPnCA==}
engines: {node: ^18.0.0 || >=20.0.0}
hasBin: true
peerDependencies:
@@ -3562,7 +3574,7 @@ packages:
dependencies:
esbuild: 0.20.2
postcss: 8.4.38
rollup: 4.13.0
rollup: 4.13.1
optionalDependencies:
fsevents: 2.3.3
dev: true

View File

@@ -2,7 +2,9 @@ import { createApp } from 'vue'
import App from './App.vue'
import { createI18n } from 'vue-i18n'
import router from './router'
import { registerSW } from 'virtual:pwa-register'
registerSW({ immediate: true })
const i18n = createI18n({
legacy: false, // you must set `false`, to use Composition API
locale: 'zh', // set locale

View File

@@ -197,7 +197,7 @@ onMounted(async () => {
</n-button>
</span>
</n-alert>
<n-split v-if="!isMobile" direction="horizontal" :max="0.75" :min="0.25" default-size="0.25">
<n-split class="left" v-if="!isMobile" direction="horizontal" :max="0.75" :min="0.25" default-size="0.25">
<template #1>
<div>
<div style="display: inline-block; margin-top: 10px; margin-bottom: 10px;">
@@ -233,13 +233,13 @@ onMounted(async () => {
</template>
<template #2>
<n-card v-if="curMail" :title="curMail.subject" style="overflow: scroll;">
<n-tag type="info">
ID: {{ curMail.id }}
</n-tag>
<n-tag type="info">
FROM: {{ curMail.source }}
</n-tag>
<n-space>
<n-tag type="info">
ID: {{ curMail.id }}
</n-tag>
<n-tag type="info">
FROM: {{ curMail.source }}
</n-tag>
<n-button v-if="curMail.attachment_id" size="small" tertiary type="info"
@click="getAttachments(curMail.attachment_id)">
{{ t('attachments') }}
@@ -252,7 +252,7 @@ onMounted(async () => {
</n-card>
</template>
</n-split>
<div v-else>
<div class="left" v-else>
<div>
<div style="display: inline-block; margin-top: 10px; margin-bottom: 10px;">
<n-pagination v-model:page="page" v-model:page-size="pageSize" :item-count="count" simple size="small" />
@@ -286,14 +286,14 @@ onMounted(async () => {
</div>
<n-drawer v-model:show="curMail" width="100%" :trap-focus="false" :block-scroll="false" to="#drawer-target">
<n-drawer-content :title="curMail.subject" closable>
<n-tag type="info">
ID: {{ curMail.id }}
</n-tag>
<n-tag type="info">
FROM: {{ curMail.source }}
</n-tag>
<n-card style="overflow: scroll;">
<n-space>
<n-tag type="info">
ID: {{ curMail.id }}
</n-tag>
<n-tag type="info">
FROM: {{ curMail.source }}
</n-tag>
<n-button v-if="curMail.attachment_id" size="small" tertiary type="info"
@click="getAttachments(curMail.attachment_id)">
{{ t('attachments') }}
@@ -378,7 +378,7 @@ onMounted(async () => {
text-align: center;
}
.n-split {
.left {
overflow: scroll;
text-align: left;
}

View File

@@ -16,6 +16,10 @@ export default defineConfig({
devOptions: {
enabled: true
},
workbox: {
disableDevLogs: true,
globPatterns: ['**/*.{js,css,html,ico,png,svg}'],
},
manifest: {
name: 'Temp Email',
short_name: 'Temp Email',