feat: Adapt to Offline Mode (#10472)

This commit is contained in:
CityFun
2025-09-24 17:40:44 +08:00
committed by GitHub
parent 672fedc7e5
commit 384f065040
3 changed files with 8 additions and 3 deletions
+1 -1
View File
@@ -107,7 +107,7 @@ func (a AppService) PageApp(ctx *gin.Context, req request.AppSearch) (interface{
lang := strings.ToLower(common.GetLang(ctx))
for _, ap := range apps {
if req.Type == "php" {
if ap.RequiredPanelVersion == 0 || !common.CompareAppVersion(common.GetSystemVersion(info.SystemVersion), fmt.Sprintf("%f", ap.RequiredPanelVersion)) {
if !global.CONF.Base.IsOffLine && (ap.RequiredPanelVersion == 0 || !common.CompareAppVersion(common.GetSystemVersion(info.SystemVersion), fmt.Sprintf("%f", ap.RequiredPanelVersion))) {
continue
}
}
+2 -2
View File
@@ -9,7 +9,7 @@
]"
>
<template #route-button>
<div class="router-button">
<div class="router-button" v-if="!isOffLine">
<template v-if="!isProductPro">
<el-button link type="primary" @click="toUpload">
{{ $t('license.levelUpPro') }}
@@ -350,7 +350,7 @@ const netOptions = ref();
const licenseRef = ref();
const quickJumpRef = ref();
const { isProductPro } = storeToRefs(globalStore);
const { isProductPro, isOffLine } = storeToRefs(globalStore);
const searchInfo = reactive({
ioOption: 'all',
@@ -34,6 +34,8 @@
import { App } from '@/api/interface/app';
import { getAppByKey, getAppDetail, searchApp } from '@/api/modules/app';
import { useVModel } from '@vueuse/core';
import { useGlobalStore } from '@/composables/useGlobalStore';
const { isOffLine } = useGlobalStore();
const props = defineProps({
mode: {
@@ -91,6 +93,9 @@ const getApp = async (appkey: string, mode: string) => {
const searchAppList = async (appID: number) => {
try {
if (isOffLine) {
appReq.resource = 'custom';
}
const res = await searchApp(appReq);
apps.value = res.data.items || [];
if (res.data && res.data.items && res.data.items.length > 0) {