mirror of
https://github.com/qishibo/AnotherRedisDesktopManager.git
synced 2026-01-25 16:46:32 +00:00
fix db select when config command is renamed, fix #24
This commit is contained in:
parent
7545029ae8
commit
2a8fc21607
@ -92,31 +92,41 @@ export default {
|
||||
this.$nextTick(() => {
|
||||
this.scrollToBottom();
|
||||
});
|
||||
} else {
|
||||
promise.then((reply) => {
|
||||
let append = '';
|
||||
|
||||
if (reply === null) {
|
||||
append = `${null}\n`;
|
||||
} else if (typeof reply === 'object') {
|
||||
const isArray = !isNaN(reply.length);
|
||||
|
||||
for (const i in reply) {
|
||||
append += `${(isArray ? '' : (`${i}\n`)) + reply[i]}\n`;
|
||||
}
|
||||
} else {
|
||||
append = `${reply}\n`;
|
||||
}
|
||||
|
||||
this.cliContent.content += append;
|
||||
this.inputSuggestionItems.delete(params);
|
||||
this.inputSuggestionItems.add(params);
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.scrollToBottom();
|
||||
});
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
promise.then((reply) => {
|
||||
let append = '';
|
||||
|
||||
if (reply === null) {
|
||||
append = `${null}\n`;
|
||||
}
|
||||
else if (typeof reply === 'object') {
|
||||
const isArray = !isNaN(reply.length);
|
||||
|
||||
for (const i in reply) {
|
||||
append += `${(isArray ? '' : (`${i}\n`)) + reply[i]}\n`;
|
||||
}
|
||||
}
|
||||
else {
|
||||
append = `${reply}\n`;
|
||||
}
|
||||
|
||||
this.cliContent.content += append;
|
||||
this.inputSuggestionItems.delete(params);
|
||||
this.inputSuggestionItems.add(params);
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.scrollToBottom();
|
||||
});
|
||||
}).catch((err) => {
|
||||
this.cliContent.content += `${err.message}\n`;
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.scrollToBottom();
|
||||
});
|
||||
});
|
||||
},
|
||||
searchUp() {
|
||||
if (--this.historyIndex < (-this.inputSuggestionItems.size - 1)) {
|
||||
|
||||
@ -286,6 +286,10 @@ export default {
|
||||
else {
|
||||
this.$set(this.dbs, menuIndex, [...Array(16).keys()]);
|
||||
}
|
||||
}).catch((err) => {
|
||||
// config command may be renamed
|
||||
console.log(`get config databases failed, ${err.message}`);
|
||||
this.$set(this.dbs, menuIndex, [...Array(16).keys()]);
|
||||
});
|
||||
},
|
||||
setGlobalConnection(menuIndex, connection) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user