mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 13:06:01 +00:00
electron app starting
This commit is contained in:
@@ -27,13 +27,13 @@
|
||||
value = e.detail;
|
||||
|
||||
if (database) {
|
||||
axiosInstance.post('connections/update-database', {
|
||||
axiosInstance().post('connections/update-database', {
|
||||
conid,
|
||||
database,
|
||||
values: { connectionColor: e.detail },
|
||||
});
|
||||
} else {
|
||||
axiosInstance.post('connections/update', {
|
||||
axiosInstance().post('connections/update', {
|
||||
_id: conid,
|
||||
values: { connectionColor: e.detail },
|
||||
});
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
value="OK"
|
||||
on:click={e => {
|
||||
closeCurrentModal();
|
||||
axiosInstance.post('config/update-settings', {
|
||||
axiosInstance().post('config/update-settings', {
|
||||
commands: {
|
||||
...$commandsSettings,
|
||||
[command.id]: {
|
||||
@@ -58,7 +58,7 @@
|
||||
value="Reset"
|
||||
on:click={() => {
|
||||
closeCurrentModal();
|
||||
axiosInstance.post('config/update-settings', {
|
||||
axiosInstance().post('config/update-settings', {
|
||||
commands: _.omit($commandsSettings, [command.id]),
|
||||
});
|
||||
}}
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
isTesting = true;
|
||||
testIdRef.update(x => x + 1);
|
||||
const testid = testIdRef.get();
|
||||
const resp = await axiosInstance.post('connections/test', e.detail);
|
||||
const resp = await axiosInstance().post('connections/test', e.detail);
|
||||
if (testIdRef.get() != testid) return;
|
||||
|
||||
isTesting = false;
|
||||
@@ -70,7 +70,7 @@
|
||||
let connection = _.omit(e.detail, omitProps);
|
||||
if (driver?.beforeConnectionSave) connection = driver?.beforeConnectionSave(connection);
|
||||
|
||||
axiosInstance.post('connections/save', connection);
|
||||
axiosInstance().post('connections/save', connection);
|
||||
closeCurrentModal();
|
||||
}
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
dumpSqlSelect(dmp, select);
|
||||
|
||||
isLoading = true;
|
||||
const response = await axiosInstance.request({
|
||||
const response = await axiosInstance().request({
|
||||
url: 'database-connections/query-data',
|
||||
method: 'post',
|
||||
params: {
|
||||
|
||||
@@ -69,7 +69,7 @@ import FormButton from '../forms/FormButton.svelte';
|
||||
const saveTab = async values => {
|
||||
const data = await getTabSaveData(values);
|
||||
|
||||
axiosInstance.post('files/save', {
|
||||
axiosInstance().post('files/save', {
|
||||
folder: 'favorites',
|
||||
file: uuidv1(),
|
||||
format: 'json',
|
||||
@@ -78,13 +78,13 @@ import FormButton from '../forms/FormButton.svelte';
|
||||
};
|
||||
|
||||
const saveFile = async values => {
|
||||
const oldDataResp = await axiosInstance.post('files/load', {
|
||||
const oldDataResp = await axiosInstance().post('files/load', {
|
||||
folder: 'favorites',
|
||||
file: editingData.file,
|
||||
format: 'json',
|
||||
});
|
||||
|
||||
axiosInstance.post('files/save', {
|
||||
axiosInstance().post('files/save', {
|
||||
folder: 'favorites',
|
||||
file: editingData.file,
|
||||
format: 'json',
|
||||
|
||||
@@ -81,8 +81,8 @@
|
||||
const handleRunnerDone = () => {
|
||||
busy = false;
|
||||
if (refreshArchiveFolderRef.get()) {
|
||||
axiosInstance.post('archive/refresh-folders', {});
|
||||
axiosInstance.post('archive/refresh-files', { folder: refreshArchiveFolderRef.get() });
|
||||
axiosInstance().post('archive/refresh-folders', {});
|
||||
axiosInstance().post('archive/refresh-files', { folder: refreshArchiveFolderRef.get() });
|
||||
$currentArchive = refreshArchiveFolderRef.get();
|
||||
$selectedWidget = 'archive';
|
||||
}
|
||||
@@ -108,7 +108,7 @@
|
||||
const script = await createImpExpScript($extensions, values);
|
||||
executeNumber += 1;
|
||||
let runid = runnerId;
|
||||
const resp = await axiosInstance.post('runners/start', { script });
|
||||
const resp = await axiosInstance().post('runners/start', { script });
|
||||
runid = resp.data.runid;
|
||||
runnerId = runid;
|
||||
|
||||
@@ -120,7 +120,7 @@
|
||||
};
|
||||
|
||||
const handleCancel = () => {
|
||||
axiosInstance.post('runners/cancel', {
|
||||
axiosInstance().post('runners/cancel', {
|
||||
runid: runnerId,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
const handleSubmit = async e => {
|
||||
const { name } = e.detail;
|
||||
await axiosInstance.post('files/save', { folder, file: name, data, format });
|
||||
await axiosInstance().post('files/save', { folder, file: name, data, format });
|
||||
closeCurrentModal();
|
||||
if (onSave) {
|
||||
onSave(name, {
|
||||
@@ -38,7 +38,7 @@
|
||||
const parsed = path.parse(filePath);
|
||||
// if (!parsed.ext) filePath += `.${fileExtension}`;
|
||||
|
||||
await axiosInstance.post('files/save-as', { filePath, data, format });
|
||||
await axiosInstance().post('files/save-as', { filePath, data, format });
|
||||
closeCurrentModal();
|
||||
|
||||
if (onSave) {
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
const loadid = uuidv1();
|
||||
loadRef.set(loadid);
|
||||
busy = true;
|
||||
const response = await axiosInstance.post('database-connections/sql-preview', {
|
||||
const response = await axiosInstance().post('database-connections/sql-preview', {
|
||||
conid,
|
||||
database,
|
||||
objects,
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
dumpSqlSelect(dmp, select);
|
||||
|
||||
isLoading = true;
|
||||
const response = await axiosInstance.request({
|
||||
const response = await axiosInstance().request({
|
||||
url: 'database-connections/query-data',
|
||||
method: 'post',
|
||||
params: {
|
||||
|
||||
Reference in New Issue
Block a user