mirror of https://github.com/chaitin/PandaWiki.git
Compare commits
No commits in common. "d8c869198ed32438e41facb886c8f16a2ac5226d" and "59ca88551849ca4b5875e644881a5ab106957d35" have entirely different histories.
d8c869198e
...
59ca885518
|
|
@ -4533,9 +4533,6 @@ const docTemplate = `{
|
|||
"contribute_settings": {
|
||||
"$ref": "#/definitions/domain.ContributeSettings"
|
||||
},
|
||||
"conversation_setting": {
|
||||
"$ref": "#/definitions/domain.ConversationSetting"
|
||||
},
|
||||
"copy_setting": {
|
||||
"enum": [
|
||||
"",
|
||||
|
|
@ -4815,9 +4812,6 @@ const docTemplate = `{
|
|||
"contribute_settings": {
|
||||
"$ref": "#/definitions/domain.ContributeSettings"
|
||||
},
|
||||
"conversation_setting": {
|
||||
"$ref": "#/definitions/domain.ConversationSetting"
|
||||
},
|
||||
"copy_setting": {
|
||||
"$ref": "#/definitions/consts.CopySetting"
|
||||
},
|
||||
|
|
@ -5758,17 +5752,6 @@ const docTemplate = `{
|
|||
}
|
||||
}
|
||||
},
|
||||
"domain.ConversationSetting": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"copyright_hide_enabled": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"copyright_info": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"domain.CreateKBReleaseReq": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
|
|
|
|||
|
|
@ -4526,9 +4526,6 @@
|
|||
"contribute_settings": {
|
||||
"$ref": "#/definitions/domain.ContributeSettings"
|
||||
},
|
||||
"conversation_setting": {
|
||||
"$ref": "#/definitions/domain.ConversationSetting"
|
||||
},
|
||||
"copy_setting": {
|
||||
"enum": [
|
||||
"",
|
||||
|
|
@ -4808,9 +4805,6 @@
|
|||
"contribute_settings": {
|
||||
"$ref": "#/definitions/domain.ContributeSettings"
|
||||
},
|
||||
"conversation_setting": {
|
||||
"$ref": "#/definitions/domain.ConversationSetting"
|
||||
},
|
||||
"copy_setting": {
|
||||
"$ref": "#/definitions/consts.CopySetting"
|
||||
},
|
||||
|
|
@ -5751,17 +5745,6 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"domain.ConversationSetting": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"copyright_hide_enabled": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"copyright_info": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"domain.CreateKBReleaseReq": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
|
|
|
|||
|
|
@ -431,8 +431,6 @@ definitions:
|
|||
description: catalog settings
|
||||
contribute_settings:
|
||||
$ref: '#/definitions/domain.ContributeSettings'
|
||||
conversation_setting:
|
||||
$ref: '#/definitions/domain.ConversationSetting'
|
||||
copy_setting:
|
||||
allOf:
|
||||
- $ref: '#/definitions/consts.CopySetting'
|
||||
|
|
@ -608,8 +606,6 @@ definitions:
|
|||
description: catalog settings
|
||||
contribute_settings:
|
||||
$ref: '#/definitions/domain.ContributeSettings'
|
||||
conversation_setting:
|
||||
$ref: '#/definitions/domain.ConversationSetting'
|
||||
copy_setting:
|
||||
$ref: '#/definitions/consts.CopySetting'
|
||||
desc:
|
||||
|
|
@ -1222,13 +1218,6 @@ definitions:
|
|||
url:
|
||||
type: string
|
||||
type: object
|
||||
domain.ConversationSetting:
|
||||
properties:
|
||||
copyright_hide_enabled:
|
||||
type: boolean
|
||||
copyright_info:
|
||||
type: string
|
||||
type: object
|
||||
domain.CreateKBReleaseReq:
|
||||
properties:
|
||||
kb_id:
|
||||
|
|
|
|||
|
|
@ -161,17 +161,11 @@ type AppSettings struct {
|
|||
WebAppLandingConfigs []WebAppLandingConfig `json:"web_app_landing_configs,omitempty"`
|
||||
WebAppLandingTheme WebAppLandingTheme `json:"web_app_landing_theme"`
|
||||
|
||||
WatermarkContent string `json:"watermark_content"`
|
||||
WatermarkSetting consts.WatermarkSetting `json:"watermark_setting" validate:"omitempty,oneof='' hidden visible"`
|
||||
CopySetting consts.CopySetting `json:"copy_setting" validate:"omitempty,oneof='' append disabled"`
|
||||
ContributeSettings ContributeSettings `json:"contribute_settings"`
|
||||
HomePageSetting consts.HomePageSetting `json:"home_page_setting"`
|
||||
ConversationSetting ConversationSetting `json:"conversation_setting"`
|
||||
}
|
||||
|
||||
type ConversationSetting struct {
|
||||
CopyrightInfo string `json:"copyright_info"`
|
||||
CopyrightHideEnabled bool `json:"copyright_hide_enabled"`
|
||||
WatermarkContent string `json:"watermark_content"`
|
||||
WatermarkSetting consts.WatermarkSetting `json:"watermark_setting" validate:"omitempty,oneof='' hidden visible"`
|
||||
CopySetting consts.CopySetting `json:"copy_setting" validate:"omitempty,oneof='' append disabled"`
|
||||
ContributeSettings ContributeSettings `json:"contribute_settings"`
|
||||
HomePageSetting consts.HomePageSetting `json:"home_page_setting"`
|
||||
}
|
||||
|
||||
type WebAppLandingTheme struct {
|
||||
|
|
@ -543,7 +537,6 @@ type AppSettingsResp struct {
|
|||
WebAppLandingConfigs []WebAppLandingConfigResp `json:"web_app_landing_configs,omitempty"`
|
||||
WebAppLandingTheme WebAppLandingTheme `json:"web_app_landing_theme"`
|
||||
HomePageSetting consts.HomePageSetting `json:"home_page_setting"`
|
||||
ConversationSetting ConversationSetting `json:"conversation_setting"`
|
||||
}
|
||||
|
||||
type WebAppLandingConfigResp struct {
|
||||
|
|
|
|||
|
|
@ -192,29 +192,12 @@ func (h *UserHandler) ResetPassword(c echo.Context) error {
|
|||
if err != nil {
|
||||
return h.NewResponseWithError(c, "failed to get user", err)
|
||||
}
|
||||
|
||||
// 非超级管理员没有改密码权限
|
||||
if user.Role != consts.UserRoleAdmin {
|
||||
return h.NewResponseWithErrCode(c, domain.ErrCodePermissionDenied)
|
||||
if user.Account == "admin" && authInfo.UserId == req.ID {
|
||||
return h.NewResponseWithError(c, "请修改安装目录下 .env 文件中的 ADMIN_PASSWORD,并重启 panda-wiki-api 容器使更改生效。", nil)
|
||||
}
|
||||
|
||||
if user.Account == "admin" {
|
||||
// admin 改不了自己的密码
|
||||
if authInfo.UserId == req.ID {
|
||||
return h.NewResponseWithError(c, "请修改安装目录下 .env 文件中的 ADMIN_PASSWORD,并重启 panda-wiki-api 容器使更改生效。", nil)
|
||||
}
|
||||
} else {
|
||||
targetUser, err := h.usecase.GetUser(ctx, req.ID)
|
||||
if err != nil {
|
||||
return h.NewResponseWithError(c, "failed to get target user", err)
|
||||
}
|
||||
|
||||
// 超级管理员不能改其他超级管理员密码
|
||||
if targetUser.Role == consts.UserRoleAdmin && targetUser.ID != authInfo.UserId {
|
||||
return h.NewResponseWithError(c, "无法修改其他超级管理员密码", nil)
|
||||
}
|
||||
if user.Account != "admin" && authInfo.UserId != req.ID {
|
||||
return h.NewResponseWithError(c, "只有管理员可以重置其他用户密码", nil)
|
||||
}
|
||||
|
||||
err = h.usecase.ResetPassword(c.Request().Context(), &req)
|
||||
if err != nil {
|
||||
return h.NewResponseWithError(c, "failed to reset password", err)
|
||||
|
|
|
|||
|
|
@ -125,9 +125,6 @@ func (u *AppUsecase) ValidateUpdateApp(ctx context.Context, id string, req *doma
|
|||
if app.Settings.WidgetBotSettings.CopyrightHideEnabled != req.Settings.WidgetBotSettings.CopyrightHideEnabled || app.Settings.WidgetBotSettings.CopyrightInfo != req.Settings.WidgetBotSettings.CopyrightInfo {
|
||||
return domain.ErrPermissionDenied
|
||||
}
|
||||
if app.Settings.ConversationSetting.CopyrightHideEnabled != req.Settings.ConversationSetting.CopyrightHideEnabled || app.Settings.ConversationSetting.CopyrightInfo != req.Settings.ConversationSetting.CopyrightInfo {
|
||||
return domain.ErrPermissionDenied
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
@ -516,21 +513,14 @@ func (u *AppUsecase) GetAppDetailByKBIDAndAppType(ctx context.Context, kbID stri
|
|||
WebAppLandingConfigs: webAppLandingConfigs,
|
||||
WebAppLandingTheme: app.Settings.WebAppLandingTheme,
|
||||
|
||||
WatermarkContent: app.Settings.WatermarkContent,
|
||||
WatermarkSetting: app.Settings.WatermarkSetting,
|
||||
CopySetting: app.Settings.CopySetting,
|
||||
ContributeSettings: app.Settings.ContributeSettings,
|
||||
HomePageSetting: app.Settings.HomePageSetting,
|
||||
ConversationSetting: app.Settings.ConversationSetting,
|
||||
WatermarkContent: app.Settings.WatermarkContent,
|
||||
WatermarkSetting: app.Settings.WatermarkSetting,
|
||||
CopySetting: app.Settings.CopySetting,
|
||||
ContributeSettings: app.Settings.ContributeSettings,
|
||||
HomePageSetting: app.Settings.HomePageSetting,
|
||||
|
||||
WecomAIBotSettings: app.Settings.WecomAIBotSettings,
|
||||
}
|
||||
|
||||
if !domain.GetBaseEditionLimitation(ctx).AllowCustomCopyright {
|
||||
appDetailResp.Settings.ConversationSetting.CopyrightHideEnabled = false
|
||||
appDetailResp.Settings.ConversationSetting.CopyrightInfo = domain.SettingCopyrightInfo
|
||||
}
|
||||
|
||||
// init ai feedback string
|
||||
if app.Settings.AIFeedbackSettings.AIFeedbackType == nil {
|
||||
appDetailResp.Settings.AIFeedbackSettings.AIFeedbackType = []string{"内容不准确", "没有帮助", "其他"}
|
||||
|
|
@ -623,12 +613,11 @@ func (u *AppUsecase) ShareGetWebAppInfo(ctx context.Context, kbID string, authId
|
|||
WebAppLandingConfigs: webAppLandingConfigs,
|
||||
WebAppLandingTheme: app.Settings.WebAppLandingTheme,
|
||||
|
||||
WatermarkContent: app.Settings.WatermarkContent,
|
||||
WatermarkSetting: app.Settings.WatermarkSetting,
|
||||
CopySetting: app.Settings.CopySetting,
|
||||
ContributeSettings: app.Settings.ContributeSettings,
|
||||
HomePageSetting: app.Settings.HomePageSetting,
|
||||
ConversationSetting: app.Settings.ConversationSetting,
|
||||
WatermarkContent: app.Settings.WatermarkContent,
|
||||
WatermarkSetting: app.Settings.WatermarkSetting,
|
||||
CopySetting: app.Settings.CopySetting,
|
||||
ContributeSettings: app.Settings.ContributeSettings,
|
||||
HomePageSetting: app.Settings.HomePageSetting,
|
||||
},
|
||||
}
|
||||
// init ai feedback string
|
||||
|
|
@ -644,8 +633,6 @@ func (u *AppUsecase) ShareGetWebAppInfo(ctx context.Context, kbID string, authId
|
|||
if !domain.GetBaseEditionLimitation(ctx).AllowCustomCopyright {
|
||||
appInfo.Settings.WebAppCustomSettings.ShowBrandInfo = &showBrand
|
||||
appInfo.Settings.DisclaimerSettings.Content = &defaultDisclaimer
|
||||
appInfo.Settings.ConversationSetting.CopyrightHideEnabled = false
|
||||
appInfo.Settings.ConversationSetting.CopyrightInfo = domain.SettingCopyrightInfo
|
||||
} else {
|
||||
if appInfo.Settings.DisclaimerSettings.Content == nil {
|
||||
appInfo.Settings.DisclaimerSettings.Content = &defaultDisclaimer
|
||||
|
|
|
|||
|
|
@ -534,7 +534,6 @@ const FooterConfig = ({ data, setIsEdit, isEdit }: FooterConfigProps) => {
|
|||
</Box>
|
||||
<VersionMask
|
||||
permission={PROFESSION_VERSION_PERMISSION}
|
||||
wrapperSx={{ px: 2 }}
|
||||
sx={{ inset: '-8px 0' }}
|
||||
>
|
||||
<Controller
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ const Member = () => {
|
|||
<Button
|
||||
size='small'
|
||||
sx={{
|
||||
color: 'var(--mui-palette-action-disabled)',
|
||||
color: 'text.tertiary',
|
||||
cursor: 'not-allowed',
|
||||
p: 0,
|
||||
minWidth: 'auto',
|
||||
|
|
@ -151,11 +151,6 @@ const Member = () => {
|
|||
size='small'
|
||||
sx={{ p: 0, minWidth: 'auto' }}
|
||||
color='primary'
|
||||
disabled={
|
||||
record.role === 'admin' &&
|
||||
user.account !== 'admin' &&
|
||||
user.id !== record.id
|
||||
}
|
||||
onClick={() => {
|
||||
setCurUser(record);
|
||||
setCurType('reset-password');
|
||||
|
|
@ -164,9 +159,8 @@ const Member = () => {
|
|||
{user?.id === record.id ? '修改密码' : '重置密码'}
|
||||
</Button>
|
||||
)}
|
||||
{user?.id !== record.id &&
|
||||
(user.account === 'admin' ||
|
||||
(user.role === 'admin' && record.role !== 'admin')) && (
|
||||
{record.account !== 'admin' &&
|
||||
(user?.id === record.id || user.account === 'admin') && (
|
||||
<Button
|
||||
size='small'
|
||||
color='error'
|
||||
|
|
|
|||
|
|
@ -108,6 +108,7 @@ const System = () => {
|
|||
aria-label='system tabs'
|
||||
sx={{
|
||||
mb: 2,
|
||||
ml: -2,
|
||||
borderBottom: 1,
|
||||
borderColor: 'divider',
|
||||
'& .MuiTabs-indicator': {
|
||||
|
|
@ -143,12 +144,12 @@ const System = () => {
|
|||
))}
|
||||
</Tabs>
|
||||
{activeTab === 'user-management' && (
|
||||
<Box>
|
||||
<Box sx={{ ml: -2 }}>
|
||||
<Member />
|
||||
</Box>
|
||||
)}
|
||||
{activeTab === 'model-config' && (
|
||||
<Box>
|
||||
<Box sx={{ ml: -2 }}>
|
||||
<ModelConfig
|
||||
ref={modelConfigRef}
|
||||
onCloseModal={() => setOpen(false)}
|
||||
|
|
|
|||
|
|
@ -55,12 +55,10 @@ const VersionMask = ({
|
|||
ConstsLicenseEdition.LicenseEditionEnterprise,
|
||||
],
|
||||
children,
|
||||
wrapperSx,
|
||||
sx,
|
||||
}: {
|
||||
permission?: ConstsLicenseEdition[];
|
||||
children?: React.ReactNode;
|
||||
wrapperSx?: SxProps;
|
||||
sx?: SxProps;
|
||||
}) => {
|
||||
const versionInfo = useVersionInfo();
|
||||
|
|
@ -69,7 +67,7 @@ const VersionMask = ({
|
|||
const nextVersionInfo = VersionInfoMap[permission[0]];
|
||||
|
||||
return (
|
||||
<StyledMaskWrapper sx={wrapperSx}>
|
||||
<StyledMaskWrapper>
|
||||
{children}
|
||||
<StyledMask sx={sx}>
|
||||
<StyledMaskContent>
|
||||
|
|
|
|||
|
|
@ -1,139 +0,0 @@
|
|||
import { putApiV1App } from '@/request/App';
|
||||
|
||||
import { FormItem, SettingCardItem } from './Common';
|
||||
import {
|
||||
DomainAppDetailResp,
|
||||
DomainConversationSetting,
|
||||
} from '@/request/types';
|
||||
import { PROFESSION_VERSION_PERMISSION } from '@/constant/version';
|
||||
import {
|
||||
FormControlLabel,
|
||||
Radio,
|
||||
RadioGroup,
|
||||
TextField,
|
||||
Box,
|
||||
} from '@mui/material';
|
||||
import { message } from '@ctzhian/ui';
|
||||
import { useEffect, useState } from 'react';
|
||||
import VersionMask from '@/components/VersionMask';
|
||||
import { Controller, useForm } from 'react-hook-form';
|
||||
import { useAppSelector } from '@/store';
|
||||
|
||||
const CardQaCopyright = ({
|
||||
data,
|
||||
refresh,
|
||||
}: {
|
||||
data: DomainAppDetailResp;
|
||||
refresh: (value: DomainConversationSetting) => void;
|
||||
}) => {
|
||||
const [isEdit, setIsEdit] = useState<boolean>(false);
|
||||
const { kb_id } = useAppSelector(state => state.config);
|
||||
const {
|
||||
control,
|
||||
handleSubmit,
|
||||
reset,
|
||||
watch,
|
||||
setValue,
|
||||
formState: { errors },
|
||||
} = useForm({
|
||||
defaultValues: {
|
||||
copyright_hide_enabled: false,
|
||||
copyright_info: '',
|
||||
},
|
||||
});
|
||||
|
||||
const copyright_hide_enabled = watch('copyright_hide_enabled');
|
||||
|
||||
const onSubmit = handleSubmit(value => {
|
||||
putApiV1App(
|
||||
{ id: data.id! },
|
||||
{ settings: { ...data.settings, conversation_setting: value }, kb_id },
|
||||
).then(() => {
|
||||
refresh(value);
|
||||
message.success('保存成功');
|
||||
setIsEdit(false);
|
||||
});
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
setValue(
|
||||
'copyright_hide_enabled',
|
||||
data.settings?.conversation_setting?.copyright_hide_enabled ?? false,
|
||||
);
|
||||
setValue(
|
||||
'copyright_info',
|
||||
data.settings?.conversation_setting?.copyright_info ?? '',
|
||||
);
|
||||
}, [data]);
|
||||
|
||||
return (
|
||||
<SettingCardItem
|
||||
title='智能问答版权信息'
|
||||
isEdit={isEdit}
|
||||
onSubmit={onSubmit}
|
||||
>
|
||||
<VersionMask permission={PROFESSION_VERSION_PERMISSION}>
|
||||
<FormItem
|
||||
label='版权信息'
|
||||
sx={{ alignItems: 'flex-start' }}
|
||||
labelSx={{ mt: 1 }}
|
||||
>
|
||||
<Controller
|
||||
control={control}
|
||||
name='copyright_hide_enabled'
|
||||
render={({ field }) => {
|
||||
return (
|
||||
<RadioGroup
|
||||
row
|
||||
{...field}
|
||||
onChange={e => {
|
||||
field.onChange(e.target.value === 'true');
|
||||
setIsEdit(true);
|
||||
}}
|
||||
>
|
||||
<FormControlLabel
|
||||
value={false}
|
||||
control={<Radio size='small' />}
|
||||
label={<Box sx={{ width: 100 }}>显示</Box>}
|
||||
/>
|
||||
<FormControlLabel
|
||||
value={true}
|
||||
control={<Radio size='small' />}
|
||||
label={<Box sx={{ width: 100 }}>隐藏</Box>}
|
||||
/>
|
||||
</RadioGroup>
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</FormItem>
|
||||
{!copyright_hide_enabled && (
|
||||
<FormItem
|
||||
label='版权文字'
|
||||
sx={{ alignItems: 'flex-start' }}
|
||||
labelSx={{ mt: 1 }}
|
||||
>
|
||||
<Controller
|
||||
control={control}
|
||||
name='copyright_info'
|
||||
render={({ field }) => (
|
||||
<TextField
|
||||
fullWidth
|
||||
{...field}
|
||||
placeholder='本网站由 PandaWiki 提供技术支持'
|
||||
error={!!errors.copyright_info}
|
||||
helperText={errors.copyright_info?.message}
|
||||
onChange={event => {
|
||||
setIsEdit(true);
|
||||
field.onChange(event);
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
</FormItem>
|
||||
)}
|
||||
</VersionMask>
|
||||
</SettingCardItem>
|
||||
);
|
||||
};
|
||||
|
||||
export default CardQaCopyright;
|
||||
|
|
@ -14,7 +14,6 @@ import CardProxy from './CardProxy';
|
|||
import CardStyle from './CardStyle';
|
||||
import CardWebCustomCode from './CardWebCustomCode';
|
||||
import CardWebSEO from './CardWebSEO';
|
||||
import CardQaCopyright from './CardQaCopyright';
|
||||
|
||||
interface CardWebProps {
|
||||
kb: DomainKnowledgeBaseDetail;
|
||||
|
|
@ -77,18 +76,6 @@ const CardWeb = ({ kb, refresh }: CardWebProps) => {
|
|||
<CardListen kb={kb} refresh={refresh} />
|
||||
<CardProxy kb={kb} refresh={refresh} />
|
||||
<CardBasicInfo kb={kb} refresh={refresh} />
|
||||
<CardQaCopyright
|
||||
data={info}
|
||||
refresh={value => {
|
||||
setInfo({
|
||||
...info,
|
||||
settings: {
|
||||
...info.settings,
|
||||
conversation_setting: value,
|
||||
},
|
||||
});
|
||||
}}
|
||||
/>
|
||||
<CardAuth kb={kb} refresh={refresh} />
|
||||
<CardCatalog
|
||||
id={info.id}
|
||||
|
|
|
|||
|
|
@ -304,7 +304,6 @@ export interface DomainAppSettings {
|
|||
/** catalog settings */
|
||||
catalog_settings?: DomainCatalogSettings;
|
||||
contribute_settings?: DomainContributeSettings;
|
||||
conversation_setting?: DomainConversationSetting;
|
||||
copy_setting?: "" | "append" | "disabled";
|
||||
/** seo */
|
||||
desc?: string;
|
||||
|
|
@ -390,7 +389,6 @@ export interface DomainAppSettingsResp {
|
|||
/** catalog settings */
|
||||
catalog_settings?: DomainCatalogSettings;
|
||||
contribute_settings?: DomainContributeSettings;
|
||||
conversation_setting?: DomainConversationSetting;
|
||||
copy_setting?: ConstsCopySetting;
|
||||
/** seo */
|
||||
desc?: string;
|
||||
|
|
@ -707,11 +705,6 @@ export interface DomainConversationReference {
|
|||
url?: string;
|
||||
}
|
||||
|
||||
export interface DomainConversationSetting {
|
||||
copyright_hide_enabled?: boolean;
|
||||
copyright_info?: string;
|
||||
}
|
||||
|
||||
export interface DomainCreateKBReleaseReq {
|
||||
kb_id: string;
|
||||
message: string;
|
||||
|
|
@ -989,11 +982,11 @@ export interface DomainNodeListItemResp {
|
|||
editor_id?: string;
|
||||
emoji?: string;
|
||||
id?: string;
|
||||
publisher_id?: string;
|
||||
name?: string;
|
||||
parent_id?: string;
|
||||
permissions?: DomainNodePermissions;
|
||||
position?: number;
|
||||
publisher_id?: string;
|
||||
rag_info?: DomainRagInfo;
|
||||
status?: DomainNodeStatus;
|
||||
summary?: string;
|
||||
|
|
@ -1780,23 +1773,23 @@ export interface DeleteApiV1AuthDeleteParams {
|
|||
export interface GetApiV1AuthGetParams {
|
||||
kb_id?: string;
|
||||
source_type:
|
||||
| "dingtalk"
|
||||
| "feishu"
|
||||
| "wecom"
|
||||
| "oauth"
|
||||
| "github"
|
||||
| "cas"
|
||||
| "ldap"
|
||||
| "widget"
|
||||
| "dingtalk_bot"
|
||||
| "feishu_bot"
|
||||
| "lark_bot"
|
||||
| "wechat_bot"
|
||||
| "wecom_ai_bot"
|
||||
| "wechat_service_bot"
|
||||
| "discord_bot"
|
||||
| "wechat_official_account"
|
||||
| "openai_api";
|
||||
| "dingtalk"
|
||||
| "feishu"
|
||||
| "wecom"
|
||||
| "oauth"
|
||||
| "github"
|
||||
| "cas"
|
||||
| "ldap"
|
||||
| "widget"
|
||||
| "dingtalk_bot"
|
||||
| "feishu_bot"
|
||||
| "lark_bot"
|
||||
| "wechat_bot"
|
||||
| "wecom_ai_bot"
|
||||
| "wechat_service_bot"
|
||||
| "discord_bot"
|
||||
| "wechat_official_account"
|
||||
| "openai_api";
|
||||
}
|
||||
|
||||
export interface GetApiV1CommentParams {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ import {
|
|||
ConstsCopySetting,
|
||||
ConstsWatermarkSetting,
|
||||
DomainDisclaimerSettings,
|
||||
DomainConversationSetting,
|
||||
DomainWebAppLandingConfig,
|
||||
} from '@/request/types';
|
||||
|
||||
|
|
@ -59,7 +58,6 @@ export interface ThemeAndStyleSetting {
|
|||
export interface KBDetail {
|
||||
name: string;
|
||||
settings: {
|
||||
conversation_setting: DomainConversationSetting;
|
||||
title: string;
|
||||
btns: NavBtn[];
|
||||
icon: string;
|
||||
|
|
|
|||
|
|
@ -247,8 +247,7 @@ const QaModal: React.FC<QaModalProps> = () => {
|
|||
<Box
|
||||
sx={{
|
||||
px: 3,
|
||||
pt: !kbDetail?.settings?.conversation_setting
|
||||
?.copyright_hide_enabled
|
||||
pt: kbDetail?.settings?.web_app_custom_style?.show_brand_info
|
||||
? 2
|
||||
: 0,
|
||||
display: 'flex',
|
||||
|
|
@ -267,10 +266,8 @@ const QaModal: React.FC<QaModalProps> = () => {
|
|||
}}
|
||||
>
|
||||
<Box>
|
||||
{!kbDetail?.settings?.conversation_setting
|
||||
?.copyright_hide_enabled &&
|
||||
(kbDetail?.settings?.conversation_setting?.copyright_info ||
|
||||
'本网站由 PandaWiki 提供技术支持')}
|
||||
{kbDetail?.settings?.web_app_custom_style?.show_brand_info &&
|
||||
'本网站由 PandaWiki 提供技术支持'}
|
||||
</Box>
|
||||
</Typography>
|
||||
</Box>
|
||||
|
|
|
|||
|
|
@ -152,11 +152,7 @@ export const WelcomeHeader = () => {
|
|||
onSearch={handleSearch}
|
||||
onQaClick={() => setQaModalOpen?.(true)}
|
||||
>
|
||||
{!!authInfo && (
|
||||
<Box sx={{ ml: 2 }}>
|
||||
<LogoutButton />
|
||||
</Box>
|
||||
)}
|
||||
<Box sx={{ ml: 2 }}>{!!authInfo && <LogoutButton />}</Box>
|
||||
<QaModal />
|
||||
</WelcomeHeaderComponent>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -304,7 +304,6 @@ export interface DomainAppSettings {
|
|||
/** catalog settings */
|
||||
catalog_settings?: DomainCatalogSettings;
|
||||
contribute_settings?: DomainContributeSettings;
|
||||
conversation_setting?: DomainConversationSetting;
|
||||
copy_setting?: "" | "append" | "disabled";
|
||||
/** seo */
|
||||
desc?: string;
|
||||
|
|
@ -390,7 +389,6 @@ export interface DomainAppSettingsResp {
|
|||
/** catalog settings */
|
||||
catalog_settings?: DomainCatalogSettings;
|
||||
contribute_settings?: DomainContributeSettings;
|
||||
conversation_setting?: DomainConversationSetting;
|
||||
copy_setting?: ConstsCopySetting;
|
||||
/** seo */
|
||||
desc?: string;
|
||||
|
|
@ -707,11 +705,6 @@ export interface DomainConversationReference {
|
|||
url?: string;
|
||||
}
|
||||
|
||||
export interface DomainConversationSetting {
|
||||
copyright_hide_enabled?: boolean;
|
||||
copyright_info?: string;
|
||||
}
|
||||
|
||||
export interface DomainCreateKBReleaseReq {
|
||||
kb_id: string;
|
||||
message: string;
|
||||
|
|
@ -993,7 +986,6 @@ export interface DomainNodeListItemResp {
|
|||
parent_id?: string;
|
||||
permissions?: DomainNodePermissions;
|
||||
position?: number;
|
||||
publisher_id?: string;
|
||||
rag_info?: DomainRagInfo;
|
||||
status?: DomainNodeStatus;
|
||||
summary?: string;
|
||||
|
|
|
|||
|
|
@ -23,17 +23,11 @@ const StyledBanner = styled('div')(({ theme }) => ({
|
|||
}));
|
||||
|
||||
const StyledTitle = styled('h1')(({ theme }) => ({
|
||||
fontSize: 60,
|
||||
fontSize: 36,
|
||||
fontWeight: 700,
|
||||
wordBreak: 'break-all',
|
||||
color: theme.palette.primary.main,
|
||||
marginBottom: theme.spacing(3),
|
||||
[theme.breakpoints.down('md')]: {
|
||||
fontSize: 50,
|
||||
},
|
||||
[theme.breakpoints.down('sm')]: {
|
||||
fontSize: 40,
|
||||
},
|
||||
}));
|
||||
|
||||
const StyledSubTitle = styled('h2')(({ theme }) => ({
|
||||
|
|
@ -334,15 +328,16 @@ const Banner = React.memo(
|
|||
: {}),
|
||||
}}
|
||||
>
|
||||
<StyledTopicBox
|
||||
sx={{
|
||||
alignItems: 'flex-start',
|
||||
gap: 0,
|
||||
py: { xs: 8, md: '200px' },
|
||||
pt: { xs: 16 },
|
||||
}}
|
||||
>
|
||||
<StyledTitle ref={titleRef}>{title.text}</StyledTitle>
|
||||
<StyledTopicBox sx={{ alignItems: 'flex-start', gap: 0, py: '200px' }}>
|
||||
<StyledTitle
|
||||
ref={titleRef}
|
||||
sx={{
|
||||
fontSize: `${title.fontSize || 60}px`,
|
||||
// color: title.color || '#5F58FE',
|
||||
}}
|
||||
>
|
||||
{title.text}
|
||||
</StyledTitle>
|
||||
{/* {subtitle.text && ( */}
|
||||
<StyledSubTitle
|
||||
ref={subtitleRef}
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ const Header = React.memo(
|
|||
// }),
|
||||
}}
|
||||
>
|
||||
<Link href={'/'} sx={{ flex: 1, minWidth: 0 }}>
|
||||
<Link href={'/'}>
|
||||
<Stack
|
||||
direction='row'
|
||||
alignItems='center'
|
||||
|
|
@ -143,16 +143,7 @@ const Header = React.memo(
|
|||
}}
|
||||
>
|
||||
<img src={logo} alt='logo' width={36} />
|
||||
<Box
|
||||
sx={{
|
||||
fontSize: 20,
|
||||
whiteSpace: 'nowrap',
|
||||
textOverflow: 'ellipsis',
|
||||
overflow: 'hidden',
|
||||
}}
|
||||
>
|
||||
{title}
|
||||
</Box>
|
||||
<Box sx={{ fontSize: 20 }}>{title}</Box>
|
||||
</Stack>
|
||||
</Link>
|
||||
{showSearch &&
|
||||
|
|
@ -162,6 +153,7 @@ const Header = React.memo(
|
|||
direction='row'
|
||||
alignItems='center'
|
||||
justifyContent='flex-end'
|
||||
sx={{ flex: 1 }}
|
||||
>
|
||||
<IconButton
|
||||
size='small'
|
||||
|
|
@ -179,9 +171,11 @@ const Header = React.memo(
|
|||
focused={false}
|
||||
onClick={() => onQaClick?.()}
|
||||
sx={{
|
||||
flex: 1,
|
||||
position: 'absolute',
|
||||
left: '50%',
|
||||
top: '50%',
|
||||
transform: 'translate(-50%, -50%)',
|
||||
maxWidth: '500px',
|
||||
minWidth: '220px',
|
||||
bgcolor: 'background.paper3',
|
||||
borderRadius: '10px',
|
||||
overflow: 'hidden',
|
||||
|
|
@ -279,13 +273,7 @@ const Header = React.memo(
|
|||
))}
|
||||
|
||||
{!mobile && btns && btns.length > 0 && (
|
||||
<Stack
|
||||
direction='row'
|
||||
gap={2}
|
||||
alignItems='center'
|
||||
justifyContent='flex-end'
|
||||
sx={{ flex: 1 }}
|
||||
>
|
||||
<Stack direction='row' gap={2} alignItems='center'>
|
||||
{btns.slice(0, Math.min(2, btns.length)).map((item, index) => (
|
||||
<Link key={index} href={item.url} target={item.target}>
|
||||
<Button
|
||||
|
|
@ -302,7 +290,6 @@ const Header = React.memo(
|
|||
}
|
||||
sx={theme => ({
|
||||
px: 3.5,
|
||||
whiteSpace: 'nowrap',
|
||||
textTransform: 'none',
|
||||
boxSizing: 'border-box',
|
||||
height: 40,
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ const Header = React.memo(
|
|||
// }),
|
||||
}}
|
||||
>
|
||||
<Link href={'/'} sx={{ flex: 1, minWidth: 0 }}>
|
||||
<Link href={'/'}>
|
||||
<Stack
|
||||
direction='row'
|
||||
alignItems='center'
|
||||
|
|
@ -167,16 +167,7 @@ const Header = React.memo(
|
|||
}}
|
||||
>
|
||||
<img src={logo} alt='logo' height={36} />
|
||||
<Box
|
||||
sx={{
|
||||
fontSize: 20,
|
||||
whiteSpace: 'nowrap',
|
||||
textOverflow: 'ellipsis',
|
||||
overflow: 'hidden',
|
||||
}}
|
||||
>
|
||||
{title}
|
||||
</Box>
|
||||
<Box sx={{ fontSize: 20 }}>{title}</Box>
|
||||
</Stack>
|
||||
</Link>
|
||||
{showSearch &&
|
||||
|
|
@ -186,6 +177,7 @@ const Header = React.memo(
|
|||
direction='row'
|
||||
alignItems='center'
|
||||
justifyContent='flex-end'
|
||||
sx={{ flex: 1 }}
|
||||
>
|
||||
<IconButton
|
||||
size='small'
|
||||
|
|
@ -203,9 +195,11 @@ const Header = React.memo(
|
|||
focused={false}
|
||||
onClick={() => onQaClick?.()}
|
||||
sx={theme => ({
|
||||
flex: 1,
|
||||
position: 'absolute',
|
||||
left: '50%',
|
||||
top: '50%',
|
||||
transform: 'translate(-50%, -50%)',
|
||||
maxWidth: '500px',
|
||||
minWidth: '220px',
|
||||
borderRadius: '10px',
|
||||
overflow: 'hidden',
|
||||
cursor: 'pointer',
|
||||
|
|
@ -243,7 +237,7 @@ const Header = React.memo(
|
|||
direction='row'
|
||||
alignItems='center'
|
||||
gap={1.5}
|
||||
sx={{ flexShrink: 0, ml: 1 }}
|
||||
sx={{ flexShrink: 0 }}
|
||||
>
|
||||
<Box
|
||||
sx={{
|
||||
|
|
@ -264,22 +258,13 @@ const Header = React.memo(
|
|||
))}
|
||||
|
||||
{!mobile && btns && btns.length > 0 && (
|
||||
<Stack
|
||||
direction='row'
|
||||
gap={2}
|
||||
alignItems='center'
|
||||
justifyContent='flex-end'
|
||||
sx={{
|
||||
flex: 1,
|
||||
}}
|
||||
>
|
||||
<Stack direction='row' gap={2} alignItems='center'>
|
||||
{btns.slice(0, Math.min(2, btns.length)).map((item, index) => (
|
||||
<Link key={index} href={item.url} target={item.target}>
|
||||
<Button
|
||||
variant={item.variant}
|
||||
sx={theme => ({
|
||||
px: 3.5,
|
||||
whiteSpace: 'nowrap',
|
||||
textTransform: 'none',
|
||||
boxSizing: 'border-box',
|
||||
height: 40,
|
||||
|
|
|
|||
Loading…
Reference in New Issue