lmenezes / elasticsearch-kopf

web admin interface for elasticsearch
MIT License
2.41k stars 333 forks source link

overly annoying incompatible version warning #392

Closed andersmartini closed 7 years ago

andersmartini commented 7 years ago

there's a little warning that pops up informing me that my version of Kopf is not compatible with my version of elasticsearch. the warning is great except a new one pops up every 5 seconds (on every automatic refresh i guess)

maybe it would be better to show this warning only once per session instead?

Lubytes commented 7 years ago

I think I ran into a solution earlier. You can make a simple change in the _site/dist/kopf.js

Avoid the nervouse amount of version compatibility alerts beginning on line 1215 sample could be a different version , though throw the alert once

 $scope.version = '2.1.2';

    $scope.modal = new ModalControls();
    var alertedOnce = false;

    $scope.$watch(
        function () {
            return ElasticService.cluster;
        },
        function (newValue, oldValue) {
            var version = ElasticService.getVersion();
            if (version && version.isValid()) {
                var major = version.getMajor();
                if (major != parseInt($scope.version.charAt(0)) && !alertedOnce) {
                    AlertService.warn(
                        'This version of kopf is not compatible with your ES version',
                        'Upgrading to newest supported version is recommeded'
                    );
                    alertedOnce = true;
                }
            }
        }
    );
lmenezes commented 7 years ago

@andersmartini sorry, the idea was really to be inconvenient. Not supporting ES 5 meant that I also did not test it against it. And even though this is unlikely, I prefer annoy people than to have someone lose data/break a cluster.

By the way, if you are looking for ES 5 support try https://github.com/lmenezes/cerebro :)