Compare commits

..

38 Commits

Author SHA1 Message Date
27195c0448 完善 速度显示 及 动画支持 2023-07-25 15:53:20 +08:00
fc26de7744 定位记录 demo 2023-07-25 02:12:00 +08:00
c61f6fcc7e hash 添加 crc32 crc64 支持 2023-07-24 11:01:18 +08:00
3bf4b7baa4 调整 2023-07-24 10:46:23 +08:00
9eb5d2bd96 添加 file hash duplicate 支持 2023-07-24 10:40:12 +08:00
ac62099b73 调整 2023-07-24 08:37:37 +08:00
450e4940b2 多线程分片下载 2023-07-24 00:15:00 +08:00
74cccba197 多线程分片下载 2023-07-23 22:45:01 +08:00
0f510c10db 调整 druid 驱动参数 2023-07-23 18:03:51 +08:00
7983aa26f9 定时器修正 2023-07-23 17:27:36 +08:00
a967f2dff2 定时器修正 2023-07-23 15:15:48 +08:00
b8bcf1b3c0 调整 网速统计 避免因长时间处于后台导致 js计时器挂起 计时不准导致统计数据异常 2023-07-23 03:59:05 +08:00
079a556e7a 结构调整 2023-07-23 03:36:43 +08:00
0c1e773247 添加弹窗支持 2023-07-23 01:27:42 +08:00
536c12b280 结构调整 2023-07-20 17:13:06 +08:00
3f8f6d5e81 调整 2023-07-20 15:35:06 +08:00
1250cfb173 调整 2023-07-20 15:06:36 +08:00
5b8fc9b651 结构调整 2023-07-20 10:53:11 +08:00
b2879dbb89 更新 依赖 2023-07-20 10:14:42 +08:00
ccb2791fe7 调整 2023-07-20 09:55:10 +08:00
c1dcf44aca 网络状态图表 初始化状态修正 2023-07-20 09:05:32 +08:00
720e6304ec 网络状态图表 2023-07-20 01:57:14 +08:00
e49486e83d 网络状态图表 2023-07-19 22:48:25 +08:00
dbbc4599cf 网络状态 初始化修正 2023-07-19 18:34:41 +08:00
b4441bcdfb 调整 2023-07-19 17:04:32 +08:00
4b20b67e4d 网络状态 2023-07-19 16:07:35 +08:00
5ab66f0571 调整 2023-07-19 14:30:39 +08:00
d3ebc8cbf5 调整 2023-07-19 08:37:59 +08:00
60b0b5938c 调整 2023-07-18 12:00:28 +08:00
f094ac4d39 调整 2023-07-17 23:32:18 +08:00
2e8f740674 CPU使用率 图表 2023-07-17 16:01:33 +08:00
2576535006 CPU使用率 图表 2023-07-17 15:53:59 +08:00
3000dc13fc 获取进程列表 2023-07-17 10:05:45 +08:00
4fa5e7e34d 调整 2023-07-17 01:01:23 +08:00
fa8ed311c2 内存使用情况
添加 ts 支持
2023-07-16 04:26:30 +08:00
0dd9cf3871 cpu 使用率 2023-07-16 03:07:37 +08:00
d506c03329 调整 2023-07-16 01:41:14 +08:00
3cc53518c1 调整 2023-07-16 01:40:50 +08:00
79 changed files with 3695 additions and 416 deletions

38
app/wails/frontend/components.d.ts vendored Normal file
View File

@ -0,0 +1,38 @@
/* eslint-disable */
/* prettier-ignore */
// @ts-nocheck
// Generated by unplugin-vue-components
// Read more: https://github.com/vuejs/core/pull/3399
export {}
declare module 'vue' {
export interface GlobalComponents {
CPUUsage: typeof import('./src/components/system/cpu/CPUUsage.vue')['default']
CPUUsageChart: typeof import('./src/components/system/cpu/CPUUsageChart.vue')['default']
ElButton: typeof import('element-plus/es')['ElButton']
ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup']
ElCol: typeof import('element-plus/es')['ElCol']
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
ElIcon: typeof import('element-plus/es')['ElIcon']
ElInput: typeof import('element-plus/es')['ElInput']
ElProgress: typeof import('element-plus/es')['ElProgress']
ElRow: typeof import('element-plus/es')['ElRow']
ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
ElStatistic: typeof import('element-plus/es')['ElStatistic']
ElSwitch: typeof import('element-plus/es')['ElSwitch']
ElTableV2: typeof import('element-plus/es')['ElTableV2']
ElTabPane: typeof import('element-plus/es')['ElTabPane']
ElTabs: typeof import('element-plus/es')['ElTabs']
ElTooltip: typeof import('element-plus/es')['ElTooltip']
MemoryUsage: typeof import('./src/components/system/memory/MemoryUsage.vue')['default']
MemoryUsageChart: typeof import('./src/components/system/memory/MemoryUsageChart.vue')['default']
NetworkCounter: typeof import('./src/components/system/network/NetworkCounter.vue')['default']
NetworkSumMaxRate: typeof import('./src/components/system/network/NetworkSumMaxRate.vue')['default']
NetworkSumRateChart: typeof import('./src/components/system/network/NetworkSumRateChart.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
TabScaffold: typeof import('./src/components/scaffold/TabScaffold.vue')['default']
}
}

View File

@ -4,6 +4,14 @@
<meta charset="UTF-8"/>
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
<title>wails</title>
<script type="text/javascript">
window._AMapSecurityConfig = {
// serviceHost:'您的代理服务器域名或地址/_AMapService',
// 例如 serviceHost:'http://1.1.1.1:80/_AMapService',
securityJsCode: "5d02234aa9de86567268e33be3c22aef"
}
</script>
</head>
<body>
<div id="app"></div>

View File

@ -8,18 +8,27 @@
"preview": "vite preview"
},
"devDependencies": {
"@types/node": "^20.4.2",
"@vitejs/plugin-vue": "^4.2.3",
"@vitejs/plugin-vue-jsx": "^3.0.1",
"autoprefixer": "^10.4.14",
"postcss": "^8.4.24",
"sass": "^1.63.6",
"tailwindcss": "^3.3.2",
"unplugin-vue-components": "^0.25.1",
"vite": "^4.0.0"
},
"dependencies": {
"@amap/amap-jsapi-loader": "^1.0.1",
"@element-plus/icons-vue": "^2.1.0",
"@vueuse/core": "^10.2.1",
"axios": "^1.4.0",
"echarts": "^5.4.2",
"element-plus": "^2.3.7",
"eruda": "^3.0.0",
"moment": "^2.29.4",
"pinia": "^2.1.4",
"typescript": "^4.6.4",
"vue": "^3.3.4",
"vue-router": "^4.2.2"
}

View File

@ -1 +1 @@
db3b02ee6f6e7fb468ee29ea3c54b365
56a069904657d2e7c850e467b8924bd9

View File

@ -1,5 +1,5 @@
<template>
<div class="mx-2">
<div class="mx-1">
<el-config-provider v-bind="globalConfig">
<router-view v-slot="{ Component, route }">
<transition name="fade" mode="out-in">

View File

