waibu-db 2.25.2 → 2.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -196,7 +196,7 @@ const handler = {
196
196
  async function getSchemaExt (modelName, view, options = {}) {
197
197
  const { readConfig } = this.app.bajo
198
198
  const { defaultsDeep } = this.app.lib.aneka
199
- const { pick, isString } = this.app.lib._
199
+ const { pick, isString, get } = this.app.lib._
200
200
 
201
201
  const model = isString(modelName) ? this.app.dobo.getModel(modelName) : modelName
202
202
  const ns = model.plugin.ns
@@ -208,6 +208,11 @@ async function getSchemaExt (modelName, view, options = {}) {
208
208
  ext = defaultsDeep(options.schema ?? {}, ext)
209
209
  await handler[view].call(this, schema, ext, options)
210
210
  delete schema.model
211
+ const req = get(options, 'args.0.req')
212
+ if (req && req.routeOptions.config.mainSiteEdit && req.site.alias !== 'default') {
213
+ schema.disabled = schema.disabled ?? []
214
+ schema.disabled.push('create', 'update', 'remove')
215
+ }
211
216
  return { schema, ext, model }
212
217
  }
213
218
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waibu-db",
3
- "version": "2.25.2",
3
+ "version": "2.26.0",
4
4
  "description": "DB Helper",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/wiki/CHANGES.md CHANGED
@@ -5,6 +5,7 @@
5
5
  - [2.25.2] Bug fix in ```wdb-data-table``` widget
6
6
  - [2.25.2] Bug fix in ```wdb-form``` widget
7
7
  - [2.25.2] Bug fix in ```get-schema-ext.js```
8
+ - [2.26.0] Add feature to edit schema only on main site
8
9
 
9
10
  ## 2026-06-13
10
11