Skip to content

Commit

Permalink
Merge branch 'dev' into update-from-ptero
Browse files Browse the repository at this point in the history
  • Loading branch information
he3als committed Nov 17, 2024
2 parents 9c575ca + 493dfaa commit cc62420
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 104 deletions.
79 changes: 0 additions & 79 deletions .github/workflows/ci.yaml

This file was deleted.

37 changes: 19 additions & 18 deletions resources/scripts/components/dashboard/ApiKeyModal.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { faClone } from '@fortawesome/free-solid-svg-icons';
import { useContext } from 'react';
import ModalContext from '@/context/ModalContext';
import { faClone } from '@fortawesome/free-solid-svg-icons';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { useContext } from 'react';

import FlashMessageRender from '@/components/FlashMessageRender';
import Button from '@/components/elements/Button';
import CopyOnClick from '@/components/elements/CopyOnClick';
import FlashMessageRender from '@/components/FlashMessageRender';

import asModal from '@/hoc/asModal';

interface Props {
Expand All @@ -17,39 +17,40 @@ const ApiKeyModal = ({ apiKey }: Props) => {
const { dismiss } = useContext(ModalContext);

return (
<div className="p-6 space-y-6 max-w-lg mx-auto rounded-lg shadow-lg ">
<div className='p-6 space-y-6 max-w-lg mx-auto rounded-lg shadow-lg '>
{/* Flash message section */}
<FlashMessageRender byKey="account" />
<FlashMessageRender byKey='account' />

{/* Modal Header */}
<p className="text-sm text-white-600 mt-2 ">
The API key you have requested is shown below. Please store it in a safe place, as it will not be shown again.
<p className='text-sm text-white-600 mt-2 '>
The API key you have requested is shown below. Please store it in a safe place, as it will not be shown
again.
</p>

{/* API Key Display Section */}
<div className="relative mt-6">
<pre className="bg-gray-900 text-white p-4 rounded-lg font-mono overflow-x-auto">
<div className='relative mt-6'>
<pre className='bg-gray-900 text-white p-4 rounded-lg font-mono overflow-x-auto'>
<CopyOnClick text={apiKey}>
<code className="text-sm break-words">{apiKey}</code>
<code className='text-sm break-words'>{apiKey}</code>
</CopyOnClick>

{/* Copy button with icon */}
<div className="absolute top-2 right-2">
<div className='absolute top-2 right-2'>
<FontAwesomeIcon
icon={faClone}
size="lg"
className="text-gray-400 hover:text-gray-600 cursor-pointer"
size='lg'
className='text-gray-400 hover:text-gray-600 cursor-pointer'
/>
</div>
</pre>
</div>

{/* Action Buttons */}
<div className="flex justify-end space-x-4">
<div className='flex justify-end space-x-4'>
<Button
type="button"
type='button'
onClick={() => dismiss()}
className="bg-red-600 text-white hover:bg-red-700 px-6 py-2 rounded-md focus:outline-none focus:ring-2 focus:ring-gray-500"
className='bg-red-600 text-white hover:bg-red-700 px-6 py-2 rounded-md focus:outline-none focus:ring-2 focus:ring-gray-500'
>
Close
</Button>
Expand All @@ -62,6 +63,6 @@ ApiKeyModal.displayName = 'ApiKeyModal';

export default asModal<Props>({
title: 'Your API Key',
closeOnEscape: true, // Allows closing the modal by pressing Escape
closeOnBackground: true, // Allows closing by clicking outside the modal
closeOnEscape: true, // Allows closing the modal by pressing Escape
closeOnBackground: true, // Allows closing by clicking outside the modal
})(ApiKeyModal);
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@ import { useState } from 'react';

import Code from '@/components/elements/Code';
import { Dialog } from '@/components/elements/dialog';
import HugeIconsTrash from '@/components/elements/hugeicons/Trash';

import { deleteSSHKey, useSSHKeys } from '@/api/account/ssh-keys';

import { useFlashKey } from '@/plugins/useFlash';

import HugeIconsTrash from '@/components/elements/hugeicons/Trash';


export default ({ name, fingerprint }: { name: string; fingerprint: string }) => {
const { clearAndAddHttpError } = useFlashKey('account');
const [visible, setVisible] = useState(false);
Expand Down Expand Up @@ -39,9 +35,7 @@ export default ({ name, fingerprint }: { name: string; fingerprint: string }) =>
>
Removing the <Code>{name}</Code> SSH key will invalidate its usage across the Panel.
</Dialog.Confirm>
<button className={`ml-4 p-2 text-sm`} onClick={() => setVisible(true)}>

</button>
<button className={`ml-4 p-2 text-sm`} onClick={() => setVisible(true)}></button>
</>
);
};

0 comments on commit cc62420

Please sign in to comment.