Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into release/1.0.0-beta
Browse files Browse the repository at this point in the history
  • Loading branch information
digiserg committed Oct 3, 2024
2 parents 20a6827 + bb7b02c commit 2758b33
Show file tree
Hide file tree
Showing 11 changed files with 289 additions and 229 deletions.
1 change: 1 addition & 0 deletions localization/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@
"the connection has been successfully updated": "لقد تم تحديث الاتصال بنجاح",
"the current release version has been successfully copied to the clipboard": "تم نسخ نسخة الإصدار الحالي إلى الحافظة بنجاح",
"the detected version of Apache Cassandra is [b]$data[/b], unwanted behaviour and compatibility issues may be encountered": "إن نسخة Apache Cassandra هي [b]$data[/b]، قد تحدث بعض السلوكيات غير المرغوبة ومشاكل توافق",
"the given name seems invalid, please provide a unique valid name": "يبدو أن الاسم المُعطى للاتصال غير صالح، يُرجى إعطاء اسم صالح ومميز للاتصال",
"the importing process has finished, results for the workspaces are: $data": "لقد انتهت عملية الاستيراد، نتائج مساحات العمل: $data",
"the local cluster [b]$data[/b] has been successfully deleted": "لقد تم حذف العنقود المحلي [b]$data[/b] بنجاح",
"the local cluster [b]$data[/b] has been successfully stopped": "لقد تم إيقاف العنقود المحلي [b]$data[/b] بنجاح",
Expand Down
3 changes: 2 additions & 1 deletion localization/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@
"the connection has been successfully updated": "the connection has been successfully updated",
"the current release version has been successfully copied to the clipboard": "the current release version has been successfully copied to the clipboard",
"the detected version of Apache Cassandra is [b]$data[/b], unwanted behaviour and compatibility issues may be encountered": "the detected version of Apache Cassandra is [b]$data[/b], unwanted behaviour and compatibility issues may be encountered",
"the given name seems invalid, please provide a unique valid name": "the given name seems invalid, please provide a unique valid name",
"the importing process has finished, results for the workspaces are: $data": "the importing process has finished, results for the workspaces are: $data",
"the local cluster [b]$data[/b] has been successfully deleted": "the local cluster [b]$data[/b] has been successfully deleted",
"the local cluster [b]$data[/b] has been successfully stopped": "the local cluster [b]$data[/b] has been successfully stopped",
Expand All @@ -336,8 +337,8 @@
"there is no difference between the previous and new metadata": "there is no difference between the previous and new metadata",
"there's a new update!": "there's a new update!",
"there's an active work area for the local cluster [b]$data[/b], please consider to close it before attempting to delete the local cluster again": "there's an active work area for the local cluster [b]$data[/b], please consider to close it before attempting to delete the local cluster again",
"this connection [b]$data[/b] has an active work area, make sure to close its work area before attempting to edit or delete it": "this connection [b]$data[/b] has an active work area, make sure to close its work area before attempting to edit or delete it",
"this connection [b]$data[/b] has an active work area, make sure to close its work area before attempting to delete the workspace [b]$data[/b]": "this connection [b]$data[/b] has an active work area, make sure to close its work area before attempting to delete the workspace [b]$data[/b]",
"this connection [b]$data[/b] has an active work area, make sure to close its work area before attempting to edit or delete it": "this connection [b]$data[/b] has an active work area, make sure to close its work area before attempting to edit or delete it",
"this connection [b]$data[/b] has an active work area, make sure to close its work area before attempting to test it": "this connection [b]$data[/b] has an active work area, make sure to close its work area before attempting to test it",
"this limit can be changed from the app's settings in the limits section": "this limit can be changed from the app's settings in the limits section",
"this update needs an app restart": "this update needs an app restart",
Expand Down
1 change: 1 addition & 0 deletions localization/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@
"the connection has been successfully updated": "La conexión se ha actualizado correctamente",
"the current release version has been successfully copied to the clipboard": "La versión actual se ha copiado correctamente en el portapapeles",
"the detected version of Apache Cassandra is [b]$data[/b], unwanted behaviour and compatibility issues may be encountered": "la versión detectada de Apache Cassandra es [b]$data[/b], se pueden encontrar comportamientos no deseados y problemas de compatibilidad",
"the given name seems invalid, please provide a unique valid name": "El nombre dado parece inválido, proporcione un nombre válido y único",
"the importing process has finished, results for the workspaces are: $data": "El proceso de importación ha finalizado, los resultados de los espacios de trabajo son: $data",
"the local cluster [b]$data[/b] has been successfully deleted": "El clúster local [b]$data[/b] se ha eliminado correctamente",
"the local cluster [b]$data[/b] has been successfully stopped": "El clúster local [b]$data[/b] se ha detenido correctamente",
Expand Down
1 change: 1 addition & 0 deletions localization/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@
"the connection has been successfully updated": "La connexion a été mise à jour avec succès",
"the current release version has been successfully copied to the clipboard": "La version actuelle a été copiée avec succès dans le presse-papiers",
"the detected version of Apache Cassandra is [b]$data[/b], unwanted behaviour and compatibility issues may be encountered": "la version détectée d’Apache Cassandra est [b]$data[/b), des comportements indésirables et des problèmes de compatibilité peuvent être rencontrés",
"the given name seems invalid, please provide a unique valid name": "le nom donné semble invalide, veuillez fournir un nom valide unique",
"the importing process has finished, results for the workspaces are: $data": "Le processus d’importation est terminé, les résultats pour les espaces de travail sont les suivants : $data",
"the local cluster [b]$data[/b] has been successfully deleted": "Le cluster local [b]$data[/b] a été supprimé avec succès",
"the local cluster [b]$data[/b] has been successfully stopped": "Le cluster local [b]$data[/b] a été arrêté avec succès",
Expand Down
1 change: 1 addition & 0 deletions localization/gl.json
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@
"the connection has been successfully updated": "A conexión actualizouse con éxito",
"the current release version has been successfully copied to the clipboard": "A versión actual foi copiada con éxito no portapapeis.",
"the detected version of Apache Cassandra is [b]$data[/b], unwanted behaviour and compatibility issues may be encountered": "A versión detectada de Apache Cassandra é [b]$data[/b], poden atoparse problemas de comportamento e compatibilidade non desexados",
"the given name seems invalid, please provide a unique valid name": "o nome de pila non parece válido, proporcione un nome único e válido",
"the importing process has finished, results for the workspaces are: $data": "O proceso de importación rematou, os resultados dos espazos de traballo son: $data",
"the local cluster [b]$data[/b] has been successfully deleted": "O cluster local [b]$data[/b] foi eliminado con éxito",
"the local cluster [b]$data[/b] has been successfully stopped": "O cluster local [b]$data[/b] foi detido con éxito",
Expand Down
1 change: 1 addition & 0 deletions localization/iw.json
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@
"the connection has been successfully updated": "החיבור עודכן בהצלחה",
"the current release version has been successfully copied to the clipboard": "גירסת ההפצה הנוכחית הועתקה בהצלחה ללוח",
"the detected version of Apache Cassandra is [b]$data[/b], unwanted behaviour and compatibility issues may be encountered": "הגרסה שזוהתה של Apache Cassandra היא [b]$data[/b], ייתכן שתיתקל בבעיות התנהגות ותאימות לא רצויות",
"the given name seems invalid, please provide a unique valid name": "השם הפרטי נראה לא חוקי, אנא ספק שם חוקי ייחודי",
"the importing process has finished, results for the workspaces are: $data": "תהליך הייבוא הסתיים, התוצאות עבור סביבות העבודה הן: $data",
"the local cluster [b]$data[/b] has been successfully deleted": "האשכול המקומי [b]$data[/b] נמחק בהצלחה",
"the local cluster [b]$data[/b] has been successfully stopped": "האשכול המקומי [b]$data[/b] הופסק בהצלחה",
Expand Down
1 change: 1 addition & 0 deletions localization/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@
"the connection has been successfully updated": "连接已成功更新",
"the current release version has been successfully copied to the clipboard": "当前发行版已成功复制到剪贴板",
"the detected version of Apache Cassandra is [b]$data[/b], unwanted behaviour and compatibility issues may be encountered": "检测到的 Apache Cassandra 版本为 [b]$data[/b],则可能会遇到不需要的行为和兼容性问题",
"the given name seems invalid, please provide a unique valid name": "给定的名称似乎无效,请提供一个唯一有效的名称",
"the importing process has finished, results for the workspaces are: $data": "导入过程已完成,工作区的结果是:$data",
"the local cluster [b]$data[/b] has been successfully deleted": "已成功删除本地群集 [b]$data[/b]",
"the local cluster [b]$data[/b] has been successfully stopped": "已成功停止本地群集 [b]$data[/b]",
Expand Down
111 changes: 76 additions & 35 deletions renderer/js/events/clusters.js
Original file line number Diff line number Diff line change
Expand Up @@ -1690,7 +1690,6 @@
if (isConnectionLost)
return


