mirror of
https://github.com/usetrmnl/byos_laravel.git
synced 2026-01-13 23:18:10 +00:00
add features
* feat: autojoin toggle * feat: auto add devices * feat: proxy feature * feat: support puppeteer in docker * feat: toggle to activate cloud proxy * feat: relay device information * feat: relay logs to cloud * feat: migrate on start * feat: calculate battery state, wifi signal * feat: eye candy for configure view * feat: update via api
This commit is contained in:
parent
d4eb832186
commit
715e6a2562
53 changed files with 1459 additions and 460 deletions
56
resources/views/livewire/plugins/api.blade.php
Normal file
56
resources/views/livewire/plugins/api.blade.php
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
<?php
|
||||
|
||||
use Livewire\Volt\Component;
|
||||
|
||||
new class extends Component {
|
||||
public $token;
|
||||
|
||||
public function mount(): void
|
||||
{
|
||||
$token = Auth::user()?->tokens()?->first();
|
||||
if ($token === null) {
|
||||
$token = Auth::user()->createToken('api-token', ['update-screen']);
|
||||
}
|
||||
$this->token = $token->plainTextToken;
|
||||
}
|
||||
|
||||
public function regenerateToken()
|
||||
{
|
||||
Auth::user()->tokens()?->first()?->delete();
|
||||
$token = Auth::user()->createToken('api-token', ['update-screen']);
|
||||
$this->token = $token->plainTextToken;
|
||||
}
|
||||
};
|
||||
?>
|
||||
|
||||
<div class="py-12">
|
||||
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
|
||||
<div class="flex justify-between items-center mb-6">
|
||||
<h2 class="text-2xl font-semibold dark:text-gray-100">API</h2>
|
||||
|
||||
</div>
|
||||
<div>
|
||||
<p>
|
||||
<flux:badge>POST</flux:badge>
|
||||
<span class="ml-2 font-mono">{{route('display.update')}}</span>
|
||||
</p>
|
||||
<div class="mt-4">
|
||||
<h3 class="text-lg">Headers</h3>
|
||||
<div>Authorization <span class="ml-2 font-mono">Bearer {{$token ?? '**********'}}</span>
|
||||
<flux:button variant="subtle" size="xs" class="mt-2" wire:click="regenerateToken()">
|
||||
Regenerate Token
|
||||
</flux:button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-4">
|
||||
<h3 class="text-lg">Body</h3>
|
||||
<div class="font-mono">
|
||||
<pre>
|
||||
{"markup":"<h1>Hello World</h1>"}
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Loading…
Add table
Add a link
Reference in a new issue