Skip to content

Commit

Permalink
add iframe($monitorId) method to get html content to show iframe for …
Browse files Browse the repository at this point in the history
…monitor
  • Loading branch information
jalallinux committed Nov 17, 2022
1 parent f29a827 commit 5444e59
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/Features/Monitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,9 @@ public function record(string $monitorId, \DateTime $start, \DateTime $end)
MonitorModeJob::dispatch($this->shinobi->getToken(), $this->shinobi->getGroupKey(), $monitorId, 'start')
->delay($end)->onConnection(config('shinobi.queue_connection', 'redis'));
}

public function iframe(string $monitorId, array $options = ['jquery', 'fullscreen']): string
{
return $this->shinobi->makeUrl("{$this->shinobi->getToken()}/embed/{$this->shinobi->getGroupKey()}/$monitorId/" . implode('|', $options));
}
}
2 changes: 1 addition & 1 deletion src/Shinobi.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static function as(string $mail, string $pass): Shinobi
return new Shinobi(...(new self)->auth()->login($mail, $pass)->only(['auth_token', 'ke'])->values());
}

private function makeUrl(string $path = ''): string
public function makeUrl(string $path = ''): string
{
$baseUrl = $this->config('base_uri');
throw_if(is_null($baseUrl), $this->throw("Base Uri is requried."));
Expand Down

0 comments on commit 5444e59

Please sign in to comment.