Compare commits
2 Commits
ca9f0a08e1
...
b0dfe348bd
Author | SHA1 | Date |
---|---|---|
Lykin | b0dfe348bd | |
Lykin | a3a1a17af3 |
|
@ -386,9 +386,10 @@ const useBrowserStore = defineStore('browser', {
|
||||||
* @param {number} db
|
* @param {number} db
|
||||||
* @param {string|number[]} [key] null or blank indicate that update tab to display normal content (blank content or server status)
|
* @param {string|number[]} [key] null or blank indicate that update tab to display normal content (blank content or server status)
|
||||||
* @param {boolean} [clearValue]
|
* @param {boolean} [clearValue]
|
||||||
|
* @param {boolean} [redirect] redirect to key detail tab
|
||||||
* @return {Promise<void>}
|
* @return {Promise<void>}
|
||||||
*/
|
*/
|
||||||
async loadKeySummary({ server, db, key, clearValue }) {
|
async loadKeySummary({ server, db, key, clearValue, redirect = true }) {
|
||||||
try {
|
try {
|
||||||
const tab = useTabStore()
|
const tab = useTabStore()
|
||||||
if (!isEmpty(key)) {
|
if (!isEmpty(key)) {
|
||||||
|
@ -402,7 +403,7 @@ const useBrowserStore = defineStore('browser', {
|
||||||
const k = nativeRedisKey(key)
|
const k = nativeRedisKey(key)
|
||||||
const binaryKey = k !== key
|
const binaryKey = k !== key
|
||||||
tab.upsertTab({
|
tab.upsertTab({
|
||||||
subTab: BrowserTabType.KeyDetail,
|
subTab: redirect === false ? null : BrowserTabType.KeyDetail,
|
||||||
server,
|
server,
|
||||||
db,
|
db,
|
||||||
type,
|
type,
|
||||||
|
@ -492,7 +493,7 @@ const useBrowserStore = defineStore('browser', {
|
||||||
if (showLoading) {
|
if (showLoading) {
|
||||||
tab.updateLoading({ server, db, loading: true })
|
tab.updateLoading({ server, db, loading: true })
|
||||||
}
|
}
|
||||||
await this.loadKeySummary({ server, db, key, clearValue: true })
|
await this.loadKeySummary({ server, db, key, clearValue: true, redirect: false })
|
||||||
await this.loadKeyDetail({
|
await this.loadKeyDetail({
|
||||||
server,
|
server,
|
||||||
db,
|
db,
|
||||||
|
|
|
@ -3,6 +3,7 @@ import { defineStore } from 'pinia'
|
||||||
import { TabItem } from '@/objects/tabItem.js'
|
import { TabItem } from '@/objects/tabItem.js'
|
||||||
import useBrowserStore from 'stores/browser.js'
|
import useBrowserStore from 'stores/browser.js'
|
||||||
import { i18nGlobal } from '@/utils/i18n.js'
|
import { i18nGlobal } from '@/utils/i18n.js'
|
||||||
|
import { BrowserTabType } from '@/consts/browser_tab_type.js'
|
||||||
|
|
||||||
const useTabStore = defineStore('tab', {
|
const useTabStore = defineStore('tab', {
|
||||||
/**
|
/**
|
||||||
|
@ -179,6 +180,7 @@ const useTabStore = defineStore('tab', {
|
||||||
}) {
|
}) {
|
||||||
let tabIndex = findIndex(this.tabList, { name: server })
|
let tabIndex = findIndex(this.tabList, { name: server })
|
||||||
if (tabIndex === -1) {
|
if (tabIndex === -1) {
|
||||||
|
subTab = subTab || BrowserTabType.KeyDetail
|
||||||
const tabItem = new TabItem({
|
const tabItem = new TabItem({
|
||||||
name: server,
|
name: server,
|
||||||
title: server,
|
title: server,
|
||||||
|
@ -202,7 +204,7 @@ const useTabStore = defineStore('tab', {
|
||||||
} else {
|
} else {
|
||||||
const tab = this.tabList[tabIndex]
|
const tab = this.tabList[tabIndex]
|
||||||
tab.blank = false
|
tab.blank = false
|
||||||
tab.subTab = subTab
|
tab.subTab = subTab || tab.subTab
|
||||||
// tab.title = db !== undefined ? `${server}/db${db}` : `${server}`
|
// tab.title = db !== undefined ? `${server}/db${db}` : `${server}`
|
||||||
tab.title = server
|
tab.title = server
|
||||||
tab.server = server
|
tab.server = server
|
||||||
|
|
Loading…
Reference in New Issue