mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-07-24 21:36:06 +00:00
committed by
GitHub
parent
2bf94539bd
commit
5abbcb62a2
@@ -9,7 +9,7 @@ import {
|
|||||||
import { useRouter, usePathname } from 'next/navigation';
|
import { useRouter, usePathname } from 'next/navigation';
|
||||||
import { sidebarConfigList } from '@/app/home/components/home-sidebar/sidbarConfigList';
|
import { sidebarConfigList } from '@/app/home/components/home-sidebar/sidbarConfigList';
|
||||||
import langbotIcon from '@/app/assets/langbot-logo.webp';
|
import langbotIcon from '@/app/assets/langbot-logo.webp';
|
||||||
import { httpClient } from '@/app/infra/http/HttpClient';
|
import { systemInfo } from '@/app/infra/http/HttpClient';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
// TODO 侧边导航栏要加动画
|
// TODO 侧边导航栏要加动画
|
||||||
@@ -104,7 +104,7 @@ export default function HomeSidebar({
|
|||||||
<div className={`${styles.langbotTextContainer}`}>
|
<div className={`${styles.langbotTextContainer}`}>
|
||||||
<div className={`${styles.langbotText}`}>LangBot</div>
|
<div className={`${styles.langbotText}`}>LangBot</div>
|
||||||
<div className={`${styles.langbotVersion}`}>
|
<div className={`${styles.langbotVersion}`}>
|
||||||
{httpClient.systemInfo?.version}
|
{systemInfo?.version}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -49,12 +49,13 @@ export interface RequestConfig extends AxiosRequestConfig {
|
|||||||
retry?: number; // 重试次数
|
retry?: number; // 重试次数
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export let systemInfo: ApiRespSystemInfo | null = null;
|
||||||
|
|
||||||
class HttpClient {
|
class HttpClient {
|
||||||
private instance: AxiosInstance;
|
private instance: AxiosInstance;
|
||||||
private disableToken: boolean = false;
|
private disableToken: boolean = false;
|
||||||
// 暂不需要SSR
|
// 暂不需要SSR
|
||||||
// private ssrInstance: AxiosInstance | null = null
|
// private ssrInstance: AxiosInstance | null = null
|
||||||
public systemInfo: ApiRespSystemInfo | null = null;
|
|
||||||
|
|
||||||
constructor(baseURL?: string, disableToken?: boolean) {
|
constructor(baseURL?: string, disableToken?: boolean) {
|
||||||
this.instance = axios.create({
|
this.instance = axios.create({
|
||||||
@@ -67,9 +68,9 @@ class HttpClient {
|
|||||||
this.disableToken = disableToken || false;
|
this.disableToken = disableToken || false;
|
||||||
this.initInterceptors();
|
this.initInterceptors();
|
||||||
|
|
||||||
if (this.systemInfo === null) {
|
if (systemInfo === null && baseURL != 'https://space.langbot.app') {
|
||||||
this.getSystemInfo().then((res) => {
|
this.getSystemInfo().then((res) => {
|
||||||
this.systemInfo = res;
|
systemInfo = res;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -400,6 +401,7 @@ class HttpClient {
|
|||||||
sort_order,
|
sort_order,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public installPluginFromGithub(
|
public installPluginFromGithub(
|
||||||
source: string,
|
source: string,
|
||||||
): Promise<AsyncTaskCreatedResp> {
|
): Promise<AsyncTaskCreatedResp> {
|
||||||
|
|||||||
Reference in New Issue
Block a user