256 lines
5.8 KiB
TypeScript
256 lines
5.8 KiB
TypeScript
import { gql } from '@apollo/client';
|
|
|
|
// 获取完整的站点和运营配置
|
|
export const GET_CONFIGS = gql`
|
|
query GetConfigs {
|
|
configs {
|
|
id
|
|
key
|
|
value
|
|
valueType
|
|
description
|
|
}
|
|
}
|
|
`;
|
|
|
|
// 获取完整的站点和运营配置
|
|
export const GET_SITE_OPS_CONFIG = gql`
|
|
query GetSiteOpsConfig {
|
|
siteOpsConfig {
|
|
site {
|
|
info {
|
|
name
|
|
localeDefault
|
|
localesSupported
|
|
}
|
|
brand {
|
|
logoUrl
|
|
primaryColor
|
|
darkModeDefault
|
|
}
|
|
footerLinks {
|
|
name
|
|
url
|
|
visibleToGuest
|
|
}
|
|
}
|
|
noticeMaintenance {
|
|
banner {
|
|
enabled
|
|
text
|
|
}
|
|
maintenanceWindow {
|
|
enabled
|
|
startTime
|
|
endTime
|
|
message
|
|
}
|
|
modalAnnouncements {
|
|
id
|
|
title
|
|
content
|
|
startTime
|
|
endTime
|
|
audience
|
|
priority
|
|
}
|
|
}
|
|
docsSupport {
|
|
links {
|
|
name
|
|
url
|
|
description
|
|
}
|
|
channels {
|
|
email
|
|
ticketSystem
|
|
chatGroups {
|
|
name
|
|
url
|
|
qrCode
|
|
description
|
|
}
|
|
workingHours
|
|
}
|
|
}
|
|
ops {
|
|
features {
|
|
registrationEnabled
|
|
inviteCodeRequired
|
|
emailVerification
|
|
}
|
|
limits {
|
|
maxUsers
|
|
maxInviteCodesPerUser
|
|
sessionTimeoutHours
|
|
}
|
|
notifications {
|
|
welcomeEmail
|
|
systemAnnouncements
|
|
maintenanceAlerts
|
|
}
|
|
}
|
|
}
|
|
}
|
|
`;
|
|
|
|
// 获取站点配置
|
|
export const GET_SITE_CONFIG = gql`
|
|
query GetSiteConfig {
|
|
siteConfig {
|
|
info {
|
|
name
|
|
localeDefault
|
|
localesSupported
|
|
}
|
|
brand {
|
|
logoUrl
|
|
primaryColor
|
|
darkModeDefault
|
|
}
|
|
footerLinks {
|
|
name
|
|
url
|
|
visibleToGuest
|
|
}
|
|
}
|
|
}
|
|
`;
|
|
|
|
// 获取公告维护配置
|
|
export const GET_NOTICE_MAINTENANCE_CONFIG = gql`
|
|
query GetNoticeMaintenanceConfig {
|
|
noticeMaintenanceConfig {
|
|
banner {
|
|
enabled
|
|
text
|
|
}
|
|
maintenanceWindow {
|
|
enabled
|
|
startTime
|
|
endTime
|
|
message
|
|
}
|
|
modalAnnouncements {
|
|
id
|
|
title
|
|
content
|
|
startTime
|
|
endTime
|
|
audience
|
|
priority
|
|
}
|
|
}
|
|
}
|
|
`;
|
|
|
|
// 获取文档支持配置
|
|
export const GET_DOCS_SUPPORT_CONFIG = gql`
|
|
query GetDocsSupportConfig {
|
|
docsSupportConfig {
|
|
links {
|
|
name
|
|
url
|
|
description
|
|
}
|
|
channels {
|
|
email
|
|
ticketSystem
|
|
chatGroups {
|
|
name
|
|
url
|
|
qrCode
|
|
description
|
|
}
|
|
workingHours
|
|
}
|
|
}
|
|
}
|
|
`;
|
|
|
|
// 获取运营配置
|
|
export const GET_OPS_CONFIG = gql`
|
|
query GetOpsConfig {
|
|
opsConfig {
|
|
features {
|
|
registrationEnabled
|
|
inviteCodeRequired
|
|
emailVerification
|
|
}
|
|
limits {
|
|
maxUsers
|
|
maxInviteCodesPerUser
|
|
sessionTimeoutHours
|
|
}
|
|
notifications {
|
|
welcomeEmail
|
|
systemAnnouncements
|
|
maintenanceAlerts
|
|
}
|
|
}
|
|
}
|
|
`;
|
|
|
|
// 验证配置
|
|
export const VALIDATE_CONFIG = gql`
|
|
query ValidateConfig {
|
|
validateConfig {
|
|
valid
|
|
errors
|
|
warnings
|
|
}
|
|
}
|
|
`;
|
|
|
|
// 批量更新配置
|
|
export const UPDATE_CONFIG_BATCH = gql`
|
|
mutation UpdateConfigBatch($input: [UpdateConfig!]!) {
|
|
updateConfigBatch(input: $input)
|
|
}
|
|
`;
|
|
|
|
// 更新单个配置设置
|
|
export const UPDATE_SETTING = gql`
|
|
mutation UpdateSetting($key: String!, $value: String!) {
|
|
updateConfigBatch(input: [{ key: $key, value: $value }])
|
|
}
|
|
`;
|
|
|
|
// 批量更新配置设置(兼容旧版本)
|
|
export const UPDATE_SETTINGS = gql`
|
|
mutation UpdateSettings($settings: [UpdateConfig!]!) {
|
|
updateConfigBatch(input: $settings)
|
|
}
|
|
`;
|
|
|
|
// 重置配置到默认值
|
|
export const RESET_SETTINGS = gql`
|
|
mutation ResetSettings($keys: [String!]!) {
|
|
resetSettings(keys: $keys) {
|
|
success
|
|
message
|
|
}
|
|
}
|
|
`;
|
|
|
|
// 导出配置
|
|
export const EXPORT_CONFIG = gql`
|
|
query ExportConfig {
|
|
exportConfig {
|
|
data
|
|
timestamp
|
|
}
|
|
}
|
|
`;
|
|
|
|
// 导入配置
|
|
export const IMPORT_CONFIG = gql`
|
|
mutation ImportConfig($configData: String!) {
|
|
importConfig(configData: $configData) {
|
|
success
|
|
message
|
|
importedCount
|
|
skippedCount
|
|
}
|
|
}
|
|
`; |