ping功能完善
This commit is contained in:
parent
b09380bc22
commit
9888e310dc
9
.env
9
.env
@ -1,8 +1,8 @@
|
||||
# Glob API URL
|
||||
VITE_GLOB_API_URL=/api
|
||||
|
||||
# VITE_APP_API_BASE_URL=http://127.0.0.1:3002/
|
||||
VITE_APP_API_BASE_URL=http://sunpaneldemo.enianteam.com
|
||||
VITE_APP_API_BASE_URL=http://127.0.0.1:3002/
|
||||
# VITE_APP_API_BASE_URL=http://sunpaneldemo.enianteam.com
|
||||
# Whether long replies are supported, which may result in higher API fees
|
||||
VITE_GLOB_OPEN_LONG_REPLY=false
|
||||
|
||||
@ -11,4 +11,7 @@ VITE_GLOB_APP_PWA=false
|
||||
|
||||
|
||||
|
||||
VITE_APP_VERSION=20240318
|
||||
|
||||
|
||||
|
||||
VITE_APP_VERSION=20240319
|
@ -2,7 +2,7 @@
|
||||
FROM node AS web_image
|
||||
|
||||
# 华为源
|
||||
# RUN npm config set registry https://repo.huaweicloud.com/repository/npm/
|
||||
# RUN npm config set registry https://registry.npmmirror.com/
|
||||
|
||||
RUN npm install pnpm -g
|
||||
|
||||
@ -10,7 +10,7 @@ WORKDIR /build
|
||||
|
||||
COPY ./package.json /build
|
||||
|
||||
COPY ./pnpm-lock.yaml /build
|
||||
# COPY ./pnpm-lock.yaml /build
|
||||
|
||||
RUN pnpm install
|
||||
|
||||
|
@ -51,10 +51,10 @@ const textColor = computed(() => {
|
||||
<!-- 文字 -->
|
||||
<!-- 如果为纯白色,将自动根据背景的明暗计算字体的黑白色 -->
|
||||
<div class="text-white flex items-center"
|
||||
:style="{ color: (iconTextColor === '#ffffff') ? textColor : iconTextColor, maxWidth: 'calc(100% - 80px)', flex: 1,position: 'relative' }">
|
||||
:style="{ color: (iconTextColor === '#ffffff') ? textColor : iconTextColor, maxWidth: 'calc(100% - 80px)', flex: 1, position: 'relative' }">
|
||||
<transition name="fade">
|
||||
|
||||
<div class="badge" v-if="itemInfo?.time">{{ itemInfo?.time }}</div> <!-- 这里的数字表示未读数 -->
|
||||
<div class="badge" v-if="itemInfo?.time">{{ itemInfo?.time }}</div> <!-- 这里的数字表示未读数 -->
|
||||
</transition>
|
||||
<div class="app-icon-info-text-box w-full">
|
||||
<div class="app-icon-info-text-box-title font-semibold w-full">
|
||||
@ -72,7 +72,12 @@ const textColor = computed(() => {
|
||||
</div>
|
||||
|
||||
<!-- 极简(小)图标(APP) -->
|
||||
<div v-if="style === PanelPanelConfigStyleEnum.icon" class="app-icon-small">
|
||||
<div v-if="style === PanelPanelConfigStyleEnum.icon" class="app-icon-small" style="position: relative;">
|
||||
<transition name="fade">
|
||||
|
||||
<div class="badge" v-if="itemInfo?.time" style="right: 12px;">{{ itemInfo?.time }}</div> <!-- 这里的数字表示未读数 -->
|
||||
</transition>
|
||||
|
||||
<div
|
||||
class="app-icon-small-icon overflow-hidden rounded-2xl sunpanel w-[70px] h-[70px] mx-auto rounded-2xl transition-all duration-200 hover:shadow-[0_0_20px_10px_rgba(0,0,0,0.2)]"
|
||||
:title="itemInfo?.description">
|
||||
@ -101,14 +106,19 @@ const textColor = computed(() => {
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
font-size: 12px;
|
||||
mix-blend-mode: difference; /* 设置文字与背景色反色 */
|
||||
mix-blend-mode: difference;
|
||||
/* 设置文字与背景色反色 */
|
||||
|
||||
/* 设置徽章内文本的大小 */
|
||||
}
|
||||
.fade-enter-active, .fade-leave-active {
|
||||
|
||||
.fade-enter-active,
|
||||
.fade-leave-active {
|
||||
transition: opacity 0.5s;
|
||||
}
|
||||
.fade-enter, .fade-leave-to {
|
||||
|
||||
.fade-enter,
|
||||
.fade-leave-to {
|
||||
opacity: 0;
|
||||
}
|
||||
</style>
|
@ -322,7 +322,7 @@ function handleSetSortStatus(groupIndex: number, sortStatus: boolean) {
|
||||
}
|
||||
async function usePing(params: any, itemGroupIndex: any) {
|
||||
const isflag = isLocalUrl(window.location.origin)
|
||||
const promises = params.items.map(async (e: any, i: number) => {
|
||||
params.items.map(async (e: any, i: number) => {
|
||||
if (isflag && e.lanUrl) {
|
||||
const time = await ping(e.lanUrl)
|
||||
//@ts-ignore
|
||||
|
@ -7,6 +7,7 @@ import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
|
||||
|
||||
function setupPlugins(env: ImportMetaEnv): PluginOption[] {
|
||||
return [
|
||||
//@ts-ignore
|
||||
vue(),
|
||||
env.VITE_GLOB_APP_PWA === 'true' && VitePWA({
|
||||
injectRegister: 'auto',
|
||||
|
Loading…
x
Reference in New Issue
Block a user