"use strict"; const sqlConsole = (function() { const dialogEl = $("#sql-console-dialog"); const queryEl = $('#sql-console-query'); const executeButton = $('#sql-console-execute'); const resultHeadEl = $('#sql-console-results thead'); const resultBodyEl = $('#sql-console-results tbody'); function showDialog() { glob.activeDialog = dialogEl; dialogEl.dialog({ modal: true, width: $(window).width(), height: $(window).height() }); } async function execute() { const sqlQuery = queryEl.val(); const result = await server.post("sql/execute", { query: sqlQuery }); if (!result.success) { showError(result.error); return; } else { showMessage("Query was executed successfully."); } const rows = result.rows; resultHeadEl.empty(); resultBodyEl.empty(); if (rows.length > 0) { const result = rows[0]; const rowEl = $("