|
@@ -3,12 +3,11 @@ import axios from 'axios';
|
|
import { Response } from 'express';
|
|
import { Response } from 'express';
|
|
import { RenderPageOptions } from 'graphql-playground-html';
|
|
import { RenderPageOptions } from 'graphql-playground-html';
|
|
import { Tab, renderPlaygroundPage } from 'graphql-playground-html/dist/render-playground-page';
|
|
import { Tab, renderPlaygroundPage } from 'graphql-playground-html/dist/render-playground-page';
|
|
-import { DefaultQueryData, FisCreateMessageUtility, NotificationData, NotificationMessage, Query, ResponseMessage, Uuid } from '../CommonMicroserviceModule/message/FISAppMessageJSUtility/interface/export'
|
|
|
|
|
|
+import { DefaultQueryData, FisCreateMessageUtility, Query, Uuid } from '../CommonMicroserviceModule/message/FISAppMessageJSUtility/interface/export'
|
|
import { HttpService } from "@nestjs/axios";
|
|
import { HttpService } from "@nestjs/axios";
|
|
import { AxiosRequestConfig } from 'axios';
|
|
import { AxiosRequestConfig } from 'axios';
|
|
import { GraphQLProviderManager } from '../CommonMicroserviceModule/provider/Fis/interface/export';
|
|
import { GraphQLProviderManager } from '../CommonMicroserviceModule/provider/Fis/interface/export';
|
|
|
|
|
|
-const io = require("socket.io-client");
|
|
|
|
|
|
|
|
const axiosConfig: AxiosRequestConfig = {
|
|
const axiosConfig: AxiosRequestConfig = {
|
|
responseType: "text",
|
|
responseType: "text",
|
|
@@ -180,12 +179,13 @@ export class FisAppGraphQlapiController {
|
|
return sub;
|
|
return sub;
|
|
}
|
|
}
|
|
|
|
|
|
- @All('multisitereport')
|
|
|
|
- async multisitereport(@Res() res: Response, @Req() req: any) {
|
|
|
|
|
|
+ @Post('multisitereport')
|
|
|
|
+ async postMultisitereport(@Res() res: Response, @Req() req: any) {
|
|
if (!this.MessageService) {
|
|
if (!this.MessageService) {
|
|
this.MessageService = new FisCreateMessageUtility('getQueryMessage');
|
|
this.MessageService = new FisCreateMessageUtility('getQueryMessage');
|
|
}
|
|
}
|
|
- let defaultQueryValue = this.thisDefaultQueryDatas.data[0].queryName;
|
|
|
|
|
|
+ let defaultQueryValue = req.body.defaultQuery ? req.body.defaultQuery : this.thisDefaultQueryDatas.data[0].queryName;
|
|
|
|
+ // let defaultQueryValue = this.thisDefaultQueryDatas.data[0].queryName;
|
|
this.thisDefaultQueryDatas?.data.forEach(res => {
|
|
this.thisDefaultQueryDatas?.data.forEach(res => {
|
|
if (res.queryName == defaultQueryValue) {
|
|
if (res.queryName == defaultQueryValue) {
|
|
this.gqQueryString = res.queryString;
|
|
this.gqQueryString = res.queryString;
|
|
@@ -195,35 +195,38 @@ export class FisAppGraphQlapiController {
|
|
payload: this.gqQueryString.replace(/\n|\r/g, "").trim()
|
|
payload: this.gqQueryString.replace(/\n|\r/g, "").trim()
|
|
}
|
|
}
|
|
|
|
|
|
- // if (!this.MessageService) {
|
|
|
|
- // this.MessageService = new FisCreateMessageUtility('getQueryMessage');
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
- // const data: {} = {
|
|
|
|
- // header: req.body.header.replace(/\n|\r/g, ""),
|
|
|
|
- // payload: req.body.payload.replace(/\n|\r/g, "").trim()
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- // axios.post(process.env.LOCALHOST + '/api/defaultObservable', this.MessageService.getQueryMessage("ABC", Query.GetData, data)).then(result => {
|
|
|
|
-
|
|
|
|
- // console.log(result.data)
|
|
|
|
let jadeargument = req.body;
|
|
let jadeargument = req.body;
|
|
jadeargument['url'] = process.env.LOCALHOST + '/api/defaultObservable';
|
|
jadeargument['url'] = process.env.LOCALHOST + '/api/defaultObservable';
|
|
jadeargument['data'] = JSON.stringify(this.MessageService.getQueryMessage("ABC", Query.GetData, data));
|
|
jadeargument['data'] = JSON.stringify(this.MessageService.getQueryMessage("ABC", Query.GetData, data));
|
|
jadeargument['defaultQueryValue'] = defaultQueryValue;
|
|
jadeargument['defaultQueryValue'] = defaultQueryValue;
|
|
|
|
+ jadeargument['action'] = './multisitereport';
|
|
|
|
+ jadeargument['defaultQuery'] = this.thisDefaultQueryDatas.data
|
|
res_render('MultiSiteReport', res, jadeargument)
|
|
res_render('MultiSiteReport', res, jadeargument)
|
|
|
|
|
|
- // }).catch(e => {
|
|
|
|
-
|
|
|
|
- // })
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ @Get('multisitereport')
|
|
|
|
+ async multisitereport(@Res() res: Response, @Req() req: any) {
|
|
|
|
+ if (!this.MessageService) {
|
|
|
|
+ this.MessageService = new FisCreateMessageUtility('getQueryMessage');
|
|
|
|
+ }
|
|
|
|
+ let defaultQueryValue = this.thisDefaultQueryDatas.data[0].queryName;
|
|
|
|
+ this.thisDefaultQueryDatas?.data.forEach(res => {
|
|
|
|
+ if (res.queryName == defaultQueryValue) {
|
|
|
|
+ this.gqQueryString = res.queryString;
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ const data: {} = {
|
|
|
|
+ payload: this.gqQueryString.replace(/\n|\r/g, "").trim()
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ let jadeargument = req.body;
|
|
|
|
+ jadeargument['url'] = process.env.LOCALHOST + '/api/defaultObservable';
|
|
|
|
+ jadeargument['data'] = JSON.stringify(this.MessageService.getQueryMessage("ABC", Query.GetData, data));
|
|
|
|
+ jadeargument['defaultQueryValue'] = defaultQueryValue;
|
|
|
|
+ jadeargument['action'] = './multisitereport';
|
|
|
|
+ jadeargument['defaultQuery'] = this.thisDefaultQueryDatas.data
|
|
|
|
+ res_render('MultiSiteReport', res, jadeargument)
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -255,6 +258,9 @@ export class FisAppGraphQlapiController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
function res_render(renderer: string, res: any, jadeargument: any) {
|
|
function res_render(renderer: string, res: any, jadeargument: any) {
|
|
|
|
|
|
res.set('Content-Type', 'text/html') // 2019-10-31
|
|
res.set('Content-Type', 'text/html') // 2019-10-31
|