mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 21:13:50 +00:00

* feat: admin add custom plugin * refresh plugins * plugin input box ui * fix: run plugin varialbes error * perf: comment * fix: ts
37 lines
743 B
TypeScript
37 lines
743 B
TypeScript
import { connectionMongo, getMongoModel } from '../../../common/mongo/index';
|
|
const { Schema } = connectionMongo;
|
|
import type { SystemPluginConfigSchemaType } from './type';
|
|
|
|
export const collectionName = 'app_system_plugins';
|
|
|
|
const SystemPluginSchema = new Schema({
|
|
pluginId: {
|
|
type: String,
|
|
required: true
|
|
},
|
|
isActive: {
|
|
type: Boolean,
|
|
required: true
|
|
},
|
|
inputConfig: {
|
|
type: Array,
|
|
default: []
|
|
},
|
|
originCost: {
|
|
type: Number,
|
|
default: 0
|
|
},
|
|
currentCost: {
|
|
type: Number,
|
|
default: 0
|
|
},
|
|
customConfig: Object
|
|
});
|
|
|
|
SystemPluginSchema.index({ pluginId: 1 });
|
|
|
|
export const MongoSystemPluginSchema = getMongoModel<SystemPluginConfigSchemaType>(
|
|
collectionName,
|
|
SystemPluginSchema
|
|
);
|