mirror of
https://github.com/langbot-app/LangBot.git
synced 2025-11-25 19:37:36 +08:00
feat: available for disabling marketplace(offline env)
This commit is contained in:
@@ -14,6 +14,7 @@ class SystemRouterGroup(group.RouterGroup):
|
|||||||
'version': constants.semantic_version,
|
'version': constants.semantic_version,
|
||||||
'debug': constants.debug_mode,
|
'debug': constants.debug_mode,
|
||||||
'enabled_platform_count': len(self.ap.platform_mgr.get_running_adapters()),
|
'enabled_platform_count': len(self.ap.platform_mgr.get_running_adapters()),
|
||||||
|
'enable_marketplace': self.ap.instance_config.data['plugin'].get('enable_marketplace', True),
|
||||||
'cloud_service_url': (
|
'cloud_service_url': (
|
||||||
self.ap.instance_config.data['plugin']['cloud_service_url']
|
self.ap.instance_config.data['plugin']['cloud_service_url']
|
||||||
if 'cloud_service_url' in self.ap.instance_config.data['plugin']
|
if 'cloud_service_url' in self.ap.instance_config.data['plugin']
|
||||||
|
|||||||
@@ -21,4 +21,5 @@ system:
|
|||||||
secret: ''
|
secret: ''
|
||||||
plugin:
|
plugin:
|
||||||
runtime_ws_url: 'ws://langbot_plugin_runtime:5400/control/ws'
|
runtime_ws_url: 'ws://langbot_plugin_runtime:5400/control/ws'
|
||||||
|
enable_marketplace: true
|
||||||
cloud_service_url: 'https://space.langbot.app'
|
cloud_service_url: 'https://space.langbot.app'
|
||||||
@@ -33,6 +33,7 @@ import { httpClient } from '@/app/infra/http/HttpClient';
|
|||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { PluginV4 } from '@/app/infra/entities/plugin';
|
import { PluginV4 } from '@/app/infra/entities/plugin';
|
||||||
|
import { systemInfo } from '@/app/infra/http/HttpClient';
|
||||||
|
|
||||||
enum PluginInstallStatus {
|
enum PluginInstallStatus {
|
||||||
WAIT_INPUT = 'wait_input',
|
WAIT_INPUT = 'wait_input',
|
||||||
@@ -213,9 +214,11 @@ export default function PluginConfigPage() {
|
|||||||
<TabsTrigger value="installed" className="px-6 py-4 cursor-pointer">
|
<TabsTrigger value="installed" className="px-6 py-4 cursor-pointer">
|
||||||
{t('plugins.installed')}
|
{t('plugins.installed')}
|
||||||
</TabsTrigger>
|
</TabsTrigger>
|
||||||
<TabsTrigger value="market" className="px-6 py-4 cursor-pointer">
|
{systemInfo.enable_marketplace && (
|
||||||
{t('plugins.marketplace')}
|
<TabsTrigger value="market" className="px-6 py-4 cursor-pointer">
|
||||||
</TabsTrigger>
|
{t('plugins.marketplace')}
|
||||||
|
</TabsTrigger>
|
||||||
|
)}
|
||||||
</TabsList>
|
</TabsList>
|
||||||
|
|
||||||
<div className="flex flex-row justify-end items-center">
|
<div className="flex flex-row justify-end items-center">
|
||||||
@@ -241,14 +244,16 @@ export default function PluginConfigPage() {
|
|||||||
<UploadIcon className="w-4 h-4" />
|
<UploadIcon className="w-4 h-4" />
|
||||||
{t('plugins.uploadLocal')}
|
{t('plugins.uploadLocal')}
|
||||||
</DropdownMenuItem>
|
</DropdownMenuItem>
|
||||||
<DropdownMenuItem
|
{systemInfo.enable_marketplace && (
|
||||||
onClick={() => {
|
<DropdownMenuItem
|
||||||
setActiveTab('market');
|
onClick={() => {
|
||||||
}}
|
setActiveTab('market');
|
||||||
>
|
}}
|
||||||
<StoreIcon className="w-4 h-4" />
|
>
|
||||||
{t('plugins.marketplace')}
|
<StoreIcon className="w-4 h-4" />
|
||||||
</DropdownMenuItem>
|
{t('plugins.marketplace')}
|
||||||
|
</DropdownMenuItem>
|
||||||
|
)}
|
||||||
</DropdownMenuContent>
|
</DropdownMenuContent>
|
||||||
</DropdownMenu>
|
</DropdownMenu>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -212,6 +212,7 @@ export interface ApiRespSystemInfo {
|
|||||||
debug: boolean;
|
debug: boolean;
|
||||||
version: string;
|
version: string;
|
||||||
cloud_service_url: string;
|
cloud_service_url: string;
|
||||||
|
enable_marketplace: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ApiRespAsyncTasks {
|
export interface ApiRespAsyncTasks {
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { ApiRespSystemInfo } from '@/app/infra/entities/api';
|
|||||||
export let systemInfo: ApiRespSystemInfo = {
|
export let systemInfo: ApiRespSystemInfo = {
|
||||||
debug: false,
|
debug: false,
|
||||||
version: '',
|
version: '',
|
||||||
|
enable_marketplace: true,
|
||||||
cloud_service_url: '',
|
cloud_service_url: '',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user