feat(wifiView) add disconnection info
This commit is contained in:
parent
5b1304e927
commit
275f3ac859
|
@ -28,9 +28,9 @@ coverage
|
|||
*.sw?
|
||||
|
||||
*.tsbuildinfo
|
||||
package-lock.json
|
||||
components.d.ts
|
||||
auto-imports.d.ts
|
||||
|
||||
# Personal
|
||||
**/_priv_*
|
||||
**/_priv_*
|
||||
Makefile
|
File diff suppressed because it is too large
Load Diff
|
@ -59,7 +59,7 @@ const compileTime = import.meta.env.VITE_APP_LAST_COMMIT;
|
|||
<el-descriptions-item label="github"><a href="https://github.com/kerms">https://github.com/kerms</a>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="邮箱">kerms@niazo.org</el-descriptions-item>
|
||||
<el-descriptions-item label="BiliBili"><a href="https://space.bilibili.com/38669852">UID38669852</a>
|
||||
<el-descriptions-item label="BiliBili"><a href="https://space.bilibili.com/3461571571353885">3461571571353885</a>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="QQ群">642246000</el-descriptions-item>
|
||||
<el-descriptions-item label="备注">欢迎大家来打扰啊~</el-descriptions-item>
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
</h1>
|
||||
<el-divider></el-divider>
|
||||
|
||||
|
||||
<h2 class="mb-4 text-xl font-bold tracking-tight md:text-2xl lg:text-3xl">连接Wi-Fi</h2>
|
||||
<el-form label-width="auto" ref="formRef" :model="ssidValidateForm" class="m-auto">
|
||||
<el-form-item
|
||||
|
@ -45,7 +44,11 @@
|
|||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<div class="mb-2">
|
||||
<el-alert type="info" show-icon>
|
||||
如果不是通过透传器的热点连接,更换Wi-Fi将导致此界面与透传器断开连接。
|
||||
</el-alert>
|
||||
</div>
|
||||
<div class="flex justify-center">
|
||||
<el-button @click="onConnectClick" type="primary">连接</el-button>
|
||||
</div>
|
||||
|
@ -259,7 +262,11 @@ const onClientMsg = (msg: ServerMsg) => {
|
|||
break;
|
||||
case WifiCmd.WIFI_API_JSON_STA_GET_AP_INFO: {
|
||||
const info = msg.data as WifiInfo;
|
||||
Object.assign(wifiStaApInfo, info);
|
||||
if (info.rssi === 0) {
|
||||
Object.assign(wifiStaApInfo, defWifiInfo);
|
||||
} else {
|
||||
Object.assign(wifiStaApInfo, info);
|
||||
}
|
||||
if (connectBtnClicked) {
|
||||
connectBtnClicked = 0;
|
||||
globalNotifyRightSide(wifiStaApInfo.ssid + " 连接成功", "success");
|
||||
|
|
205
vite.config.ts
205
vite.config.ts
|
@ -2,115 +2,118 @@ import { fileURLToPath, URL } from 'node:url'
|
|||
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
|
||||
import AutoImport from 'unplugin-auto-import/vite'
|
||||
import Components from 'unplugin-vue-components/vite'
|
||||
import { defineConfig } from 'vite'
|
||||
import {ConfigEnv, defineConfig, loadEnv} from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
import svgLoader from "vite-svg-loader";
|
||||
import cssInjectedByJsPlugin from "vite-plugin-css-injected-by-js";
|
||||
import { viteSingleFile } from 'vite-plugin-singlefile'
|
||||
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
vue(),
|
||||
AutoImport({
|
||||
resolvers: [ElementPlusResolver()],
|
||||
}),
|
||||
Components({
|
||||
resolvers: [ElementPlusResolver()],
|
||||
}),
|
||||
svgLoader(),
|
||||
cssInjectedByJsPlugin(),
|
||||
viteSingleFile(),
|
||||
],
|
||||
define: {
|
||||
export default ({mode}: ConfigEnv) => {
|
||||
process.env = {...process.env, ...loadEnv(mode, process.cwd())};
|
||||
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': fileURLToPath(new URL('./src', import.meta.url))
|
||||
}
|
||||
},
|
||||
|
||||
cacheDir: "/tmp/zhuang/cache",
|
||||
worker: {
|
||||
rollupOptions: {
|
||||
output: {
|
||||
inlineDynamicImports: true,
|
||||
minifyInternalExports: true,
|
||||
// entryFileNames: (chunkInfo) => {
|
||||
// // console.log(chunkInfo)
|
||||
// if (chunkInfo.name.includes("shared")) {
|
||||
// console.log(chunkInfo.name);
|
||||
// }
|
||||
// return "worker.js";
|
||||
// },
|
||||
entryFileNames: "[name].js",
|
||||
return defineConfig({
|
||||
plugins: [
|
||||
vue(),
|
||||
AutoImport({
|
||||
resolvers: [ElementPlusResolver()],
|
||||
}),
|
||||
Components({
|
||||
resolvers: [ElementPlusResolver()],
|
||||
}),
|
||||
svgLoader(),
|
||||
cssInjectedByJsPlugin(),
|
||||
viteSingleFile(),
|
||||
],
|
||||
define: {},
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': fileURLToPath(new URL('./src', import.meta.url))
|
||||
}
|
||||
}
|
||||
},
|
||||
build: {
|
||||
// target: 'es2015',
|
||||
outDir: '/tmp/zhuang/dap-web-dist/',
|
||||
emptyOutDir: true,
|
||||
cssMinify: 'lightningcss',
|
||||
},
|
||||
|
||||
rollupOptions: {
|
||||
output: {
|
||||
inlineDynamicImports: true,
|
||||
minifyInternalExports: true,
|
||||
assetFileNames: (assetInfo) => {
|
||||
if (!assetInfo || !assetInfo.name) {
|
||||
return 'default-filename.ext';
|
||||
}
|
||||
const info = assetInfo.name.split(".");
|
||||
let extType = info[info.length - 1];
|
||||
if (/png|jpe?g|svg|gif|tiff|bmp|ico/i.test(extType)) {
|
||||
extType = "img";
|
||||
} else if (/woff|woff2/.test(extType)) {
|
||||
extType = "css";
|
||||
} else if (/css/.test(extType)) {
|
||||
extType = "css";
|
||||
return "style.css"
|
||||
}
|
||||
console.log(assetInfo)
|
||||
return `[name]-[hash][extname]`;
|
||||
},
|
||||
// chunkFileNames: "[name]-[hash].js",
|
||||
// chunkFileNames: "[name][hash].js",
|
||||
chunkFileNames(chunkInfo) {
|
||||
// Check if this chunk is your SharedWorker
|
||||
// console.log(chunkInfo)
|
||||
cacheDir: process.env.VITE_CACHE_DIR || undefined,
|
||||
worker: {
|
||||
rollupOptions: {
|
||||
output: {
|
||||
inlineDynamicImports: true,
|
||||
minifyInternalExports: true,
|
||||
// entryFileNames: (chunkInfo) => {
|
||||
// // console.log(chunkInfo)
|
||||
// if (chunkInfo.name.includes("shared")) {
|
||||
// console.log(chunkInfo.name);
|
||||
// }
|
||||
// return "worker.js";
|
||||
// },
|
||||
entryFileNames: "[name].js",
|
||||
}
|
||||
}
|
||||
},
|
||||
build: {
|
||||
// target: 'es2015',
|
||||
outDir: process.env.VITE_OUTPUT_DIR || undefined,
|
||||
emptyOutDir: true,
|
||||
cssMinify: 'lightningcss',
|
||||
|
||||
// For other chunks, use the default naming scheme
|
||||
return 'assets/[name]-[hash].js';
|
||||
},
|
||||
// entryFileNames: "[name]-[hash].js",
|
||||
entryFileNames: (chunkInfo) => {
|
||||
// console.log(chunkInfo)
|
||||
if (chunkInfo.name.includes("shared")) {
|
||||
console.log(chunkInfo.name);
|
||||
}
|
||||
return "script.js";
|
||||
},
|
||||
rollupOptions: {
|
||||
output: {
|
||||
inlineDynamicImports: true,
|
||||
minifyInternalExports: true,
|
||||
assetFileNames: (assetInfo) => {
|
||||
if (!assetInfo || !assetInfo.name) {
|
||||
return 'default-filename.ext';
|
||||
}
|
||||
const info = assetInfo.name.split(".");
|
||||
let extType = info[info.length - 1];
|
||||
if (/png|jpe?g|svg|gif|tiff|bmp|ico/i.test(extType)) {
|
||||
extType = "img";
|
||||
} else if (/woff|woff2/.test(extType)) {
|
||||
extType = "css";
|
||||
} else if (/css/.test(extType)) {
|
||||
extType = "css";
|
||||
return "style.css"
|
||||
}
|
||||
console.log(assetInfo)
|
||||
return `[name]-[hash][extname]`;
|
||||
},
|
||||
// chunkFileNames: "[name]-[hash].js",
|
||||
// chunkFileNames: "[name][hash].js",
|
||||
chunkFileNames(chunkInfo) {
|
||||
// Check if this chunk is your SharedWorker
|
||||
// console.log(chunkInfo)
|
||||
|
||||
sourcemapFileNames: "map-[name].js",
|
||||
// sanitizeFileName: "anit-[name].js",
|
||||
// entryFileNames: (chunkInfo) => {
|
||||
// console.log(chunkInfo)
|
||||
// return `${chunkInfo.name}.js`
|
||||
// },
|
||||
// manualChunks(id) {
|
||||
// /* if (id.match('.*!/src/.*shared[a-zA-Z0-9-_]*[.](ts|js).*')) {
|
||||
// // Prevent bundling node_modules into common chunks
|
||||
// return 'bundle-shared';
|
||||
// }
|
||||
// else */{
|
||||
// // Prevent bundling node_modules into common chunks
|
||||
// return 'script'
|
||||
// }
|
||||
// },
|
||||
manualChunks: undefined,
|
||||
},
|
||||
}
|
||||
},
|
||||
})
|
||||
// For other chunks, use the default naming scheme
|
||||
return 'assets/[name]-[hash].js';
|
||||
},
|
||||
// entryFileNames: "[name]-[hash].js",
|
||||
entryFileNames: (chunkInfo) => {
|
||||
// console.log(chunkInfo)
|
||||
if (chunkInfo.name.includes("shared")) {
|
||||
console.log(chunkInfo.name);
|
||||
}
|
||||
return "script.js";
|
||||
},
|
||||
|
||||
sourcemapFileNames: "map-[name].js",
|
||||
// sanitizeFileName: "anit-[name].js",
|
||||
// entryFileNames: (chunkInfo) => {
|
||||
// console.log(chunkInfo)
|
||||
// return `${chunkInfo.name}.js`
|
||||
// },
|
||||
// manualChunks(id) {
|
||||
// /* if (id.match('.*!/src/.*shared[a-zA-Z0-9-_]*[.](ts|js).*')) {
|
||||
// // Prevent bundling node_modules into common chunks
|
||||
// return 'bundle-shared';
|
||||
// }
|
||||
// else */{
|
||||
// // Prevent bundling node_modules into common chunks
|
||||
// return 'script'
|
||||
// }
|
||||
// },
|
||||
manualChunks: undefined,
|
||||
},
|
||||
}
|
||||
},
|
||||
})
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue