mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-17 23:33:12 +09:00
Refactor web interface
Reimplement the pages of the web interface in order to make them prettier and more easily amended by plugins.
This commit is contained in:
1 parent
0c0626564a
commit
f67f56e6de
32 files changed
+1502
-1059
No files matched your search
@@ -1,5 +1,6 @@
|
||||
import { notification } from "antd";
|
||||
|
||||
|
||||
export default function notify(message, type = "info", description = undefined) {
|
||||
notification[type]({
|
||||
message: typeof message === "string" ? message : "ERROR: See console",
|
||||
@@ -8,3 +9,25 @@ export default function notify(message, type = "info", description = undefined)
|
||||
});
|
||||
if (typeof message !== "string") console.error(message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Promise rejection handler notifying the user
|
||||
*
|
||||
* Shows the error occuring in a notification card.
|
||||
*
|
||||
* @param {string} message -
|
||||
* User facing message to give context to the error. Should say which
|
||||
* operation failed.
|
||||
* @returns {function(err)} function showing the error passed to it.
|
||||
*/
|
||||
export function notifyErrorHandler(message) {
|
||||
return function handler(err) {
|
||||
console.error(err);
|
||||
notification.error({
|
||||
message,
|
||||
description: err.message,
|
||||
duration: 0,
|
||||
placement: "bottomRight",
|
||||
});
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user