mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
修复windows下路径的问题,添加设置项,完善翻译
This commit is contained in:
1 parent
5980080302
commit
6ad41dc2ae
29 files changed
+368
-278
No files matched your search
@@ -1,5 +1,9 @@
|
||||
import { AutoloadPage } from 'vj/misc/PageLoader';
|
||||
import { InfoDialog } from 'vj/components/dialog';
|
||||
import Notification from 'vj/components/notification';
|
||||
import { FLAG_ALERT } from 'vj/constant/message';
|
||||
import i18n from 'vj/utils/i18n';
|
||||
import tpl from 'vj/utils/tpl';
|
||||
|
||||
const messagePage = new AutoloadPage('messagePage', () => {
|
||||
async function init() {
|
||||
@@ -8,12 +12,23 @@ const messagePage = new AutoloadPage('messagePage', () => {
|
||||
const sock = new SockJs(`/home/messages-conn?token=${UiContext.token}`);
|
||||
sock.onmessage = (message) => {
|
||||
const msg = JSON.parse(message.data);
|
||||
Notification.show({
|
||||
title: msg.udoc.uname,
|
||||
avatar: msg.udoc.gravatar,
|
||||
message: msg.mdoc.content,
|
||||
duration: 0,
|
||||
});
|
||||
if (msg.mdoc.flag | FLAG_ALERT) {
|
||||
// Is alert
|
||||
const dialog = new InfoDialog({
|
||||
$body: tpl`
|
||||
<div class="typo">
|
||||
<p>${i18n(msg.udoc.content)}</p>
|
||||
</div>`,
|
||||
});
|
||||
dialog.open();
|
||||
} else {
|
||||
// Is message
|
||||
Notification.show({
|
||||
title: msg.udoc.uname,
|
||||
avatar: msg.udoc.gravatar,
|
||||
message: msg.mdoc.content,
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user