in src/templates/custom.ts [28:55]
constructor(opts: Partial<GrafanaCustomTemplate> = {}) {
this.state = {
allFormat: 'glob',
current: {},
datasource: null,
includeAll: false,
allValue: '',
name: 'template',
options: [],
query: null,
refresh: 0,
refresh_on_load: false,
type: 'custom',
};
this.defaultValue = '';
// Overwrite defaults with custom values
Object.keys(opts).forEach((key) => {
switch (key) {
case 'defaultValue':
this.defaultValue = opts[key];
break;
default:
this.state[key] = opts[key];
}
});
this._processOptions();
}