Browse Source

Change uptime to last 90 days

pull/1993/head
Thomas 2 years ago
parent
commit
1431c7f923
  1. 8
      apps/api/src/app/info/info.service.ts
  2. 1
      apps/client/src/app/pages/open/open-page.html

8
apps/api/src/app/info/info.service.ts

@ -17,6 +17,7 @@ import {
ghostfolioFearAndGreedIndexDataSource
} from '@ghostfolio/common/config';
import {
DATE_FORMAT,
encodeDataSource,
extractNumberFromString
} from '@ghostfolio/common/helper';
@ -29,7 +30,7 @@ import { Injectable, Logger } from '@nestjs/common';
import { JwtService } from '@nestjs/jwt';
import * as bent from 'bent';
import * as cheerio from 'cheerio';
import { subDays } from 'date-fns';
import { format, subDays } from 'date-fns';
@Injectable()
export class InfoService {
@ -344,7 +345,10 @@ export class InfoService {
)) as string;
const get = bent(
`https://betteruptime.com/api/v2/monitors/${monitorId}/sla`,
`https://betteruptime.com/api/v2/monitors/${monitorId}/sla?from=${format(
subDays(new Date(), 90),
DATE_FORMAT
)}&to${format(new Date(), DATE_FORMAT)}`,
'GET',
'json',
200,

1
apps/client/src/app/pages/open/open-page.html

@ -96,6 +96,7 @@
<a class="d-block" href="https://status.ghostfol.io">
<gf-value
size="large"
subLabel="(Last 90 days)"
[isPercent]="true"
[precision]="2"
[value]="statistics?.uptime ?? '-'"

Loading…
Cancel
Save