|
|
|
@ -330,9 +330,12 @@ export class VariableSrv { |
|
|
|
for (const v of this.variables) { |
|
|
|
for (const v of this.variables) { |
|
|
|
const key = `var-${v.name}`; |
|
|
|
const key = `var-${v.name}`; |
|
|
|
if (vars.hasOwnProperty(key)) { |
|
|
|
if (vars.hasOwnProperty(key)) { |
|
|
|
update.push(v.setValueFromUrl(vars[key])); |
|
|
|
if (this.isVariableUrlValueDifferentFromCurrent(v, vars[key])) { |
|
|
|
|
|
|
|
update.push(v.setValueFromUrl(vars[key])); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (update.length) { |
|
|
|
if (update.length) { |
|
|
|
Promise.all(update).then(() => { |
|
|
|
Promise.all(update).then(() => { |
|
|
|
this.dashboard.templateVariableValueUpdated(); |
|
|
|
this.dashboard.templateVariableValueUpdated(); |
|
|
|
@ -341,6 +344,11 @@ export class VariableSrv { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
isVariableUrlValueDifferentFromCurrent(variable: any, urlValue: any) { |
|
|
|
|
|
|
|
// lodash _.isEqual handles array of value equality checks as well
|
|
|
|
|
|
|
|
return !_.isEqual(variable.current.value, urlValue); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
updateUrlParamsWithCurrentVariables() { |
|
|
|
updateUrlParamsWithCurrentVariables() { |
|
|
|
// update url
|
|
|
|
// update url
|
|
|
|
const params = this.$location.search(); |
|
|
|
const params = this.$location.search(); |
|
|
|
|