Adding some controls around datasource config creation and updating minio fetch.
This commit is contained in:
parent
ee4f72126a
commit
b6a5ccbf10
|
@ -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.`)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue