mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-20 03:06:00 +00:00
ace editor
This commit is contained in:
@@ -2,15 +2,20 @@
|
||||
const engineToMode = {
|
||||
mssql: 'sqlserver',
|
||||
mysql: 'mysql',
|
||||
postgre: 'pgsql',
|
||||
postgres: 'pgsql',
|
||||
};
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
import AceEditor from './AceEditorCore.svelte';
|
||||
import AceEditor from './AceEditor.svelte';
|
||||
export let engine;
|
||||
|
||||
$: console.log('engine', engine);
|
||||
let mode;
|
||||
|
||||
$: {
|
||||
const match = (engine || '').match(/^([^@]*)@/);
|
||||
mode = engineToMode[match ? match[1] : engine] || 'sql';
|
||||
}
|
||||
</script>
|
||||
|
||||
<AceEditor mode={engineToMode[engine] || 'sql'} />
|
||||
<AceEditor {mode} />
|
||||
|
||||
Reference in New Issue
Block a user