mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-21 14:50:08 +03:00
on VM instantiation
This commit is contained in:
parent
518f636186
commit
d25c48f5ff
@ -190,15 +190,18 @@ define(function(require) {
|
||||
});
|
||||
}
|
||||
|
||||
function diffValues(finder, inElement){
|
||||
function diffValues(newValues, oldValues){
|
||||
var diff = [];
|
||||
if(finder && inElement){
|
||||
var Template = Array.isArray(inElement)? inElement: [inElement];
|
||||
var Finder = Array.isArray(finder)? finder: [finder];
|
||||
var x = Template.map(function(internalTemplate){return JSON.stringify(internalTemplate);});
|
||||
Finder.forEach(function(fnd) {
|
||||
if($.inArray(JSON.stringify(fnd),x) === -1){
|
||||
diff.push(fnd);
|
||||
if(oldValues && newValues){
|
||||
oldValues = Array.isArray(oldValues)? oldValues: [oldValues];
|
||||
newValues = Array.isArray(newValues)? newValues: [newValues];
|
||||
var oldValuesString = oldValues.map(function(internalValue){
|
||||
return JSON.stringify(internalValue);
|
||||
});
|
||||
|
||||
newValues.forEach(function (newValue){
|
||||
if($.inArray(JSON.stringify(newValue),oldValuesString) === -1){
|
||||
diff.push(newValue);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user