mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-20 04:16:00 +00:00
fixed mongo update condition
This commit is contained in:
@@ -490,7 +490,11 @@
|
||||
|
||||
function getSelectedDataJson(forceArray = false) {
|
||||
const cells = cellsToRegularCells(selectedCells);
|
||||
const data = cells.map(cell => grider.getRowData(cell[0])[realColumnUniqueNames[cell[1]]]);
|
||||
const data = cells.map(cell => {
|
||||
const rowData = grider.getRowData(cell[0]);
|
||||
if (!rowData) return null;
|
||||
return rowData[realColumnUniqueNames[cell[1]]];
|
||||
});
|
||||
if (!data.every(x => _.isArray(x) || _.isPlainObject(x))) return null;
|
||||
if (data.length == 0) return null;
|
||||
if (data.length == 1 && _.isPlainObject(data[0]) && !forceArray) return data[0];
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
import FormSubmit from '../forms/FormSubmit.svelte';
|
||||
import JSONTree from '../jsontree/JSONTree.svelte';
|
||||
import AceEditor from '../query/AceEditor.svelte';
|
||||
import newQuery from '../query/newQuery';
|
||||
|
||||
import ModalBase from './ModalBase.svelte';
|
||||
import { closeCurrentModal } from './modalTools';
|
||||
@@ -29,6 +30,17 @@
|
||||
}}
|
||||
/>
|
||||
<FormStyledButton type="button" value="Close" on:click={closeCurrentModal} />
|
||||
<FormStyledButton
|
||||
type="button"
|
||||
value="Open script"
|
||||
on:click={() => {
|
||||
newQuery({
|
||||
initialData: script,
|
||||
});
|
||||
|
||||
closeCurrentModal();
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</ModalBase>
|
||||
</FormProvider>
|
||||
|
||||
Reference in New Issue
Block a user