triggers panel multi-ds supoort: refactor
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
export function migratePanelSchema(panel) {
|
||||
const schemaVersion = getSchemaVersion(panel);
|
||||
switch (schemaVersion) {
|
||||
case 1:
|
||||
panel.datasources = [panel.datasource];
|
||||
panel.targets[panel.datasources[0]] = panel.triggers;
|
||||
break;
|
||||
}
|
||||
|
||||
return panel;
|
||||
}
|
||||
|
||||
function getSchemaVersion(panel) {
|
||||
return panel.schemaVersion || 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user