mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2026-10-02 00:00:06 +00:00
feat: Adapt to Offline Mode (#10472)
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user