Skip to content

Commit

Permalink
For issue #421, with updates and improvements (#424)
Browse files Browse the repository at this point in the history
* For issue #421, with updates and improvements

- The enhanced terminal should now render complex rows without issues.
- Updates in the `About` section:
	- Users can now see the versions of different components and parts of the app; like the binaries, Electron, Node and Chrome.
	-
- Updates in the UI and the style files.

* Updated the app's icon for macOS

* Fixes for macOS

* Added a new phrase to the localization files

* Update for refresh metadata button in scheme diff

* For issue #383
  • Loading branch information
mhmdkrmabd authored Sep 16, 2024
1 parent c3d1704 commit 17ba47f
Show file tree
Hide file tree
Showing 17 changed files with 223 additions and 35 deletions.
18 changes: 11 additions & 7 deletions custom_node_modules/main/consts.js

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

1 change: 1 addition & 0 deletions localization/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@
"settings have been successfully saved": "تم حفظ الإعدادات بنجاح",
"settings": "الإعدادات",
"show differentiation": "إظهار الفرق",
"show more": "إظهار المزيد",
"snapshot suffix": "لاحقة اللقطة",
"some settings have been successfully saved, however, an error has occurred with variables, $data": "تم حفظ بعض الإعدادات بنجاح، مع ذلك، لقد حدث خطأ يتعلق بالمتغيرات، $data",
"something went wrong while attempt to test connection [b]$data[/b] in workspace [b]$data[/b], mostly it is an issue with <code>cqlsh.rc</code> file": "لقد حدث خطأ أثناء محاولة تجربة الاتصال [b]$data[/b] في مساحة العمل [b]$data[/b]، يبدو أنها مشكلة في ملف الإعدادات <code>cqlsh.rc</code> الخاص بالاتصال",
Expand Down
1 change: 1 addition & 0 deletions localization/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@
"settings have been successfully saved": "settings have been successfully saved",
"settings": "settings",
"show differentiation": "show differentiation",
"show more": "show more",
"snapshot suffix": "snapshot suffix",
"some settings have been successfully saved, however, an error has occurred with variables, $data": "some settings have been successfully saved, however, an error has occurred with variables, $data",
"something went wrong while attempt to test connection [b]$data[/b] in workspace [b]$data[/b], mostly it is an issue with <code>cqlsh.rc</code> file": "something went wrong while attempt to test connection [b]$data[/b] in workspace [b]$data[/b], mostly it is an issue with <code>cqlsh.rc</code> file",
Expand Down
1 change: 1 addition & 0 deletions localization/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@
"settings have been successfully saved": "La configuración se ha guardado con éxito",
"settings": "Configuración",
"show differentiation": "Mostrar diferenciación",
"show more": "mostrar más",
"snapshot suffix": "Sufijo de instantánea",
"some settings have been successfully saved, however, an error has occurred with variables, $data": "Algunas configuraciones se han guardado correctamente, sin embargo, se ha producido un error con las variables, $data",
"something went wrong while attempt to test connection [b]$data[/b] in workspace [b]$data[/b], mostly it is an issue with <code>cqlsh.rc</code> file": "Algo salió mal al intentar probar la conexión [b]$data[/b] en el espacio de trabajo [b]$data[/b], principalmente es un problema con el archivo <code>cqlsh.rc</code>",
Expand Down
1 change: 1 addition & 0 deletions localization/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@
"settings have been successfully saved": "Les paramètres ont été enregistrés avec succès",
"settings": "Paramètres",
"show differentiation": "Différenciation de l’écran",
"show more": "Afficher plus",
"snapshot suffix": "suffixe d’instantané",
"some settings have been successfully saved, however, an error has occurred with variables, $data": "Certains paramètres ont été enregistrés avec succès, cependant, une erreur s’est produite avec les variables, $data",
"something went wrong while attempt to test connection [b]$data[/b] in workspace [b]$data[/b], mostly it is an issue with <code>cqlsh.rc</code> file": "Quelque chose s’est mal passé lors de la tentative de test de connexion [b]$data[/b] dans l’espace de travail [b]$data[/b], il s’agit principalement d’un problème avec <code>le fichier cqlsh.rc</code>",
Expand Down
1 change: 1 addition & 0 deletions localization/gl.json
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@
"settings have been successfully saved": "A configuración gardouse con éxito",
"settings": "Configuración",
"show differentiation": "mostrar diferenciación",
"show more": "mostrar máis",
"snapshot suffix": "Sufixo Snapshot",
"some settings have been successfully saved, however, an error has occurred with variables, $data": "Algunhas configuracións gardáronse con éxito, con todo, produciuse un erro con variables, $data",
"something went wrong while attempt to test connection [b]$data[/b] in workspace [b]$data[/b], mostly it is an issue with <code>cqlsh.rc</code> file": "Algo saíu mal mentres intentaba probar a conexión [b]$data[/b] no espazo de traballo [b]$data[/b], principalmente é un problema co ficheiro <code>cqlsh.rc</code>.",
Expand Down
1 change: 1 addition & 0 deletions localization/iw.json
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@
"settings have been successfully saved": "ההגדרות נשמרו בהצלחה",
"settings": "הגדרות",
"show differentiation": "הצג בידול",
"show more": "להראות יותר",
"snapshot suffix": "סיומת תצלום בזק",
"some settings have been successfully saved, however, an error has occurred with variables, $data": "הגדרות מסוימות נשמרו בהצלחה, עם זאת, אירעה שגיאה עם משתנים, $data",
"something went wrong while attempt to test connection [b]$data[/b] in workspace [b]$data[/b], mostly it is an issue with <code>cqlsh.rc</code> file": "משהו השתבש בעת ניסיון לבדוק את החיבור [b]$data[/b] בסביבת עבודה [b]$data[/b], לרוב מדובר בבעיה בקובץ <code>cqlsh.rc</code>",
Expand Down
1 change: 1 addition & 0 deletions localization/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@
"settings have been successfully saved": "设置已成功保存",
"settings": "设置",
"show differentiation": "显示差异化",
"show more": "显示更多",
"snapshot suffix": "快照后缀",
"some settings have been successfully saved, however, an error has occurred with variables, $data": "某些设置已成功保存,但是,变量发生错误,$data",
"something went wrong while attempt to test connection [b]$data[/b] in workspace [b]$data[/b], mostly it is an issue with <code>cqlsh.rc</code> file": "尝试在工作区 [b]$data[/b] 中测试连接 [b]$data[/b] 时出错,主要是 <code>cqlsh.rc</code> 文件的问题",
Expand Down
Binary file modified renderer/assets/images/axonops-icon-512x512.icns
Binary file not shown.
6 changes: 3 additions & 3 deletions renderer/js/events/clusters.js
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,7 @@
</span>
</div>
<div class="actions">
<span class="refresh btn btn-secondary btn-dark btn-sm" data-mdb-ripple-color="dark" data-tippy="tooltip" data-mdb-placement="top" data-title="Refresh metadata" data-mulang="refresh metadata" capitalize-first
<span class="refresh btn btn-secondary btn-dark btn-sm" ${isSandbox ? 'style="bottom: 0px;"' : ''} data-mdb-ripple-color="dark" data-tippy="tooltip" data-mdb-placement="top" data-title="Refresh metadata" data-mulang="refresh metadata" capitalize-first
data-id="${refreshDifferentiationBtnID}">
<ion-icon name="refresh"></ion-icon>
</span>
Expand Down Expand Up @@ -3291,7 +3291,7 @@
* Maximum allowed statements to be saved are 30 for each cluster
* When this value is exceeded the oldest statement should be removed
*/
if (history.length >= 30)
if (history.length > 50)
history.pop()

