axonops / axonops-workbench

AxonOps™ Workbench for Apache Cassandra® - Desktop application for Mac, Windows and Linux
https://axonops.com
Apache License 2.0
11 stars 0 forks source link

[feat]: Truncate the length of the partitioner string value in the tree as its too long #362

Closed millerjp closed 1 month ago

millerjp commented 2 months ago

this long string takes up too much space

Screenshot 2024-09-06 at 16 54 01

You can split this by . and take the last element of the array - eg org.apache.cassandra.dht.Murmer3Partitioner becomes just Murmer3Partitioner

Always do this with a split and last element in the array as there could be different packages for the partitioner class to reside under. Also, make sure if it can handle if it is already coming back as Murmer3Partitioner

eg

let strings = [
    "org.apache.cassandra.dht.Murmer3Partitioner",
    "Murmer3Partitioner"
];

strings.forEach(string => {
    let match = string.match(/[^.]+$/);
    if (match) {
        console.log(match[0]);  // Output: Murmer3Partitioner for both cases
    } else {
        console.log(string); //If something doesnt work, just use the original string
    } 
});