@ -91,7 +91,6 @@ function tabRemove(name){
<template>
<el-tabs v-model="tab" @tab-change="tabChange" @tab-remove="tabRemove" style="height:100%" class="tab-scaffold">
<el-tab-pane
v-for="item in tabs"
:key="item.name"
@ -100,8 +99,8 @@ function tabRemove(name){
:name="item.name">
<router-view v-slot="{ Component, route }">
<transition name="fade" mode="out-in">
<el-scrollbar height="100%" class="scroll-bar">
<div class="h-full">
<el-scrollbar class="scroll-bar">
<div class="h-full mx-1.5">
<component v-if="route.meta.keepAlive != null && route.meta.keepAlive === false" :is="Component" :key="route.path"/>
<keep-alive v-else>
<component :is="Component" :key="route.path"/>
@ -111,7 +110,6 @@ function tabRemove(name){
</transition>
</router-view>
</el-tab-pane>
</el-tabs>
</template>

View File

@ -0,0 +1,47 @@
<script setup>
import {useCpuUsage} from "src/utils/system/cpu";
import {computed} from "vue";
const props = defineProps({
showLabel: {
default: true
}
})
const cpuUsage = useCpuUsage()
const singleUsage = computed(()=>{
return Number((cpuUsage.value[0] || 0).toFixed(2))
})
const colors = [
{ color: '#f56c6c', percentage: 100 },
{ color: '#e6a23c', percentage: 80 },
{ color: '#5cb87a', percentage: 30 },
]
</script>
<template>
<div class="text-center">
<slot name="header"></slot>
</div>
<div class="text-center">
<el-progress type="dashboard" :percentage="singleUsage" :color="colors">
<template #default="{ percentage }">
<p class="percentage-value">{{ percentage }}%</p>
<p class="percentage-text" v-if="props.showLabel">CPU使用率</p>
</template>
</el-progress>
</div>
<div class="text-center">
<slot name="footer"></slot>
</div>
</template>
<style scoped>
.percentage-value {
font-size: 18px;
}
.percentage-text {
font-size: 14px;
}
</style>

View File

@ -0,0 +1,144 @@
<script setup>
import {useCpuUsage} from "src/utils/system/cpu";
import {computed, onActivated, onMounted, reactive, ref, watch} from "vue";
import * as echarts from "echarts";
import moment from "moment";
const props = defineProps({
showLabel: {
type:Boolean,
default: true,
},
label: {
type: String,
default: "CPU使用率",
},
labelPosition :{
type: String,
default: "center",
},
labelStyle: {
type: Object,
default: {
fontSize: 14
}
},
maxStep:{
type: Number,
default: 600
}
})
const cpuUsage = useCpuUsage()
const singleUsage = computed(()=>{
return Number((cpuUsage.value[0] || 0).toFixed(2))
})
const colors = [
{ color: '#f56c6c', percentage: 100 },
{ color: '#e6a23c', percentage: 80 },
{ color: '#5cb87a', percentage: 30 },
]
const chartRef = ref()
const chart = reactive({
title: {
left: props.labelPosition,
text: props.label,
textStyle: props.labelStyle
},
tooltip: {
trigger: 'axis',
formatter: (params)=> {
params = params[0];
return `
<div>${params.value[0]}</div>
<div class="text-center">${params.value[1]}%</div>
`;
},
axisPointer: {
animation: false
}
},
xAxis: {
type: 'category',
splitLine: {
show: false
}
},
yAxis: {
type: 'value',
splitLine: {
show: false
},
min: 0,
max: 100
},
visualMap: {
show: false,
pieces: [
{
gte: 0,
lte: 30,
color: '#5cb87a'
},
{
gt: 30,
lte: 80,
color: '#e6a23c'
},
{
gt: 80,
lte: 100,
color: '#f56c6c'
},
]
},
series: [
{
name: 'CPU使用率',
type: 'line',
showSymbol: false,
data: [],
areaStyle: {
origin: 'start'
}
}
]
})
onMounted(()=>{
const chartInst = echarts.init(chartRef.value)
chartInst.setOption(chart)
chartInst.resize()
onActivated(()=>{
chartInst.resize()
})
watch(singleUsage,(v)=>{
let data = chart.series[0].data
data.push({
name: moment().format("HH:mm:ss"),
value: [moment().format("HH:mm:ss"), v]
})
if(data.length > props.maxStep){
data.splice(0,1)
}
chartInst.setOption(chart)
})
window.addEventListener("resize",()=>{
chartInst.resize()
})
})
</script>
<template>
<div ref="chartRef" class="w-full h-full"></div>
</template>
<style scoped>
.percentage-value {
font-size: 18px;
}
.percentage-text {
font-size: 14px;
}
</style>

View File

@ -0,0 +1,45 @@
<script setup>
import {useMemoryTotalSize, useMemoryUsage, useMemoryUsageSize} from "src/utils/system/memory";
const props = defineProps({
showLabel: {
default: true
}
})
const usage = useMemoryUsage()
const used = useMemoryUsageSize()
const total = useMemoryTotalSize()
const colors = [
{ color: '#f56c6c', percentage: 100 },
{ color: '#e6a23c', percentage: 80 },
{ color: '#5cb87a', percentage: 30 },
]
</script>
<template>
<div class="text-center">
<slot name="header"></slot>
</div>
<div class="text-center">
<el-progress type="dashboard" :percentage="usage" :color="colors">
<template #default="{ percentage }">
<p class="percentage-value">{{ percentage }}%</p>
<div class="percentage-text" v-if="props.showLabel">内存使用率</div>
</template>
</el-progress>
</div>
<div class="text-center">
<slot name="footer" :used="used" :total="total"></slot>
</div>
</template>
<style scoped>
.percentage-value {
font-size: 18px;
}
.percentage-text {
font-size: 14px;
}
</style>

View File

@ -0,0 +1,170 @@
<script setup>
import {
useMemoryTotalSizeWithByte,
useMemoryUsageSizeWithByte
} from "src/utils/system/memory";
import {computed, onActivated, onMounted, reactive, ref, watch} from "vue";
import * as echarts from "echarts";
import moment from "moment";
import {bytesToSizeWithUnit} from "src/utils/file/file";
const props = defineProps({
showLabel: {
type:Boolean,
default: true,
},
label: {
type: String,
default: "内存使用情况",
},
labelPosition :{
type: String,
default: "center",
},
labelStyle: {
type: Object,
default: {
fontSize: 14
}
},
maxStep:{
type: Number,
default: 600
},
showMax: {
type:Boolean,
default: true
}
})
const memoryTotal = useMemoryTotalSizeWithByte()
const memoryUsage = useMemoryUsageSizeWithByte()
const colors = [
{ color: '#f56c6c', percentage: 100 },
{ color: '#e6a23c', percentage: 80 },
{ color: '#5cb87a', percentage: 30 },
]
const chartRef = ref()
const chart = reactive({
title: {
left: props.labelPosition,
text: props.label,
textStyle: props.labelStyle
},
tooltip: {
trigger: 'axis',
formatter: (params)=> {
params = params[0];
return `
<div>${params.value[0]}</div>
<div class="text-center">${bytesToSizeWithUnit(params.value[1])}</div>
`;
},
axisPointer: {
animation: false
}
},
xAxis: {
type: 'category',
splitLine: {
show: false
},
},
yAxis: {
type: 'value',
boundaryGap: [0, '100%'],
splitLine: {
show: false
},
axisLabel: {
align: 'right',
overflow: 'truncate',
ellipsis: '...',
width: 75,
formatter(value,index){
return bytesToSizeWithUnit(value)
}
},
min: 0,
max: props.showMax?memoryTotal:undefined,
},
grid:{
left: 75,
containLabel: false
},
visualMap: getVisualMap(),
series: [
{
name: '内存使用情况',
type: 'line',
showSymbol: false,
data: [],
areaStyle: {
origin: 'start'
}
}
]
})
function getVisualMap(){
return {
show: false,
pieces: [
{
gte: 0,
lte: memoryTotal.value * 0.3,
color: '#5cb87a'
},
{
gt: memoryTotal.value * 0.3,
lte: memoryTotal.value * 0.8,
color: '#e6a23c'
},
{
gt: memoryTotal.value * 0.8,
lte: memoryTotal.value,
color: '#f56c6c'
},
]
}
}
onMounted(()=>{
const chartInst = echarts.init(chartRef.value)
chartInst.setOption(chart)
chartInst.resize()
onActivated(()=>{
chartInst.resize()
})
watch(memoryUsage,(v)=>{
chart.visualMap = getVisualMap()
let data = chart.series[0].data
data.push({
name: moment().format("HH:mm:ss"),
value: [moment().format("HH:mm:ss"), v]
})
if(data.length > props.maxStep){
data.splice(0,1)
}
chartInst.setOption(chart)
})
window.addEventListener("resize",()=>{
chartInst.resize()
})
})
</script>
<template>
<div ref="chartRef" class="w-full h-full"></div>
</template>
<style scoped>
.percentage-value {
font-size: 18px;
}
.percentage-text {
font-size: 14px;
}
</style>

View File

@ -0,0 +1,37 @@
<script setup>
import {useNetworkSumCounter, useNetworkSumRate} from "src/utils/system/network";
import {bytesToSizeWithUnit} from "src/utils/file/file";
const networkSumCounter = useNetworkSumCounter()
const networkSumRate = useNetworkSumRate()
</script>
<template>
<div class="text-center">
<el-statistic title="实时下载速度"
:formatter="bytesToSizeWithUnit"
suffix="/s"
:value="networkSumRate.recv">
</el-statistic>
<el-statistic title="接收"
:formatter="bytesToSizeWithUnit"
:value="networkSumCounter.bytesRecv">
</el-statistic>
<el-statistic title="实时上传速度"
:formatter="bytesToSizeWithUnit"
suffix="/s"
:value="networkSumRate.sent">
</el-statistic>
<el-statistic title="发送"
:formatter="bytesToSizeWithUnit"
:value="networkSumCounter.bytesSent">
</el-statistic>
</div>
</template>
<style scoped>
</style>

View File

@ -0,0 +1,26 @@
<script setup>
import {useNetworkSumMaxRate} from "src/utils/system/network";
import {bytesToSizeWithUnit} from "src/utils/file/file";
const networkSumMaxRate = useNetworkSumMaxRate()
</script>
<template>
<div class="text-center">
<el-statistic title="最高下载速度"
:formatter="bytesToSizeWithUnit"
suffix="/s"
:value="networkSumMaxRate.recv">
</el-statistic>
<el-statistic title="最高上传速度"
:formatter="bytesToSizeWithUnit"
suffix="/s"
:value="networkSumMaxRate.sent">
</el-statistic>
</div>
</template>
<style scoped>
</style>

View File

@ -0,0 +1,164 @@
<script setup>
import {onActivated, onMounted, reactive, ref, watch} from "vue";
import * as echarts from "echarts";
import moment from "moment";
import {bytesToSizeWithUnit} from "src/utils/file/file";
import {useNetworkSumRate} from "src/utils/system/network";
const props = defineProps({
showLabel: {
type:Boolean,
default: true,
},
label: {
type: String,
default: "网络状态",
},
labelPosition :{
type: String,
default: "85",
},
labelStyle: {
type: Object,
default: {
fontSize: 14
}
},
maxStep:{
type: Number,
default: 600
},
showMax: {
type:Boolean,
default: true
}
})
const netWorkSumRate = useNetworkSumRate()
const colors = [
{ color: '#f56c6c', percentage: 100 },
{ color: '#e6a23c', percentage: 80 },
{ color: '#5cb87a', percentage: 30 },
]
const chartRef = ref()
const chart = reactive({
title: {
left: props.labelPosition,
text: props.label,
textStyle: props.labelStyle
},
tooltip: {
trigger: 'axis',
valueFormatter(value){
return `${bytesToSizeWithUnit(value)}/s`
},
axisPointer: {
animation: false
}
},
xAxis: {
type: 'category',
splitLine: {
show: false
},
},
yAxis: {
type: 'value',
boundaryGap: false,
splitLine: {
show: false
},
axisLabel: {
align: 'right',
overflow: 'truncate',
ellipsis: '...',
width: 85,
formatter(value){
return `${bytesToSizeWithUnit(value)}/s`
}
},
min: 0,
},
grid:{
left: 85,
containLabel: false
},
legend: {
left: 'right'
},
series: [
{
name: '上传',
type: 'line',
showSymbol: false,
data: [],
areaStyle: {
origin: 'start'
},
itemStyle:{
color: "#e6a23c"
}
},
{
name: '下载',
type: 'line',
showSymbol: false,
data: [],
areaStyle: {
origin: 'start'
},
itemStyle:{
color: "#5cb87a"
}
}
]
})
onMounted(()=>{
const chartInst = echarts.init(chartRef.value)
chartInst.setOption(chart)
chartInst.resize()
onActivated(()=>{
chartInst.resize()
})
watch(netWorkSumRate,(v)=>{
let upload = chart.series[0].data
upload.push({
name: moment().format("HH:mm:ss"),
value: [moment().format("HH:mm:ss"), v.sent]
})
if(upload.length > props.maxStep){
upload.splice(0,1)
}
let download = chart.series[1].data
download.push({
name: moment().format("HH:mm:ss"),
value: [moment().format("HH:mm:ss"), v.recv]
})
if(download.length > props.maxStep){
download.splice(0,1)
}
chartInst.setOption(chart)
})
window.addEventListener("resize",()=>{
chartInst.resize()
})
})
</script>
<template>
<div ref="chartRef" class="w-full h-full"></div>
</template>
<style scoped>
.percentage-value {
font-size: 18px;
}
.percentage-text {
font-size: 14px;
}
</style>

View File

@ -31,6 +31,14 @@ const routes = [
groups: "/",
}
},
{
path: "/location-record",
component: ()=>import("src/views/tabs/location-record/index.vue"),
meta: {
title: "定位记录",
groups: "/"
}
},
{
path: "/test",
component: ()=>import("src/views/tabs/home/Test.vue"),

View File

@ -0,0 +1,62 @@
import axios, {AxiosInstance, AxiosRequestConfig, AxiosResponse, InternalAxiosRequestConfig} from "axios";
import {ElNotification} from "element-plus";
export function getAxiosInstance(axiosRequestConfig: AxiosRequestConfig): AxiosInstance {
let instance = axios.create(axiosRequestConfig);
// 全局 请求拦截器
instance.interceptors.request.use(async (config: InternalAxiosRequestConfig) => {
let headers = config.headers || {}
return config;
})
// 全局 响应拦截器
instance.interceptors.response.use(successCB, rejectCB);
return instance;
}
// 请求成功回调
export function successCB(response: AxiosResponse | Promise<AxiosResponse>): AxiosResponse | Promise<AxiosResponse> {
function processResponse(response: AxiosResponse) {
if (response.status === 200) { // 响应成功
if (response.data.code === 401) {
ElNotification.warning({
message: "登录状态失效, 请重新登录",
})
console.log(response,response.data.msg)
} else if (response.data.code === 403) {
setTimeout(() => {
console.log(response,response.data.msg)
}, 0)
}
return response;
} else {
return Promise.reject(response);
}
}
if (response instanceof Promise) {
let resp: AxiosResponse
return new Promise((resolve)=>{
response.then((r: AxiosResponse) => {
resp = r;
resolve(processResponse(resp))
});
})
} else {
return processResponse(response);
}
}
// 请求失败回调
export function rejectCB(error: any): any {
let response = error.response
if(response.status === 401){
return response;
} else if(response.status === 403){
setTimeout(() => {
console.log(response.data.msg)
}, 0)
return response;
}
return Promise.reject(error);
}

View File

@ -0,0 +1,92 @@
export interface FileUnitType {
size: number,
unit: string
}
export const FileUnit: Record<string, FileUnitType> = {
B: {
size: 1,
unit: "B",
},
KB: {
size: 2 ** 10,
unit: "KB",
},
MB: {
size: 2 ** (10 * 2),
unit: "MB",
},
GB: {
size: 2 ** (10 * 3),
unit: "GB",
},
TB: {
size: 2 ** (10 * 4),
unit: "TB",
},
PB: {
size: 2 ** (10 * 5),
unit: "PB",
},
EB: {
size: 2 ** (10 * 6),
unit: "EB",
},
ZB: {
size: 2 ** (10 * 7),
unit: "ZB",
},
YB: {
size: 2 ** (10 * 8),
unit: "YB",
},
DB: {
size: 2 ** (10 * 9),
unit: "DB",
},
NB: {
size: 2 ** (10 * 10),
unit: "NB",
},
}
export function convertToFileSizeWithUnit(anySize:string, defaultUnit:FileUnitType = FileUnit.B){
let units = Object.values(FileUnit).map(item=>item.unit)
units = units.concat(Object.values(FileUnit).slice(1).map(item=>item.unit.replace("B","")))
let unitsReg = units.toString().replace(/,/g,"|")
let reg = new RegExp(`^(\\d+\\.?\\d*)(\\s*(${unitsReg})?)?$`,"i")
let matchResult = anySize.match(reg)
if(!matchResult){
return "未知大小"
} else {
if(!matchResult[3]){
return bytesToSizeWithUnit(Number(matchResult[1]))
} else {
return calcSize(Number(matchResult[1]), defaultUnit)
}
}
}
export function bytesToSizeWithUnit(byteSize?:number){
if(byteSize == null || byteSize < 0){
return `0${FileUnit.B.unit}`
}
let targetUnitIndex = Object.values(FileUnit).findIndex(item => item.size > byteSize) || 0
let targetUnit:FileUnitType
if(targetUnitIndex > 0){
targetUnit = Object.values(FileUnit)[targetUnitIndex - 1]
} else {
targetUnit = Object.values(FileUnit)[0]
}
return `${calcSize(byteSize,targetUnit)} ${targetUnit.unit}`
}
export function numberToHz(number:number){
return bytesToSizeWithUnit(number).replace(FileUnit.B.unit,"")
}
export function calcSize(byteSize:number,targetUnit:FileUnitType){
return Number((byteSize / targetUnit.size).toFixed(2))
}

View File

@ -0,0 +1,38 @@
import {GetCpuInfo, GetCpuUsage, GetNetworkCounter, GetVirtualMemory} from "frontend/wailsjs/go/system/InfoUtils";
import {computed, reactive, ref, watch} from "vue";
import {asyncComputed} from "@vueuse/core";
import {bytesToSizeWithUnit} from "src/utils/file/file";
import {cpu as CPU} from "frontend/wailsjs/go/models";
import InfoStat = CPU.InfoStat;
let cpu = reactive({
info: <InfoStat>{
modelName: ""
},
usage: {
data: <number[]>[],
interval: <NodeJS.Timeout | undefined>undefined
},
})
export function useCpuUsage(){
clearInterval(cpu.usage.interval)
function loop(){
GetCpuUsage().then(result=>cpu.usage.data = result)
cpu.usage.interval = setTimeout(()=>{
loop()
},1000)
}
loop()
return computed(()=>cpu.usage.data)
}
export function useCpuInfo(){
GetCpuInfo().then(result=>{
Object.assign(cpu.info,result[0] || {})
})
return cpu.info
}

View File

@ -0,0 +1,64 @@
import {reactive, computed} from "vue";
import {GetVirtualMemory} from "frontend/wailsjs/go/system/InfoUtils";
import {bytesToSizeWithUnit} from "src/utils/file/file";
import {mem} from "frontend/wailsjs/go/models";
import VirtualMemoryStat = mem.VirtualMemoryStat;
const memory = reactive({
data: <VirtualMemoryStat>{},
interval: <NodeJS.Timeout | undefined>undefined,
})
function loopMemory(){
clearInterval(memory.interval)
function loop(){
GetVirtualMemory().then(result=> {
memory.data = result
})
memory.interval = setTimeout(()=>{
loop()
},1000)
}
loop()
}
export function useMemoryUsage(){
if(memory.interval == null){
loopMemory()
}
return computed(()=> Number((memory.data.usedPercent || 0).toFixed(2)))
}
export function useMemoryUsageSizeWithByte(){
if(memory.interval == null){
loopMemory()
}
return computed(()=> memory.data.used || 0)
}
export function useMemoryUsageSize(){
if(memory.interval == null){
loopMemory()
}
return computed(()=> bytesToSizeWithUnit(memory.data.used || 0))
}
export function useMemoryTotalSize(){
if(memory.interval == null){
loopMemory()
}
return computed(()=> bytesToSizeWithUnit(memory.data.total || 0))
}
export function useMemoryTotalSizeWithByte(){
if(memory.interval == null){
loopMemory()
}
return computed(()=> memory.data.total || 0)
}

View File

@ -0,0 +1,92 @@
import {reactive} from "vue";
import {net} from "frontend/wailsjs/go/models";
import IOCountersStat = net.IOCountersStat;
import {GetNetworkCounter} from "frontend/wailsjs/go/system/InfoUtils";
import moment from "moment";
const network = reactive({
counter: {
data: <IOCountersStat[]>[],
interval: <any>undefined
},
sumCounter: {
rate: {
recv: -1,
sent: -1,
max: {
recv: 0,
sent: 0
}
},
data: <IOCountersStat>{
bytesRecv: -1,
bytesSent: -1
},
lastTime: moment(0),
interval: <NodeJS.Timeout|undefined>undefined,
}
})
function loopNetworkSumCounter(){
clearInterval(network.sumCounter.interval)
let delay = 1000
function loop(){
let fixed = 0
GetNetworkCounter(true).then(result=> {
let now = moment()
let recv = result[0].bytesRecv || 0
let sent = result[0].bytesSent || 0
network.sumCounter.data.bytesRecv = network.sumCounter.data.bytesRecv == -1?recv:network.sumCounter.data.bytesRecv
network.sumCounter.data.bytesSent = network.sumCounter.data.bytesSent == -1?sent:network.sumCounter.data.bytesSent
// 避免因 webView 进入休眠/计时器误差 导致数据异常
if(now.diff(network.sumCounter.lastTime,'s') <= 1){
// 实时网速
network.sumCounter.rate.recv = recv - network.sumCounter.data.bytesRecv
network.sumCounter.rate.sent = sent - network.sumCounter.data.bytesSent
// 最高网速
network.sumCounter.rate.max.recv = Math.max(network.sumCounter.rate.max.recv, network.sumCounter.rate.recv)
network.sumCounter.rate.max.sent = Math.max(network.sumCounter.rate.max.sent, network.sumCounter.rate.sent)
}
network.sumCounter.data = result[0]
// 修正计时器延迟
fixed = Math.max(delay - now.diff(network.sumCounter.lastTime,'ms'), 0)
network.sumCounter.lastTime = now
})
// 每秒调用一次
network.sumCounter.interval = setTimeout(()=>{
loop()
},delay - fixed)
}
loop()
}
export function useNetworkSumCounter(){
if(network.sumCounter.interval == null){
loopNetworkSumCounter()
}
return network.sumCounter.data
}
export function useNetworkSumRate(){
if(network.sumCounter.interval == null){
loopNetworkSumCounter()
}
return network.sumCounter.rate
}
export function useNetworkSumMaxRate(){
if(network.sumCounter.interval == null){
loopNetworkSumCounter()
}
return network.sumCounter.rate.max
}

View File

@ -40,7 +40,7 @@ GetAllEnv().then((data)=>{
</script>
<template>
<div style="height: 100%">
<el-auto-resizer>
<template #default="{ height, width}">
<el-table-v2 mb-1 :height="height" :width="width" :data="table.data" :columns="table.columns" ref="tableRef">
@ -62,7 +62,7 @@ GetAllEnv().then((data)=>{
</el-table-v2>
</template>
</el-auto-resizer>
</div>
</template>
<style scoped>

View File

@ -40,7 +40,14 @@ import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import en from 'element-plus/dist/locale/en.mjs'
import {useGlobalTabs} from "src/store/globalTabs";
import {useRouter} from "vue-router";
import {ElAutoResizer} from "element-plus";
import CPUUsage from "src/components/system/cpu/CPUUsage.vue";
import MemoryUsage from "src/components/system/memory/MemoryUsage.vue";
import CPUUsageChart from "src/components/system/cpu/CPUUsageChart.vue";
import MemoryUsageChart from "src/components/system/memory/MemoryUsageChart.vue";
import NetworkCounter from "src/components/system/network/NetworkCounter.vue";
import NetworkSumRateChart from "src/components/system/network/NetworkSumRateChart.vue"
import NetworkSumMaxRate from "src/components/system/network/NetworkSumMaxRate.vue";
import {useCpuInfo} from "src/utils/system/cpu";
function switchLocale(){
console.log(globalConfigState.ui.value.locale)
if(globalConfigState.ui.value.locale.name === 'zh-cn'){
@ -91,19 +98,48 @@ const generateData = (
)
})
const table = reactive({
columns: generateColumns(10),
data: generateData(generateColumns(10),20)
})
const cpuInfo = useCpuInfo()
</script>
<template>
<div class="result w-full text-center" id="result">Please enter your name below 👇</div>
<div class="input-box w-full text-center" id="input">
<el-input v-model="controller.input" type="text" autocomplete="off"></el-input>
<el-button class="btn" @click="sendNotify()">通知</el-button>
</div>
<el-row>
<el-col :md="4" :sm="12">
<CPUUsage>
<template #footer>
<div class="text-sm">{{cpuInfo.modelName}}</div>
</template>
</CPUUsage>
</el-col>
<el-col :md="4" :sm="12">
<MemoryUsage>
<template #footer="{used, total}">
<div class="text-sm">{{ used }}/{{ total }}</div>
</template>
</MemoryUsage>
</el-col>
<el-col :sm="12" :md="4">
<NetworkCounter></NetworkCounter>
</el-col>
<el-col :sm="12" :md="4">
<NetworkSumMaxRate></NetworkSumMaxRate>
</el-col>
</el-row>
<el-row>
<el-col :xs="24" :sm="12" :md="8">
<CPUUsageChart style="height: 300px"/>
</el-col>
<el-col :xs="24" :sm="12" :md="8">
<MemoryUsageChart style="height: 300px"/>
</el-col>
<el-col :xs="24" :sm="12" :md="8">
<NetworkSumRateChart style="height: 300px"/>
</el-col>
</el-row>
<el-button class="btn" @click="sendNotify()">通知</el-button>
<el-button @click="getAllEnv()">获取所有环境变量</el-button>
<div>
@ -112,18 +148,10 @@ const table = reactive({
</div>
<el-button @click="switchLocale()">切换 locale</el-button>
<div style="height: 50vh">
<el-auto-resizer>
<template #default="{ height, width}">
<el-table-v2 mb-1 :height="height" :width="width" :data="table.data" :columns="table.columns" fixed/>
</template>
</el-auto-resizer>
</div>
<el-pagination :total="100" />
<el-button @click="addTab()">添加tab</el-button>
<el-button @click="router.push('/environment')">环境变量</el-button>
<el-button @click="router.push('/location-record')">定位记录</el-button>
</template>
<style scoped>

View File

@ -0,0 +1,32 @@
import {getAxiosInstance} from "src/utils/axios";
export const http = getAxiosInstance({
timeout: 30 * 1000
})
export default http;
export interface locationRecordListDTO {
startTime?:string,
endTime?:string
}
export const locationRecord = {
list: (dto:locationRecordListDTO, server: string)=>{
return http.post(`${server}/location/record/list`, dto,{
headers: {
token: localStorage.getItem("token")
}
})
}
}
export interface LoginDTO {
account: string,
password: string
}
export const auth = {
login: (dto:LoginDTO, server: string)=>{
return http.post(`${server}/auth/login`, dto)
}
}

View File

@ -0,0 +1,506 @@
<template>
<div class=" w-full h-full">
<div class="flex justify-start flex-wrap items-center">
<div class="flex" v-if="!view.loginStatus">
<el-input v-model="authModel.account" class="mx-1" label="账号" dense clearable clear-icon="close" filled />
<el-input v-model="authModel.password" class="mx-1" label="密码" type="password" dense clearable clear-icon="close" filled />
<el-button @click="login">登录</el-button>
</div>
<div class="flex" v-else>
<el-button @click="logout">切换账号</el-button>
</div>
<div class="flex items-center">
<el-date-picker
v-model="date"
type="datetimerange"
/>
<el-button @click="search">查询</el-button>
</div>
</div>
<div class="flex justify-end flex-wrap items-center p-1">
显示所有路径点
<el-switch
v-model="options.showMarker"
color="primary"
@update:model-value="toggleShowMarker"
keep-color
/>
仅使用高精度定位
<el-switch
v-model="options.useHighAccuracyLocation"
color="primary"
@update:model-value="toggleUseHighAccuracyLocation"
keep-color
/>
自动缩放
<el-switch
v-model="options.autoScaling"
color="primary"
@update:model-value="toggleAutoView"
keep-color
/>
卫星地图
<el-switch
v-model="layers.satellite.show"
color="primary"
@update:model-value="toggleSatellite"
keep-color
/>
路网
<el-switch
v-model="layers.roadNet.show"
color="primary"
@update:model-value="toggleRoadNet"
keep-color
/>
实时交通
<el-switch
v-model="layers.traffic.show"
color="primary"
@update:model-value="toggleTraffic"
keep-color
/>
纠偏路线
<el-switch
v-model="feature.showFixed"
color="primary"
@update:model-value="fixedLocation"
keep-color
/>
</div>
<div ref="containerRef" id="map-container" style="height: 80vh">
<div class="absolute bg-amber-50 rounded-br z-50 text-center" style="width: 300px" v-if="view.filterData.length > 0">
<div class="flex">
<div class="w-1/4">最高速度</div>
<div>{{view.speed.max}} km/h</div>
</div>
<div class="flex">
<div class="w-1/4">平均速度</div>
<div>{{view.speed.avg}} km/h</div>
</div>
</div>
<div class="absolute bottom-0 right-0 bg-amber-50 rounded-tl z-50 text-left pl-1.5" style="width: 350px" v-if="view.lines.length > 0">
<div class="flex justify-between">
<div>
路径数量: {{view.lines.length}}
</div>
<div>
<el-button dense @click="changeAnimateRate">动画速率: {{view.animateRate}}</el-button>
</div>
</div>
<el-scrollbar :style="{height: view.lines.length * 25 > 350 ?'350px':view.lines.length * 25 + 'px'}" class="overflow-auto">
<el-checkbox-group style="height: 25px" v-model="options.showLines" @update:model-value="changeShowLines" :options="options.lines" type="checkbox" dense>
<el-row v-for="opt in options.lines">
<el-col style="height: 25px">
<div>
<el-checkbox :label="opt.value">
<span style="height: 25px">{{ opt.label }}</span>
<el-icon v-if="view.animating === opt.value"
@click.prevent="stop"
color="red"
size="1rem">
<SwitchButton />
</el-icon>
<el-icon v-else @click.prevent="play(opt)" color="teal" size="1rem" class="q-ml-sm">
<VideoPlay/>
</el-icon>
</el-checkbox>
</div>
</el-col>
</el-row>
</el-checkbox-group>
</el-scrollbar>
</div>
</div>
</div>
</template>
<script setup>
import {VideoPlay,SwitchButton} from "@element-plus/icons-vue"
import AMapLoader from '@amap/amap-jsapi-loader';
import {onActivated, onMounted, onUnmounted, reactive, ref} from "vue";
import moment from "moment";
import {locationRecord} from "src/views/tabs/location-record/api";
import {getAvgSpeed, getMaxSpeed} from "src/views/tabs/location-record/logic/speed";
import {
checkLoginStatus,
loginRequest,
logoutHandler
} from "src/views/tabs/location-record/logic/login";
import {fixedLocationHandler} from "src/views/tabs/location-record/logic/location";
import {drawMarkers} from "src/views/tabs/location-record/logic/markers";
import {drawLines} from "src/views/tabs/location-record/logic/lines";
import {pauseAnimation, playAnimation, stopAnimation} from "src/views/tabs/location-record/logic/play";
import {ElMessage} from "element-plus";
function login(){
loginRequest(authModel, options.server).finally(()=>{
view.loginStatus = checkLoginStatus()
})
}
function logout(){
logoutHandler()
view.loginStatus = checkLoginStatus()
}
const date = ref([
moment().startOf('d').toDate(),
moment().toDate()
])
const feature = reactive({
showFixed: false
})
function changeAnimateRate(){
const animateRate = [1,2,5,10,20,30,60,120]
let curIndex = animateRate.findIndex(item=>item === view.animateRate)
let nextIndex = curIndex + 1
view.animateRate = nextIndex >= animateRate.length ? animateRate[0] : animateRate[nextIndex]
if(view.animating !== -1){
let index = view.animating
pauseAnimation(data)
setTimeout(()=>{
play(options.lines[index])
},100)
}
}
function stop(){
stopAnimation(map,data,view)
}
function play(item){
if(view.animating !== item.value){
stop()
}
console.log(item,view.lines,data.polylines)
options.showLines = [item.value]
changeShowLines()
view.animating = item.value
playAnimation(map,data,view.lines[item.value],view.animateRate,view,item.value)
}
// vue
let map = {}
const data = {
data: [],
polylines: [],
fixedPolyline: {},
labelsLayer: null,
markers: [],
tmpMarker: null,
infoWindow: null,
animateMarker: null,
}
const view = reactive({
filterData: [],
speed: {
max: 0,
avg: 0
},
lines: [],
loginStatus: false,
animateRate: 1,
animating: -1
})
onMounted(()=>{
view.loginStatus = checkLoginStatus()
})
onUnmounted(()=>{
clearMap()
map.remove(data.labelsLayer || {})
map.remove(data.tmpMarker || {})
map.remove(data.animateMarker || {})
map.remove(data.infoWindow || {})
})
const layers = reactive({
satellite: {
inst: {},
show: true,
},
roadNet: {
inst: {},
show: false,
},
traffic: {
inst: {},
show: false,
}
})
const options = reactive({
server: "http://10.10.10.200:45680",
useHighAccuracyLocation: true,
showMarker: false,
autoScaling: true,
lines: [],
showLines: [],
})
const authModel = reactive({
account: "",
password: "",
})
function toggleAutoView(v){
if(v){
map.setFitView()
}
}
function toggleShowMarker(v){
if(v){
options.autoScaling = false
}
redrawMap()
}
function redrawMap(){
clearMap()
drawMap()
}
function toggleUseHighAccuracyLocation(){
redrawMap()
}
function toggleSatellite(){
if (layers.satellite.show) {
layers.satellite.inst.show()
} else {
layers.satellite.inst.hide()
}
}
function toggleRoadNet() {
if (layers.roadNet.show) {
layers.roadNet.inst.show()
} else {
layers.roadNet.inst.hide()
}
}
function toggleTraffic() {
if (layers.traffic.show) {
layers.traffic.inst.show()
} else {
layers.traffic.inst.hide()
}
}
function changeShowLines(){
console.log("options.showLines",options.showLines)
console.log("view.lines",view.lines)
let showLines = view.lines.filter((_,index)=>options.showLines.includes(index))
drawMarkers(map,data,options,showLines)
drawLines(map,data,showLines)
view.speed.max = (getMaxSpeed(showLines.flat()) * 3.6).toFixed(2);
view.speed.avg = (getAvgSpeed(showLines.flat()) * 3.6).toFixed(2);
}
const containerRef = ref()
// onActivated(()=>{
onMounted(()=>{
console.log("初始化")
AMapLoader.load({
"key": "e01d7df3a4c3a1b8f06fa4544ddbbe9c", // WebKey load
"version": "2.0", // JSAPI 1.4.15
"plugins": [
"AMap.Scale",
"AMap.HawkEye",
"AMap.ToolBar",
"AMap.ControlBar",
"AMap.MoveAnimation"
],// 使'AMap.Scale'
"lang": "zh_cn"
}).then((AMap) => {
let scale = new AMap.Scale({
visible: true
})
let toolBar = new AMap.ToolBar({
visible: true,
position: {
top: '110px',
right: '40px'
}
})
let controlBar = new AMap.ControlBar({
visible: true,
position: {
top: '10px',
right: '10px'
}
})
map = new AMap.Map(containerRef.value,{
resizeEnable: true,
viewMode:'3D', //
center: [116.397428, 39.90923],
zoom: 14,
});
console.log("地图对象", map)
map.on("moveend",()=>{
let bounds = map.getBounds()
data.markers.forEach(marker=>{
if(bounds.contains(marker.getPosition())) {
marker.show()
} else {
marker.hide()
}
})
})
map.addControl(scale)
map.addControl(toolBar)
map.addControl(controlBar)
//
layers.satellite.inst = new AMap.TileLayer.Satellite({
visible: layers.satellite.show,
})
//
layers.roadNet.inst = new AMap.TileLayer.RoadNet({
visible: layers.roadNet.show,
index: 10
})
//
layers.traffic.inst = new AMap.TileLayer.Traffic({
zIndex: 11,
visible: layers.traffic.show,
});
map.addLayer(layers.satellite.inst)
map.addLayer(layers.roadNet.inst)
map.addLayer(layers.traffic.inst)
}).catch(e => {
ElMessage.error({
message: "地图组件初始化失败",
})
console.log(e);
})
// })
})
function clearMap(){
view.lines = []
map.remove(data.polylines)
map.remove(data.markers)
}
function drawMap(autoSelect=false){
if(options.useHighAccuracyLocation){
console.log("[仅使用高精度定位数据]")
data.data = data.data.filter(item=>item.locationType === 1)
}
data.data = data.data.map(item=>{
return {
time: moment(item.locationTime),
...item,
}
})
data.data.sort((a,b)=>{
return a.time.isBefore(b.time)?-1:1
})
view.filterData = data.data;
view.speed.max = (getMaxSpeed(view.filterData) * 3.6).toFixed(2);
view.speed.avg = (getAvgSpeed(view.filterData) * 3.6).toFixed(2);
console.log("data", data.data)
view.lines = []
let prev = moment(0)
for (let i = 0; i < data.data.length; i++) {
let datum = data.data[i]
if (prev.year() === datum.time.year() && prev.month() === datum.time.month() && prev.date() === datum.time.date() && datum.time.diff(prev,'m') <= 5 ) {
prev = datum.time
} else {
prev = datum.time
view.lines.push([])
}
view.lines[view.lines.length -1].push(datum)
}
view.lines = view.lines.reverse()
options.lines = view.lines.map((item,index)=>{
if(autoSelect){
//
options.showLines.push(index)
}
return {
label: `${item[0].locationTime} ~ ${item[item.length-1].locationTime}`,
value: index,
}
})
console.log("lines", view.lines)
drawMarkers(map,data,options,view.lines.filter((_,index)=>options.showLines.includes(index)))
drawLines(map,data,view.lines.filter((_,index)=>options.showLines.includes(index)))
setTimeout(()=>{
if(!options.autoScaling){
return
}
if (data.polylines.length > 0) {
map.setFitView()
}
})
fixedLocation()
}
function search() {
console.log(date.value)
view.animating = -1
let params = {
startTime: !date.value[0] ? undefined : moment(date.value[0]).format("YYYY-MM-DD HH:mm:ss"),
endTime: !date.value[1] ? undefined : moment(date.value[1]).format("YYYY-MM-DD HH:mm:ss"),
}
clearMap();
locationRecord.list(params, options.server).then(resp => {
if(resp.status !== 200){
console.log(resp)
let res = resp.data || {}
ElMessage.error({
message: res.data || res.msg || "请求失败",
})
throw new Error("请求失败")
}
return resp.data;
}).then(res => {
data.data = res.data || []
options.showLines = []
drawMap(true)
})
}
function fixedLocation() {
map.remove(data.fixedPolyline)
if (!feature.showFixed) {
return
}
fixedLocationHandler(map,data)
}
</script>
<style scoped lang="scss">
#container {
width: 100%;
height: 80vh;
}
</style>

View File

@ -0,0 +1,10 @@
export const COLOR = [
'#6090e0', '#30c030', '#d070d0', '#80c0f0', '#f07050', '#ffb900',
'#37a2da', '#ffdb5c', '#8378ea', '#e7bcf3', '#32c5e9', '#67e0e3',
'#dd6b66', '#759aa0', '#e69d87', '#8dc1a9', '#ea7e53', '#eedd78',
]
export function randomColorList(len:number){
return Array.from({ length: len })
.map(() => COLOR[Math.floor(Math.random() * COLOR.length)]);
}

View File

@ -0,0 +1,18 @@
export function createCanvasDir(){
let canvasDir = document.createElement('canvas')
let width = 24;
let height = 24;
canvasDir.width = width;
canvasDir.height = height;
let context = canvasDir.getContext('2d')!;
context.strokeStyle = 'white';
context.lineJoin = 'round';
context.lineWidth = 8;
context.moveTo(-4, width - 4);
context.lineTo(width / 2, 6);
context.lineTo(width + 4, width - 4);
context.stroke();
return canvasDir;
}

View File

@ -0,0 +1,72 @@
import {randomColorList} from "src/views/tabs/location-record/logic/color";
import {createCanvasDir} from "src/views/tabs/location-record/logic/icon";
import {getAvgSpeed, getMaxSpeed} from "src/views/tabs/location-record/logic/speed";
const canvasDir = createCanvasDir();
const SLOW = "#ff0036"
const NORMAL = "#ff8119"
const FAST = "#AF5"
export function drawLines(map,data,lines){
map.remove(data.polylines)
data.polylines = []
let colorList = randomColorList(lines.length)
lines.forEach((_data,index) => {
let max = getMaxSpeed(_data)
let avg = getAvgSpeed(_data)
let p:any = []
for (let i = 0; i < _data.length; i++) {
let item = _data[i]
let speed = item.speed || 0
let type
if(speed < avg / 2){
type= SLOW
} else if(speed >= avg/2 && speed < avg){
type = NORMAL
} else {
type = FAST
}
if(p.length === 0){
p.push({
path: [new AMap.LngLat(item.longitude, item.latitude)],
strokeColor: type,
})
} else {
if(p[p.length - 1].strokeColor === type){
p[p.length - 1].path.push(new AMap.LngLat(item.longitude, item.latitude))
} else {
let prevPath = p[p.length - 1].path
let prev = prevPath[prevPath.length - 1]
p.push({
path: [prev, new AMap.LngLat(item.longitude, item.latitude)],
strokeColor: type,
})
}
}
}
console.log("p",p)
let polylineArr:any[] = []
p.forEach((item)=>{
let polyline = new AMap.Polyline({
path: item.path,
showDir: true,
dirImg: canvasDir,
borderWeight: 6, // 线条宽度,默认为 1
strokeWeight: 6,
strokeOpacity: 0.9, // 透明度
strokeColor: item.strokeColor, // 线条颜色
dirColor: 'white',
lineJoin: 'round' // 折线拐点连接处样式})
})
polylineArr.push(polyline)
})
data.polylines.push(polylineArr)
})
data.polylines = data.polylines.flat()
console.log("polylines",data.polylines)
map.add(data.polylines)
}

View File

@ -0,0 +1,65 @@
export function fixedLocationHandler(map,data) {
console.log(map,data)
let task:Promise<any>[] = []
let startTime
let preFixedData = (data.data || []).map((item, index) => {
if (index % 500 === 0) {
startTime = data.data[0].time
}
let time = item.time
return {
x: item.longitude,
y: item.latitude,
sp: item.speed || 0,
ag: item.bearing || 0,
tm: index % 500 === 0 ? time.unix() : time.diff(startTime, 's')
}
})
console.log("纠偏路线 预处理数据: ", preFixedData)
let group:any[] = []
let len = preFixedData.length
for (let i = 0; i < Math.ceil(len / 500); i++) {
group.push(preFixedData.splice(0, 500))
}
console.log("分组: ", group)
task = group.map(item => {
return new Promise(resolve => {
AMap.plugin('AMap.GraspRoad', function () {
let grasp = new AMap.GraspRoad();
grasp.driving(item, function (error, result) {
if (error) {
resolve([])
}
if (!error) {
let newPath = result.data.points;//纠偏后的轨迹
let distance = result.data.distance;//里程
console.log("返回值 => ", "路径: ", newPath, "里程: ", distance)
resolve(newPath)
}
})
})
})
})
Promise.all(task).then(paths => {
let fixedData = paths.flat(1)
console.log("纠偏路线数据: ", fixedData)
data.fixedPolyline = new AMap.Polyline({
path: fixedData.map(item => {
return new AMap.LngLat(item.x, item.y)
}),
showDir: true,
strokeColor: 'orange', // 线条颜色
borderWeight: 6, // 线条宽度,默认为 1
strokeWeight: 6,
})
map.add(data.fixedPolyline)
})
}

View File

@ -0,0 +1,54 @@
import {auth, LoginDTO} from "src/views/tabs/location-record/api";
import moment from "moment";
import {ElMessage, ElNotification} from "element-plus";
export function checkLoginStatus(){
let user = localStorage.getItem("user")
let lastLogin = localStorage.getItem("lastLogin")
let token = localStorage.getItem("token")
return !!user &&
!!lastLogin &&
!!token &&
moment().diff(moment(lastLogin),"h") < 24
}
export function logoutHandler(){
localStorage.removeItem("user")
localStorage.removeItem("lastLogin")
localStorage.removeItem("token")
}
export function loginRequest(authModel:LoginDTO, server:string){
logoutHandler()
return new Promise((resolve)=>{
auth.login(authModel,server).then((resp)=>{
let res = resp.data
console.log("login", res)
if(res.code !== 200){
ElMessage.warning({
message: res.data || res.msg,
duration: 500
})
resolve(false)
} else {
ElMessage.success({
message: "登录成功",
duration: 500
})
localStorage.setItem("user", authModel.account)
localStorage.setItem("lastLogin", moment().format("YYYY-MM-DD HH:mm:ss"))
localStorage.setItem("token",res.data.token)
resolve(true)
}
}).catch((e)=>{
console.error(e)
ElMessage.error({
message: "登录失败",
duration: 500,
})
resolve(false)
})
})
}

View File

@ -0,0 +1,91 @@
export function getMarkers(map,data,line){
if(!data.tmpMarker){
data.tmpMarker = new AMap.Marker({
anchor: 'bottom-center',
offset: [0, -15],
});
}
return line.filter((_, index) => index % 1 === 0).map((item) => {
let text = {
fontSize: 10,
content: `时间:${item.locationTime}<br>速度: ${((item.speed || 0) * 3.6).toFixed(2)}km/h 方向角: ${(item.bearing || 0).toFixed(2)}°`
}
let marker = new AMap.LabelMarker({
name: item.id,
position: [item.longitude, item.latitude],
zIndex: 10,
icon: {
// 图标类型,现阶段只支持 image 类型
type: 'image',
// 图片 url
image: 'https://webapi.amap.com/theme/v1.3/markers/n/mark_b.png',
// 图片尺寸
size: [6, 9],
// 图片相对 position 的锚点,默认为 bottom-center
anchor: 'bottom-center'
},
// text,
})
function show(e) {
let position = e.data.data && e.data.data.position;
if (position) {
data.tmpMarker.setContent(
`<div class="amap-info-window"
style="padding: .75rem 1.25rem;font-size:12px;
margin-bottom: 1rem;
border-radius: .25rem;
position: fixed;
top: 1rem;
background-color: white;
width: auto;
min-width: 22rem;
border-width: 0;
right: 1rem;
box-shadow: 0 2px 6px 0 rgba(114, 124, 245, .5);">`
+ text.content +
'<div class="amap-info-sharp"></div>' +
'</div>');
data.tmpMarker.setPosition(position);
map.add(data.tmpMarker);
}
}
function hide() {
map.remove(data.tmpMarker);
}
marker.on('mouseover', (e) => show(e));
marker.on('touchstart', (e) => show(e));
marker.on('mouseout', () => hide());
marker.on('touchend', () => hide());
return marker;
});
}
export function drawMarkers(map,data,options,lines){
if(!data.labelsLayer){
data.labelsLayer = new AMap.LabelsLayer({
zooms: [3, 20],
zIndex: 1000,
// 该层内标注是否避让
collision: true,
// 设置 allowCollisiontrue可以让标注避让用户的标注
allowCollision: false,
});
map.add(data.labelsLayer)
}
data.labelsLayer.remove(data.markers)
data.markers = []
if(!options.showMarker){
return
}
data.markers = lines.map(line=>{
return getMarkers(map,data,line)
}).flat()
data.labelsLayer.add(data.markers)
}

View File

@ -0,0 +1,84 @@
let index = 0
export function playAnimation(map,data,line,animateRate,view,itemIndex){
console.log("playAnimation",line)
if(data.animateMarker){
map.remove(data.animateMarker)
}
data.animateMarker = new AMap.Marker({
map: map,
position: [0,0],
icon: "https://a.amap.com/jsapi_demos/static/demo-center-v2/car.png",
offset: new AMap.Pixel(-13, -26),
autoRotation: true
})
if(!data.infoWindow){
data.infoWindow = new AMap.InfoWindow({
offset: new AMap.Pixel(6, -25),
content: "",
isCustom: true
});
}
if(itemIndex !== view.animating){
index = 0
}
let path = line.slice(index).map((item) => {
return new AMap.LngLat(item.longitude, item.latitude)
})
data.animateMarker.stopMove();
data.animateMarker.on("movealong",()=>{})
let lastMovingIndex = 0
data.animateMarker.on("moving",(e)=>{
if(lastMovingIndex != e.index){
index++
}
lastMovingIndex = e.index
let lastLocation = e.passedPath[e.passedPath.length - 1];
data.infoWindow.setPosition(lastLocation);
let speed = ((line[index].speed||0) * 3.6).toFixed(2)
data.infoWindow.setContent(`<div style="width:180px;background: #fff;border-radius: 5px">
<div>${line[index].locationTime}</div>
<div>${speed} km/h</div>
</div>`);
map.setCenter(e.target.getPosition(),true)
})
data.animateMarker.on("moveend",()=>{
if(index >= line.length-2){
setTimeout(()=>{
view.animating = -1
index = 0
data.animateMarker.stopMove()
map.remove(data.animateMarker)
data.infoWindow.close()
},100)
}
})
let polyline = new AMap.Polyline({
path: path,
})
data.animateMarker.moveAlong(polyline.getPath(),{
duration: 1000/animateRate,
autoRotation: true
});
data.infoWindow.open(map, data.animateMarker.getPosition())
}
export function stopAnimation(map,data,view){
if(!data.animateMarker){
return
}
pauseAnimation(data)
view.animating = -1
index = 0
}
export function pauseAnimation(data){
if(!data.animateMarker){
return
}
data.animateMarker.stopMove()
}

View File

@ -0,0 +1,14 @@
export function getMaxSpeed(data:any[]){
let sortSpeedData = JSON.parse(JSON.stringify(data)).sort((a,b)=>{return (b.speed || 0) - (a.speed||0)})
return ((sortSpeedData[0]||{}).speed || 0)
}
export function getAvgSpeed(data:any[]){
if(data.length === 0){
return 0
} else {
return ((data.map(item=>item.speed || 0).reduce((prev,cur)=>{
return prev + cur
},0) / data.length))
}
}

View File

@ -10,6 +10,7 @@
"resolveJsonModule": true,
"isolatedModules": false,
"esModuleInterop": true,
"noImplicitAny": false,
"lib": [
"ESNext",
"DOM"
@ -24,7 +25,8 @@
"src/**/*.ts",
"src/**/*.d.ts",
"src/**/*.tsx",
"src/**/*.vue"
"src/**/*.vue",
"node_modules/@amap/amap-jsapi-loader/src/global.d.ts"
],
"references": [
{

View File

@ -1,10 +1,19 @@
import {defineConfig} from "vite";
import vuePlugin from "@vitejs/plugin-vue";
import vueJsx from '@vitejs/plugin-vue-jsx';
import Components from 'unplugin-vue-components/vite';
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers';
import path from "path"
import wailsPlugin from "./wails-plugin";
export default defineConfig({
plugins: [
vuePlugin(),
vueJsx(),
// 按需引入NaiveUi且自动创建组件声明
Components({
dts: true,
resolvers: [ElementPlusResolver()],
}),
wailsPlugin({
excludeUrls: [
"/s/.*"

View File

@ -0,0 +1,5 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
import {config} from '../models';
export function GetConfig():Promise<config.Config>;

View File

@ -0,0 +1,7 @@
// @ts-check
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
export function GetConfig() {
return window['go']['config']['Support']['GetConfig']();
}

View File

@ -1,5 +1,8 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
import {context} from '../models';
export function Ctx():Promise<context.Context>;
export function ForceClose():Promise<void>;

View File

@ -2,10 +2,14 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
export function Ctx() {
return window['go']['core']['App']['Ctx']();
}
export function ForceClose() {
return window['go']['main']['App']['ForceClose']();
return window['go']['core']['App']['ForceClose']();
}
export function ReloadApp() {
return window['go']['main']['App']['ReloadApp']();
return window['go']['core']['App']['ReloadApp']();
}

View File

@ -0,0 +1,13 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
import {frontend} from '../models';
export function MessageDialog(arg1:frontend.MessageDialogOptions):Promise<string>;
export function OpenDirectoryDialog(arg1:frontend.OpenDialogOptions):Promise<string>;
export function OpenFileDialog(arg1:frontend.OpenDialogOptions):Promise<string>;
export function OpenMultipleFilesDialog(arg1:frontend.OpenDialogOptions):Promise<Array<string>>;
export function SaveFileDialog(arg1:frontend.SaveDialogOptions):Promise<string>;

View File

@ -0,0 +1,23 @@
// @ts-check
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
export function MessageDialog(arg1) {
return window['go']['dialog']['Support']['MessageDialog'](arg1);
}
export function OpenDirectoryDialog(arg1) {
return window['go']['dialog']['Support']['OpenDirectoryDialog'](arg1);
}
export function OpenFileDialog(arg1) {
return window['go']['dialog']['Support']['OpenFileDialog'](arg1);
}
export function OpenMultipleFilesDialog(arg1) {
return window['go']['dialog']['Support']['OpenMultipleFilesDialog'](arg1);
}
export function SaveFileDialog(arg1) {
return window['go']['dialog']['Support']['SaveFileDialog'](arg1);
}

View File

@ -0,0 +1,8 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
export function CalcMD5(arg1:string):Promise<string>;
export function CalcSHA1(arg1:string):Promise<string>;
export function RecursiveScan(arg1:string,arg2:boolean,arg3:boolean):Promise<Array<string>>;

View File

@ -0,0 +1,15 @@
// @ts-check
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
export function CalcMD5(arg1) {
return window['go']['duplicate']['Support']['CalcMD5'](arg1);
}
export function CalcSHA1(arg1) {
return window['go']['duplicate']['Support']['CalcSHA1'](arg1);
}
export function RecursiveScan(arg1, arg2, arg3) {
return window['go']['duplicate']['Support']['RecursiveScan'](arg1, arg2, arg3);
}

View File

@ -0,0 +1,11 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
import {io} from '../models';
export function CopyN(arg1:io.Writer,arg2:string,arg3:number):Promise<number>;
export function IsDir(arg1:string):Promise<boolean>;
export function IsFile(arg1:string):Promise<boolean>;
export function SaveJSONFile(arg1:string,arg2:any):Promise<void>;

View File

@ -0,0 +1,19 @@
// @ts-check
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
export function CopyN(arg1, arg2, arg3) {
return window['go']['file']['Support']['CopyN'](arg1, arg2, arg3);
}
export function IsDir(arg1) {
return window['go']['file']['Support']['IsDir'](arg1);
}
export function IsFile(arg1) {
return window['go']['file']['Support']['IsFile'](arg1);
}
export function SaveJSONFile(arg1, arg2) {
return window['go']['file']['Support']['SaveJSONFile'](arg1, arg2);
}

View File

@ -0,0 +1,14 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
export function CalcCRC32(arg1:string,arg2:number):Promise<string>;
export function CalcCRC64(arg1:string,arg2:number):Promise<string>;
export function CalcMD5(arg1:string,arg2:number):Promise<string>;
export function CalcSHA1(arg1:string,arg2:number):Promise<string>;
export function CalcSHA256(arg1:string,arg2:number):Promise<string>;
export function CalcSHA512(arg1:string,arg2:number):Promise<string>;

View File

@ -0,0 +1,27 @@
// @ts-check
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
export function CalcCRC32(arg1, arg2) {
return window['go']['hash']['Support']['CalcCRC32'](arg1, arg2);
}
export function CalcCRC64(arg1, arg2) {
return window['go']['hash']['Support']['CalcCRC64'](arg1, arg2);
}
export function CalcMD5(arg1, arg2) {
return window['go']['hash']['Support']['CalcMD5'](arg1, arg2);
}
export function CalcSHA1(arg1, arg2) {
return window['go']['hash']['Support']['CalcSHA1'](arg1, arg2);
}
export function CalcSHA256(arg1, arg2) {
return window['go']['hash']['Support']['CalcSHA256'](arg1, arg2);
}
export function CalcSHA512(arg1, arg2) {
return window['go']['hash']['Support']['CalcSHA512'](arg1, arg2);
}

View File

@ -1,3 +1,67 @@
export namespace config {
export class DebuggerConfig {
enable: boolean;
static createFrom(source: any = {}) {
return new DebuggerConfig(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.enable = source["enable"];
}
}
export class ServerConfig {
host: string;
port: number;
static createFrom(source: any = {}) {
return new ServerConfig(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.host = source["host"];
this.port = source["port"];
}
}
export class Config {
server?: ServerConfig;
debug?: DebuggerConfig;
static createFrom(source: any = {}) {
return new Config(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.server = this.convertValues(source["server"], ServerConfig);
this.debug = this.convertValues(source["debug"], DebuggerConfig);
}
convertValues(a: any, classs: any, asMap: boolean = false): any {
if (!a) {
return a;
}
if (a.slice) {
return (a as any[]).map(elem => this.convertValues(elem, classs));
} else if ("object" === typeof a) {
if (asMap) {
for (const key of Object.keys(a)) {
a[key] = new classs(a[key]);
}
return a;
}
return new classs(a);
}
return a;
}
}
}
export namespace cpu {
export class InfoStat {
@ -299,21 +363,62 @@ export namespace net {
return a;
}
}
}
export namespace process {
export class Process {
pid: number;
export class IOCountersStat {
name: string;
bytesSent: number;
bytesRecv: number;
packetsSent: number;
packetsRecv: number;
errin: number;
errout: number;
dropin: number;
dropout: number;
fifoin: number;
fifoout: number;
static createFrom(source: any = {}) {
return new Process(source);
return new IOCountersStat(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.pid = source["pid"];
this.name = source["name"];
this.bytesSent = source["bytesSent"];
this.bytesRecv = source["bytesRecv"];
this.packetsSent = source["packetsSent"];
this.packetsRecv = source["packetsRecv"];
this.errin = source["errin"];
this.errout = source["errout"];
this.dropin = source["dropin"];
this.dropout = source["dropout"];
this.fifoin = source["fifoin"];
this.fifoout = source["fifoout"];
}
}
}
export namespace system {
export class ProcessDTO {
pid: number;
name: string;
parent: number;
status: string;
createTime: number;
static createFrom(source: any = {}) {
return new ProcessDTO(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.pid = source["pid"];
this.name = source["name"];
this.parent = source["parent"];
this.status = source["status"];
this.createTime = source["createTime"];
}
}

View File

@ -3,9 +3,8 @@
import {cpu} from '../models';
import {disk} from '../models';
import {net} from '../models';
import {process} from '../models';
import {mem} from '../models';
import {system} from '../models';
import {mem} from '../models';
export function GetAllProcessPid():Promise<Array<number>>;
@ -15,6 +14,8 @@ export function GetCpuTimes():Promise<Array<cpu.TimesStat>>;
export function GetCpuUsage():Promise<Array<number>>;
export function GetCurrentPid():Promise<number>;
export function GetDiskPartitions():Promise<Array<disk.PartitionStat>>;
export function GetDiskUsage(arg1:string):Promise<disk.UsageStat>;
@ -23,7 +24,11 @@ export function GetIOCounters():Promise<{[key: string]: disk.IOCountersStat}>;
export function GetNetWorkConnection():Promise<Array<net.ConnectionStat>>;
export function GetProcessInfo(arg1:number):Promise<process.Process>;
export function GetNetworkCounter(arg1:boolean):Promise<Array<net.IOCountersStat>>;
export function GetProcessInfo(arg1:number):Promise<system.ProcessDTO>;
export function GetProcesses():Promise<Array<system.ProcessDTO>>;
export function GetSwapMemory():Promise<mem.SwapMemoryStat>;

View File

@ -18,6 +18,10 @@ export function GetCpuUsage() {
return window['go']['system']['InfoUtils']['GetCpuUsage']();
}
export function GetCurrentPid() {
return window['go']['system']['InfoUtils']['GetCurrentPid']();
}
export function GetDiskPartitions() {
return window['go']['system']['InfoUtils']['GetDiskPartitions']();
}
@ -34,10 +38,18 @@ export function GetNetWorkConnection() {
return window['go']['system']['InfoUtils']['GetNetWorkConnection']();
}
export function GetNetworkCounter(arg1) {
return window['go']['system']['InfoUtils']['GetNetworkCounter'](arg1);
}
export function GetProcessInfo(arg1) {
return window['go']['system']['InfoUtils']['GetProcessInfo'](arg1);
}
export function GetProcesses() {
return window['go']['system']['InfoUtils']['GetProcesses']();
}
export function GetSwapMemory() {
return window['go']['system']['InfoUtils']['GetSwapMemory']();
}

View File

@ -7,17 +7,294 @@
resolved "https://registry.npmmirror.com/@alloc/quick-lru/-/quick-lru-5.2.0.tgz#7bf68b20c0a350f936915fcae06f58e32007ce30"
integrity sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==
"@amap/amap-jsapi-loader@^1.0.1":
version "1.0.1"
resolved "https://registry.npmmirror.com/@amap/amap-jsapi-loader/-/amap-jsapi-loader-1.0.1.tgz#9ec4b4d5d2467eac451f6c852e35db69e9f9f0c0"
integrity sha512-nPyLKt7Ow/ThHLkSvn2etQlUzqxmTVgK7bIgwdBRTg2HK5668oN7xVxkaiRe3YZEzGzfV2XgH5Jmu2T73ljejw==
"@ampproject/remapping@^2.2.0":
version "2.2.1"
resolved "https://registry.npmmirror.com/@ampproject/remapping/-/remapping-2.2.1.tgz#99e8e11851128b8702cd57c33684f1d0f260b630"
integrity sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==
dependencies:
"@jridgewell/gen-mapping" "^0.3.0"
"@jridgewell/trace-mapping" "^0.3.9"
"@antfu/utils@^0.7.4":
version "0.7.5"
resolved "https://registry.npmmirror.com/@antfu/utils/-/utils-0.7.5.tgz#c36f37add92a7de57b9c29ae0c1f399706bff345"
integrity sha512-dlR6LdS+0SzOAPx/TPRhnoi7hE251OVeT2Snw0RguNbBSbjUHdWr0l3vcUUDg26rEysT89kCbtw1lVorBXLLCg==
"@babel/code-frame@^7.22.5":
version "7.22.5"
resolved "https://registry.npmmirror.com/@babel/code-frame/-/code-frame-7.22.5.tgz#234d98e1551960604f1246e6475891a570ad5658"
integrity sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ==
dependencies:
"@babel/highlight" "^7.22.5"
"@babel/compat-data@^7.22.9":
version "7.22.9"
resolved "https://registry.npmmirror.com/@babel/compat-data/-/compat-data-7.22.9.tgz#71cdb00a1ce3a329ce4cbec3a44f9fef35669730"
integrity sha512-5UamI7xkUcJ3i9qVDS+KFDEK8/7oJ55/sJMB1Ge7IEapr7KfdfV/HErR+koZwOfd+SgtFKOKRhRakdg++DcJpQ==
"@babel/core@^7.20.7":
version "7.22.9"
resolved "https://registry.npmmirror.com/@babel/core/-/core-7.22.9.tgz#bd96492c68822198f33e8a256061da3cf391f58f"
integrity sha512-G2EgeufBcYw27U4hhoIwFcgc1XU7TlXJ3mv04oOv1WCuo900U/anZSPzEqNjwdjgffkk2Gs0AN0dW1CKVLcG7w==
dependencies:
"@ampproject/remapping" "^2.2.0"
"@babel/code-frame" "^7.22.5"
"@babel/generator" "^7.22.9"
"@babel/helper-compilation-targets" "^7.22.9"
"@babel/helper-module-transforms" "^7.22.9"
"@babel/helpers" "^7.22.6"
"@babel/parser" "^7.22.7"
"@babel/template" "^7.22.5"
"@babel/traverse" "^7.22.8"
"@babel/types" "^7.22.5"
convert-source-map "^1.7.0"
debug "^4.1.0"
gensync "^1.0.0-beta.2"
json5 "^2.2.2"
semver "^6.3.1"
"@babel/generator@^7.22.7", "@babel/generator@^7.22.9":
version "7.22.9"
resolved "https://registry.npmmirror.com/@babel/generator/-/generator-7.22.9.tgz#572ecfa7a31002fa1de2a9d91621fd895da8493d"
integrity sha512-KtLMbmicyuK2Ak/FTCJVbDnkN1SlT8/kceFTiuDiiRUUSMnHMidxSCdG4ndkTOHHpoomWe/4xkvHkEOncwjYIw==
dependencies:
"@babel/types" "^7.22.5"
"@jridgewell/gen-mapping" "^0.3.2"
"@jridgewell/trace-mapping" "^0.3.17"
jsesc "^2.5.1"
"@babel/helper-annotate-as-pure@^7.22.5":
version "7.22.5"
resolved "https://registry.npmmirror.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz#e7f06737b197d580a01edf75d97e2c8be99d3882"
integrity sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg==
dependencies:
"@babel/types" "^7.22.5"
"@babel/helper-compilation-targets@^7.22.9":
version "7.22.9"
resolved "https://registry.npmmirror.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.9.tgz#f9d0a7aaaa7cd32a3f31c9316a69f5a9bcacb892"
integrity sha512-7qYrNM6HjpnPHJbopxmb8hSPoZ0gsX8IvUS32JGVoy+pU9e5N0nLr1VjJoR6kA4d9dmGLxNYOjeB8sUDal2WMw==
dependencies:
"@babel/compat-data" "^7.22.9"
"@babel/helper-validator-option" "^7.22.5"
browserslist "^4.21.9"
lru-cache "^5.1.1"
semver "^6.3.1"
"@babel/helper-create-class-features-plugin@^7.22.9":
version "7.22.9"
resolved "https://registry.npmmirror.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.22.9.tgz#c36ea240bb3348f942f08b0fbe28d6d979fab236"
integrity sha512-Pwyi89uO4YrGKxL/eNJ8lfEH55DnRloGPOseaA8NFNL6jAUnn+KccaISiFazCj5IolPPDjGSdzQzXVzODVRqUQ==
dependencies:
"@babel/helper-annotate-as-pure" "^7.22.5"
"@babel/helper-environment-visitor" "^7.22.5"
"@babel/helper-function-name" "^7.22.5"
"@babel/helper-member-expression-to-functions" "^7.22.5"
"@babel/helper-optimise-call-expression" "^7.22.5"
"@babel/helper-replace-supers" "^7.22.9"
"@babel/helper-skip-transparent-expression-wrappers" "^7.22.5"
"@babel/helper-split-export-declaration" "^7.22.6"
semver "^6.3.1"
"@babel/helper-environment-visitor@^7.22.5":
version "7.22.5"
resolved "https://registry.npmmirror.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.5.tgz#f06dd41b7c1f44e1f8da6c4055b41ab3a09a7e98"
integrity sha512-XGmhECfVA/5sAt+H+xpSg0mfrHq6FzNr9Oxh7PSEBBRUb/mL7Kz3NICXb194rCqAEdxkhPT1a88teizAFyvk8Q==
"@babel/helper-function-name@^7.22.5":
version "7.22.5"
resolved "https://registry.npmmirror.com/@babel/helper-function-name/-/helper-function-name-7.22.5.tgz#ede300828905bb15e582c037162f99d5183af1be"
integrity sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ==
dependencies:
"@babel/template" "^7.22.5"
"@babel/types" "^7.22.5"
"@babel/helper-hoist-variables@^7.22.5":
version "7.22.5"
resolved "https://registry.npmmirror.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz#c01a007dac05c085914e8fb652b339db50d823bb"
integrity sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==
dependencies:
"@babel/types" "^7.22.5"
"@babel/helper-member-expression-to-functions@^7.22.5":
version "7.22.5"
resolved "https://registry.npmmirror.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.22.5.tgz#0a7c56117cad3372fbf8d2fb4bf8f8d64a1e76b2"
integrity sha512-aBiH1NKMG0H2cGZqspNvsaBe6wNGjbJjuLy29aU+eDZjSbbN53BaxlpB02xm9v34pLTZ1nIQPFYn2qMZoa5BQQ==
dependencies:
"@babel/types" "^7.22.5"
"@babel/helper-module-imports@^7.22.5":
version "7.22.5"
resolved "https://registry.npmmirror.com/@babel/helper-module-imports/-/helper-module-imports-7.22.5.tgz#1a8f4c9f4027d23f520bd76b364d44434a72660c"
integrity sha512-8Dl6+HD/cKifutF5qGd/8ZJi84QeAKh+CEe1sBzz8UayBBGg1dAIJrdHOcOM5b2MpzWL2yuotJTtGjETq0qjXg==
dependencies:
"@babel/types" "^7.22.5"
"@babel/helper-module-transforms@^7.22.9":
version "7.22.9"
resolved "https://registry.npmmirror.com/@babel/helper-module-transforms/-/helper-module-transforms-7.22.9.tgz#92dfcb1fbbb2bc62529024f72d942a8c97142129"
integrity sha512-t+WA2Xn5K+rTeGtC8jCsdAH52bjggG5TKRuRrAGNM/mjIbO4GxvlLMFOEz9wXY5I2XQ60PMFsAG2WIcG82dQMQ==
dependencies:
"@babel/helper-environment-visitor" "^7.22.5"
"@babel/helper-module-imports" "^7.22.5"
"@babel/helper-simple-access" "^7.22.5"
"@babel/helper-split-export-declaration" "^7.22.6"
"@babel/helper-validator-identifier" "^7.22.5"
"@babel/helper-optimise-call-expression@^7.22.5":
version "7.22.5"
resolved "https://registry.npmmirror.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.22.5.tgz#f21531a9ccbff644fdd156b4077c16ff0c3f609e"
integrity sha512-HBwaojN0xFRx4yIvpwGqxiV2tUfl7401jlok564NgB9EHS1y6QT17FmKWm4ztqjeVdXLuC4fSvHc5ePpQjoTbw==
dependencies:
"@babel/types" "^7.22.5"
"@babel/helper-plugin-utils@^7.22.5":
version "7.22.5"
resolved "https://registry.npmmirror.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz#dd7ee3735e8a313b9f7b05a773d892e88e6d7295"
integrity sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==
"@babel/helper-replace-supers@^7.22.9":
version "7.22.9"
resolved "https://registry.npmmirror.com/@babel/helper-replace-supers/-/helper-replace-supers-7.22.9.tgz#cbdc27d6d8d18cd22c81ae4293765a5d9afd0779"
integrity sha512-LJIKvvpgPOPUThdYqcX6IXRuIcTkcAub0IaDRGCZH0p5GPUp7PhRU9QVgFcDDd51BaPkk77ZjqFwh6DZTAEmGg==
dependencies:
"@babel/helper-environment-visitor" "^7.22.5"
"@babel/helper-member-expression-to-functions" "^7.22.5"
"@babel/helper-optimise-call-expression" "^7.22.5"
"@babel/helper-simple-access@^7.22.5":
version "7.22.5"
resolved "https://registry.npmmirror.com/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz#4938357dc7d782b80ed6dbb03a0fba3d22b1d5de"
integrity sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==
dependencies:
"@babel/types" "^7.22.5"
"@babel/helper-skip-transparent-expression-wrappers@^7.22.5":
version "7.22.5"
resolved "https://registry.npmmirror.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.22.5.tgz#007f15240b5751c537c40e77abb4e89eeaaa8847"
integrity sha512-tK14r66JZKiC43p8Ki33yLBVJKlQDFoA8GYN67lWCDCqoL6EMMSuM9b+Iff2jHaM/RRFYl7K+iiru7hbRqNx8Q==
dependencies:
"@babel/types" "^7.22.5"
"@babel/helper-split-export-declaration@^7.22.6":
version "7.22.6"
resolved "https://registry.npmmirror.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz#322c61b7310c0997fe4c323955667f18fcefb91c"
integrity sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==
dependencies:
"@babel/types" "^7.22.5"
"@babel/helper-string-parser@^7.22.5":
version "7.22.5"
resolved "https://registry.npmmirror.com/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz#533f36457a25814cf1df6488523ad547d784a99f"
integrity sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==
"@babel/helper-validator-identifier@^7.22.5":
version "7.22.5"
resolved "https://registry.npmmirror.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz#9544ef6a33999343c8740fa51350f30eeaaaf193"
integrity sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==
"@babel/helper-validator-option@^7.22.5":
version "7.22.5"
resolved "https://registry.npmmirror.com/@babel/helper-validator-option/-/helper-validator-option-7.22.5.tgz#de52000a15a177413c8234fa3a8af4ee8102d0ac"
integrity sha512-R3oB6xlIVKUnxNUxbmgq7pKjxpru24zlimpE8WK47fACIlM0II/Hm1RS8IaOI7NgCr6LNS+jl5l75m20npAziw==
"@babel/helpers@^7.22.6":
version "7.22.6"
resolved "https://registry.npmmirror.com/@babel/helpers/-/helpers-7.22.6.tgz#8e61d3395a4f0c5a8060f309fb008200969b5ecd"
integrity sha512-YjDs6y/fVOYFV8hAf1rxd1QvR9wJe1pDBZ2AREKq/SDayfPzgk0PBnVuTCE5X1acEpMMNOVUqoe+OwiZGJ+OaA==
dependencies:
"@babel/template" "^7.22.5"
"@babel/traverse" "^7.22.6"
"@babel/types" "^7.22.5"
"@babel/highlight@^7.22.5":
version "7.22.5"
resolved "https://registry.npmmirror.com/@babel/highlight/-/highlight-7.22.5.tgz#aa6c05c5407a67ebce408162b7ede789b4d22031"
integrity sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw==
dependencies:
"@babel/helper-validator-identifier" "^7.22.5"
chalk "^2.0.0"
js-tokens "^4.0.0"
"@babel/parser@^7.20.15", "@babel/parser@^7.21.3":
version "7.22.6"
resolved "https://registry.npmmirror.com/@babel/parser/-/parser-7.22.6.tgz#201f8b47be20c76c7c5743b9c16129760bf9a975"
integrity sha512-EIQu22vNkceq3LbjAq7knDf/UmtI2qbcNI8GRBlijez6TpQLvSodJPYfydQmNA5buwkxxxa/PVI44jjYZ+/cLw==
"@babel/parser@^7.22.5", "@babel/parser@^7.22.7":
version "7.22.7"
resolved "https://registry.npmmirror.com/@babel/parser/-/parser-7.22.7.tgz#df8cf085ce92ddbdbf668a7f186ce848c9036cae"
integrity sha512-7NF8pOkHP5o2vpmGgNGcfAeCvOYhGLyA3Z4eBQkT1RJlWu47n63bCs93QfJ2hIAFCil7L5P2IWhs1oToVgrL0Q==
"@babel/plugin-syntax-jsx@^7.22.5":
version "7.22.5"
resolved "https://registry.npmmirror.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.22.5.tgz#a6b68e84fb76e759fc3b93e901876ffabbe1d918"
integrity sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg==
dependencies:
"@babel/helper-plugin-utils" "^7.22.5"
"@babel/plugin-syntax-typescript@^7.22.5":
version "7.22.5"
resolved "https://registry.npmmirror.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.22.5.tgz#aac8d383b062c5072c647a31ef990c1d0af90272"
integrity sha512-1mS2o03i7t1c6VzH6fdQ3OA8tcEIxwG18zIPRp+UY1Ihv6W+XZzBCVxExF9upussPXJ0xE9XRHwMoNs1ep/nRQ==
dependencies:
"@babel/helper-plugin-utils" "^7.22.5"
"@babel/plugin-transform-typescript@^7.20.7":
version "7.22.9"
resolved "https://registry.npmmirror.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.22.9.tgz#91e08ad1eb1028ecc62662a842e93ecfbf3c7234"
integrity sha512-BnVR1CpKiuD0iobHPaM1iLvcwPYN2uVFAqoLVSpEDKWuOikoCv5HbKLxclhKYUXlWkX86DoZGtqI4XhbOsyrMg==
dependencies:
"@babel/helper-annotate-as-pure" "^7.22.5"
"@babel/helper-create-class-features-plugin" "^7.22.9"
"@babel/helper-plugin-utils" "^7.22.5"
"@babel/plugin-syntax-typescript" "^7.22.5"
"@babel/template@^7.22.5":
version "7.22.5"
resolved "https://registry.npmmirror.com/@babel/template/-/template-7.22.5.tgz#0c8c4d944509875849bd0344ff0050756eefc6ec"
integrity sha512-X7yV7eiwAxdj9k94NEylvbVHLiVG1nvzCV2EAowhxLTwODV1jl9UzZ48leOC0sH7OnuHrIkllaBgneUykIcZaw==
dependencies:
"@babel/code-frame" "^7.22.5"
"@babel/parser" "^7.22.5"
"@babel/types" "^7.22.5"
"@babel/traverse@^7.22.5", "@babel/traverse@^7.22.6", "@babel/traverse@^7.22.8":
version "7.22.8"
resolved "https://registry.npmmirror.com/@babel/traverse/-/traverse-7.22.8.tgz#4d4451d31bc34efeae01eac222b514a77aa4000e"
integrity sha512-y6LPR+wpM2I3qJrsheCTwhIinzkETbplIgPBbwvqPKc+uljeA5gP+3nP8irdYt1mjQaDnlIcG+dw8OjAco4GXw==
dependencies:
"@babel/code-frame" "^7.22.5"
"@babel/generator" "^7.22.7"
"@babel/helper-environment-visitor" "^7.22.5"
"@babel/helper-function-name" "^7.22.5"
"@babel/helper-hoist-variables" "^7.22.5"
"@babel/helper-split-export-declaration" "^7.22.6"
"@babel/parser" "^7.22.7"
"@babel/types" "^7.22.5"
debug "^4.1.0"
globals "^11.1.0"
"@babel/types@^7.22.5":
version "7.22.5"
resolved "https://registry.npmmirror.com/@babel/types/-/types-7.22.5.tgz#cd93eeaab025880a3a47ec881f4b096a5b786fbe"
integrity sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==
dependencies:
"@babel/helper-string-parser" "^7.22.5"
"@babel/helper-validator-identifier" "^7.22.5"
to-fast-properties "^2.0.0"
"@ctrl/tinycolor@^3.4.1":
version "3.6.0"
resolved "https://registry.npmmirror.com/@ctrl/tinycolor/-/tinycolor-3.6.0.tgz#53fa5fe9c34faee89469e48f91d51a3766108bc8"
integrity sha512-/Z3l6pXthq0JvMYdUFyX9j0MaCltlIn6mfh9jLyQwg5aPKxkyNa0PTHtU1AlFXLNk55ZuAeJRcpvq+tmLfKmaQ==
"@element-plus/icons-vue@^2.0.6":
"@element-plus/icons-vue@^2.0.6", "@element-plus/icons-vue@^2.1.0":
version "2.1.0"
resolved "https://registry.npmmirror.com/@element-plus/icons-vue/-/icons-vue-2.1.0.tgz#7ad90d08a8c0d5fd3af31c4f73264ca89614397a"
integrity sha512-PSBn3elNoanENc1vnCfh+3WA9fimRC7n+fWkf3rE5jvv+aBohNHABC/KAR5KWPecxWxDTVT1ERpRbOMRcOV/vA==
@ -144,7 +421,7 @@
dependencies:
"@floating-ui/core" "^1.3.1"
"@jridgewell/gen-mapping@^0.3.2":
"@jridgewell/gen-mapping@^0.3.0", "@jridgewell/gen-mapping@^0.3.2":
version "0.3.3"
resolved "https://registry.npmmirror.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz#7e02e6eb5df901aaedb08514203b096614024098"
integrity sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==
@ -173,7 +450,7 @@
resolved "https://registry.npmmirror.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32"
integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==
"@jridgewell/trace-mapping@^0.3.9":
"@jridgewell/trace-mapping@^0.3.17", "@jridgewell/trace-mapping@^0.3.9":
version "0.3.18"
resolved "https://registry.npmmirror.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz#25783b2086daf6ff1dcb53c9249ae480e4dd4cd6"
integrity sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==
@ -207,6 +484,20 @@
resolved "https://registry.npmmirror.com/@sxzz/popperjs-es/-/popperjs-es-2.11.7.tgz#a7f69e3665d3da9b115f9e71671dae1b97e13671"
integrity sha512-Ccy0NlLkzr0Ex2FKvh2X+OyERHXJ88XJ1MXtsI9y9fGexlaXaVTPzBCRBwIxFkORuOb+uBqeu+RqnpgYTEZRUQ==
"@rollup/pluginutils@^5.0.2":
version "5.0.2"
resolved "https://registry.npmmirror.com/@rollup/pluginutils/-/pluginutils-5.0.2.tgz#012b8f53c71e4f6f9cb317e311df1404f56e7a33"
integrity sha512-pTd9rIsP92h+B6wWwFbW8RkZv4hiR/xKsqre4SIuAOaOEQRxi0lqLke9k2/7WegC85GgUs9pjmOjCUi3In4vwA==
dependencies:
"@types/estree" "^1.0.0"
estree-walker "^2.0.2"
picomatch "^2.3.1"
"@types/estree@^1.0.0":
version "1.0.1"
resolved "https://registry.npmmirror.com/@types/estree/-/estree-1.0.1.tgz#aa22750962f3bf0e79d753d3cc067f010c95f194"
integrity sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==
"@types/lodash-es@^4.17.6":
version "4.17.7"
resolved "https://registry.npmmirror.com/@types/lodash-es/-/lodash-es-4.17.7.tgz#22edcae9f44aff08546e71db8925f05b33c7cc40"
@ -219,6 +510,11 @@
resolved "https://registry.npmmirror.com/@types/lodash/-/lodash-4.14.195.tgz#bafc975b252eb6cea78882ce8a7b6bf22a6de632"
integrity sha512-Hwx9EUgdwf2GLarOjQp5ZH8ZmblzcbTBC2wtQWNKARBSxM9ezRIAUpeDTgoQRAFB0+8CNWXVA9+MaSOzOF3nPg==
"@types/node@^20.4.2":
version "20.4.2"
resolved "https://registry.npmmirror.com/@types/node/-/node-20.4.2.tgz#129cc9ae69f93824f92fac653eebfb4812ab4af9"
integrity sha512-Dd0BYtWgnWJKwO1jkmTrzofjK2QXXcai0dmtzvIBhcA+RsG5h8R3xlyta0kGOZRNfL9GuRtb1knmPEhQrePCEw==
"@types/web-bluetooth@^0.0.16":
version "0.0.16"
resolved "https://registry.npmmirror.com/@types/web-bluetooth/-/web-bluetooth-0.0.16.tgz#1d12873a8e49567371f2a75fe3e7f7edca6662d8"
@ -229,11 +525,40 @@
resolved "https://registry.npmmirror.com/@types/web-bluetooth/-/web-bluetooth-0.0.17.tgz#5c9f3c617f64a9735d7b72a7cc671e166d900c40"
integrity sha512-4p9vcSmxAayx72yn70joFoL44c9MO/0+iVEBIQXe3v2h2SiAsEIo/G5v6ObFWvNKRFjbrVadNf9LqEEZeQPzdA==
"@vitejs/plugin-vue-jsx@^3.0.1":
version "3.0.1"
resolved "https://registry.npmmirror.com/@vitejs/plugin-vue-jsx/-/plugin-vue-jsx-3.0.1.tgz#4c088ce445e34ae27e78a66e6dbf2cc2e85f827d"
integrity sha512-+Jb7ggL48FSPS1uhPnJbJwWa9Sr90vQ+d0InW+AhBM22n+cfuYqJZDckBc+W3QSHe1WDvewMZfa4wZOtk5pRgw==
dependencies:
"@babel/core" "^7.20.7"
"@babel/plugin-transform-typescript" "^7.20.7"
"@vue/babel-plugin-jsx" "^1.1.1"
"@vitejs/plugin-vue@^4.2.3":
version "4.2.3"
resolved "https://registry.npmmirror.com/@vitejs/plugin-vue/-/plugin-vue-4.2.3.tgz#ee0b6dfcc62fe65364e6395bf38fa2ba10bb44b6"
integrity sha512-R6JDUfiZbJA9cMiguQ7jxALsgiprjBeHL5ikpXfJCH62pPHtI+JdJ5xWj6Ev73yXSlYl86+blXn1kZHQ7uElxw==
"@vue/babel-helper-vue-transform-on@^1.1.5":
version "1.1.5"
resolved "https://registry.npmmirror.com/@vue/babel-helper-vue-transform-on/-/babel-helper-vue-transform-on-1.1.5.tgz#a976486b21e108e545524fe41ffe3fc9bbc28c7f"
integrity sha512-SgUymFpMoAyWeYWLAY+MkCK3QEROsiUnfaw5zxOVD/M64KQs8D/4oK6Q5omVA2hnvEOE0SCkH2TZxs/jnnUj7w==
"@vue/babel-plugin-jsx@^1.1.1":
version "1.1.5"
resolved "https://registry.npmmirror.com/@vue/babel-plugin-jsx/-/babel-plugin-jsx-1.1.5.tgz#5088bae7dbb83531d94df3742ff650c12fd54973"
integrity sha512-nKs1/Bg9U1n3qSWnsHhCVQtAzI6aQXqua8j/bZrau8ywT1ilXQbK4FwEJGmU8fV7tcpuFvWmmN7TMmV1OBma1g==
dependencies:
"@babel/helper-module-imports" "^7.22.5"
"@babel/plugin-syntax-jsx" "^7.22.5"
"@babel/template" "^7.22.5"
"@babel/traverse" "^7.22.5"
"@babel/types" "^7.22.5"
"@vue/babel-helper-vue-transform-on" "^1.1.5"
camelcase "^6.3.0"
html-tags "^3.3.1"
svg-tags "^1.0.0"
"@vue/compiler-core@3.3.4":
version "3.3.4"
resolved "https://registry.npmmirror.com/@vue/compiler-core/-/compiler-core-3.3.4.tgz#7fbf591c1c19e1acd28ffd284526e98b4f581128"
@ -373,6 +698,18 @@
dependencies:
vue-demi "*"
acorn@^8.9.0:
version "8.10.0"
resolved "https://registry.npmmirror.com/acorn/-/acorn-8.10.0.tgz#8be5b3907a67221a81ab23c7889c4c5526b62ec5"
integrity sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==
ansi-styles@^3.2.1:
version "3.2.1"
resolved "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d"
integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==
dependencies:
color-convert "^1.9.0"
any-promise@^1.0.0:
version "1.3.0"
resolved "https://registry.npmmirror.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f"
@ -396,6 +733,11 @@ async-validator@^4.2.5:
resolved "https://registry.npmmirror.com/async-validator/-/async-validator-4.2.5.tgz#c96ea3332a521699d0afaaceed510a54656c6339"
integrity sha512-7HhHjtERjqlNbZtqNqy2rckN/SpOOlmDliet+lP7k+eKZEjPk3DgyeU9lIXLdeLz0uBbbVp+9Qdow9wJWgwwfg==
asynckit@^0.4.0:
version "0.4.0"
resolved "https://registry.npmmirror.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==
autoprefixer@^10.4.14:
version "10.4.14"
resolved "https://registry.npmmirror.com/autoprefixer/-/autoprefixer-10.4.14.tgz#e28d49902f8e759dd25b153264e862df2705f79d"
@ -408,6 +750,15 @@ autoprefixer@^10.4.14:
picocolors "^1.0.0"
postcss-value-parser "^4.2.0"
axios@^1.4.0:
version "1.4.0"
resolved "https://registry.npmmirror.com/axios/-/axios-1.4.0.tgz#38a7bf1224cd308de271146038b551d725f0be1f"
integrity sha512-S4XCWMEmzvo64T9GfvQDOXgYRDJ/wsSZc7Jvdgx5u1sd0JwsuPLqb3SYmusag+edF6ziyMensPVqLTSc1PiSEA==
dependencies:
follow-redirects "^1.15.0"
form-data "^4.0.0"
proxy-from-env "^1.1.0"
balanced-match@^1.0.0:
version "1.0.2"
resolved "https://registry.npmmirror.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee"
@ -426,6 +777,13 @@ brace-expansion@^1.1.7:
balanced-match "^1.0.0"
concat-map "0.0.1"
brace-expansion@^2.0.1:
version "2.0.1"
resolved "https://registry.npmmirror.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae"
integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==
dependencies:
balanced-match "^1.0.0"
braces@^3.0.2, braces@~3.0.2:
version "3.0.2"
resolved "https://registry.npmmirror.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107"
@ -433,7 +791,7 @@ braces@^3.0.2, braces@~3.0.2:
dependencies:
fill-range "^7.0.1"
browserslist@^4.21.5:
browserslist@^4.21.5, browserslist@^4.21.9:
version "4.21.9"
resolved "https://registry.npmmirror.com/browserslist/-/browserslist-4.21.9.tgz#e11bdd3c313d7e2a9e87e8b4b0c7872b13897635"
integrity sha512-M0MFoZzbUrRU4KNfCrDLnvyE7gub+peetoTid3TBIqtunaDJyXlwhakT+/VkvSXcfIzFfK/nkCs4nmyTmxdNSg==
@ -448,11 +806,25 @@ camelcase-css@^2.0.1:
resolved "https://registry.npmmirror.com/camelcase-css/-/camelcase-css-2.0.1.tgz#ee978f6947914cc30c6b44741b6ed1df7f043fd5"
integrity sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==
camelcase@^6.3.0:
version "6.3.0"
resolved "https://registry.npmmirror.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a"
integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==
caniuse-lite@^1.0.30001464, caniuse-lite@^1.0.30001503:
version "1.0.30001512"
resolved "https://registry.npmmirror.com/caniuse-lite/-/caniuse-lite-1.0.30001512.tgz#7450843fb581c39f290305a83523c7a9ef0d4cb4"
integrity sha512-2S9nK0G/mE+jasCUsMPlARhRCts1ebcp2Ji8Y8PWi4NDE1iRdLCnEPHkEfeBrGC45L4isBx5ur3IQ6yTE2mRZw==
chalk@^2.0.0:
version "2.4.2"
resolved "https://registry.npmmirror.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424"
integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==
dependencies:
ansi-styles "^3.2.1"
escape-string-regexp "^1.0.5"
supports-color "^5.3.0"
"chokidar@>=3.0.0 <4.0.0", chokidar@^3.5.3:
version "3.5.3"
resolved "https://registry.npmmirror.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd"
@ -468,6 +840,25 @@ caniuse-lite@^1.0.30001464, caniuse-lite@^1.0.30001503:
optionalDependencies:
fsevents "~2.3.2"
color-convert@^1.9.0:
version "1.9.3"
resolved "https://registry.npmmirror.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8"
integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==
dependencies:
color-name "1.1.3"
color-name@1.1.3:
version "1.1.3"
resolved "https://registry.npmmirror.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25"
integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==
combined-stream@^1.0.8:
version "1.0.8"
resolved "https://registry.npmmirror.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f"
integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==
dependencies:
delayed-stream "~1.0.0"
commander@^4.0.0:
version "4.1.1"
resolved "https://registry.npmmirror.com/commander/-/commander-4.1.1.tgz#9fd602bd936294e9e9ef46a3f4d6964044b18068"
@ -478,6 +869,11 @@ concat-map@0.0.1:
resolved "https://registry.npmmirror.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==
convert-source-map@^1.7.0:
version "1.9.0"
resolved "https://registry.npmmirror.com/convert-source-map/-/convert-source-map-1.9.0.tgz#7faae62353fb4213366d0ca98358d22e8368b05f"
integrity sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==
cssesc@^3.0.0:
version "3.0.0"
resolved "https://registry.npmmirror.com/cssesc/-/cssesc-3.0.0.tgz#37741919903b868565e1c09ea747445cd18983ee"
@ -493,6 +889,18 @@ dayjs@^1.11.3:
resolved "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.9.tgz#9ca491933fadd0a60a2c19f6c237c03517d71d1a"
integrity sha512-QvzAURSbQ0pKdIye2txOzNaHmxtUBXerpY0FJsFXUMKbIZeFm5ht1LS/jFsrncjnmtv8HsG0W2g6c0zUjZWmpA==
debug@^4.1.0, debug@^4.3.4:
version "4.3.4"
resolved "https://registry.npmmirror.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865"
integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==
dependencies:
ms "2.1.2"
delayed-stream@~1.0.0:
version "1.0.0"
resolved "https://registry.npmmirror.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==
didyoumean@^1.2.2:
version "1.2.2"
resolved "https://registry.npmmirror.com/didyoumean/-/didyoumean-1.2.2.tgz#989346ffe9e839b4555ecf5666edea0d3e8ad037"
@ -503,6 +911,14 @@ dlv@^1.1.3:
resolved "https://registry.npmmirror.com/dlv/-/dlv-1.1.3.tgz#5c198a8a11453596e751494d49874bc7732f2e79"
integrity sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==
echarts@^5.4.2:
version "5.4.2"
resolved "https://registry.npmmirror.com/echarts/-/echarts-5.4.2.tgz#9f38781c9c6ae323e896956178f6956952c77a48"
integrity sha512-2W3vw3oI2tWJdyAz+b8DuWS0nfXtSDqlDmqgin/lfzbkB01cuMEN66KWBlmur3YMp5nEDEEt5s23pllnAzB4EA==
dependencies:
tslib "2.3.0"
zrender "5.4.3"
electron-to-chromium@^1.4.431:
version "1.4.450"
resolved "https://registry.npmmirror.com/electron-to-chromium/-/electron-to-chromium-1.4.450.tgz#df232c961ee9bf4e8980f86e96a6e9f291720138"
@ -572,6 +988,11 @@ escape-html@^1.0.3:
resolved "https://registry.npmmirror.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988"
integrity sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==
escape-string-regexp@^1.0.5:
version "1.0.5"
resolved "https://registry.npmmirror.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==
estree-walker@^2.0.2:
version "2.0.2"
resolved "https://registry.npmmirror.com/estree-walker/-/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac"
@ -602,6 +1023,20 @@ fill-range@^7.0.1:
dependencies:
to-regex-range "^5.0.1"
follow-redirects@^1.15.0:
version "1.15.2"
resolved "https://registry.npmmirror.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13"
integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==
form-data@^4.0.0:
version "4.0.0"
resolved "https://registry.npmmirror.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452"
integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==
dependencies:
asynckit "^0.4.0"
combined-stream "^1.0.8"
mime-types "^2.1.12"
fraction.js@^4.2.0:
version "4.2.0"
resolved "https://registry.npmmirror.com/fraction.js/-/fraction.js-4.2.0.tgz#448e5109a313a3527f5a3ab2119ec4cf0e0e2950"
@ -622,6 +1057,11 @@ function-bind@^1.1.1:
resolved "https://registry.npmmirror.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"
integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==
gensync@^1.0.0-beta.2:
version "1.0.0-beta.2"
resolved "https://registry.npmmirror.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0"
integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==
glob-parent@^5.1.2, glob-parent@~5.1.2:
version "5.1.2"
resolved "https://registry.npmmirror.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4"
@ -648,6 +1088,16 @@ glob@7.1.6:
once "^1.3.0"
path-is-absolute "^1.0.0"
globals@^11.1.0:
version "11.12.0"
resolved "https://registry.npmmirror.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e"
integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==
has-flag@^3.0.0:
version "3.0.0"
resolved "https://registry.npmmirror.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd"
integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==
has@^1.0.3:
version "1.0.3"
resolved "https://registry.npmmirror.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796"
@ -655,6 +1105,11 @@ has@^1.0.3:
dependencies:
function-bind "^1.1.1"
html-tags@^3.3.1:
version "3.3.1"
resolved "https://registry.npmmirror.com/html-tags/-/html-tags-3.3.1.tgz#a04026a18c882e4bba8a01a3d39cfe465d40b5ce"
integrity sha512-ztqyC3kLto0e9WbNp0aeP+M3kTt+nbaIveGmUxAtZa+8iFgKLUOD4YKM5j+f3QD89bra7UeumolZHKuOXnTmeQ==
immutable@^4.0.0:
version "4.3.1"
resolved "https://registry.npmmirror.com/immutable/-/immutable-4.3.1.tgz#17988b356097ab0719e2f741d56f3ec6c317f9dc"
@ -709,6 +1164,21 @@ jiti@^1.18.2:
resolved "https://registry.npmmirror.com/jiti/-/jiti-1.19.1.tgz#fa99e4b76a23053e0e7cde098efe1704a14c16f1"
integrity sha512-oVhqoRDaBXf7sjkll95LHVS6Myyyb1zaunVwk4Z0+WPSW4gjS0pl01zYKHScTuyEhQsFxV5L4DR5r+YqSyqyyg==
js-tokens@^4.0.0:
version "4.0.0"
resolved "https://registry.npmmirror.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==
jsesc@^2.5.1:
version "2.5.2"
resolved "https://registry.npmmirror.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4"
integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==
json5@^2.2.2:
version "2.2.3"
resolved "https://registry.npmmirror.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283"
integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==
lilconfig@^2.0.5, lilconfig@^2.1.0:
version "2.1.0"
resolved "https://registry.npmmirror.com/lilconfig/-/lilconfig-2.1.0.tgz#78e23ac89ebb7e1bfbf25b18043de756548e7f52"
@ -719,6 +1189,11 @@ lines-and-columns@^1.1.6:
resolved "https://registry.npmmirror.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632"
integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==
local-pkg@^0.4.3:
version "0.4.3"
resolved "https://registry.npmmirror.com/local-pkg/-/local-pkg-0.4.3.tgz#0ff361ab3ae7f1c19113d9bb97b98b905dbc4963"
integrity sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==
lodash-es@^4.17.21:
version "4.17.21"
resolved "https://registry.npmmirror.com/lodash-es/-/lodash-es-4.17.21.tgz#43e626c46e6591b7750beb2b50117390c609e3ee"
@ -734,6 +1209,13 @@ lodash@^4.17.21:
resolved "https://registry.npmmirror.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
lru-cache@^5.1.1:
version "5.1.1"
resolved "https://registry.npmmirror.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920"
integrity sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==
dependencies:
yallist "^3.0.2"
magic-string@^0.30.0:
version "0.30.1"
resolved "https://registry.npmmirror.com/magic-string/-/magic-string-0.30.1.tgz#ce5cd4b0a81a5d032bd69aab4522299b2166284d"
@ -759,6 +1241,18 @@ micromatch@^4.0.4, micromatch@^4.0.5:
braces "^3.0.2"
picomatch "^2.3.1"
mime-db@1.52.0:
version "1.52.0"
resolved "https://registry.npmmirror.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70"
integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==
mime-types@^2.1.12:
version "2.1.35"
resolved "https://registry.npmmirror.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a"
integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==
dependencies:
mime-db "1.52.0"
minimatch@^3.0.4:
version "3.1.2"
resolved "https://registry.npmmirror.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b"
@ -766,6 +1260,23 @@ minimatch@^3.0.4:
dependencies:
brace-expansion "^1.1.7"
minimatch@^9.0.1:
version "9.0.3"
resolved "https://registry.npmmirror.com/minimatch/-/minimatch-9.0.3.tgz#a6e00c3de44c3a542bfaae70abfc22420a6da825"
integrity sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==
dependencies:
brace-expansion "^2.0.1"
moment@^2.29.4:
version "2.29.4"
resolved "https://registry.npmmirror.com/moment/-/moment-2.29.4.tgz#3dbe052889fe7c1b2ed966fcb3a77328964ef108"
integrity sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==
ms@2.1.2:
version "2.1.2"
resolved "https://registry.npmmirror.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==
mz@^2.7.0:
version "2.7.0"
resolved "https://registry.npmmirror.com/mz/-/mz-2.7.0.tgz#95008057a56cafadc2bc63dde7f9ff6955948e32"
@ -908,6 +1419,11 @@ postcss@^8.1.10, postcss@^8.4.23, postcss@^8.4.24:
picocolors "^1.0.0"
source-map-js "^1.0.2"
proxy-from-env@^1.1.0:
version "1.1.0"
resolved "https://registry.npmmirror.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2"
integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==
queue-microtask@^1.2.2:
version "1.2.3"
resolved "https://registry.npmmirror.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243"
@ -964,6 +1480,11 @@ sass@^1.63.6:
immutable "^4.0.0"
source-map-js ">=0.6.2 <2.0.0"
semver@^6.3.1:
version "6.3.1"
resolved "https://registry.npmmirror.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4"
integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==
"source-map-js@>=0.6.2 <2.0.0", source-map-js@^1.0.2:
version "1.0.2"
resolved "https://registry.npmmirror.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c"
@ -982,11 +1503,23 @@ sucrase@^3.32.0:
pirates "^4.0.1"
ts-interface-checker "^0.1.9"
supports-color@^5.3.0:
version "5.5.0"
resolved "https://registry.npmmirror.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f"
integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==
dependencies:
has-flag "^3.0.0"
supports-preserve-symlinks-flag@^1.0.0:
version "1.0.0"
resolved "https://registry.npmmirror.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09"
integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==
svg-tags@^1.0.0:
version "1.0.0"
resolved "https://registry.npmmirror.com/svg-tags/-/svg-tags-1.0.0.tgz#58f71cee3bd519b59d4b2a843b6c7de64ac04764"
integrity sha512-ovssysQTa+luh7A5Weu3Rta6FJlFBBbInjOh722LIt6klpU2/HtdUbszju/G4devcvk8PGt7FCLv5wftu3THUA==
tailwindcss@^3.3.2:
version "3.3.2"
resolved "https://registry.npmmirror.com/tailwindcss/-/tailwindcss-3.3.2.tgz#2f9e35d715fdf0bbf674d90147a0684d7054a2d3"
@ -1030,6 +1563,11 @@ thenify-all@^1.0.0:
dependencies:
any-promise "^1.0.0"
to-fast-properties@^2.0.0:
version "2.0.0"
resolved "https://registry.npmmirror.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e"
integrity sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==
to-regex-range@^5.0.1:
version "5.0.1"
resolved "https://registry.npmmirror.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4"
@ -1042,6 +1580,42 @@ ts-interface-checker@^0.1.9:
resolved "https://registry.npmmirror.com/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz#784fd3d679722bc103b1b4b8030bcddb5db2a699"
integrity sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==
tslib@2.3.0:
version "2.3.0"
resolved "https://registry.npmmirror.com/tslib/-/tslib-2.3.0.tgz#803b8cdab3e12ba581a4ca41c8839bbb0dacb09e"
integrity sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==
typescript@^4.6.4:
version "4.9.5"
resolved "https://registry.npmmirror.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a"
integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==
unplugin-vue-components@^0.25.1:
version "0.25.1"
resolved "https://registry.npmmirror.com/unplugin-vue-components/-/unplugin-vue-components-0.25.1.tgz#84e30374460e2e6e30b6c5bfa6127c11097c1065"
integrity sha512-kzS2ZHVMaGU2XEO2keYQcMjNZkanDSGDdY96uQT9EPe+wqSZwwgbFfKVJ5ti0+8rGAcKHColwKUvctBhq2LJ3A==
dependencies:
"@antfu/utils" "^0.7.4"
"@rollup/pluginutils" "^5.0.2"
chokidar "^3.5.3"
debug "^4.3.4"
fast-glob "^3.2.12"
local-pkg "^0.4.3"
magic-string "^0.30.0"
minimatch "^9.0.1"
resolve "^1.22.2"
unplugin "^1.3.1"
unplugin@^1.3.1:
version "1.3.2"
resolved "https://registry.npmmirror.com/unplugin/-/unplugin-1.3.2.tgz#899917d4c22e290ec5ef66c1a56577348a7693a2"
integrity sha512-Lh7/2SryjXe/IyWqx9K7IKwuKhuOFZEhotiBquOODsv2IVyDkI9lv/XhgfjdXf/xdbv32txmnBNnC/JVTDJlsA==
dependencies:
acorn "^8.9.0"
chokidar "^3.5.3"
webpack-sources "^3.2.3"
webpack-virtual-modules "^0.5.0"
update-browserslist-db@^1.0.11:
version "1.0.11"
resolved "https://registry.npmmirror.com/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz#9a2a641ad2907ae7b3616506f4b977851db5b940"
@ -1089,12 +1663,34 @@ vue@^3.3.4:
"@vue/server-renderer" "3.3.4"
"@vue/shared" "3.3.4"
webpack-sources@^3.2.3:
version "3.2.3"
resolved "https://registry.npmmirror.com/webpack-sources/-/webpack-sources-3.2.3.tgz#2d4daab8451fd4b240cc27055ff6a0c2ccea0cde"
integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==
webpack-virtual-modules@^0.5.0:
version "0.5.0"
resolved "https://registry.npmmirror.com/webpack-virtual-modules/-/webpack-virtual-modules-0.5.0.tgz#362f14738a56dae107937ab98ea7062e8bdd3b6c"
integrity sha512-kyDivFZ7ZM0BVOUteVbDFhlRt7Ah/CSPwJdi8hBpkK7QLumUqdLtVfm/PX/hkcnrvr0i77fO5+TjZ94Pe+C9iw==
wrappy@1:
version "1.0.2"
resolved "https://registry.npmmirror.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==
yallist@^3.0.2:
version "3.1.1"
resolved "https://registry.npmmirror.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd"
integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==
yaml@^2.1.1:
version "2.3.1"
resolved "https://registry.npmmirror.com/yaml/-/yaml-2.3.1.tgz#02fe0975d23cd441242aa7204e09fc28ac2ac33b"
integrity sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ==
zrender@5.4.3:
version "5.4.3"
resolved "https://registry.npmmirror.com/zrender/-/zrender-5.4.3.tgz#41ffaf835f3a3210224abd9d6964b48ff01e79f5"
integrity sha512-DRUM4ZLnoaT0PBVvGBDO9oWIDBKFdAVieNWxWwK0niYzJCMwGchRk21/hsE+RKkIveH3XHCyvXcJDkgLVvfizQ==
dependencies:
tslib "2.3.0"

View File

@ -9,6 +9,7 @@ require (
github.com/go-playground/locales v0.14.1
github.com/go-playground/universal-translator v0.18.1
github.com/go-playground/validator/v10 v10.14.1
github.com/goccy/go-json v0.10.2
github.com/gookit/goutil v0.6.11
github.com/mutecomm/go-sqlcipher/v4 v4.4.2
github.com/pelletier/go-toml/v2 v2.0.8
@ -38,7 +39,6 @@ require (
github.com/go-openapi/spec v0.20.4 // indirect
github.com/go-openapi/swag v0.19.15 // indirect
github.com/go-toast/toast v0.0.0-20190211030409-01e6764cf0a4 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/godbus/dbus/v5 v5.1.0 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/uuid v1.3.0 // indirect

View File

@ -2,43 +2,52 @@ package main
import (
"embed"
"skapp/pkg/env"
"skapp/pkg/sdk/system"
systemUtils "skapp/pkg/system"
"skapp/pkg/utils"
"github.com/wailsapp/wails/v2"
"github.com/wailsapp/wails/v2/pkg/options"
"github.com/wailsapp/wails/v2/pkg/options/assetserver"
"skapp/pkg/core"
"skapp/pkg/sdk/config"
"skapp/pkg/sdk/dialog"
"skapp/pkg/sdk/env"
fileSdk "skapp/pkg/sdk/file"
"skapp/pkg/sdk/file/duplicate"
"skapp/pkg/sdk/file/hash"
"skapp/pkg/sdk/system"
"skapp/pkg/sdk/utils"
)
//go:embed all:frontend/dist
var assets embed.FS
func main() {
defer func() {
system.DestroyFileManager()
}()
// Create an instance of the app structure
app := NewApp()
app := core.NewApp()
fileSupport := fileSdk.New()
hashSupport := hash.New(fileSupport)
duplicateSupport := duplicate.New(fileSupport, hashSupport)
// Create application with options
err := wails.Run(&options.App{
Title: "wails",
Width: 1024,
Height: 768,
AssetServer: &assetserver.Options{
Assets: assets,
Assets: assets,
Handler: app.Handler,
},
BackgroundColour: &options.RGBA{R: 255, G: 255, B: 255, A: 1},
OnStartup: app.startup,
OnBeforeClose: app.beforeClose,
OnShutdown: app.shutdown,
OnStartup: app.Startup,
OnBeforeClose: app.BeforeClose,
OnShutdown: app.Shutdown,
Bind: []interface{}{
app,
&env.Env{},
&utils.Utils{},
&systemUtils.InfoUtils{},
&system.InfoUtils{},
dialog.New(app),
&config.Support{},
fileSupport,
hashSupport,
duplicateSupport,
},
Debug: options.Debug{
OpenInspectorOnStartup: true,

View File

@ -1,4 +1,4 @@
package main
package core
import (
"context"
@ -32,13 +32,16 @@ func NewApp() *App {
app.load()
return app
}
func (a *App) Ctx() context.Context {
return a.ctx
}
func (a *App) ReloadApp() {
runtime.WindowReloadApp(a.ctx)
}
func (a *App) ForceClose() {
a.shutdown(a.ctx)
a.Shutdown(a.ctx)
os.Exit(0)
}
@ -68,9 +71,7 @@ func (a *App) load() {
a.Handler = engine.Handler()
}
// startup is called when the app starts. The context is saved
// so we can call the runtime methods
func (a *App) startup(ctx context.Context) {
func (a *App) Startup(ctx context.Context) {
if !global.Config.HasDebug() || !global.Config.Debug.Enable {
err := a.pidLock.Lock()
if err != nil {
@ -105,11 +106,11 @@ func (a *App) startup(ctx context.Context) {
}()
}
func (a *App) beforeClose(ctx context.Context) bool {
func (a *App) BeforeClose(ctx context.Context) bool {
return false
}
func (a *App) shutdown(ctx context.Context) {
func (a *App) Shutdown(ctx context.Context) {
ctx2, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()

View File

@ -0,0 +1,12 @@
package config
import (
"skapp/global"
"skapp/pkg/config"
)
type Support struct{}
func (s *Support) GetConfig() *config.Config {
return global.Config
}

View File

@ -0,0 +1,39 @@
package dialog
import (
"github.com/wailsapp/wails/v2/pkg/runtime"
"skapp/pkg/core"
)
func New(app *core.App) *Support {
return &Support{app}
}
type Support struct {
app *core.App
}
func (s *Support) OpenFileDialog(dialogOptions runtime.OpenDialogOptions) string {
path, _ := runtime.OpenFileDialog(s.app.Ctx(), dialogOptions)
return path
}
func (s *Support) OpenMultipleFilesDialog(dialogOptions runtime.OpenDialogOptions) []string {
path, _ := runtime.OpenMultipleFilesDialog(s.app.Ctx(), dialogOptions)
return path
}
func (s *Support) OpenDirectoryDialog(dialogOptions runtime.OpenDialogOptions) string {
path, _ := runtime.OpenDirectoryDialog(s.app.Ctx(), dialogOptions)
return path
}
func (s *Support) SaveFileDialog(dialogOptions runtime.SaveDialogOptions) string {
path, _ := runtime.SaveFileDialog(s.app.Ctx(), dialogOptions)
return path
}
func (s *Support) MessageDialog(dialogOptions runtime.MessageDialogOptions) string {
path, _ := runtime.MessageDialog(s.app.Ctx(), dialogOptions)
return path
}

View File

@ -0,0 +1,28 @@
package downloader
import (
"fmt"
"log"
"os"
"testing"
"time"
)
func TestDownloader(t *testing.T) {
url := "https://mirrors.tuna.tsinghua.edu.cn/Adoptium/8/jdk/x64/windows/OpenJDK8U-jdk_x64_windows_hotspot_8u382b05.zip"
dir := os.TempDir()
fmt.Println(dir)
fileName := "OpenJDK8U-jdk_x64_windows_hotspot_8u382b05.zip"
a, _ := getRedirectInfo(url, UserAgent)
location := a.Header.Get("Location")
if len(location) == 0 {
location = url
}
startTime := time.Now()
d := NewDownloader(location, dir, fileName, 5)
if err := d.Run(); err != nil {
log.Fatal(err)
}
fmt.Printf("\n 文件下载完成耗时: %f second\n", time.Now().Sub(startTime).Seconds())
}

View File

@ -0,0 +1,285 @@
package downloader
import (
"bytes"
"errors"
"fmt"
"io"
"log"
"mime"
"net/http"
"net/url"
"os"
"path/filepath"
"strconv"
"sync"
)
const UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36"
// PartFile 文件切片
type PartFile struct {
Index int64
From int64
To int64
Data []byte
Done bool
}
type Downloader struct {
FileSize int64
Url string
FileName string
Path string
PartNum int64
donePart []PartFile
}
// NewDownloader 创建下载器
func NewDownloader(url, outputDir, outputFileName string, partNum int64) *Downloader {
if outputDir == "" {
wd, err := os.Getwd() //获取当前工作目录
if err != nil {
log.Println(err)
}
outputDir = wd
}
return &Downloader{
FileSize: 0,
Url: url,
FileName: outputFileName,
Path: outputDir,
PartNum: partNum,
donePart: make([]PartFile, partNum),
}
}
func (d *Downloader) getNewRequest(method string) (*http.Request, error) {
req, err := http.NewRequest(
method,
d.Url,
nil)
return req, err
}
func (d *Downloader) head() (int64, error) {
req, err := d.getNewRequest(http.MethodHead)
req = setNewHeader(req)
if err != nil {
return 0, err
}
resp, err := http.DefaultClient.Do(req)
if err != nil {
return 0, err
}
if resp.StatusCode > 299 {
return 0, errors.New(fmt.Sprintf("Can't process, response is %v", resp.StatusCode))
}
if resp.Header.Get("Accept-Ranges") != "bytes" {
return 0, errors.New("服务器不支持文件断点续传")
}
d.FileName = GetFileInfoFromResponse(resp)
length, err := strconv.Atoi(resp.Header.Get("Content-Length"))
return int64(length), err
}
// 下载切片
func (d *Downloader) downloadPart(c PartFile, f *os.File) error {
r, err := d.getNewRequest("GET")
r = setNewHeader(r)
if err != nil {
return err
}
log.Printf("开始[%d]下载from:%d to:%d\n", c.Index, c.From, c.To)
r.Header.Set("Range", fmt.Sprintf("bytes=%v-%v", c.From, c.To))
resp, err := http.DefaultClient.Do(r)
if err != nil {
return err
}
if resp.StatusCode > 299 {
return errors.New(fmt.Sprintf("服务器错误状态码: %v", resp.StatusCode))
}
defer func(Body io.ReadCloser) {
_ = Body.Close()
}(resp.Body)
bs, err := io.ReadAll(resp.Body)
if err != nil {
return err
}
if len(bs) != int(c.To-c.From+1) {
}
c.Data = bs
c.Done = true
d.donePart[c.Index] = c
_, err = f.WriteAt(bs, c.From)
if err != nil {
c.Done = true
}
log.Printf("结束[%d]下载", c.Index)
return err
}
func (d *Downloader) checkIntegrity(t *os.File) error {
log.Println("开始合并文件")
totalSize := 0
for _, s := range d.donePart {
//hash.Write(s.Data)
totalSize += len(s.Data)
}
if int64(totalSize) != d.FileSize {
return errors.New("文件不完整")
}
_ = t.Close()
return os.Rename(filepath.Join(d.Path, d.FileName+".tmp"), filepath.Join(d.Path, d.FileName))
}
// Run 开始下载任务
func (d *Downloader) Run() error {
fileTotalSize, err := d.head()
if err != nil {
return err
}
d.FileSize = fileTotalSize
jobs := make([]PartFile, d.PartNum)
eachSize := fileTotalSize / d.PartNum
path := filepath.Join(d.Path, d.FileName+".tmp")
tmpFile := new(os.File)
fByte := make([]byte, d.FileSize)
if exists(path) {
tmpFile, err = os.OpenFile(path, os.O_RDWR|os.O_TRUNC|os.O_CREATE, 0)
if err != nil {
return err
}
fByte, err = io.ReadAll(tmpFile)
} else {
tmpFile, err = os.Create(path)
}
if err != nil {
return err
}
defer func(tmpFile *os.File) {
_ = tmpFile.Close()
}(tmpFile)
for i := range jobs {
i64 := int64(i)
jobs[i64].Index = i64
if i == 0 {
jobs[i64].From = 0
} else {
jobs[i64].From = jobs[i64-1].To + 1
}
if i64 < d.PartNum-1 {
jobs[i64].To = jobs[i64].From + eachSize
} else {
//the last filePart
jobs[i64].To = fileTotalSize - 1
}
}
for i, j := range jobs {
tmpJob := j
emptyTmp := make([]byte, tmpJob.To-j.From)
if bytes.Compare(emptyTmp, fByte[tmpJob.From:j.To]) != 0 {
tmpJob.Data = fByte[j.From : j.To+1]
tmpJob.Done = true
d.donePart[tmpJob.Index] = tmpJob
} else {
tmpJob.Done = false
}
jobs[i] = tmpJob
}
var wg sync.WaitGroup
for _, j := range jobs {
if !j.Done {
wg.Add(1)
go func(job PartFile) {
defer wg.Done()
err := d.downloadPart(job, tmpFile)
if err != nil {
log.Println("下载文件失败:", err, job)
}
}(j)
}
}
wg.Wait()
return d.checkIntegrity(tmpFile)
}
func getRedirectInfo(u, userAgent string) (*http.Response, error) {
log.Println("获取重定向信息")
var a *url.URL
a, _ = url.Parse(u)
header := http.Header{}
//header.Add("Cookie", rawCookies)
header.Add("User-Agent", userAgent)
request := http.Request{
Header: header,
Method: "GET",
URL: a,
}
client := &http.Client{
CheckRedirect: func(req *http.Request, via []*http.Request) error {
return http.ErrUseLastResponse
},
}
response, err := client.Do(&request)
if err != nil {
return nil, err
}
return response, nil
}
func setNewHeader(r *http.Request) *http.Request {
r.Header.Add("User-Agent", UserAgent)
r.Header.Add("Upgrade-Insecure-Requests", "1")
return r
}
func exists(path string) bool {
_, err := os.Stat(path) //os.Stat获取文件信息
if err != nil {
if os.IsExist(err) {
return true
}
return false
}
return true
}
func GetFileInfoFromResponse(resp *http.Response) string {
contentDisposition := resp.Header.Get("Content-Disposition")
if contentDisposition != "" {
_, params, err := mime.ParseMediaType(contentDisposition)
if err != nil {
panic(err)
}
return params["filename"]
}
filename := filepath.Base(resp.Request.URL.Path)
return filename
}

View File

@ -0,0 +1,13 @@
package downloader
import "skapp/pkg/core"
type Support struct {
app *core.App
}
func New(app *core.App) *Support {
return &Support{
app,
}
}

View File

@ -0,0 +1,86 @@
package duplicate
import (
"bufio"
"io/fs"
"os"
"path/filepath"
"skapp/pkg/sdk/file/hash"
"skapp/pkg/logger"
fileSdk "skapp/pkg/sdk/file"
)
var log = logger.Log
type Support struct {
fileSupport *fileSdk.Support
hash *hash.Support
}
func New(fileSupport *fileSdk.Support, hash *hash.Support) *Support {
return &Support{fileSupport, hash}
}
var (
maxReadSize int64 = 1024 * 1024 * 5
chunkSize = 1024 * 1024
)
// RecursiveScan 递归 目录下需要扫描的文件
func (s *Support) RecursiveScan(dir string, addFile bool, addDir bool) []string {
//nodeModules, _ := regexp.Compile("node_modules")
//if nodeModules.Match([]byte(dir)) {
// return []string{}
//}
files := make([]string, 0)
fileMap := make(map[string]bool)
//suffixReg, _ := regexp.Compile(".*[\\.j(t)s|\\.vue|\\.jsx|\\.tsx]$")
absPath, _ := filepath.Abs(dir)
_ = filepath.Walk(absPath, func(file string, info fs.FileInfo, err error) error {
if info.Mode() == os.ModeSymlink {
file, err = os.Readlink(file)
s.RecursiveScan(file, addFile, addDir)
return err
}
if addFile {
if s.fileSupport.IsFile(file) {
//if suffixReg.Match([]byte(file)) {
log.Infof("[扫描文件] 添加扫描文件 %s", file)
fileMap[file] = true
//}
}
}
if addDir {
if s.fileSupport.IsDir(file) {
log.Infof("[扫描文件] 添加扫描文件夹 %s", file)
fileMap[file] = true
}
}
return nil
})
files = make([]string, 0, len(fileMap))
for file := range fileMap {
files = append(files, file)
}
return files
}
func Reader(file *os.File) *bufio.Reader {
return bufio.NewReaderSize(file, chunkSize)
}
func (s *Support) CalcSHA1(path string) (sha1hex string, err error) {
return s.hash.CalcSHA1(path, maxReadSize)
}
func (s *Support) CalcMD5(path string) (md5hex string, err error) {
return s.hash.CalcMD5(path, maxReadSize)
}

View File

@ -0,0 +1,79 @@
package file
import (
"errors"
"fmt"
"io"
"os"
"path/filepath"
"skapp/pkg/utils/json"
)
type Support struct {
}
func New() *Support {
return &Support{}
}
func (s *Support) IsFile(path string) bool {
info, err := os.Stat(path)
if err != nil {
return false
}
return !info.IsDir()
}
func (s *Support) IsDir(path string) bool {
info, err := os.Stat(path)
if err != nil {
return false
}
return info.IsDir()
}
func (s *Support) CopyN(w io.Writer, path string, n int64) (int64, error) {
if s.IsDir(path) {
return 0, errors.New(fmt.Sprintf("%s 为文件夹", path))
}
file, err := os.Open(path)
defer func(file *os.File) {
_ = file.Close()
}(file)
if err != nil {
return 0, err
}
info, _ := file.Stat()
if n <= 0 {
return io.Copy(w, file)
}
if info.Size() < n {
return io.Copy(w, file)
} else {
return io.CopyN(w, file, n)
}
}
func (s *Support) SaveJSONFile(filePath string, data interface{}) error {
if !filepath.IsAbs(filePath) {
root, _ := os.Getwd()
filePath = filepath.Join(root, filePath)
}
jsonFile, err := os.OpenFile(filePath, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0644)
defer func(scmF *os.File) {
_ = scmF.Close()
}(jsonFile)
if err != nil {
return err
}
_, err = jsonFile.WriteString(json.Json(data))
return err
}

View File

@ -0,0 +1,80 @@
package hash
import (
"crypto/md5"
"crypto/sha1"
"crypto/sha256"
"crypto/sha512"
"encoding/hex"
"hash/crc32"
"hash/crc64"
fileSdk "skapp/pkg/sdk/file"
)
type Support struct {
fileSupport *fileSdk.Support
}
func New(fileSupport *fileSdk.Support) *Support {
return &Support{fileSupport}
}
func (s *Support) CalcCRC32(path string, readSize int64) (hash string, err error) {
h := crc32.NewIEEE()
_, err = s.fileSupport.CopyN(h, path, readSize)
if err != nil {
return "", err
}
return hex.EncodeToString(h.Sum(nil)), nil
}
func (s *Support) CalcCRC64(path string, readSize int64) (hash string, err error) {
h := crc64.New(crc64.MakeTable(crc64.ECMA))
_, err = s.fileSupport.CopyN(h, path, readSize)
if err != nil {
return "", err
}
return hex.EncodeToString(h.Sum(nil)), nil
}
func (s *Support) CalcSHA512(path string, readSize int64) (hash string, err error) {
h := sha512.New()
_, err = s.fileSupport.CopyN(h, path, readSize)
if err != nil {
return "", err
}
return hex.EncodeToString(h.Sum(nil)), nil
}
func (s *Support) CalcSHA256(path string, readSize int64) (hash string, err error) {
h := sha256.New()
_, err = s.fileSupport.CopyN(h, path, readSize)
if err != nil {
return "", err
}
return hex.EncodeToString(h.Sum(nil)), nil
}
func (s *Support) CalcSHA1(path string, readSize int64) (hash string, err error) {
h := sha1.New()
_, err = s.fileSupport.CopyN(h, path, readSize)
if err != nil {
return "", err
}
return hex.EncodeToString(h.Sum(nil)), nil
}
func (s *Support) CalcMD5(path string, readSize int64) (hash string, err error) {
h := md5.New()
_, err = s.fileSupport.CopyN(h, path, readSize)
if err != nil {
return "", err
}
return hex.EncodeToString(h.Sum(nil)), nil
}

View File

@ -1,168 +0,0 @@
package file
import (
"io/fs"
"os"
"path/filepath"
"skapp/pkg/logger"
"sync"
)
type Manager struct {
FileManager *sync.Map
lock *sync.RWMutex
}
func NewManager() *Manager {
return &Manager{
FileManager: &sync.Map{},
lock: &sync.RWMutex{},
}
}
func (m *Manager) Len() (count int64) {
defer func() {
m.lock.RUnlock()
}()
m.lock.RLock()
m.Each(func(file *os.File) bool {
count++
return true
})
return
}
func (m *Manager) Each(cb func(*os.File) bool) {
defer func() {
m.lock.RUnlock()
}()
m.lock.RLock()
m.FileManager.Range(func(key, value any) bool {
flagManager := value.(*sync.Map)
flagManager.Range(func(key, value any) bool {
fileModeManager := value.(*sync.Map)
fileModeManager.Range(func(key, value any) bool {
f := (value).(*os.File)
return cb(f)
})
return true
})
return true
})
}
func (m *Manager) Remove(path string, flag int, perm fs.FileMode) {
if m.Get(path, flag, perm) == nil {
return
}
defer func() {
m.lock.Unlock()
}()
m.lock.Lock()
absPath, err := filepath.Abs(path)
if err != nil {
return
}
logger.Log.Infof("Remove %+v %+v %+v\n", absPath, flag, perm)
var value interface{}
value, _ = m.FileManager.Load(absPath)
flagManager := value.(*sync.Map)
value, _ = flagManager.Load(flag)
fileModeManager := value.(*sync.Map)
value, _ = fileModeManager.LoadAndDelete(perm.String())
f := value.(*os.File)
_ = f.Close()
}
func (m *Manager) Get(path string, flag int, perm fs.FileMode) *os.File {
defer func() {
m.lock.RUnlock()
}()
m.lock.RLock()
absPath, err := filepath.Abs(path)
if err != nil {
return nil
}
logger.Log.Infof("Get %+v %+v %+v\n", absPath, flag, perm)
value, ok := m.FileManager.Load(absPath)
if !ok {
return nil
}
switch flagManager := value.(type) {
case *sync.Map:
value, ok := flagManager.Load(flag)
if !ok {
return nil
}
switch fileModeManager := value.(type) {
case *sync.Map:
f, ok := fileModeManager.Load(perm.String())
if !ok {
return nil
}
return f.(*os.File)
}
}
return nil
}
func (m *Manager) Close() {
m.Each(func(f *os.File) bool {
_ = f.Close()
return true
})
}
func (m *Manager) Set(file *os.File, path string, flag int, perm fs.FileMode) {
defer func() {
m.lock.Unlock()
}()
m.lock.Lock()
absPath, err := filepath.Abs(path)
if err != nil {
return
}
logger.Log.Infof("Set %+v %+v %+v\n", absPath, flag, perm)
value, ok := m.FileManager.Load(path)
if !ok {
flagManager := sync.Map{}
fileModeManager := sync.Map{}
fileModeManager.Store(perm.String(), file)
flagManager.Store(flag, &fileModeManager)
m.FileManager.Store(absPath, &flagManager)
return
}
switch flagManager := value.(type) {
case *sync.Map:
value, ok := flagManager.Load(flag)
if !ok {
fileModeManager := sync.Map{}
fileModeManager.Store(perm.String(), file)
flagManager.Store(flag, &fileModeManager)
}
switch fileModeManager := value.(type) {
case *sync.Map:
_, ok := fileModeManager.Load(perm.String())
if !ok {
fileModeManager.Store(perm.String(), file)
}
}
}
}

View File

@ -1,11 +0,0 @@
package system
import (
"skapp/pkg/sdk/system/file"
)
var FileManager = file.NewManager()
func DestroyFileManager() {
FileManager.Close()
}

View File

@ -1,75 +0,0 @@
package system
import (
"os"
"path/filepath"
"sync"
"testing"
)
var wg = sync.WaitGroup{}
func TestAppendFileManager(t *testing.T) {
defer func() {
DestroyFileManager()
}()
path := "./io.go"
absPath, err := filepath.Abs(path)
if err != nil {
t.Fatal(err)
}
_, err = os.Stat(absPath)
if err != nil {
t.Fatal(err)
}
f, err := os.OpenFile(absPath, os.O_RDONLY, 0644)
if err != nil {
t.Fatal(err)
}
FileManager.Set(f, absPath, os.O_RDONLY, 0644)
t.Logf("文件数量: %d", FileManager.Len())
for i := 0; i < 10; i++ {
wg.Add(1)
go func(i int, t *testing.T) {
f := FileManager.Get(absPath, os.O_RDONLY, 0644)
if f != nil {
t.Log(f.Stat())
}
if i == 5 {
FileManager.Remove(absPath, os.O_RDONLY, 0644)
}
wg.Done()
}(i, t)
}
wg.Wait()
}
func TestManager(t *testing.T) {
path := "./io.go"
absPath, err := filepath.Abs(path)
if err != nil {
t.Fatal(err)
}
_, err = os.Stat(absPath)
if err != nil {
t.Fatal(err)
}
f, err := os.OpenFile(absPath, os.O_RDONLY, 0644)
if err != nil {
t.Fatal(err)
}
FileManager.Set(f, absPath, os.O_RDONLY, 0644)
f = FileManager.Get(absPath, 0, 0644)
t.Log(f.Name())
}

View File

@ -0,0 +1,15 @@
package system
import (
"github.com/shirou/gopsutil/net"
)
func (i *InfoUtils) GetNetWorkConnection() []net.ConnectionStat {
info, _ := net.Connections("all")
return info
}
func (i *InfoUtils) GetNetworkCounter(all bool) []net.IOCountersStat {
info, _ := net.IOCounters(!all)
return info
}

View File

@ -0,0 +1,56 @@
package system
import (
"github.com/shirou/gopsutil/process"
"os"
)
func (i *InfoUtils) GetCurrentPid() int {
return os.Getpid()
}
func (i *InfoUtils) GetAllProcessPid() []int32 {
pidList, _ := process.Pids()
return pidList
}
type ProcessDTO struct {
Pid int32 `json:"pid"`
Name string `json:"name"`
Parent int32 `json:"parent"`
Status string `json:"status"`
CreateTime int64 `json:"createTime"`
}
func (i *InfoUtils) process2ProcessDTO(p *process.Process) *ProcessDTO {
d := &ProcessDTO{
Pid: p.Pid,
Name: "",
Parent: 0,
Status: "",
CreateTime: 0,
}
d.Name, _ = p.Name()
parent, _ := p.Parent()
if parent != nil {
d.Parent = parent.Pid
}
d.CreateTime, _ = p.CreateTime()
d.Status, _ = p.Status()
return d
}
func (i *InfoUtils) GetProcessInfo(pid int32) *ProcessDTO {
info, _ := process.NewProcess(pid)
return i.process2ProcessDTO(info)
}
func (i *InfoUtils) GetProcesses() []*ProcessDTO {
info, _ := process.Processes()
dto := make([]*ProcessDTO, 0)
for _, p := range info {
dto = append(dto, i.process2ProcessDTO(p))
}
return dto
}

View File

@ -1,68 +1,4 @@
package system
import (
"io/fs"
"os"
"path/filepath"
)
type System struct{}
func (s *System) GetFileInfo(path string) (os.FileInfo, error) {
f, err := os.OpenFile(path, os.O_RDONLY, 0644)
defer func(f *os.File) {
_ = f.Close()
}(f)
if err != nil {
return nil, err
}
return f.Stat()
}
func (s *System) OpenFile(path string, flag int, perm fs.FileMode) (*os.File, error) {
absPath, err := filepath.Abs(path)
if err != nil {
return nil, err
}
_, err = os.Stat(absPath)
if err != nil {
return nil, err
}
f, err := os.OpenFile(absPath, flag, perm)
FileManager.Set(f, absPath, flag, perm)
return f, err
}
func (s *System) ReadFile(path string, chunkId int64, chunkSize int64) ([]byte, error) {
f := FileManager.Get(path, os.O_RDONLY, fs.FileMode(0644))
if f == nil {
return nil, os.ErrClosed
}
info, err := f.Stat()
size := info.Size()
if err != nil {
return nil, err
}
offset := chunkId * chunkSize
if offset+chunkSize > size {
chunkSize = size - offset
}
data := make([]byte, chunkSize)
_, err = f.ReadAt(data, offset)
if err != nil {
return nil, err
}
return data, nil
}
func (s *System) CloseFile(path string, flag int, perm fs.FileMode) {
FileManager.Remove(path, flag, perm)
type InfoUtils struct {
}

View File

@ -4,7 +4,7 @@ import (
"fmt"
"log"
"path/filepath"
"skapp/pkg/utils"
"skapp/pkg/sdk/utils"
"xorm.io/xorm"
)

View File

@ -1,8 +0,0 @@
package system
import "github.com/shirou/gopsutil/net"
func (i *InfoUtils) GetNetWorkConnection() []net.ConnectionStat {
info, _ := net.Connections("all")
return info
}

View File

@ -1,13 +0,0 @@
package system
import "github.com/shirou/gopsutil/process"
func (i *InfoUtils) GetAllProcessPid() []int32 {
pidList, _ := process.Pids()
return pidList
}
func (i *InfoUtils) GetProcessInfo(pid int32) *process.Process {
info, _ := process.NewProcess(pid)
return info
}

View File

@ -1,4 +0,0 @@
package system
type InfoUtils struct {
}

View File

@ -0,0 +1,10 @@
package json
import (
"github.com/goccy/go-json"
)
func Json(data interface{}) string {
jsonBytes, _ := json.MarshalIndent(data, "", " ")
return string(jsonBytes)
}

View File

@ -19,6 +19,13 @@ spring:
password: 12341234
url: jdbc:mysql://10.10.10.200:3306/matrix_v2?createDatabaseIfNotExist=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
# jdbc-url: jdbc:mysql://10.10.10.100:3306/matrix?createDatabaseIfNotExist=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
initial-size: 5
min-idle: 5
maxWait: 60000
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
validationQuery: SELECT 1
rules:
sharding:

View File

@ -37,12 +37,20 @@ spring:
datasource:
names: ds
ds:
# type: com.zaxxer.hikari.HikariDataSource
# type: com.zaxxer.hikari.HikariDataSource
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
username: root
password: 12341234
url: jdbc:mysql://10.10.10.200:3306/matrix_v2?createDatabaseIfNotExist=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true
initial-size: 5
min-idle: 5
maxWait: 60000
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
validationQuery: SELECT 1
# jdbc-url: jdbc:mysql://10.10.10.100:3306/matrix?createDatabaseIfNotExist=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
rules: