Henry Whitaker %!s(int64=3) %!d(string=hai) anos
pai
achega
d7c1e2b8ac
Modificáronse 1 ficheiros con 6 adicións e 5 borrados
  1. 6 5
      api/homepage/uptime_kuma.php

+ 6 - 5
api/homepage/uptime_kuma.php

@@ -84,11 +84,12 @@ trait UptimeKumaHomepageItem
 		$api = [];
 		$url = $this->qualifyURL($this->config['uptimeKumaURL']);
 		try {
-			$response = $this->getKumaClient($url, $this->config['uptimeKumaToken'])->get('/metrics');
-
-			$body = $response->getBody()->getContents();
-
-			$metrics = (new UptimeKumaMetrics($body))->process();
+			$metrics = (new UptimeKumaMetrics(
+				$this->getKumaClient($url, $this->config['uptimeKumaToken'])
+				->get('/metrics')
+				->getBody()
+				->getContents()
+			))->process();
 
 			$api = [
 				'data' => $metrics->getMonitors(),