try {
if (!((['connectionerror:', ',last_host']).some((keyword) => minifyText(allOutput).includes(keyword))))
throw 0
Expand Down Expand Up @@ -7095,6 +7094,9 @@
let input = $(this), // Point at the current input
workspaceID = getActiveWorkspaceID() // Get the active workspace's ID

// Remove any visual feedback about having an invalid value
input.removeClass('is-invalid')

// Ignore the input field if it is not associated with a section in the `cqlsh.rc` config file
if (getAttributes(input, 'info-section') == 'none')
return
Expand All @@ -7119,9 +7121,6 @@
// Convert final value to string
value = `${value}`

// Remove any visual feedback about having an invalid value
input.removeClass('is-invalid')

// Inner function to update the editor's content
let update = async () => {
isUpdatingEditor = true // Change the value to `true`; to prevent collisions
Expand Down Expand Up @@ -8015,6 +8014,20 @@
*/
extraCondition = editingMode ? clusterName != editedClusterObject.name : true

try {
if (Sanitize(minifyText(clusterName)).length > 0)
throw 0

// Enable the buttons in the footer
button.add('#testConnectionCluster').add('#switchEditor').removeAttr('disabled')

// Show feedback to the user
showToast(I18next.capitalize(I18next.t(!editingMode ? 'add connection' : 'update connection')), I18next.capitalizeFirstLetter(I18next.t('the given name seems invalid, please provide a unique valid name')) + '.', 'failure')

// Skip the upcoming code - terminate the saving/updating process -
return
} catch (e) {}

try {
// If there's no duplication then skip this try-catch block
if ([undefined, null].includes(exists) || !extraCondition)
Expand Down Expand Up @@ -8208,6 +8221,12 @@
editedClusterObject = newEditedCluster
} catch (e) {}

// Refresh clusters for the currently active workspace
$(document).trigger('refreshClusters', workspaceID)

// Get workspaces; to sync with newly added/updated clusters
$(document).trigger('getWorkspaces')

{
setTimeout(() => {
let clusterElement = $(`div.clusters-container div.cluster[data-id="${finalCluster.info.id}"]`),
Expand All @@ -8221,6 +8240,34 @@
// Point at the status element - the flashing circle at the top right -
statusElement = clusterElement.children('div.status')


try {
if (!secrets[0])
throw 0

getKey('public', (key) => {
try {
// If the received key is valid to be used then skip this try-catch block
if (key.length <= 0)
throw 0

for (secret of secrets) {
if (typeof secret !== 'object')
continue

try {
if (`${secret.value}`.length <= 0)
throw 0

let value = encrypt(key, secret.value)

clusterElement.attr(`data-${secret.name.toLowerCase().replace('ssh', 'ssh-')}`, value)
} catch (e) {}
}
} catch (e) {}
})
} catch (e) {}

try {
if (tempClusterID == null)
throw 0
Expand Down Expand Up @@ -8271,12 +8318,6 @@
})
}, 1000)
}

// Refresh clusters for the currently active workspace
$(document).trigger('refreshClusters', workspaceID)

// Get workspaces; to sync with newly added/updated clusters
$(document).trigger('getWorkspaces')
}
// End of the inner function to do processes after saving/updating cluster

