Skip to content

Commit

Permalink
New feature related to #533, updates for #532, changes and improvemen…
Browse files Browse the repository at this point in the history
…ts (#534)
  • Loading branch information
mhmdkrmabd authored Nov 1, 2024
1 parent 89d5ef5 commit 325356f
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 5 deletions.
6 changes: 3 additions & 3 deletions custom_node_modules/main/pty.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion renderer/js/axonops_agent_webview.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ document.addEventListener('DOMContentLoaded', () => {
setTimeout(() => {
try {
document.querySelector('div[data-id="reloadWebView"]').addEventListener('click', () => {
console.log("CLICKED");
IPCRenderer.sendToHost(`reload-webview`)
})
} catch (e) {}
Expand Down
15 changes: 14 additions & 1 deletion renderer/js/events/clusters.js
Original file line number Diff line number Diff line change
Expand Up @@ -3300,6 +3300,18 @@
// Clear the statement's input field and make sure it's focused on it
setTimeout(() => statementInputField.val('').trigger('input').focus().attr('style', null))

try {
let isClearCommand = (['clear', 'cls']).some((command) => statement.startsWith(minifyText(command)))

if (!isClearCommand)
throw 0


sessionContainer.children('div.block').find('div.actions div.btn[action="delete"]').click()

return
} catch (e) {}

try {
if (!((['quit', 'exit']).some((command) => minifyText(statement).startsWith(minifyText(command)))))
throw 0
Expand Down Expand Up @@ -3416,8 +3428,9 @@
isCQLSHCommand = Modules.Consts.CQLSHCommands.some((command) => minifiedStatement.startsWith(minifyText(command))),
// Whether or not the statement is quitting the cqlsh session
isQuitCommand = (['quit', 'exit']).some((command) => minifiedStatement.startsWith(minifyText(command))),
isClearCommand = (['clear', 'cls']).some((command) => minifiedStatement.startsWith(minifyText(command))),
// Decide whether or not the execution button should be disabled
isExecutionButtonDisabled = minifiedStatement.length <= 0 || ((!isCQLSHCommand && !isQuitCommand) && !minifiedStatement.endsWith(';'))
isExecutionButtonDisabled = minifiedStatement.length <= 0 || ((!isCQLSHCommand && !isQuitCommand && !isClearCommand) && !minifiedStatement.endsWith(';'))

// Disable/enable the execution button
executeBtn.attr('disabled', isExecutionButtonDisabled ? '' : null)
Expand Down
18 changes: 18 additions & 0 deletions renderer/js/events/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,24 @@

actionButton.filter('[action="toggleFullscreen"]').click()
})

$(document).on('keydown', function(e) {
// CTRL+L to clear the enhanced terminal
if (!e.ctrlKey || e.keyCode != 76)
return

let interactiveTerminal = $(`div[content="workarea"] div.workarea[cluster-id="${activeClusterID}"] div.tab-content div.tab-pane[tab="cqlsh-session"] div.interactive-terminal-container div.session-content`)

if (interactiveTerminal.length <= 0)
return

try {
if (!interactiveTerminal.is(':visible'))
throw 0

interactiveTerminal.children('div.block').find('div.actions div.btn[action="delete"]').click()
} catch (e) {}
})
}
}

Expand Down

0 comments on commit 325356f

Please sign in to comment.