mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 01:38:19 +08:00
merge origin/master
This commit is contained in:
commit
0e20de9200
2 files changed
+4
-3
No files matched your search
@@ -49,7 +49,7 @@ global.Hydro.lib.problemSearch = async (domainId, q, opts) => {
|
||||
post_filter: {
|
||||
bool: {
|
||||
minimum_should_match: 1,
|
||||
should: domainIds.map((i) => ({ term: { domainId: i } })),
|
||||
should: domainIds.map((i) => ({ match: { domainId: i } })),
|
||||
},
|
||||
},
|
||||
});
|
||||
@@ -64,7 +64,7 @@ export const description = 'Elastic problem search re-index';
|
||||
|
||||
export async function run({ domainId }, report) {
|
||||
try {
|
||||
if (domainId) await client.deleteByQuery({ index: 'problem', query: { term: { domainId } } });
|
||||
if (domainId) await client.deleteByQuery({ index: 'problem', query: { match: { domainId } } });
|
||||
else await client.deleteByQuery({ index: 'problem', query: { match_all: {} } });
|
||||
} catch (e) {
|
||||
if (!e.message.includes('index_not_found_exception')) throw e;
|
||||
|
||||
@@ -162,6 +162,7 @@ export default class Editor extends DOMAttachedObject {
|
||||
|
||||
async initVditor() {
|
||||
const pagename = document.documentElement.getAttribute('data-page');
|
||||
const isProblemPage = ['problem_create', 'problem_edit'].includes(pagename);
|
||||
const isProblemEdit = pagename === 'problem_edit';
|
||||
const { default: Vditor } = await import('vditor');
|
||||
const { $dom } = this;
|
||||
@@ -209,7 +210,7 @@ export default class Editor extends DOMAttachedObject {
|
||||
},
|
||||
})
|
||||
.then(() => {
|
||||
this.vditor.insertValue(`${wrapper.join(`file://${filename}`)} `);
|
||||
this.vditor.insertValue(`${wrapper.join(`${isProblemPage ? 'file://' : `/file/${UserContext._id}/`}${filename}`)} `);
|
||||
this.vditor.vditor.tip.hide();
|
||||
})
|
||||
.catch((e: { message: string; }) => {
|
||||
|
||||
Reference in new issue
Block a user