mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-21 03:15:45 -08:00
create mostly working
This commit is contained in:
parent
4cb0012872
commit
9b31ae3146
|
@ -9,6 +9,7 @@ use Livewire\Component;
|
|||
|
||||
class PersonalAccessTokens extends Component
|
||||
{
|
||||
public $name;
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.personal-access-tokens', [
|
||||
|
@ -26,7 +27,7 @@ class PersonalAccessTokens extends Component
|
|||
|
||||
public function createToken(): void
|
||||
{
|
||||
Auth::user()->createToken($this->name, $this->scopes);
|
||||
Auth::user()->createToken($this->name);
|
||||
}
|
||||
|
||||
public function deleteToken($tokenId): void
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
|
||||
<h4 class="modal-title">
|
||||
{{ $title }}
|
||||
Create Token
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -59,7 +59,89 @@
|
|||
</div>
|
||||
</div>
|
||||
<!-- Create Token Modal -->
|
||||
<x-personal-access-tokens.create-token-modal />
|
||||
<div class="modal fade" id="modal-create-token" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
|
||||
<h4 class="modal-title">
|
||||
Create Token
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<!-- Form Errors -->
|
||||
@if($errors === true)
|
||||
<div class="alert alert-danger"
|
||||
{{-- v-if="form.errors.length > 0"--}}
|
||||
>
|
||||
<p><strong>Whoops!</strong> Something went wrong!</p>
|
||||
<br>
|
||||
<ul>
|
||||
<li
|
||||
{{-- v-for="error in form.errors"--}}
|
||||
>
|
||||
{{-- {{ error }}--}}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Create Token Form -->
|
||||
<form class="form-horizontal" role="form"
|
||||
{{-- @submit.prevent="store"--}}
|
||||
>
|
||||
<!-- Name -->
|
||||
<div class="form-group">
|
||||
<label class="col-md-4 control-label" for="name">Name</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="create-token-name" type="text" aria-label="name" class="form-control" name="name"
|
||||
wire:model.defer="name"
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Scopes -->
|
||||
{{-- <div class="form-group"--}}
|
||||
{{-- v-if="scopes.length > 0"--}}
|
||||
{{-- >--}}
|
||||
{{-- <label class="col-md-4 control-label">Scopes</label>--}}
|
||||
|
||||
{{-- <div class="col-md-6">--}}
|
||||
{{-- <div--}}
|
||||
{{-- v-for="scope in scopes"--}}
|
||||
{{-- >--}}
|
||||
{{-- <div class="checkbox">--}}
|
||||
{{-- <label>--}}
|
||||
{{-- <input type="checkbox"--}}
|
||||
{{-- @click="toggleScope(scope.id)"--}}
|
||||
{{-- :checked="scopeIsAssigned(scope.id)"--}}
|
||||
{{-- >--}}
|
||||
|
||||
{{-- {{ scope.id }}--}}
|
||||
{{-- </label>--}}
|
||||
{{-- </div>--}}
|
||||
{{-- </div>--}}
|
||||
{{-- </div>--}}
|
||||
{{-- </div>--}}
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- Modal Actions -->
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn primary" data-dismiss="modal">Close</button>
|
||||
|
||||
<button type="button" class="btn btn-primary"
|
||||
wire:click="createToken(name)"
|
||||
>
|
||||
Create
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- View New Token Modal -->
|
||||
<x-personal-access-tokens.view-new-token />
|
||||
</div>
|
Loading…
Reference in a new issue