mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 05:29:26 +08:00
Merge branch 'next' into feat/data-time-variables
This commit is contained in:
commit
e84f94f143
@ -48,6 +48,7 @@ module.exports = (cli) => {
|
||||
.option('-i, --instances [instances]')
|
||||
.option('--db-sync')
|
||||
.option('--quickstart')
|
||||
.option('--launch-mode [launchMode]')
|
||||
.allowUnknownOption()
|
||||
.action(async (opts) => {
|
||||
checkDBDialect();
|
||||
@ -119,17 +120,27 @@ module.exports = (cli) => {
|
||||
]);
|
||||
process.exit();
|
||||
} else {
|
||||
run(
|
||||
'pm2-runtime',
|
||||
[
|
||||
'start',
|
||||
...instancesArgs,
|
||||
`${APP_PACKAGE_ROOT}/lib/index.js`,
|
||||
NODE_ARGS ? `--node-args="${NODE_ARGS}"` : undefined,
|
||||
'--',
|
||||
...process.argv.slice(2),
|
||||
].filter(Boolean),
|
||||
);
|
||||
const launchMode = opts.launchMode || process.env.APP_LAUNCH_MODE || 'pm2';
|
||||
if (launchMode === 'pm2') {
|
||||
run(
|
||||
'pm2-runtime',
|
||||
[
|
||||
'start',
|
||||
...instancesArgs,
|
||||
`${APP_PACKAGE_ROOT}/lib/index.js`,
|
||||
NODE_ARGS ? `--node-args="${NODE_ARGS}"` : undefined,
|
||||
'--',
|
||||
...process.argv.slice(2),
|
||||
].filter(Boolean),
|
||||
);
|
||||
} else {
|
||||
run(
|
||||
'node',
|
||||
[`${APP_PACKAGE_ROOT}/lib/index.js`, ...(NODE_ARGS || '').split(' '), ...process.argv.slice(2)].filter(
|
||||
Boolean,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
@ -145,15 +145,7 @@ const processCondition = async (
|
||||
const processAdvancedCondition = async (condition, variables, localVariables, jsonLogic) => {
|
||||
const operator = condition.op;
|
||||
const rightValue = await parseVariableValue(condition.rightVar, variables, localVariables);
|
||||
let leftValue = await parseVariableValue(condition.leftVar, variables, localVariables);
|
||||
const leftCollectionField = await variables.getCollectionField(condition.leftVar, localVariables);
|
||||
if (
|
||||
leftValue &&
|
||||
['datetime', 'date', 'datetimeNoTz', 'dateOnly', 'unixTimestamp'].includes(leftCollectionField.type)
|
||||
) {
|
||||
const format = getFormatFromDateStr(rightValue);
|
||||
leftValue = dayjs.utc(leftValue).local().format(format);
|
||||
}
|
||||
const leftValue = await parseVariableValue(condition.leftVar, variables, localVariables);
|
||||
if (operator) {
|
||||
return jsonLogic.apply({ [operator]: [leftValue, rightValue] });
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user