waibu-db 1.1.3 → 1.1.4
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.
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
function buildParams ({ model, req, reply, action }) {
|
|
2
2
|
const { camelCase, kebabCase, map, upperFirst, get } = this.lib._
|
|
3
3
|
const { getSchema } = this.app.dobo
|
|
4
|
-
const [
|
|
4
|
+
const [, ...names] = map(kebabCase(model).split('-'), n => upperFirst(n))
|
|
5
5
|
const schema = getSchema(camelCase(model), false)
|
|
6
|
-
const modelTitle = this.app[schema.ns].title + ': ' + names.join(' ')
|
|
6
|
+
const modelTitle = this.app[schema.ns].title + ': ' + req.t(camelCase(names.join(' ')))
|
|
7
7
|
const page = {
|
|
8
|
-
title: req.t(get(req, 'routeOptions.config.title',
|
|
8
|
+
title: req.t(get(req, 'routeOptions.config.title', this.app[schema.ns].title)),
|
|
9
9
|
modelTitle
|
|
10
10
|
}
|
|
11
11
|
return { page }
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
function modelsMenu (req) {
|
|
1
|
+
function modelsMenu (locals, req) {
|
|
2
2
|
const { getPluginPrefix } = this.app.waibu
|
|
3
|
-
const {
|
|
3
|
+
const { pascalCase } = this.app.bajo
|
|
4
4
|
const { getAppTitle } = this.app.waibuMpa
|
|
5
|
-
const { map, pick, groupBy, keys, kebabCase, filter, get } = this.lib._
|
|
5
|
+
const { camelCase, map, pick, groupBy, keys, kebabCase, filter, get } = this.lib._
|
|
6
6
|
|
|
7
7
|
const prefix = getPluginPrefix(this.name)
|
|
8
8
|
const schemas = filter(this.app.dobo.schemas, s => {
|
|
@@ -29,7 +29,7 @@ function modelsMenu (req) {
|
|
|
29
29
|
name: k,
|
|
30
30
|
children: map(items, item => {
|
|
31
31
|
return {
|
|
32
|
-
name:
|
|
32
|
+
name: req.t(camelCase(item.name.slice(plugin.alias.length))),
|
|
33
33
|
href: `waibuAdmin:/${prefix}/${kebabCase(item.name)}/list`
|
|
34
34
|
}
|
|
35
35
|
})
|