Adding some controls around datasource config creation and updating minio fetch.

This commit is contained in:
mike12345567 2022-08-17 11:01:25 +01:00
parent ee4f72126a
commit b6a5ccbf10
2 changed files with 5 additions and 1 deletions

View File

@ -19,6 +19,9 @@
async function saveDatasource() {
try {
if (!datasource.name) {
datasource.name = name
}
const resp = await save(datasource, skipFetch)
$goto(`./datasource/${resp._id}`)
notifications.success(`Datasource updated successfully.`)

View File

@ -17,6 +17,7 @@ const {
downloadTarball,
} = require("./utilities")
const { updateClientLibrary } = require("./clientLibrary")
const { checkSlashesInUrl } = require("../")
const env = require("../../environment")
const {
USER_METDATA_PREFIX,
@ -358,7 +359,7 @@ exports.getDatasourcePlugin = async (name, url) => {
if (fs.existsSync(filename)) {
return require(filename)
}
const response = fetch(url)
const response = await fetch(checkSlashesInUrl(`${env.MINIO_URL}/${url}`))
if (response.status === 200) {
const content = await response.text()
fs.writeFileSync(filename, content)