Skip to content

Commit 88b6b0e

Browse files
author
zhoudian
committed
dbtabs 为空 则默认16个库
1 parent 1bb54e0 commit 88b6b0e

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/pages/HostContent/index.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ class HostContent extends Component {
102102
});
103103
});
104104
} catch (error) {
105+
Log.error("[cmd=info] Keyspace split error", error);
106+
}
107+
if (dbTabs.length === 0) {
105108
for (let i = 0; i < 16; i++) {
106109
dbTabs.push({
107110
key: "" + i,
@@ -110,7 +113,6 @@ class HostContent extends Component {
110113
total: i,
111114
});
112115
}
113-
Log.error("[cmd=info] Keyspace split error", error);
114116
}
115117
this.setState({ dbTabs: dbTabs });
116118
});
@@ -193,7 +195,7 @@ class HostContent extends Component {
193195
}}
194196
>
195197
{this.hostKeyShowType ===
196-
HOST_KEY_SHOW_TYPE.TREE ? (
198+
HOST_KEY_SHOW_TYPE.TREE ? (
197199
<HostKeyTree
198200
node={this.props.node}
199201
db={tab.dbIndex}
@@ -209,7 +211,7 @@ class HostContent extends Component {
209211
""
210212
)}
211213
{this.hostKeyShowType ===
212-
HOST_KEY_SHOW_TYPE.TABLE ? (
214+
HOST_KEY_SHOW_TYPE.TABLE ? (
213215
<HostKey
214216
node={this.props.node}
215217
db={tab.dbIndex}
@@ -227,7 +229,7 @@ class HostContent extends Component {
227229
</div>
228230
<div style={{ paddingLeft: "20px" }}>
229231
{redisKeyType ===
230-
REDIS_DATA_TYPE.STRING ? (
232+
REDIS_DATA_TYPE.STRING ? (
231233
<HostKeyString
232234
redisKey={redisKey}
233235
redisKeyType={redisKeyType}
@@ -240,7 +242,7 @@ class HostContent extends Component {
240242
""
241243
)}
242244
{redisKeyType ===
243-
REDIS_DATA_TYPE.ZSET ? (
245+
REDIS_DATA_TYPE.ZSET ? (
244246
<HostKeySortSet
245247
redisKey={redisKey}
246248
redisKeyType={redisKeyType}
@@ -253,7 +255,7 @@ class HostContent extends Component {
253255
""
254256
)}
255257
{redisKeyType ===
256-
REDIS_DATA_TYPE.SET ? (
258+
REDIS_DATA_TYPE.SET ? (
257259
<HostKeySet
258260
redisKey={redisKey}
259261
redisKeyType={redisKeyType}
@@ -266,7 +268,7 @@ class HostContent extends Component {
266268
""
267269
)}
268270
{redisKeyType ===
269-
REDIS_DATA_TYPE.HASH ? (
271+
REDIS_DATA_TYPE.HASH ? (
270272
<HostKeyHash
271273
redisKey={redisKey}
272274
redisKeyType={redisKeyType}
@@ -279,7 +281,7 @@ class HostContent extends Component {
279281
""
280282
)}
281283
{redisKeyType ===
282-
REDIS_DATA_TYPE.LIST ? (
284+
REDIS_DATA_TYPE.LIST ? (
283285
<HostKeyList
284286
redisKey={redisKey}
285287
redisKeyType={redisKeyType}

0 commit comments

Comments
 (0)