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() {
|
async function saveDatasource() {
|
||||||
try {
|
try {
|
||||||
|
if (!datasource.name) {
|
||||||
|
datasource.name = name
|
||||||
|
}
|
||||||
const resp = await save(datasource, skipFetch)
|
const resp = await save(datasource, skipFetch)
|
||||||
$goto(`./datasource/${resp._id}`)
|
$goto(`./datasource/${resp._id}`)
|
||||||
notifications.success(`Datasource updated successfully.`)
|
notifications.success(`Datasource updated successfully.`)
|
||||||
|
|
|
@ -17,6 +17,7 @@ const {
|
||||||
downloadTarball,
|
downloadTarball,
|
||||||
} = require("./utilities")
|
} = require("./utilities")
|
||||||
const { updateClientLibrary } = require("./clientLibrary")
|
const { updateClientLibrary } = require("./clientLibrary")
|
||||||
|
const { checkSlashesInUrl } = require("../")
|
||||||
const env = require("../../environment")
|
const env = require("../../environment")
|
||||||
const {
|
const {
|
||||||
USER_METDATA_PREFIX,
|
USER_METDATA_PREFIX,
|
||||||
|
@ -358,7 +359,7 @@ exports.getDatasourcePlugin = async (name, url) => {
|
||||||
if (fs.existsSync(filename)) {
|
if (fs.existsSync(filename)) {
|
||||||
return require(filename)
|
return require(filename)
|
||||||
}
|
}
|
||||||
const response = fetch(url)
|
const response = await fetch(checkSlashesInUrl(`${env.MINIO_URL}/${url}`))
|
||||||
if (response.status === 200) {
|
if (response.status === 200) {
|
||||||
const content = await response.text()
|
const content = await response.text()
|
||||||
fs.writeFileSync(filename, content)
|
fs.writeFileSync(filename, content)
|
||||||
|
|
Loading…
Reference in New Issue