mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-05 15:11:15 +00:00
Introduces persistent protocol enable/disable state and related API endpoints in the backend, and adds frontend support for toggling protocols and managing protocol configs. Refactors protocol config storage to use per-protocol files, updates ProtocolManager to handle config and status, and enhances the Satori protocol UI with unified card components and improved state refresh. Removes the obsolete PROTOCOL_REFACTOR.md documentation.
24 lines
915 B
TypeScript
24 lines
915 B
TypeScript
import { ConfigBase } from '@/napcat-core/helper/config-base';
|
|
import { NapCatCore } from '@/napcat-core/index';
|
|
import { Type, Static } from '@sinclair/typebox';
|
|
import { AnySchema } from 'ajv';
|
|
|
|
export const NapcatConfigSchema = Type.Object({
|
|
fileLog: Type.Boolean({ default: false }),
|
|
consoleLog: Type.Boolean({ default: true }),
|
|
fileLogLevel: Type.String({ default: 'debug' }),
|
|
consoleLogLevel: Type.String({ default: 'info' }),
|
|
packetBackend: Type.String({ default: 'auto' }),
|
|
packetServer: Type.String({ default: '' }),
|
|
o3HookMode: Type.Number({ default: 0 }),
|
|
protocols: Type.Optional(Type.Record(Type.String(), Type.Boolean())),
|
|
});
|
|
|
|
export type NapcatConfig = Static<typeof NapcatConfigSchema>;
|
|
|
|
export class NapCatConfigLoader extends ConfigBase<NapcatConfig> {
|
|
constructor (core: NapCatCore, configPath: string, schema: AnySchema) {
|
|
super('napcat', core, configPath, schema);
|
|
}
|
|
}
|