Skip to content

Commit

Permalink
Revert "cache host icons"
Browse files Browse the repository at this point in the history
This reverts commit a0c4ec2.
  • Loading branch information
morimoriysmoon authored and scroix committed Apr 1, 2024
1 parent dffb3c0 commit de237e7
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions nodel-webui-js/src/nodel.js
Original file line number Diff line number Diff line change
Expand Up @@ -737,22 +737,15 @@ var updateFavicon = function(host){
document.getElementsByTagName('head')[0].appendChild(link);
}

var hostIconMap = new Map();
var generateHostIcon = function(host) {
var icon = hostIconMap.get(host);
if (icon) {
return icon;
}
var hash = XXH.h64(host, 0x4e6f64656c).toString(16).padStart(16,'0');
var options = {
background: [255, 255, 255, 0],
margin: 0.1,
size: 20,
format: 'svg'
};
icon = new Identicon(hash, options).toString();
hostIconMap.set(host, icon);
return icon;
return new Identicon(hash, options).toString();
}

var updateHost = function(host, targetList) {
Expand Down Expand Up @@ -830,13 +823,6 @@ var refreshLocalsList = function(){
}

var getNodeList = function(filterstr){
// check if relate element exist
if($(".nodel-list").length < 1) {
var deferred = $.Deferred();
setTimeout(function() { deferred.reject(); }, 100);
return deferred.promise();
}

if(!_.isUndefined(filterstr)) $.observable(nodeList['flt'] = filterstr);
filter = {'filter': nodeList['flt']};
var d = $.Deferred();
Expand All @@ -858,13 +844,6 @@ var getNodeList = function(filterstr){
}

var getLocalsList = function(filterstr){
// check if relate element exist
if($(".nodel-locals").length < 1) {
var deferred = $.Deferred();
setTimeout(function() { deferred.reject(); }, 100);
return deferred.promise();
}

if(!_.isUndefined(filterstr)) $.observable(localsList['flt'] = filterstr);
var fltstr = localsList['flt'];
var d = $.Deferred();
Expand Down

0 comments on commit de237e7

Please sign in to comment.