mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-24 22:03:54 +00:00
4.8.23 dev (#3917)
* fix: icon refresh * fix: aiproxy http request * fix: collection list count * fix: collection list count * fix: tts selector name * update action
This commit is contained in:
11
.github/workflows/fastgpt-preview-image.yml
vendored
11
.github/workflows/fastgpt-preview-image.yml
vendored
@@ -68,14 +68,3 @@ jobs:
|
|||||||
SEALOS_TYPE: 'pr_comment'
|
SEALOS_TYPE: 'pr_comment'
|
||||||
SEALOS_FILENAME: 'report.md'
|
SEALOS_FILENAME: 'report.md'
|
||||||
SEALOS_REPLACE_TAG: 'DEFAULT_REPLACE_DEPLOY'
|
SEALOS_REPLACE_TAG: 'DEFAULT_REPLACE_DEPLOY'
|
||||||
|
|
||||||
helm-check:
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
- name: Helm Check
|
|
||||||
run: |
|
|
||||||
helm dependency update files/helm/fastgpt
|
|
||||||
helm lint files/helm/fastgpt
|
|
||||||
helm package files/helm/fastgpt
|
|
||||||
|
4
.github/workflows/helm-release.yaml
vendored
4
.github/workflows/helm-release.yaml
vendored
@@ -24,6 +24,6 @@ jobs:
|
|||||||
export APP_VERSION=${{ steps.vars.outputs.tag }}
|
export APP_VERSION=${{ steps.vars.outputs.tag }}
|
||||||
export HELM_VERSION=${{ steps.vars.outputs.tag }}
|
export HELM_VERSION=${{ steps.vars.outputs.tag }}
|
||||||
export HELM_REPO=ghcr.io/${{ github.repository_owner }}
|
export HELM_REPO=ghcr.io/${{ github.repository_owner }}
|
||||||
helm dependency update files/helm/fastgpt
|
helm dependency update deploy/helm/fastgpt
|
||||||
helm package files/helm/fastgpt --version ${HELM_VERSION}-helm --app-version ${APP_VERSION} -d bin
|
helm package deploy/helm/fastgpt --version ${HELM_VERSION}-helm --app-version ${APP_VERSION} -d bin
|
||||||
helm push bin/fastgpt-${HELM_VERSION}-helm.tgz oci://${HELM_REPO}
|
helm push bin/fastgpt-${HELM_VERSION}-helm.tgz oci://${HELM_REPO}
|
||||||
|
@@ -38,10 +38,12 @@ const addCommonMiddleware = (schema: mongoose.Schema) => {
|
|||||||
schema.post(op, function (this: any, result: any, next) {
|
schema.post(op, function (this: any, result: any, next) {
|
||||||
if (this._startTime) {
|
if (this._startTime) {
|
||||||
const duration = Date.now() - this._startTime;
|
const duration = Date.now() - this._startTime;
|
||||||
|
|
||||||
const warnLogData = {
|
const warnLogData = {
|
||||||
query: this._query,
|
collectionName: this.collection?.name,
|
||||||
op,
|
op: this.op,
|
||||||
|
...(this._query && { query: this._query }),
|
||||||
|
...(this._update && { update: this._update }),
|
||||||
|
...(this._delete && { delete: this._delete }),
|
||||||
duration
|
duration
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import React, { useEffect } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import type { IconProps } from '@chakra-ui/react';
|
import type { IconProps } from '@chakra-ui/react';
|
||||||
import { Box, Icon } from '@chakra-ui/react';
|
import { Box, Icon } from '@chakra-ui/react';
|
||||||
import { iconPaths } from './constants';
|
import { iconPaths } from './constants';
|
||||||
@@ -8,7 +8,7 @@ import { useRefresh } from '../../../hooks/useRefresh';
|
|||||||
const iconCache: Record<string, any> = {};
|
const iconCache: Record<string, any> = {};
|
||||||
|
|
||||||
const MyIcon = ({ name, w = 'auto', h = 'auto', ...props }: { name: IconNameType } & IconProps) => {
|
const MyIcon = ({ name, w = 'auto', h = 'auto', ...props }: { name: IconNameType } & IconProps) => {
|
||||||
const { refresh } = useRefresh();
|
const [, setUpdate] = useState(0);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (iconCache[name]) {
|
if (iconCache[name]) {
|
||||||
@@ -20,7 +20,7 @@ const MyIcon = ({ name, w = 'auto', h = 'auto', ...props }: { name: IconNameType
|
|||||||
const component = { as: icon.default };
|
const component = { as: icon.default };
|
||||||
// Store in cache
|
// Store in cache
|
||||||
iconCache[name] = component;
|
iconCache[name] = component;
|
||||||
refresh();
|
setUpdate((prev) => prev + 1); // force update
|
||||||
})
|
})
|
||||||
.catch((error) => console.log(error));
|
.catch((error) => console.log(error));
|
||||||
}, [name]);
|
}, [name]);
|
||||||
|
@@ -42,7 +42,7 @@ const TTSSelect = ({
|
|||||||
label: (
|
label: (
|
||||||
<HStack>
|
<HStack>
|
||||||
<Avatar borderRadius={'0'} w={'1.25rem'} src={providerData.avatar} />
|
<Avatar borderRadius={'0'} w={'1.25rem'} src={providerData.avatar} />
|
||||||
<Box>{t(providerData.name)}</Box>
|
<Box>{t(model.name as any)}</Box>
|
||||||
</HStack>
|
</HStack>
|
||||||
),
|
),
|
||||||
value: model.model,
|
value: model.model,
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
import type { NextApiRequest, NextApiResponse } from 'next';
|
import type { NextApiRequest, NextApiResponse } from 'next';
|
||||||
import { jsonRes } from '@fastgpt/service/common/response';
|
import { jsonRes } from '@fastgpt/service/common/response';
|
||||||
import { request } from 'https';
|
import { request as httpsRequest } from 'https';
|
||||||
|
import { request as httpRequest } from 'http';
|
||||||
import { authSystemAdmin } from '@fastgpt/service/support/permission/user/auth';
|
import { authSystemAdmin } from '@fastgpt/service/support/permission/user/auth';
|
||||||
|
|
||||||
const baseUrl = process.env.AIPROXY_API_ENDPOINT;
|
const baseUrl = process.env.AIPROXY_API_ENDPOINT;
|
||||||
@@ -30,7 +31,10 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
|||||||
delete req.headers?.host;
|
delete req.headers?.host;
|
||||||
delete req.headers?.origin;
|
delete req.headers?.origin;
|
||||||
|
|
||||||
const requestResult = request({
|
// Select request function based on protocol
|
||||||
|
const requestFn = parsedUrl.protocol === 'https:' ? httpsRequest : httpRequest;
|
||||||
|
|
||||||
|
const requestResult = requestFn({
|
||||||
protocol: parsedUrl.protocol,
|
protocol: parsedUrl.protocol,
|
||||||
hostname: parsedUrl.hostname,
|
hostname: parsedUrl.hostname,
|
||||||
port: parsedUrl.port,
|
port: parsedUrl.port,
|
||||||
|
@@ -14,6 +14,7 @@ import { PaginationResponse } from '@fastgpt/web/common/fetch/type';
|
|||||||
import { parsePaginationRequest } from '@fastgpt/service/common/api/pagination';
|
import { parsePaginationRequest } from '@fastgpt/service/common/api/pagination';
|
||||||
import { DatasetCollectionSchemaType } from '@fastgpt/global/core/dataset/type';
|
import { DatasetCollectionSchemaType } from '@fastgpt/global/core/dataset/type';
|
||||||
import { MongoDatasetData } from '@fastgpt/service/core/dataset/data/schema';
|
import { MongoDatasetData } from '@fastgpt/service/core/dataset/data/schema';
|
||||||
|
import { MongoDatasetTraining } from '@fastgpt/service/core/dataset/training/schema';
|
||||||
|
|
||||||
async function handler(
|
async function handler(
|
||||||
req: NextApiRequest
|
req: NextApiRequest
|
||||||
@@ -115,7 +116,7 @@ async function handler(
|
|||||||
{ _id: string; count: number }[],
|
{ _id: string; count: number }[],
|
||||||
{ _id: string; count: number }[]
|
{ _id: string; count: number }[]
|
||||||
] = await Promise.all([
|
] = await Promise.all([
|
||||||
MongoDatasetCollection.aggregate(
|
MongoDatasetTraining.aggregate(
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
$match: {
|
$match: {
|
||||||
|
Reference in New Issue
Block a user