minor bug fixes

This commit is contained in:
undefined committed 2025-04-21 05:07:50 +08:00
1 parent 2bfac40a8b
commit 401bb505c2
8 files changed
+18 -24

No files matched your search

+1 -1
View File
@@ -73,7 +73,7 @@ if (CI && (!tag || GITHUB_EVENT_NAME !== 'push')) {
}
}
await spawnAsync(
`yarn npm publish --access public --tag ${tag} ${CI ? '--provenance' : ''}`,
`yarn npm publish --access public --tag ${tag}${CI ? ' --provenance' : ''}`,
path.resolve(name),
);
}
+3 -2
View File
@@ -44,7 +44,7 @@
"cross-spawn": "^7.0.6",
"esbuild": "0.25.2",
"eslint": "^9.25.0",
"eslint-import-resolver-typescript": "^4.3.2",
"eslint-import-resolver-typescript": "^4.3.3",
"eslint-import-resolver-webpack": "^0.13.10",
"fs-extra": "^11.3.0",
"globals": "^16.0.0",
@@ -61,5 +61,6 @@
"supports-hyperlinks": "^3.2.0",
"typescript": "5.8.3",
"wtfnode": "^0.10.0"
}
},
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
+1 -1
View File
@@ -27,7 +27,7 @@
"@zip.js/zip.js": "^2.7.60",
"adm-zip": "0.5.16",
"cac": "^6.7.14",
"cordis": "4.0.0-beta.1",
"cordis": "4.0.0-beta.2",
"csv-stringify": "^6.5.2",
"emoji-regex": "^10.4.0",
"emojis-list": "2.1.0",
+1 -1
View File
@@ -194,7 +194,7 @@ export async function apply(ctx: Context) {
await opcount.inc(op, id, periodSecs, maxOperations);
},
renderTitle(str: string) {
const name = this.ctx.setting.get('server.name');
const name = this.ctx.get('setting')?.get('server.name') || system.get('server.name');
if (this.UiContext.extraTitleContent) return `${this.UiContext.extraTitleContent} - ${this.translate(str)} - ${name}`;
return `${this.translate(str)} - ${name}`;
},
@@ -19,7 +19,16 @@ const FileSelectAutoComplete = React.forwardRef<any, any>((props, ref) => (
itemKey={(item) => `${item._id?.toString() || item.name || item}`}
renderItem={(item) => item.name || item._id || item} // TODO icon
allowEmptyQuery
{...props}
{...{
width: '100%',
height: 'auto',
listStyle: {},
multi: false,
selectedKeys: [],
freeSolo: false,
freeSoloConverter: (input) => input,
...props,
}}
/>
));
@@ -38,14 +47,4 @@ FileSelectAutoComplete.propTypes = {
FileSelectAutoComplete.displayName = 'FileSelectAutoComplete';
FileSelectAutoComplete.defaultProps = {
width: '100%',
height: 'auto',
listStyle: {},
multi: false,
selectedKeys: [],
freeSolo: false,
freeSoloConverter: (input) => input,
};
export default FileSelectAutoComplete;
@@ -39,15 +39,12 @@ function ExtraFilesConfig() {
const userExtraFiles = useSelector((state: RootState) => state.config.user_extra_files || [], isEqual);
const judgeExtraFiles = useSelector((state: RootState) => state.config.judge_extra_files || [], isEqual);
const dispatch = useDispatch();
const userRef = React.useRef<any>();
const judgeRef = React.useRef<any>();
return (
<FormItem columns={12} label="ExtraFilesConfig" disableLabel>
<Card style={{ padding: 10 }}>
<div className="row">
<FormItem columns={12} label={i18n('user_extra_files')}>
<FileSelectAutoComplete
ref={userRef}
data={Files}
selectedKeys={userExtraFiles}
onChange={(val) => dispatch({ type: 'CONFIG_FORM_UPDATE', key: 'user_extra_files', value: val.split(',') })}
@@ -56,7 +53,6 @@ function ExtraFilesConfig() {
</FormItem>
<FormItem columns={12} label={i18n('judge_extra_files')}>
<FileSelectAutoComplete
ref={judgeRef}
data={Files}
selectedKeys={judgeExtraFiles}
onChange={(val) => dispatch({ type: 'CONFIG_FORM_UPDATE', key: 'judge_extra_files', value: val.split(',') })}
@@ -75,7 +71,6 @@ function LangConfig() {
const data = Object.keys(window.LANGS).filter((i) => !prefixes.has(i))
.map((i) => ({ name: `${i.includes('.') ? `${window.LANGS[i.split('.')[0]].display || ''}/` : ''}${window.LANGS[i].display}`, _id: i }));
const dispatch = useDispatch();
const ref = React.useRef<any>();
const selectedKeys = langs.filter((i) => !prefixes.has(i));
return (
<FormItem columns={12} label="langs" disableLabel>
@@ -83,7 +78,6 @@ function LangConfig() {
<div className="row">
<FormItem columns={12} label="langs">
<CustomSelectAutoComplete
ref={ref}
data={data}
placeholder={!selectedKeys.length ? i18n('Unlimited') : i18n('Code language')}
selectedKeys={selectedKeys}
+1 -1
View File
@@ -49,7 +49,7 @@
"clean-webpack-plugin": "^4.0.0",
"clipboard": "^2.0.11",
"copy-webpack-plugin": "^13.0.0",
"cordis": "4.0.0-beta.1",
"cordis": "4.0.0-beta.2",
"core-js": "^3.41.0",
"core-js-compat": "^3.41.0",
"css-loader": "^7.1.2",
+1 -1
View File
@@ -8,7 +8,7 @@
"preview": "vite preview"
},
"dependencies": {
"@vitejs/plugin-react": "^4.4.0",
"@vitejs/plugin-react": "^4.4.1",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},