mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-03 04:43:59 +00:00
update
This commit is contained in:
parent
c5c34f5b6a
commit
55ac094fc4
@ -17,6 +17,12 @@
|
|||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
type GraphQLErrors = Array<{ message: string }>;
|
||||||
|
type GraphQLResponse<T> = {
|
||||||
|
data?: T;
|
||||||
|
errors?: GraphQLErrors;
|
||||||
|
};
|
||||||
|
|
||||||
export let globalAbortController = new AbortController();
|
export let globalAbortController = new AbortController();
|
||||||
export function abortRequestsAndUpdate() {
|
export function abortRequestsAndUpdate() {
|
||||||
globalAbortController.abort();
|
globalAbortController.abort();
|
||||||
|
@ -14,14 +14,13 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
import { cancelToken } from "@/utils/cancelToken";
|
|
||||||
import { httpQuery } from "./base";
|
import { httpQuery } from "./base";
|
||||||
|
|
||||||
async function fetchQuery(param: { queryStr: string; conditions: { [key: string]: unknown } }) {
|
async function fetchQuery(param: { queryStr: string; conditions: { [key: string]: unknown } }) {
|
||||||
const response = await httpQuery({
|
const response = await httpQuery({
|
||||||
method: "post",
|
method: "post",
|
||||||
json: { query: param.queryStr, variables: { ...param.conditions } },
|
json: { query: param.queryStr, variables: { ...param.conditions } },
|
||||||
headers: { cancelToken: cancelToken() },
|
headers: {},
|
||||||
});
|
});
|
||||||
if (response.errors) {
|
if (response.errors) {
|
||||||
response.errors = response.errors.map((e: { message: string }) => e.message).join(" ");
|
response.errors = response.errors.map((e: { message: string }) => e.message).join(" ");
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
import { httpQuery } from "./base";
|
import { httpQuery } from "./base";
|
||||||
import { cancelToken } from "@/utils/cancelToken";
|
|
||||||
import * as app from "./query/app";
|
import * as app from "./query/app";
|
||||||
import * as selector from "./query/selector";
|
import * as selector from "./query/selector";
|
||||||
import * as dashboard from "./query/dashboard";
|
import * as dashboard from "./query/dashboard";
|
||||||
@ -52,7 +51,7 @@ class Graphql {
|
|||||||
public params(variables: unknown) {
|
public params(variables: unknown) {
|
||||||
return httpQuery({
|
return httpQuery({
|
||||||
method: "post",
|
method: "post",
|
||||||
headers: { cancelToken: cancelToken() },
|
headers: {},
|
||||||
json: {
|
json: {
|
||||||
query: query[this.queryData],
|
query: query[this.queryData],
|
||||||
variables,
|
variables,
|
||||||
|
Loading…
Reference in New Issue
Block a user