A5.php/resources/views/dashboard.blade.php

85 lines
3.5 KiB
PHP

<!DOCTYPE html>
<html lang="en" data-bs-theme="dark">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<title>Dashboard</title>
</head>
<body>
@include('components.header')
<div class="d-flex flex-row justify-content-evenly my-4" style="width: 100vw;">
<form action="/tokens/create" method="post" class="d-flex flex-column justify-content-center align-items-center bg-dark-subtle w-25 p-5 rounded-4" style="width: max-content;">
@csrf
<div class="mb-3 w-100">
<label for="token" class="form-label">Token Name</label>
<input type="text" class="form-control" id="token" name="token_name">
@if (session('failed'))
<p id="error" class="text-danger">{{ session('failed') }}</p>
@endif
</div>
<button type="submit" class="btn btn-primary" onclick="tokenIntercepter()">Create Token</button>
@if (session('token'))
<p class="m-0 mt-2 p-0">Token:</p>
<p id="token" style="width: max-content; cursor: pointer;" class="text-primary text-decoration-underline m-0 mb-2 p-0" onclick="copyToken({{ session('token') }})">{{ session('token') }}</p>
@endif
</form>
<form action="/inventory/add" method="post" class="d-flex flex-column justify-content-center align-items-center bg-dark-subtle w-25 p-5 rounded-4" style="width: max-content;">
@csrf
<div class="mb-3 w-100">
<label for="name" class="form-label">Name</label>
<input type="text" class="form-control" id="name" name="name">
</div>
<div class="mb-3 w-100">
<label for="desc" class="form-label">Description</label>
<input type="text" class="form-control" id="desc" name="desc">
</div>
<div class="mb-3 w-100">
<label for="price" class="form-label">Price</label>
<input type="number" class="form-control" id="price" name="price">
</div>
<button type="submit" class="btn btn-primary">Create Item</button>
</form>
</div>
<div id="content" class="w-100 d-flex justify-content-center align-items-center">
<table class="w-50 table table-striped border">
<thead>
<tr>
<th scope="col">ID</th>
<th scope="col">Name</th>
<th scope="col">Description</th>
<th scope="col">Price</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Potion</td>
<td>Just a Simple Potion</td>
<td>$360</td>
</tr>
</tbody>
</table>
</div>
<style>
.token:hover {
background-color: var(--bs-primary-text-emphasis)
}
</style>
<script>
const copy = (value) => navigator.clipboard.writeText(value);
</script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous">
</script>
</body>
</html>