diff --git a/public/_worker.js b/public/_worker.js index d40a0b7..2242dad 100644 --- a/public/_worker.js +++ b/public/_worker.js @@ -38,15 +38,9 @@ export default { addHeaders(response) return response } - response = new Response( - JSON.stringify({ - name: info.name, - avatar: info.avatar, - desc: info.desc, - footer: info.footer, - }), - { headers: { 'Content-Type': 'application/json' } }, - ) + response = new Response(JSON.stringify(info), { + headers: { 'Content-Type': 'application/json' }, + }) addHeaders(response) return response } diff --git a/src/api/info.ts b/src/api/info.ts index 2722973..86e7448 100644 --- a/src/api/info.ts +++ b/src/api/info.ts @@ -4,7 +4,7 @@ export interface IInfo { name: string avatar: string desc: string - footer: string + rtl: boolean } export const infoRequest = () => { diff --git a/src/api/uptime.ts b/src/api/uptime.ts index bf8212c..3f455e7 100644 --- a/src/api/uptime.ts +++ b/src/api/uptime.ts @@ -4,14 +4,18 @@ export interface _Result { name: string url: string average: string - daily: { + daily: Array<{ date: any uptime: string down: { times: number duration: number } - }[] + }> + response_times: Array<{ + datetime: number + value: number + }> total: { times: number duration: number @@ -19,7 +23,7 @@ export interface _Result { status: string opts: { [key: string]: string } } -export type _Resp = { +export interface _Resp { stat: string pagination: { offset: number @@ -41,6 +45,10 @@ export type _Resp = { timeout: number status: number create_datetime: number + response_times: Array<{ + datetime: number + value: number + }> logs: Array<{ id: number type: number @@ -75,6 +83,7 @@ export const uptimeRequest = (apikey: string, days: number) => { format: 'json', logs: 1, log_types: '1-2', + response_times: 1, logs_start_date: start, logs_end_date: end, custom_uptime_ranges: ranges.join('-'), @@ -130,6 +139,7 @@ export const uptimeRequest = (apikey: string, days: number) => { total: total, status: 'unknow', opts: {}, + response_times: monitor.response_times, } let match diff --git a/src/components/StatusItem.vue b/src/components/StatusItem.vue index 202d6b1..a2fc58b 100644 --- a/src/components/StatusItem.vue +++ b/src/components/StatusItem.vue @@ -1,15 +1,18 @@ diff --git a/src/pages/index.vue b/src/pages/index.vue index ca55a98..29422fe 100644 --- a/src/pages/index.vue +++ b/src/pages/index.vue @@ -104,7 +104,7 @@ >