diff --git a/config/cfg_default.js b/config/cfg_default.js index 942fc626..3d1418cb 100644 --- a/config/cfg_default.js +++ b/config/cfg_default.js @@ -8,15 +8,15 @@ export const avatarProfile = true // 群面板排名 export const groupRank = false +// 可选值5~30,建议15。设置高排名人数会导致渲染图片速度加长,发送缓慢 +export const rankNumber = 15 + // 使用【#上传深渊】功能取代【#深渊】功能,默认关闭 export const uploadAbyssData = false // 使用【#面板练度统计】功能取代【#练度统计】功能,默认关闭 export const profileStat = false -// 可选值5~30,建议15。设置高排行人数会导致渲染图片速度加长,发送缓慢 -export const rankNumber = 15 - // 老婆查询 export const avatarWife = true diff --git a/config/system/cfg_system.js b/config/system/cfg_system.js index b1ab97af..e20329a6 100644 --- a/config/system/cfg_system.js +++ b/config/system/cfg_system.js @@ -35,6 +35,14 @@ export const cfgSchema = { type: 'num', desc: '参与排名的限制条件:1:无限制 2:有CK 3:有16个角色或有CK 4:有御三家(安柏&凯亚&丽莎)或有CK 5:有16个角色+御三家或有CK。 若改变设置请根据情况决定是否需要【#重置排名】' }, + rankNumber: { + title: '排名人数', + key: '排名人数', + type: 'num', + def: 15, + input: (n) => Math.min(30, Math.max(5, (n * 1 || 15))), + desc: '可选值5~30,建议15。设置高排名人数会导致渲染图片速度加长,发送缓慢' + }, uploadAbyssData: { title: '上传深渊', key: '深渊', @@ -49,14 +57,6 @@ export const cfgSchema = { oldCfgKey: 'profile.stat', desc: '使用【#面板练度统计】功能取代【#练度统计】功能,默认关闭' }, - rankNumber: { - title: '排行人数', - key: '排行人数', - type: 'num', - def: 15, - input: (n) => Math.min(30, Math.max(5, (n * 1 || 15))), - desc: '可选值5~30,建议15。设置高排行人数会导致渲染图片速度加长,发送缓慢' - }, avatarWife: { title: '老婆查询', key: '老婆', diff --git a/models/ProfileRank.js b/models/ProfileRank.js index feb235d6..7dbea862 100644 --- a/models/ProfileRank.js +++ b/models/ProfileRank.js @@ -1,6 +1,6 @@ import lodash from 'lodash' import moment from 'moment' -import { Cfg, Common, Data, } from '../components/index.js' +import { Cfg, Common, Data } from '../components/index.js' export default class ProfileRank { constructor (data) { @@ -193,6 +193,7 @@ export default class ProfileRank { await Data.redisSet(`miao:rank:${groupId}:cfg`, ret, 3600 * 24 * 365) ret.limitTxt = rankLimitTxt[rankLimit] ret.time = moment(new Date(ret.timestamp)).format('MM-DD HH:mm') + ret.number = Cfg.get('rankNumber', 15) return ret } diff --git a/resources/character/rank-profile-list.html b/resources/character/rank-profile-list.html index 9a5ff6bc..e1a9182c 100644 --- a/resources/character/rank-profile-list.html +++ b/resources/character/rank-profile-list.html @@ -33,6 +33,9 @@
  • 排名参与条件: {{rankCfg.limitTxt}}
  • +
  • + 排名人数: {{rankCfg.number}} (可由管理员在#喵喵设置 内设置,范围5~30) +
  • {{/if}} @@ -134,4 +137,4 @@ {{/each}} -{{/block}} \ No newline at end of file +{{/block}}