Adapting GUI for error report managing
[vid.git] / vid-app-common / src / main / webapp / app / vid / scripts / services / reportService.js
1 "use strict";
2
3 var ReportService = function ( $http ) {
4
5     return {
6
7         getReportData: function(requestInfo) {
8             return $http.post("error-report",requestInfo);
9         },
10
11         getReportTimeStamp: function () {
12             const today = new Date();
13             const se = String(today.getSeconds()).padStart(2, '0');
14             const mi = String(today.getMinutes()).padStart(2, '0');
15             const hr = String(today.getHours()).padStart(2, '0');
16             const dd = String(today.getDate()).padStart(2, '0');
17             const mm = String(today.getMonth() + 1).padStart(2, '0');
18             const yyyy = today.getFullYear();
19
20             return hr + '-' + mi + '-' + se + "_" + dd + '-' + mm + '-' + yyyy;
21         }
22
23     }
24
25 };
26
27 appDS2.factory("ReportService", ["$http", ReportService]);