scripthost/resources/views/script.blade.php
Javier Feliz 74f5dc5db1
Some checks failed
tests / ci (push) Has been cancelled
linter / quality (push) Has been cancelled
Build & Push Docker Image to Registry / build (release) Failing after 3m7s
Initial test
2025-07-22 19:45:33 -04:00

49 lines
2.1 KiB
PHP

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@include('partials.head')
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.30.0/themes/prism-okaidia.min.css"
crossorigin="anonymous" referrerpolicy="no-referrer" />
<title>{{ $script->name }}</title>
</head>
<body>
@php
$copystring = "curl -fsSL ".route('script-content', ['path' => $script->path]).' | sh';
@endphp
<div class="max-w-2xl mx-auto py-24">
<flux:heading class="text-4xl text-center" size="xl">{{ $script->name }}</flux:heading>
<div class="my-8">
<div x-data="{ command: '{{ $copystring }}', copied: false }"
class="bg-zinc-800 flex justify-between items-center">
<pre class="dark:text-white p-4 rounded select-all" x-text="command"></pre>
<flux:button variant="ghost"
x-on:click="navigator.clipboard.writeText(command); copied = true; setTimeout(() => copied = false, 2000)"
class="absolute top-0 bottom-0 right-3">
<span x-show="!copied">
<flux:icon.clipboard />
</span>
<span x-cloak x-show="copied"
class="absolute mb-10 bg-black dark:bg-white dark:text-black p-0.5 rounded-lg">Copied!</span>
</flux:button>
</div>
<pre><code class="lang-shell">{{$script->content}}</code></pre>
</div>
</div>
@fluxScripts
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.30.0/prism.min.js"
integrity="sha512-HiD3V4nv8fcjtouznjT9TqDNDm1EXngV331YGbfVGeKUoH+OLkRTCMzA34ecjlgSQZpdHZupdSrqHY+Hz3l6uQ=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.30.0/components/prism-bash.min.js"
integrity="sha512-whYhDwtTmlC/NpZlCr6PSsAaLOrfjVg/iXAnC4H/dtiHawpShhT2SlIMbpIhT/IL/NrpdMm+Hq2C13+VKpHTYw=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
</body>
</html>