Expand Down Expand Up @@ -8342,6 +8383,30 @@
// Determine the proper function to be called based on whether the current mode is `edit` or not
let clustersCallFunction = editingMode ? Modules.Clusters.updateCluster : Modules.Clusters.saveCluster

/**
* Encrypt all provided secrets - for Apache Cassandra and SSH -
*
* Create an array of names and values of the secrets
*/
let secrets = [{
name: 'username',
value: username
}, {
name: 'password',
value: password
}, {
name: 'sshUsername',
value: sshUsername
}, {
name: 'sshPassword',
value: sshPassword
},
{
name: 'sshPassphrase',
value: sshPassphrase
}
]

try {
// If there's no need to wait for the encryption process then skip this try-catch block
if (!waitForEncryption)
Expand All @@ -8364,30 +8429,6 @@
return
} catch (e) {}

/**
* Encrypt all provided secrets - for Apache Cassandra and SSH -
*
* Create an array of names and values of the secrets
*/
let secrets = [{
name: 'username',
value: username
}, {
name: 'password',
value: password
}, {
name: 'sshUsername',
value: sshUsername
}, {
name: 'sshPassword',
value: sshPassword
},
{
name: 'sshPassphrase',
value: sshPassphrase
}
]

// Values will be saved in the `secrets` object
finalCluster.info.secrets = [],
// Array to be a copy from the original secrets before manipulation
Expand Down Expand Up @@ -8429,7 +8470,7 @@
clustersCallFunction(workspaceID, finalCluster).then((status) => postProcess(status, editingMode ? {
...savedSecrets,
...finalCluster.info.credentials
} : null))
} : [true, ...secrets]))
})