// Add the statement at the very beginning of the array
Expand Down Expand Up @@ -4982,7 +4982,7 @@
savedHistoryItems = Store.get(clusterID) || []

// Reverse the array; to make the last saved item the first one in the list
savedHistoryItems.reverse()
// savedHistoryItems.reverse()

// Define index to be set for each history item
let index = 0
Expand Down
53 changes: 36 additions & 17 deletions renderer/js/events/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -601,26 +601,28 @@

// Listen to key presses in relation to the more options/settings shortcuts
setTimeout(() => {
tinyKeys.tinykeys(window, {
"$mod+Shift+Equal": () => actionButton.filter('[action="zoomIn"]').click(),
"$mod+Shift+Minus": () => actionButton.filter('[action="zoomOut"]').click(),
"$mod+Shift+Digit0": () => actionButton.filter('[action="zoomReset"]').click()
})

if (OS.platform() == 'darwin')
try {
tinyKeys.tinykeys(window, {
"$mod+Shift+BracketRight": () => actionButton.filter('[action="zoomIn"]').click(),
"$mod+Shift+Slash": () => actionButton.filter('[action="zoomOut"]').click(),
"$mod+Shift+Digit9": () => actionButton.filter('[action="zoomReset"]').click()
"$mod+Shift+Equal": () => actionButton.filter('[action="zoomIn"]').click(),
"$mod+Shift+Minus": () => actionButton.filter('[action="zoomOut"]').click(),
"$mod+Shift+Digit0": () => actionButton.filter('[action="zoomReset"]').click()
})

if (OS.platform() == 'win32') {
tinyKeys.tinykeys(window, {
"$mod+Shift+Digit9": () => actionButton.filter('[action="zoomReset"]').click()
})
$(`a[action="zoomReset"]`).find('kbd[digit]').text('9')
}
}, 1000)
if (OS.platform() == 'darwin')
tinyKeys.tinykeys(window, {
"$mod+Shift+BracketRight": () => actionButton.filter('[action="zoomIn"]').click(),
"$mod+Shift+Slash": () => actionButton.filter('[action="zoomOut"]').click(),
"$mod+Shift+Digit9": () => actionButton.filter('[action="zoomReset"]').click()
})

if (OS.platform() == 'win32') {
tinyKeys.tinykeys(window, {
"$mod+Shift+Digit9": () => actionButton.filter('[action="zoomReset"]').click()
})
$(`a[action="zoomReset"]`).find('kbd[digit]').text('9')
}
} catch (e) {}
}, 5000)

