mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-05-01 05:03:57 +00:00
fix sorting
This commit is contained in:
@@ -5,6 +5,7 @@ export const DB_KEYS_SHOW_INCREMENT = 100;
|
|||||||
|
|
||||||
export interface DbKeysNodeModelBase {
|
export interface DbKeysNodeModelBase {
|
||||||
text?: string;
|
text?: string;
|
||||||
|
sortKey: string;
|
||||||
key: string;
|
key: string;
|
||||||
count?: number;
|
count?: number;
|
||||||
level: number;
|
level: number;
|
||||||
@@ -163,6 +164,7 @@ export function dbKeys_mergeNextPage(tree: DbKeysTreeModel, nextPage: DbKeysLoad
|
|||||||
...keyObj,
|
...keyObj,
|
||||||
level: keyPath.length,
|
level: keyPath.length,
|
||||||
text: keyPath[keyPath.length - 1],
|
text: keyPath[keyPath.length - 1],
|
||||||
|
sortKey: keyPath[keyPath.length - 1],
|
||||||
keyPath,
|
keyPath,
|
||||||
parentKey: keyPath.slice(0, -1).join(tree.treeKeySeparator),
|
parentKey: keyPath.slice(0, -1).join(tree.treeKeySeparator),
|
||||||
};
|
};
|
||||||
@@ -190,6 +192,7 @@ export function dbKeys_mergeNextPage(tree: DbKeysTreeModel, nextPage: DbKeysLoad
|
|||||||
type: 'dir',
|
type: 'dir',
|
||||||
key: newDirKey,
|
key: newDirKey,
|
||||||
text: `${newDirPath[newDirPath.length - 1]}${tree.treeKeySeparator}*`,
|
text: `${newDirPath[newDirPath.length - 1]}${tree.treeKeySeparator}*`,
|
||||||
|
sortKey: newDirPath[newDirPath.length - 1],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -218,7 +221,7 @@ export function dbKeys_mergeNextPage(tree: DbKeysTreeModel, nextPage: DbKeysLoad
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (const key in childrenByKey) {
|
for (const key in childrenByKey) {
|
||||||
childrenByKey[key] = _sortBy(childrenByKey[key], 'text');
|
childrenByKey[key] = _sortBy(childrenByKey[key], 'sortKey');
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user