mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: testdata generate callback
This commit is contained in:
1 file changed
+11
-1
@@ -348,7 +348,17 @@ const page = new NamedPage('problem_files', () => {
|
|||||||
</div>`,
|
</div>`,
|
||||||
width: `${window.innerWidth - 200}px`,
|
width: `${window.innerWidth - 200}px`,
|
||||||
height: `${window.innerHeight - 100}px`,
|
height: `${window.innerHeight - 100}px`,
|
||||||
}).open();
|
});
|
||||||
|
const callback = (data: MessageEvent<any>) => {
|
||||||
|
if (data.data.status === STATUS.STATUS_ACCEPTED) {
|
||||||
|
dialog.close();
|
||||||
|
Notification.success('Testdata generated successfully.');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
window.addEventListener('message', callback, false);
|
||||||
|
await dialog.open();
|
||||||
|
window.removeEventListener('message', callback, false);
|
||||||
|
await pjax.request({ push: false });
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
Notification.error([error.message, ...error.params].join(' '));
|
Notification.error([error.message, ...error.params].join(' '));
|
||||||
|
|||||||
Reference in new issue
Block a user