$(document).on('keydown', function(e) {
// F11 for toggling fullscreen mode
Expand Down Expand Up @@ -1133,3 +1135,20 @@
})
}, 500)
}

{
$('button#showMoreAbout').click(function() {
let isSlideUp = $(this).hasClass('slideUp'),
rightSide = $('div.modal#appAbout div.modal-body div.side-right')

$(this).toggleClass('slideUp', !isSlideUp)

$('div#moreAbout').slideToggle(300, function() {
try {
rightSide.animate({
scrollTop: rightSide.get(0).scrollHeight
}, 250)
} catch (e) {}
})
})
}
3 changes: 3 additions & 0 deletions renderer/js/funcs.js
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,9 @@ let convertJSONToTable = (json, isExpandOn = false) => {
let finalItem = item

try {
if (typeof finalItem === 'object')
throw 0

finalItem = JSON.parse(repairJSON(item))
} catch (e) {}

Expand Down
70 changes: 66 additions & 4 deletions renderer/js/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ $(document).on('initialize', () => {
})

// Update the web view element `src` with the AI Assistant's server URL
webviewAIAssistant.attr('src', Modules.Consts.AIAssistantServer)
webviewAIAssistant.attr('src', Modules.Consts.URLS.AIAssistantServer)

// Show/hide the loading spinner based on the status
webviewAIAssistant
Expand Down Expand Up @@ -310,7 +310,7 @@ $(document).on('initialize', () => {
})

// Logout from the AxonOps AI Chat
buttons.logout.click(() => webviewAIAssistant.attr('src', `${(new URL(Modules.Consts.AIAssistantServer)).origin}/logout`))
buttons.logout.click(() => webviewAIAssistant.attr('src', `${(new URL(Modules.Consts.URLS.AIAssistantServer)).origin}/logout`))

// Check and enable/disable the back/forward buttons based on the status
setInterval(() => {
Expand Down Expand Up @@ -1136,8 +1136,50 @@ $(document).on('initialize', () => {
let areBinariesExist = binaries.every((binary) => `${data}`.search(binary))

// Skip the upcoming code if all of them exist
if (areBinariesExist)
try {
if (!areBinariesExist)
throw 0

// If the host is Windows then change the binary call format
let binCall = (OS.platform() == 'win32') ? 'cqlsh-407.exe' : './cqlsh-407',
// Define the cqlsh tool's directory
binDirectory = `&& cd "cqlsh-407" && `

// Switch to the single-file mode
try {
if (!FS.lstatSync(Path.join(CWD, `cqlsh-407`)).isDirectory())
binDirectory = '&&'
} catch (e) {}

Terminal.run(`cd "${binariesPath}" ${binDirectory} ${binCall} --cversion=1`, (err, data, stderr) => {
try {
data = minifyText(manipulateOutput(data))
} catch (e) {}

if (!(data != undefined && `${data}`.length != 0)) {
$('div#moreAbout div[data-version="binaries"]').hide()
return
}

try {
import(Path.join(__dirname, '..', '..', 'node_modules', 'url-join', 'lib', 'url-join.js')).then((module) => {
let releaseLink = module.default(Modules.Consts.URLS.Binaries, 'releases', 'tag', data)

$('div#moreAbout div[data-version="binaries"] button').click(() => {
try {
Open(releaseLink)
} catch (e) {}
})
})
} catch (e) {}

$('div#moreAbout div[data-version="binaries"] span').text(data)
})

return
} catch (e) {}

$('div#moreAbout div[data-version="binaries"]').hide()

// Show feedback to the user if one of the binaries is missing
showToast(I18next.capitalize(I18next.t(`binaries check`)), I18next.capitalizeFirstLetter(I18next.t(`it seems some or all binaries shipped with the app are corrupted or missing, this state will cause critical issues for many processes. Please make sure to have the official complete version of the app`)) + '.', 'failure')
Expand Down Expand Up @@ -1261,7 +1303,7 @@ $(document).on('initialize', () => {

try {
import(Path.join(__dirname, '..', '..', 'node_modules', 'url-join', 'lib', 'url-join.js')).then((module) => {
let releaseLink = module.default(AppInfo.repository, 'releases', 'tag', AppInfo.version)
let releaseLink = module.default(Modules.Consts.URLS.Workbench, 'releases', 'tag', AppInfo.version)

$('button#releaseNotes').click(() => {
try {
Expand Down Expand Up @@ -1304,5 +1346,25 @@ $(document).on('initialize', () => setTimeout(() => {
})
}, 2000))


// Send the `loaded` event to the main thread, and show the `About` dialog/modal
$(document).on('initialize', () => setTimeout(() => {
$('div#moreAbout').children('div[data-version]:not([data-version="binaries"])').each(function() {
try {
let version = process.versions[$(this).attr('data-version')]

if (version == undefined) {
$(this).hide()
throw 0
}

$(this).children('span').text(version)
} catch (e) {}
})
}, 3000))




// Once the UI is ready, get all workspaces
$(document).ready(() => IPCRenderer.on('windows-shown', () => $(document).trigger('getWorkspaces')))
6 changes: 6 additions & 0 deletions renderer/styles/collections/globs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -859,3 +859,9 @@ ion-icon.axonops-status {
margin-left: 2px;
}
}

.json-literal,
.json-string {
color: #e3e3e3;
font-weight: normal;
}
4 changes: 2 additions & 2 deletions renderer/styles/master.css

Large diffs are not rendered by default.

69 changes: 68 additions & 1 deletion renderer/styles/master.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3216,7 +3216,7 @@ div.tab-content {
outline: 0;
font-family: 'Terminal', monospace;
width: 50%;
max-height: 320px;
max-height: 510px;
overflow-y: scroll;
border-radius: 7px;
padding: 5px 0;
Expand Down Expand Up @@ -4474,6 +4474,73 @@ div.app-info-actions {
}
}
}

button#showMoreAbout {
color: inherit;
margin: 8px 0;
padding: 6px 10px 6px 5px;

ion-icon {
font-size: 145%;
transition: all 0.15s ease-in-out;
}

&.slideUp {
ion-icon {
transform: rotate(180deg);
}
}
}

div#moreAbout {
background: #201f23;
font-family: 'Terminal', monospace;
font-size: 75%;
text-align: left;
padding: 5px;
border-radius: 7px;
width: 100%;
display: none;

div[data-version] {
&:first-letter {
text-transform: capitalize;
}

button {
width: 25px;
height: 25px;
border-radius: 50%;
overflow: hidden;
position: relative;
bottom: 2px;

ion-icon {
position: absolute;
inset: 0;
margin: auto !important;
font-size: 120% !important;
color: #e3e3e3;
opacity: 0.8;
transition: opacity 0.2s ease-in-out;

&[name="external-link"] {
opacity: 0.65;
}
}

&:hover {
ion-icon {
opacity: 0.65;

&[name="external-link"] {
opacity: 0.50;
}
}
}
}
}
}
/**
* Import right-to-left style
*/
Expand Down
Loading

0 comments on commit 17ba47f

Please sign in to comment.