|
8 | 8 | <p class="text-gray-400">get the deets</p>
|
9 | 9 | </div>
|
10 | 10 | <%= link_to "← Back to API Keys",
|
11 |
| - admin_admin_api_keys_path, |
12 |
| - class: "text-gray-400 hover:text-white" %> |
| 11 | + admin_admin_api_keys_path, |
| 12 | + class: "text-gray-400 hover:text-white" %> |
13 | 13 | </div>
|
14 | 14 | </div>
|
15 | 15 |
|
16 |
| - <div class="grid grid-cols-1 lg:grid-cols-2 gap-8"> |
| 16 | + <div class="grid grid-cols-1 gap-8"> |
17 | 17 | <div class="bg-dark rounded-lg p-6">
|
18 |
| - <h2 class="text-xl font-semibold text-white mb-4">deets</h2> |
19 |
| - |
| 18 | + <h2 class="text-xl font-semibold text-white mb-4">okay now what lmao</h2> |
20 | 19 | <div class="space-y-4">
|
| 20 | + <div> |
| 21 | + <label class="block text-md font-medium text-gray-400 mb-2">what was it again?</label> |
| 22 | + <code class="block bg-darkless px-3 py-2 rounded text-white text-sm"> |
| 23 | + <%= @admin_api_key.token[0..20] %>... |
| 24 | + </code> |
| 25 | + <% unless flash[:api_key_token] %> |
| 26 | + <p class="text-md text-gray-400 mt-1"> |
| 27 | + you cant see the full thing again, we showed it when you created it ya doofus |
| 28 | + </p> |
| 29 | + <% end %> |
| 30 | + </div> |
| 31 | + <div> |
| 32 | + <label class="block text-md font-bold text-white mb-2">how to use it?</label> |
| 33 | + <p class="text-md text-gray-400 mb-2"> |
| 34 | + most likely you are not crazy enough to build your own api client but you can use <a href="https://fraudcheck.3kh0.net/" class="text-blue-400 hover:underline" target="_blank">rowan's fraud check tool</a> to use the admin api. |
| 35 | + </p> |
| 36 | + <p class="text-md text-gray-400"> |
| 37 | + if you are building your own client, just use the token as a bearer token in the auth header of your requests, check the actual source code for more details. or you could just be normal and use the fraud check tool i already made for you. |
| 38 | + </p> |
| 39 | + </div> |
| 40 | + </div> |
| 41 | + </div> |
| 42 | + |
| 43 | + <div class="bg-dark rounded-lg p-6"> |
| 44 | + <h2 class="text-xl font-semibold text-white mb-4">deets</h2> |
| 45 | + <% if flash[:api_key_token] %> |
| 46 | + <div class="bg-green-900/30 border border-green-500/50 rounded-lg p-4"> |
| 47 | + <h3 class="text-green-300 font-medium mb-2">heres ya key, copy it now!</h3> |
| 48 | + <p class="text-green-200 text-sm mb-3"> |
| 49 | + copy it now, its not gonna be shown again silly |
| 50 | + </p> |
| 51 | + <div class="bg-gray-800 rounded p-3 mb-3"> |
| 52 | + <code class="block text-white text-sm break-all select-all"> |
| 53 | + <%= flash[:api_key_token] %> |
| 54 | + </code> |
| 55 | + </div> |
| 56 | + </div> |
| 57 | + <% end %> |
| 58 | + <div class="grid grid-cols-1 md:grid-cols-2 gap-6"> |
21 | 59 | <div>
|
22 | 60 | <label class="block text-sm font-medium text-gray-400 mb-1">name</label>
|
23 | 61 | <div class="text-white"><%= @admin_api_key.name %></div>
|
|
46 | 84 | <div class="text-green-400">live</div>
|
47 | 85 | </div>
|
48 | 86 | </div>
|
49 |
| - |
50 |
| - <div class="mt-6 pt-6 border-t border-gray-600"> |
51 |
| - <%= link_to "nuke it", |
| 87 | + <div class="mt-6"></div> |
| 88 | + <%= link_to "nuke it", |
52 | 89 | admin_admin_api_key_path(@admin_api_key),
|
53 | 90 | data: { "turbo-method": :delete },
|
54 | 91 | class: "bg-red-600 hover:bg-red-700 text-white px-4 py-2 rounded-lg font-medium transition-colors" %>
|
55 |
| - </div> |
56 |
| - </div> |
57 |
| - |
58 |
| - <div class="bg-dark rounded-lg p-6"> |
59 |
| - <h2 class="text-xl font-semibold text-white mb-4">how 2 api</h2> |
60 |
| - |
61 |
| - <div class="space-y-4"> |
62 |
| - <% if flash[:api_key_token] %> |
63 |
| - <div class="bg-green-900/30 border border-green-500/50 rounded-lg p-4"> |
64 |
| - <h3 class="text-green-300 font-medium mb-2">heres your key!</h3> |
65 |
| - <p class="text-green-200 text-sm mb-3"> |
66 |
| - copy it now, its not gonna be shown again silly |
67 |
| - </p> |
68 |
| - <div class="bg-gray-800 rounded p-3 mb-3"> |
69 |
| - <code class="block text-white text-sm break-all select-all"> |
70 |
| - <%= flash[:api_key_token] %> |
71 |
| - </code> |
72 |
| - </div> |
73 |
| - </div> |
74 |
| - <% end %> |
75 |
| - |
76 |
| - <div> |
77 |
| - <label class="block text-sm font-medium text-gray-400 mb-2">preview</label> |
78 |
| - <code class="block bg-gray-800 px-3 py-2 rounded text-white text-sm"> |
79 |
| - <%= @admin_api_key.token[0..20] %>... |
80 |
| - </code> |
81 |
| - <% unless flash[:api_key_token] %> |
82 |
| - <p class="text-xs text-gray-400 mt-1"> |
83 |
| - you cant see the thing again, we showed it when you created it ya doofus |
84 |
| - </p> |
85 |
| - <% end %> |
86 |
| - </div> |
87 |
| - |
88 |
| - <div> |
89 |
| - <label class="block text-sm font-medium text-gray-400 mb-2">auth stuff</label> |
90 |
| - <div class="bg-gray-800 rounded p-3"> |
91 |
| - <code class="text-white text-sm"> |
92 |
| - Authorization: Bearer YOUR_KEY_HERE |
93 |
| - </code> |
94 |
| - </div> |
95 |
| - <p class="text-xs text-gray-400 mt-1"> |
96 |
| - replace <code>YOUR_KEY_HERE</code> with your actual api key, pass it as a header and your balling |
97 |
| - </p> |
98 |
| - </div> |
99 |
| - |
100 |
| - <div> |
101 |
| - <label class="block text-sm font-medium text-gray-400 mb-2">domain</label> |
102 |
| - <div class="bg-gray-800 rounded p-3"> |
103 |
| - <code class="text-blue-400 text-sm"> |
104 |
| - <%= request.protocol %><%= request.host_with_port %>/api/admin/v1/ |
105 |
| - </code> |
106 |
| - </div> |
107 |
| - </div> |
108 |
| - </div> |
109 | 92 | </div>
|
110 | 93 | </div>
|
111 | 94 | </div>
|
0 commit comments