From 70c4c910357da1ec8ae6411c2a2c4c90e1b7271b Mon Sep 17 00:00:00 2001 From: kunkliricsi Date: Thu, 26 Nov 2020 10:11:49 +0100 Subject: [PATCH] Fixed LogService baseUrl --- .../src/components/logs/LogService.js | 208 ++++++++++++++++++ .../src/components/logs/LogService.js.map | 1 + .../src/components/logs/LogService.ts | 6 +- 3 files changed, 212 insertions(+), 3 deletions(-) create mode 100644 Birdmap.API/ClientApp/src/components/logs/LogService.js create mode 100644 Birdmap.API/ClientApp/src/components/logs/LogService.js.map diff --git a/Birdmap.API/ClientApp/src/components/logs/LogService.js b/Birdmap.API/ClientApp/src/components/logs/LogService.js new file mode 100644 index 0000000..65ef2b4 --- /dev/null +++ b/Birdmap.API/ClientApp/src/components/logs/LogService.js @@ -0,0 +1,208 @@ +"use strict"; +/* tslint:disable */ +/* eslint-disable */ +//---------------------- +// +// Generated using the NSwag toolchain v13.8.2.0 (NJsonSchema v10.2.1.0 (Newtonsoft.Json v12.0.0.0)) (http://NSwag.org) +// +//---------------------- +// ReSharper disable InconsistentNaming +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ApiException = exports.HttpStatusCode = void 0; +var LogService = /** @class */ (function () { + function LogService(baseUrl, http) { + this.jsonParseReviver = undefined; + this.http = http ? http : window; + this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : "api/logs"; + } + LogService.prototype.getAll = function () { + var _this = this; + var url_ = this.baseUrl + "/all"; + url_ = url_.replace(/[?&]$/, ""); + var options_ = { + method: "GET", + headers: { + "Accept": "application/json", + 'Authorization': sessionStorage.getItem('user') + } + }; + return this.http.fetch(url_, options_).then(function (_response) { + return _this.processGetAll(_response); + }); + }; + LogService.prototype.processGetAll = function (response) { + var _this = this; + var status = response.status; + var _headers = {}; + if (response.headers && response.headers.forEach) { + response.headers.forEach(function (v, k) { return _headers[k] = v; }); + } + ; + if (status === 200) { + return response.text().then(function (_responseText) { + var result200 = null; + var resultData200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver); + if (Array.isArray(resultData200)) { + result200 = []; + for (var _i = 0, resultData200_1 = resultData200; _i < resultData200_1.length; _i++) { + var item = resultData200_1[_i]; + result200.push(item); + } + } + return result200; + }); + } + else if (status !== 200 && status !== 204) { + return response.text().then(function (_responseText) { + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + }); + } + return Promise.resolve(null); + }; + LogService.prototype.getFiles = function (filenames) { + var _this = this; + var url_ = this.baseUrl + "?"; + if (filenames !== undefined && filenames !== null) + filenames && filenames.forEach(function (item) { url_ += "filenames=" + encodeURIComponent("" + item) + "&"; }); + url_ = url_.replace(/[?&]$/, ""); + var options_ = { + method: "GET", + headers: { + "Accept": "application/octet-stream", + 'Authorization': sessionStorage.getItem('user') + } + }; + return this.http.fetch(url_, options_).then(function (_response) { + return _this.processGetFiles(_response); + }); + }; + LogService.prototype.processGetFiles = function (response) { + var status = response.status; + var _headers = {}; + if (response.headers && response.headers.forEach) { + response.headers.forEach(function (v, k) { return _headers[k] = v; }); + } + ; + if (status === 200 || status === 206) { + var contentDisposition = response.headers ? response.headers.get("content-disposition") : undefined; + var fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined; + var fileName_1 = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined; + return response.blob().then(function (blob) { return { fileName: fileName_1, data: blob, status: status, headers: _headers }; }); + } + else if (status !== 200 && status !== 204) { + return response.text().then(function (_responseText) { + return throwException("An unexpected server error occurred.", status, _responseText, _headers); + }); + } + return Promise.resolve(null); + }; + return LogService; +}()); +exports.default = LogService; +var HttpStatusCode; +(function (HttpStatusCode) { + HttpStatusCode["Continue"] = "Continue"; + HttpStatusCode["SwitchingProtocols"] = "SwitchingProtocols"; + HttpStatusCode["Processing"] = "Processing"; + HttpStatusCode["EarlyHints"] = "EarlyHints"; + HttpStatusCode["OK"] = "OK"; + HttpStatusCode["Created"] = "Created"; + HttpStatusCode["Accepted"] = "Accepted"; + HttpStatusCode["NonAuthoritativeInformation"] = "NonAuthoritativeInformation"; + HttpStatusCode["NoContent"] = "NoContent"; + HttpStatusCode["ResetContent"] = "ResetContent"; + HttpStatusCode["PartialContent"] = "PartialContent"; + HttpStatusCode["MultiStatus"] = "MultiStatus"; + HttpStatusCode["AlreadyReported"] = "AlreadyReported"; + HttpStatusCode["IMUsed"] = "IMUsed"; + HttpStatusCode["MultipleChoices"] = "Ambiguous"; + HttpStatusCode["Ambiguous"] = "Ambiguous"; + HttpStatusCode["MovedPermanently"] = "Moved"; + HttpStatusCode["Moved"] = "Moved"; + HttpStatusCode["Found"] = "Redirect"; + HttpStatusCode["Redirect"] = "Redirect"; + HttpStatusCode["SeeOther"] = "RedirectMethod"; + HttpStatusCode["RedirectMethod"] = "RedirectMethod"; + HttpStatusCode["NotModified"] = "NotModified"; + HttpStatusCode["UseProxy"] = "UseProxy"; + HttpStatusCode["Unused"] = "Unused"; + HttpStatusCode["TemporaryRedirect"] = "TemporaryRedirect"; + HttpStatusCode["RedirectKeepVerb"] = "TemporaryRedirect"; + HttpStatusCode["PermanentRedirect"] = "PermanentRedirect"; + HttpStatusCode["BadRequest"] = "BadRequest"; + HttpStatusCode["Unauthorized"] = "Unauthorized"; + HttpStatusCode["PaymentRequired"] = "PaymentRequired"; + HttpStatusCode["Forbidden"] = "Forbidden"; + HttpStatusCode["NotFound"] = "NotFound"; + HttpStatusCode["MethodNotAllowed"] = "MethodNotAllowed"; + HttpStatusCode["NotAcceptable"] = "NotAcceptable"; + HttpStatusCode["ProxyAuthenticationRequired"] = "ProxyAuthenticationRequired"; + HttpStatusCode["RequestTimeout"] = "RequestTimeout"; + HttpStatusCode["Conflict"] = "Conflict"; + HttpStatusCode["Gone"] = "Gone"; + HttpStatusCode["LengthRequired"] = "LengthRequired"; + HttpStatusCode["PreconditionFailed"] = "PreconditionFailed"; + HttpStatusCode["RequestEntityTooLarge"] = "RequestEntityTooLarge"; + HttpStatusCode["RequestUriTooLong"] = "RequestUriTooLong"; + HttpStatusCode["UnsupportedMediaType"] = "UnsupportedMediaType"; + HttpStatusCode["RequestedRangeNotSatisfiable"] = "RequestedRangeNotSatisfiable"; + HttpStatusCode["ExpectationFailed"] = "ExpectationFailed"; + HttpStatusCode["MisdirectedRequest"] = "MisdirectedRequest"; + HttpStatusCode["UnprocessableEntity"] = "UnprocessableEntity"; + HttpStatusCode["Locked"] = "Locked"; + HttpStatusCode["FailedDependency"] = "FailedDependency"; + HttpStatusCode["UpgradeRequired"] = "UpgradeRequired"; + HttpStatusCode["PreconditionRequired"] = "PreconditionRequired"; + HttpStatusCode["TooManyRequests"] = "TooManyRequests"; + HttpStatusCode["RequestHeaderFieldsTooLarge"] = "RequestHeaderFieldsTooLarge"; + HttpStatusCode["UnavailableForLegalReasons"] = "UnavailableForLegalReasons"; + HttpStatusCode["InternalServerError"] = "InternalServerError"; + HttpStatusCode["NotImplemented"] = "NotImplemented"; + HttpStatusCode["BadGateway"] = "BadGateway"; + HttpStatusCode["ServiceUnavailable"] = "ServiceUnavailable"; + HttpStatusCode["GatewayTimeout"] = "GatewayTimeout"; + HttpStatusCode["HttpVersionNotSupported"] = "HttpVersionNotSupported"; + HttpStatusCode["VariantAlsoNegotiates"] = "VariantAlsoNegotiates"; + HttpStatusCode["InsufficientStorage"] = "InsufficientStorage"; + HttpStatusCode["LoopDetected"] = "LoopDetected"; + HttpStatusCode["NotExtended"] = "NotExtended"; + HttpStatusCode["NetworkAuthenticationRequired"] = "NetworkAuthenticationRequired"; +})(HttpStatusCode = exports.HttpStatusCode || (exports.HttpStatusCode = {})); +var ApiException = /** @class */ (function (_super) { + __extends(ApiException, _super); + function ApiException(message, status, response, headers, result) { + var _this = _super.call(this) || this; + _this.isApiException = true; + _this.message = message; + _this.status = status; + _this.response = response; + _this.headers = headers; + _this.result = result; + return _this; + } + ApiException.isApiException = function (obj) { + return obj.isApiException === true; + }; + return ApiException; +}(Error)); +exports.ApiException = ApiException; +function throwException(message, status, response, headers, result) { + if (result !== null && result !== undefined) + throw result; + else + throw new ApiException(message, status, response, headers, null); +} +//# sourceMappingURL=LogService.js.map \ No newline at end of file diff --git a/Birdmap.API/ClientApp/src/components/logs/LogService.js.map b/Birdmap.API/ClientApp/src/components/logs/LogService.js.map new file mode 100644 index 0000000..c75c02d --- /dev/null +++ b/Birdmap.API/ClientApp/src/components/logs/LogService.js.map @@ -0,0 +1 @@ +{"version":3,"file":"LogService.js","sourceRoot":"","sources":["LogService.ts"],"names":[],"mappings":";AACA,oBAAoB;AACpB,oBAAoB;AACpB,wBAAwB;AACxB,mBAAmB;AACnB,2HAA2H;AAC3H,oBAAoB;AACpB,wBAAwB;AACxB,uCAAuC;;;;;;;;;;;;;;;;AAEvC;IAKI,oBAAY,OAAgB,EAAE,IAAyE;QAF7F,qBAAgB,GAAmD,SAAS,CAAC;QAGnF,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAM,MAAM,CAAC;QACtC,IAAI,CAAC,OAAO,GAAG,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC;IACpF,CAAC;IAED,2BAAM,GAAN;QAAA,iBAeC;QAdG,IAAI,IAAI,GAAG,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACjC,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QAEjC,IAAI,QAAQ,GAAgB;YACxB,MAAM,EA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D,CAAA;IACzD,6DAA2C,CAAA;IAC3C,mDAAiC,CAAA;IACjC,2CAAyB,CAAA;IACzB,2DAAyC,CAAA;IACzC,mDAAiC,CAAA;IACjC,qEAAmD,CAAA;IACnD,iEAA+C,CAAA;IAC/C,6DAA2C,CAAA;IAC3C,+CAA6B,CAAA;IAC7B,6CAA2B,CAAA;IAC3B,iFAA+D,CAAA;AACnE,CAAC,EAnEW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAmEzB;AAED;IAAkC,gCAAK;IAOnC,sBAAY,OAAe,EAAE,MAAc,EAAE,QAAgB,EAAE,OAAgC,EAAE,MAAW;QAA5G,YACI,iBAAO,SAOV;QAES,oBAAc,GAAG,IAAI,CAAC;QAP5B,KAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,KAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,KAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,KAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,KAAI,CAAC,MAAM,GAAG,MAAM,CAAC;;IACzB,CAAC;IAIM,2BAAc,GAArB,UAAsB,GAAQ;QAC1B,OAAO,GAAG,CAAC,cAAc,KAAK,IAAI,CAAC;IACvC,CAAC;IACL,mBAAC;AAAD,CAAC,AAtBD,CAAkC,KAAK,GAsBtC;AAtBY,oCAAY;AAwBzB,SAAS,cAAc,CAAC,OAAe,EAAE,MAAc,EAAE,QAAgB,EAAE,OAAgC,EAAE,MAAY;IACrH,IAAI,MAAM,KAAK,IAAI,IAAI,MAAM,KAAK,SAAS;QACvC,MAAM,MAAM,CAAC;;QAEb,MAAM,IAAI,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;AACzE,CAAC"} \ No newline at end of file diff --git a/Birdmap.API/ClientApp/src/components/logs/LogService.ts b/Birdmap.API/ClientApp/src/components/logs/LogService.ts index 7e48fbc..5ca463e 100644 --- a/Birdmap.API/ClientApp/src/components/logs/LogService.ts +++ b/Birdmap.API/ClientApp/src/components/logs/LogService.ts @@ -15,11 +15,11 @@ export default class LogService { constructor(baseUrl?: string, http?: { fetch(url: RequestInfo, init?: RequestInit): Promise }) { this.http = http ? http : window; - this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : "https://localhost:44331"; + this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : "api/logs"; } getAll(): Promise { - let url_ = this.baseUrl + "/api/Logs/all"; + let url_ = this.baseUrl + "/all"; url_ = url_.replace(/[?&]$/, ""); let options_ = { @@ -58,7 +58,7 @@ export default class LogService { } getFiles(filenames: string[] | null | undefined): Promise { - let url_ = this.baseUrl + "/api/Logs?"; + let url_ = this.baseUrl + "?"; if (filenames !== undefined && filenames !== null) filenames && filenames.forEach(item => { url_ += "filenames=" + encodeURIComponent("" + item) + "&"; }); url_ = url_.replace(/[?&]$/, "");