--- /dev/null
+import toastr from '../../assets/js/toastr.min.js'\r
+export default function(type, title, info, detail="") {\r
+ if(typeof type == "number") {\r
+ if(200 <= type && type < 300) {\r
+ type = "success";\r
+ } else if (300 <= type && type < 500) {\r
+ type = "warning";\r
+ } else if (500 <= type) {\r
+ type = "error";\r
+ } else {\r
+ type = "info";\r
+ }\r
+ }\r
+ if(detail != "") {\r
+ detail = "* <strong>detail:</strong> " + detail;\r
+ }\r
+ var content = "<br>* " + info + "<br><br>" + detail;\r
+ if(type == "success"){\r
+ toastr.success(content, title);\r
+ }\r
+ else if(type == "info") {\r
+ toastr.info(content, title);\r
+ }\r
+ else if(type == "error"){\r
+ toastr.error(content, title);\r
+ }\r
+ else {\r
+ toastr.warning(content, title);\r
+ }\r
+}
\ No newline at end of file