From 26b13e50c888bc0ca03c0f68731f7c5abff0c6b6 Mon Sep 17 00:00:00 2001 From: LeoQi Date: Fri, 20 Jul 2018 02:52:12 +0800 Subject: add testsuite and testcase list pages in frontend of testing-scheduler JIRA: BOTTLENECK-236 add two base pages: testsuite page and testcase list page. Change-Id: I2c8eefac58893b0a3c0fb9c20f724f8612893dc0 Signed-off-by: Zheng Qibin --- .../ui/src/components/message/showMessage.js | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 testing-scheduler/ui/src/components/message/showMessage.js (limited to 'testing-scheduler/ui/src/components/message') diff --git a/testing-scheduler/ui/src/components/message/showMessage.js b/testing-scheduler/ui/src/components/message/showMessage.js new file mode 100644 index 00000000..39cc32bf --- /dev/null +++ b/testing-scheduler/ui/src/components/message/showMessage.js @@ -0,0 +1,30 @@ +import toastr from '../../assets/js/toastr.min.js' +export default function(type, title, info, detail="") { + if(typeof type == "number") { + if(200 <= type && type < 300) { + type = "success"; + } else if (300 <= type && type < 500) { + type = "warning"; + } else if (500 <= type) { + type = "error"; + } else { + type = "info"; + } + } + if(detail != "") { + detail = "* detail: " + detail; + } + var content = "
* " + info + "

" + detail; + if(type == "success"){ + toastr.success(content, title); + } + else if(type == "info") { + toastr.info(content, title); + } + else if(type == "error"){ + toastr.error(content, title); + } + else { + toastr.warning(content, title); + } +} \ No newline at end of file -- cgit 1.2.3-korg