|
33 | 33 | <a href="{{ route('customer.billing-portal') }}" class="inline-flex items-center px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm text-sm font-medium text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500"> |
34 | 34 | Billing |
35 | 35 | </a> |
36 | | - <form method="POST" action="{{ route('customer.logout') }}"> |
37 | | - @csrf |
38 | | - <button type="submit" class="inline-flex items-center px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm text-sm font-medium text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500"> |
39 | | - Sign out |
40 | | - </button> |
41 | | - </form> |
42 | 36 | </div> |
43 | 37 | </div> |
44 | 38 | </div> |
@@ -181,7 +175,7 @@ class="ml-2 inline-flex items-center px-2.5 py-1.5 border border-gray-300 dark:b |
181 | 175 | <h3 class="text-lg leading-6 font-medium text-gray-900 dark:text-white"> |
182 | 176 | Keys |
183 | 177 | <span class="ml-2 text-sm text-gray-500 dark:text-gray-400"> |
184 | | - ({{ $license->subLicenses->count() }}{{ $license->subLicenseLimit ? '/' . $license->subLicenseLimit : '' }}) |
| 178 | + ({{ $license->subLicenses->where('is_suspended', false)->count() }}{{ $license->subLicenseLimit ? '/' . $license->subLicenseLimit : '' }}) |
185 | 179 | </span> |
186 | 180 | </h3> |
187 | 181 | <p class="mt-1 max-w-2xl text-sm text-gray-500 dark:text-gray-400"> |
@@ -264,7 +258,7 @@ class="text-blue-600 hover:text-blue-500 text-sm" |
264 | 258 | > |
265 | 259 | Edit |
266 | 260 | </button> |
267 | | - <form method="POST" action="{{ route('customer.licenses.sub-licenses.suspend', [$license->key, $subLicense]) }}" class="inline"> |
| 261 | + <form method="POST" action="{{ route('customer.licenses.sub-licenses.suspend', [$license->key, $subLicense]) }}" class="inline" onsubmit="return confirmSuspension(event)"> |
268 | 262 | @csrf |
269 | 263 | @method('PATCH') |
270 | 264 | <button type="submit" class="text-yellow-600 hover:text-yellow-500 text-sm"> |
@@ -294,7 +288,7 @@ class="text-blue-600 hover:text-blue-500 text-sm" |
294 | 288 | </span> |
295 | 289 | </h3> |
296 | 290 | <p class="mt-1 max-w-2xl text-sm text-gray-500 dark:text-gray-400"> |
297 | | - These keys are currently suspended and cannot be used. |
| 291 | + These keys are permanently suspended and cannot be used or reactivated. |
298 | 292 | </p> |
299 | 293 | </div> |
300 | 294 | </div> |
@@ -332,22 +326,6 @@ class="ml-2 text-xs text-blue-600 hover:text-blue-500" |
332 | 326 | </div> |
333 | 327 | @endif |
334 | 328 | </div> |
335 | | - <div class="ml-4 flex items-center space-x-2"> |
336 | | - <button |
337 | | - type="button" |
338 | | - onclick="showEditSubLicenseModal({{ $subLicense->id }}, '{{ $subLicense->name }}', '{{ $subLicense->assigned_email }}')" |
339 | | - class="text-blue-600 hover:text-blue-500 text-sm" |
340 | | - > |
341 | | - Edit |
342 | | - </button> |
343 | | - <form method="POST" action="{{ route('customer.licenses.sub-licenses.unsuspend', [$license->key, $subLicense]) }}" class="inline"> |
344 | | - @csrf |
345 | | - @method('PATCH') |
346 | | - <button type="submit" class="text-green-600 hover:text-green-500 text-sm"> |
347 | | - Unsuspend |
348 | | - </button> |
349 | | - </form> |
350 | | - </div> |
351 | 329 | </div> |
352 | 330 | </div> |
353 | 331 | </div> |
@@ -697,5 +675,22 @@ function hideEditLicenseNameModal() { |
697 | 675 | hideEditLicenseNameModal(); |
698 | 676 | } |
699 | 677 | }); |
| 678 | +
|
| 679 | + // Confirm suspension with warning about permanence |
| 680 | + function confirmSuspension(event) { |
| 681 | + const confirmed = confirm( |
| 682 | + 'Are you sure you want to suspend this license?\n\n' + |
| 683 | + 'WARNING: Once suspended, this license cannot be reactivated. ' + |
| 684 | + 'You will need to create a new license instead.\n\n' + |
| 685 | + 'This action is permanent and cannot be undone.' |
| 686 | + ); |
| 687 | +
|
| 688 | + if (!confirmed) { |
| 689 | + event.preventDefault(); |
| 690 | + return false; |
| 691 | + } |
| 692 | +
|
| 693 | + return true; |
| 694 | + } |
700 | 695 | </script> |
701 | 696 | </x-layout> |
0 commit comments