// Skip the upcoming code
Expand Down
2 changes: 1 addition & 1 deletion renderer/js/events/workspaces.js
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,7 @@ $(document).on('getWorkspaces refreshWorkspaces', function(e) {
let nameExists = allWorkspaces.find((workspace) => manipulateText(workspace.name) == manipulateText(name.val()) && workspace.id != workspaceID)

// If the name exists, or the name is invalid
if (nameExists != undefined || name.val().trim().length <= 0 || Sanitize(name.val()).length <= 0) {
if (nameExists != undefined || name.val().trim().length <= 0 || Sanitize(minifyText(name.val())).length <= 0) {
// Add `invalid` class for the name input field
name.parent().addClass('mdc-text-field--invalid')

Expand Down
4 changes: 4 additions & 0 deletions renderer/js/funcs.js
Original file line number Diff line number Diff line change
Expand Up @@ -896,6 +896,7 @@ let convertTableToTabulator = (json, container, callback) => {
* @Return: {object} a valid tree structure to be rendered
*/
let buildTreeview = (metadata, ignoreTitles = false) => {
console.log(metadata);
/**
* Due to the way JSTree is coded, there's an issue with the paths in Windows
* To solve this issue, this inner function replaces the backward slashes
Expand Down Expand Up @@ -1152,6 +1153,9 @@ let buildTreeview = (metadata, ignoreTitles = false) => {
buildTreeViewForChild(keyspacesID, keyspaceID, `Keyspace`, keyspace, 'keyspace')

try {
if (keyspace.replication_strategy == undefined)
throw 0

let replicationStrategy = JSON.parse(repairJSON(keyspace.replication_strategy)),
replicationStrategyID = getRandomID(30)

Expand Down
Loading

0 comments on commit 2758b33

Please sign in to comment.