async getEvents()

in src/store/modules/event.ts [77:106]


    async getEvents() {
      this.loading = true;
      const response = await graphql.query("queryEvents").params({
        condition: {
          ...this.condition,
          time: useAppStoreWithOut().durationTime,
        },
      });
      this.loading = false;
      if (response.errors) {
        return response;
      }
      if (response.data.fetchEvents) {
        this.events = (response.data.fetchEvents.events || []).map((item: Event) => {
          let scope = "Service";
          if (item.source.serviceInstance) {
            scope = "ServiceInstance";
          }
          if (item.source.endpoint) {
            scope = "Endpoint";
          }
          item.scope = scope;
          if (!item.endTime || item.endTime === item.startTime) {
            item.endTime = Number(item.startTime) + 60000;
          }
          return item;
        });
      }
      return response;
    },