diff --git a/AsbCloudWebApi/Controllers/AnalyticsController.cs b/AsbCloudWebApi/Controllers/AnalyticsController.cs index 9a2fce2a..ef246888 100644 --- a/AsbCloudWebApi/Controllers/AnalyticsController.cs +++ b/AsbCloudWebApi/Controllers/AnalyticsController.cs @@ -1,4 +1,5 @@ using System; +using System.Linq; using System.Collections.Generic; using AsbCloudApp.Data; using AsbCloudApp.Services; @@ -38,6 +39,9 @@ namespace AsbCloudWebApi.Controllers var wellDepthToDayData = analyticsService.GetWellDepthToDay(wellId); + if (wellDepthToDayData is null || !wellDepthToDayData.Any()) + return NoContent(); + return Ok(wellDepthToDayData); } @@ -62,6 +66,9 @@ namespace AsbCloudWebApi.Controllers var wellDepthToIntervalData = analyticsService.GetWellDepthToInterval(wellId, intervalHoursTimestamp, workBeginTimestamp); + if (wellDepthToIntervalData is null || !wellDepthToIntervalData.Any()) + return NoContent(); + return Ok(wellDepthToIntervalData); } @@ -84,6 +91,9 @@ namespace AsbCloudWebApi.Controllers var analytics = analyticsService.GetOperationsSummary(wellId, begin, end); + if (analytics is null || !analytics.Any()) + return NoContent(); + return Ok(analytics); } @@ -108,6 +118,9 @@ namespace AsbCloudWebApi.Controllers var analytics = analyticsService.GetOperationsToInterval(wellId, intervalHoursTimestamp, workBeginTimestamp); + if (analytics is null || !analytics.Any()) + return NoContent(); + return Ok(analytics); } } diff --git a/AsbCloudWebApi/Controllers/DataController.cs b/AsbCloudWebApi/Controllers/DataController.cs index 5f50a45d..63df6e8c 100644 --- a/AsbCloudWebApi/Controllers/DataController.cs +++ b/AsbCloudWebApi/Controllers/DataController.cs @@ -4,6 +4,7 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; +using System.Linq; namespace AsbCloudWebApi.Controllers { @@ -41,6 +42,10 @@ namespace AsbCloudWebApi.Controllers if (begin == default) begin = DateTime.Now.AddSeconds(-intervalSec); var content = telemetryDataService.Get(wellId, begin, intervalSec, approxPointsCount); + + if (content is null || !content.Any()) + return NoContent(); + return Ok(content); } diff --git a/AsbCloudWebApi/Controllers/MessageController.cs b/AsbCloudWebApi/Controllers/MessageController.cs index 17e3ed56..fbce313f 100644 --- a/AsbCloudWebApi/Controllers/MessageController.cs +++ b/AsbCloudWebApi/Controllers/MessageController.cs @@ -41,6 +41,10 @@ namespace AsbCloudWebApi.Controllers begin = default; var result = messageService.GetMessages(wellId, categoryids, begin, end, skip, take); + + if (result is null || result.Count == 0) + return NoContent(); + return Ok(result); } diff --git a/AsbCloudWebApi/Controllers/ReportController.cs b/AsbCloudWebApi/Controllers/ReportController.cs index 8dd2ffb7..846b3281 100644 --- a/AsbCloudWebApi/Controllers/ReportController.cs +++ b/AsbCloudWebApi/Controllers/ReportController.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Linq; using System.IO; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; @@ -120,6 +121,10 @@ namespace AsbCloudWebApi.Controllers DateTime begin = default, DateTime end = default) { var suitableReportsNames = reportService.GetSuitableReports(wellId, begin, end, stepSeconds, format); + + if (suitableReportsNames is null || !suitableReportsNames.Any()) + return NoContent(); + return Ok(suitableReportsNames); } diff --git a/AsbCloudWebApi/Controllers/WellController.cs b/AsbCloudWebApi/Controllers/WellController.cs index 4033eead..1e16a167 100644 --- a/AsbCloudWebApi/Controllers/WellController.cs +++ b/AsbCloudWebApi/Controllers/WellController.cs @@ -3,6 +3,7 @@ using AsbCloudApp.Services; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; +using System.Linq; namespace AsbCloudWebApi.Controllers { @@ -31,6 +32,9 @@ namespace AsbCloudWebApi.Controllers var wells = wellService.GetWellsByCustomer((int)idCustomer); + if (wells is null || !wells.Any()) + return NoContent(); + return Ok(wells); } @@ -47,6 +51,9 @@ namespace AsbCloudWebApi.Controllers var transmittingWells = wellService.GetTransmittingWells((int)idCustomer); + if (transmittingWells is null || !transmittingWells.Any()) + return NoContent(); + return Ok(transmittingWells); } diff --git a/AsbCloudWebApi/wwwroot/asset-manifest.json b/AsbCloudWebApi/wwwroot/asset-manifest.json new file mode 100644 index 00000000..8191ad04 --- /dev/null +++ b/AsbCloudWebApi/wwwroot/asset-manifest.json @@ -0,0 +1,34 @@ +{ + "files": { + "main.css": "/static/css/main.78f652ed.chunk.css", + "main.js": "/static/js/main.bc9ed2e6.chunk.js", + "main.js.map": "/static/js/main.bc9ed2e6.chunk.js.map", + "runtime-main.js": "/static/js/runtime-main.bfbc5d7c.js", + "runtime-main.js.map": "/static/js/runtime-main.bfbc5d7c.js.map", + "static/js/2.d2927f6c.chunk.js": "/static/js/2.d2927f6c.chunk.js", + "static/js/2.d2927f6c.chunk.js.map": "/static/js/2.d2927f6c.chunk.js.map", + "static/js/3.e81cf339.chunk.js": "/static/js/3.e81cf339.chunk.js", + "static/js/3.e81cf339.chunk.js.map": "/static/js/3.e81cf339.chunk.js.map", + "index.html": "/index.html", + "static/css/main.78f652ed.chunk.css.map": "/static/css/main.78f652ed.chunk.css.map", + "static/js/2.d2927f6c.chunk.js.LICENSE.txt": "/static/js/2.d2927f6c.chunk.js.LICENSE.txt", + "static/media/40752.04f88a90.png": "/static/media/40752.04f88a90.png", + "static/media/40808.9c38815a.png": "/static/media/40808.9c38815a.png", + "static/media/40997.3601b273.png": "/static/media/40997.3601b273.png", + "static/media/42483.54ae2d28.png": "/static/media/42483.54ae2d28.png", + "static/media/43745.0c1185c0.png": "/static/media/43745.0c1185c0.png", + "static/media/asb-logo.5d662174.png": "/static/media/asb-logo.5d662174.png", + "static/media/map_background.08470ca4.png": "/static/media/map_background.08470ca4.png", + "static/media/pointer.31629e02.svg": "/static/media/pointer.31629e02.svg", + "static/media/well-chart-1.0ba3a280.png": "/static/media/well-chart-1.0ba3a280.png", + "static/media/well-chart-2.d79caafa.png": "/static/media/well-chart-2.d79caafa.png", + "static/media/well-chart-3.98133e57.png": "/static/media/well-chart-3.98133e57.png", + "static/media/well-chart-8.9c38815a.png": "/static/media/well-chart-8.9c38815a.png" + }, + "entrypoints": [ + "static/js/runtime-main.bfbc5d7c.js", + "static/js/2.d2927f6c.chunk.js", + "static/css/main.78f652ed.chunk.css", + "static/js/main.bc9ed2e6.chunk.js" + ] +} \ No newline at end of file diff --git a/AsbCloudWebApi/wwwroot/favicon.ico b/AsbCloudWebApi/wwwroot/favicon.ico new file mode 100644 index 00000000..0427b291 Binary files /dev/null and b/AsbCloudWebApi/wwwroot/favicon.ico differ diff --git a/AsbCloudWebApi/wwwroot/index.html b/AsbCloudWebApi/wwwroot/index.html index 75687662..eddbbf9f 100644 --- a/AsbCloudWebApi/wwwroot/index.html +++ b/AsbCloudWebApi/wwwroot/index.html @@ -1,10 +1 @@ - - -
- -`s get reset. However, we also reset the\n// bottom margin to use `em` units instead of `em`.\np {\n margin-top: 0;\n margin-bottom: 1em;\n}\n\n// Abbreviations\n//\n// 1. remove the bottom border in Firefox 39-.\n// 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.\n// 3. Add explicit cursor to indicate changed behavior.\n// 4. Duplicate behavior to the data-* attribute for our tooltip plugin\n\nabbr[title],\nabbr[data-original-title] {\n // 4\n text-decoration: underline; // 2\n text-decoration: underline dotted; // 2\n border-bottom: 0; // 1\n cursor: help; // 3\n}\n\naddress {\n margin-bottom: 1em;\n font-style: normal;\n line-height: inherit;\n}\n\ninput[type='text'],\ninput[type='password'],\ninput[type='number'],\ntextarea {\n -webkit-appearance: none;\n}\n\nol,\nul,\ndl {\n margin-top: 0;\n margin-bottom: 1em;\n}\n\nol ol,\nul ul,\nol ul,\nul ol {\n margin-bottom: 0;\n}\n\ndt {\n font-weight: 500;\n}\n\ndd {\n margin-bottom: 0.5em;\n margin-left: 0; // Undo browser default\n}\n\nblockquote {\n margin: 0 0 1em;\n}\n\ndfn {\n font-style: italic; // Add the correct font style in Android 4.3-\n}\n\nb,\nstrong {\n font-weight: bolder; // Add the correct font weight in Chrome, Edge, and Safari\n}\n\nsmall {\n font-size: 80%; // Add the correct font size in all browsers\n}\n\n//\n// Prevent `sub` and `sup` elements from affecting the line height in\n// all browsers.\n//\n\nsub,\nsup {\n position: relative;\n font-size: 75%;\n line-height: 0;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\nsup {\n top: -0.5em;\n}\n\n//\n// Links\n//\n\na {\n color: @link-color;\n text-decoration: @link-decoration;\n background-color: transparent; // remove the gray background on active links in IE 10.\n outline: none;\n cursor: pointer;\n transition: color 0.3s;\n -webkit-text-decoration-skip: objects; // remove gaps in links underline in iOS 8+ and Safari 8+.\n\n &:hover {\n color: @link-hover-color;\n }\n\n &:active {\n color: @link-active-color;\n }\n\n &:active,\n &:hover {\n text-decoration: @link-hover-decoration;\n outline: 0;\n }\n\n // https://github.com/ant-design/ant-design/issues/22503\n &:focus {\n text-decoration: @link-focus-decoration;\n outline: @link-focus-outline;\n }\n\n &[disabled] {\n color: @disabled-color;\n cursor: not-allowed;\n pointer-events: none;\n }\n}\n\n//\n// Code\n//\n\npre,\ncode,\nkbd,\nsamp {\n font-size: 1em; // Correct the odd `em` font sizing in all browsers.\n font-family: @code-family;\n}\n\npre {\n // remove browser default top margin\n margin-top: 0;\n // Reset browser default of `1em` to use `em`s\n margin-bottom: 1em;\n // Don't allow content to break outside\n overflow: auto;\n}\n\n//\n// Figures\n//\nfigure {\n // Apply a consistent margin strategy (matches our type styles).\n margin: 0 0 1em;\n}\n\n//\n// Images and content\n//\n\nimg {\n vertical-align: middle;\n border-style: none; // remove the border on images inside links in IE 10-.\n}\n\nsvg:not(:root) {\n overflow: hidden; // Hide the overflow in IE\n}\n\n// Avoid 300ms click delay on touch devices that support the `touch-action` CSS property.\n//\n// In particular, unlike most other browsers, IE11+Edge on Windows 10 on touch devices and IE Mobile 10-11\n// DON'T remove the click delay when `` is present.\n// However, they DO support emoving the click delay via `touch-action: manipulation`.\n// See:\n// * https://getbootstrap.com/docs/4.0/content/reboot/#click-delay-optimization-for-touch\n// * http://caniuse.com/#feat=css-touch-action\n// * https://patrickhlauke.github.io/touch/tests/results/#suppressing-300ms-delay\n\na,\narea,\nbutton,\n[role='button'],\ninput:not([type='range']),\nlabel,\nselect,\nsummary,\ntextarea {\n touch-action: manipulation;\n}\n\n//\n// Tables\n//\n\ntable {\n border-collapse: collapse; // Prevent double borders\n}\n\ncaption {\n padding-top: 0.75em;\n padding-bottom: 0.3em;\n color: @text-color-secondary;\n text-align: left;\n caption-side: bottom;\n}\n\nth {\n // Matches default `