core: use common plugin-api interface

This commit is contained in:
undefined committed 2022-09-30 19:02:40 +08:00
1 parent c61c875bee
commit 70a96aecac
54 files changed
+387 -566

No files matched your search

+2 -2
View File
@@ -4,8 +4,8 @@ import path from 'path';
import AdmZip from 'adm-zip';
import fs from 'fs-extra';
import yaml from 'js-yaml';
import { Context } from '../context';
import { ValidationError } from '../error';
import { PluginContext } from '../loader';
import { PERM, PRIV } from '../model/builtin';
import problem, { ProblemDoc } from '../model/problem';
import { Handler } from '../service/server';
@@ -98,7 +98,7 @@ class ProblemImportHydroHandler extends Handler {
}
}
export async function apply(ctx: PluginContext) {
export async function apply(ctx: Context) {
ctx.Route('problem_import_hydro', '/problem/import/hydro', ProblemImportHydroHandler, PERM.PERM_CREATE_PROBLEM);
ctx.inject('ProblemAdd', 'problem_import_hydro', { icon: 'copy', text: 'Import From Hydro' });
}