(k, ds?)
| 19 | import { $datasources } from "src/views/datasource/store" |
| 20 | |
| 21 | export const getDatasource = (k, ds?):Datasource => { |
| 22 | const datasources = ds ?? $datasources.get() |
| 23 | let currentDatasource |
| 24 | if (hasVariableFormat(k?.toString())) { |
| 25 | const name = replaceWithVariables(k) |
| 26 | currentDatasource = datasources?.find(ds => ds.name == name) |
| 27 | } else { |
| 28 | currentDatasource = datasources?.find(ds => ds.id == k) |
| 29 | } |
| 30 | return currentDatasource |
| 31 | } |
| 32 | |
| 33 | export const roundDsTime = timestamp => { |
| 34 | return floor(timestamp) |
no test coverage detected