|
@@ -5,7 +5,6 @@ use GuzzleHttp\Client;
|
|
|
|
|
|
abstract class SupportedApps
|
|
abstract class SupportedApps
|
|
{
|
|
{
|
|
- public $config;
|
|
|
|
|
|
|
|
public function test($url, $requiresLoginFirst=false)
|
|
public function test($url, $requiresLoginFirst=false)
|
|
{
|
|
{
|
|
@@ -14,7 +13,12 @@ abstract class SupportedApps
|
|
|
|
|
|
public function execute($url, $requiresLoginFirst=false)
|
|
public function execute($url, $requiresLoginFirst=false)
|
|
{
|
|
{
|
|
-
|
|
|
|
|
|
+ if($requiresLoginFirst) {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $client = new Client(['http_errors' => false, 'timeout' => 15, 'connect_timeout' => 15]);
|
|
|
|
+ return $client->request('GET', $url);
|
|
}
|
|
}
|
|
|
|
|
|
public function login()
|
|
public function login()
|
|
@@ -27,6 +31,18 @@ abstract class SupportedApps
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ public function getLiveStats($status, $data)
|
|
|
|
+ {
|
|
|
|
+ $className = get_class($this);
|
|
|
|
+ $explode = explode('\\', $className);
|
|
|
|
+ $name = end($explode);
|
|
|
|
+
|
|
|
|
+ $html = view('SupportedApps::'.$name.'.livestats', $data)->with('data', $data)->render();
|
|
|
|
+ return json_encode(['status' => $status, 'html' => $html]);
|
|
|
|
+ //return
|
|
|
|
+ }
|
|
|
|
+
|
|
public static function getList()
|
|
public static function getList()
|
|
{
|
|
{
|
|
$list_url = 'https://apps.heimdall.site/list';
|
|
$list_url = 'https://apps.heimdall.site/list';
|
|
@@ -60,11 +76,16 @@ abstract class SupportedApps
|
|
|
|
|
|
$app->name = $details->name;
|
|
$app->name = $details->name;
|
|
$app->sha = $details->sha;
|
|
$app->sha = $details->sha;
|
|
- $app->icon = 'storage/supportedapps/'.$details->icon;
|
|
|
|
|
|
+ $app->icon = 'supportedapps/'.$details->icon;
|
|
$app->website = $details->website;
|
|
$app->website = $details->website;
|
|
$app->license = $details->license;
|
|
$app->license = $details->license;
|
|
$app->description = $details->description;
|
|
$app->description = $details->description;
|
|
- $app->enhanced = $details->enhanced;
|
|
|
|
|
|
+
|
|
|
|
+ $appclass = $app->class();
|
|
|
|
+ $application = new $appclass;
|
|
|
|
+ $enhanced = (bool)($application instanceof \App\EnhancedApps);
|
|
|
|
+
|
|
|
|
+ $app->enhanced = $enhanced;
|
|
$app->tile_background = $details->tile_background;
|
|
$app->tile_background = $details->tile_background;
|
|
$app->save();
|
|
$app->save();
|
|
}
|
|
}
|