mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 23:35:59 +00:00
SYNC: Merge pull request #14 from dbgate/ai-sql
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
export let showCaller = false;
|
||||
export let startLine = 0;
|
||||
export let onMessageClick = null;
|
||||
export let onExplainError = null;
|
||||
|
||||
export let filter = '';
|
||||
|
||||
@@ -90,6 +91,7 @@
|
||||
{startLine}
|
||||
previousRow={index > 0 ? items[index - 1] : null}
|
||||
{onMessageClick}
|
||||
{onExplainError}
|
||||
/>
|
||||
{/each}
|
||||
</table>
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
import JSONTree from '../jsontree/JSONTree.svelte';
|
||||
import FontIcon from '../icons/FontIcon.svelte';
|
||||
import { plusExpandIcon } from '../icons/expandIcons';
|
||||
import InlineButton from '../buttons/InlineButton.svelte';
|
||||
|
||||
export let row;
|
||||
export let index;
|
||||
@@ -27,6 +28,7 @@
|
||||
|
||||
export let previousRow = null;
|
||||
export let onMessageClick = null;
|
||||
export let onExplainError = null;
|
||||
|
||||
let isExpanded = false;
|
||||
</script>
|
||||
@@ -43,6 +45,15 @@
|
||||
<FontIcon icon={plusExpandIcon(isExpanded)} />
|
||||
</span>
|
||||
{row.message}
|
||||
{#if row.severity == 'error' && onExplainError}
|
||||
<InlineButton
|
||||
title="Explain error"
|
||||
inlineBlock
|
||||
on:click={e => {
|
||||
onExplainError(row);
|
||||
}}><FontIcon icon="img ai" /> Explain</InlineButton
|
||||
>
|
||||
{/if}
|
||||
</td>
|
||||
<td>{moment(row.time).format('HH:mm:ss')}</td>
|
||||
<td>{formatDuration(new Date(row.time).getTime() - time0)}</td>
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
export let startLine = 0;
|
||||
export let onChangeErrors = null;
|
||||
export let onMessageClick = null;
|
||||
export let onExplainError = null;
|
||||
|
||||
const cachedMessagesRef = createRef([]);
|
||||
const lastErrorMessageCountRef = createRef(0);
|
||||
@@ -70,5 +71,13 @@
|
||||
{#if showNoMessagesAlert && (!displayedMessages || displayedMessages.length == 0)}
|
||||
<ErrorInfo message="No messages" icon="img alert" />
|
||||
{:else}
|
||||
<MessageView items={displayedMessages} {onMessageClick} {showProcedure} {showLine} {showCaller} {startLine} />
|
||||
<MessageView
|
||||
items={displayedMessages}
|
||||
{onMessageClick}
|
||||
{showProcedure}
|
||||
{showLine}
|
||||
{showCaller}
|
||||
{startLine}
|
||||
{onExplainError}
|
||||
/>
|
||||
{/if}
|
||||
|
||||
@@ -21,8 +21,8 @@ function getParsedLocalStorage(key) {
|
||||
|
||||
const saveHandlersList = [];
|
||||
|
||||
export default function useEditorData({ tabid, reloadToken = 0, loadFromArgs = null, onInitialData = null }) {
|
||||
const localStorageKey = `tabdata_editor_${tabid}`;
|
||||
export default function useEditorData({ tabid, reloadToken = 0, loadFromArgs = null, onInitialData = null, editorKeyword = 'editor' }) {
|
||||
const localStorageKey = `tabdata_${editorKeyword}_${tabid}`;
|
||||
let changeCounter = 0;
|
||||
let savedCounter = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user