feat: switch back to codemirror with jsonc support

This commit is contained in:
Aarnav Tale 2024-10-22 00:41:44 -04:00
parent a9e8394dec
commit d1fa76971b
No known key found for this signature in database
7 changed files with 1456 additions and 1098 deletions

View file

@ -17,7 +17,7 @@ import { loadContext } from '~/utils/config/headplane'
import { HeadscaleError, pull, put } from '~/utils/headscale'
import { getSession } from '~/utils/sessions'
import Monaco from './editor'
import { Editor, Differ } from './cm'
export async function loader({ request }: LoaderFunctionArgs) {
const session = await getSession(request.headers.get('Cookie'))
@ -254,19 +254,16 @@ export default function Page() {
</Tab>
</TabList>
<TabPanel id="edit">
<Monaco
<Editor
isDisabled={!data.hasAclWrite}
variant="edit"
language={data.aclType}
state={[acl, setAcl]}
defaultValue={data.currentAcl}
onChange={setAcl}
/>
</TabPanel>
<TabPanel id="diff">
<Monaco
variant="diff"
language={data.aclType}
state={[acl, setAcl]}
policy={data.currentAcl}
<Differ
left={data.currentAcl}
right={acl}
/>
</TabPanel>
<TabPanel id="preview">