修改模版内容
This commit is contained in:
14
README.md
14
README.md
@@ -275,24 +275,24 @@ BigDataTool采用模块化分层架构设计:
|
|||||||
### Cassandra配置
|
### Cassandra配置
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"cluster_name": "生产集群",
|
"cluster_name": "示例集群",
|
||||||
"hosts": ["192.168.1.100", "192.168.1.101"],
|
"hosts": ["127.0.0.1", "127.0.0.2"],
|
||||||
"port": 9042,
|
"port": 9042,
|
||||||
"datacenter": "dc1",
|
"datacenter": "dc1",
|
||||||
"username": "cassandra",
|
"username": "cassandra",
|
||||||
"password": "password",
|
"password": "password",
|
||||||
"keyspace": "my_keyspace",
|
"keyspace": "example_keyspace",
|
||||||
"table": "my_table"
|
"table": "example_table"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Redis配置
|
### Redis配置
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"name": "生产Redis",
|
"name": "示例Redis",
|
||||||
"nodes": [
|
"nodes": [
|
||||||
{"host": "192.168.1.200", "port": 7000},
|
{"host": "127.0.0.1", "port": 6379},
|
||||||
{"host": "192.168.1.201", "port": 7001}
|
{"host": "127.0.0.2", "port": 6379}
|
||||||
],
|
],
|
||||||
"password": "redis_password",
|
"password": "redis_password",
|
||||||
"socket_timeout": 3,
|
"socket_timeout": 3,
|
||||||
|
@@ -83,16 +83,16 @@ def create_connection(config):
|
|||||||
|
|
||||||
使用示例:
|
使用示例:
|
||||||
config = {
|
config = {
|
||||||
'hosts': ['192.168.1.100', '192.168.1.101'],
|
'hosts': ['127.0.0.1'],
|
||||||
'port': 9042,
|
'port': 9042,
|
||||||
'username': 'cassandra',
|
'username': 'cassandra',
|
||||||
'password': 'password',
|
'password': 'password',
|
||||||
'keyspace': 'my_keyspace',
|
'keyspace': 'example_keyspace',
|
||||||
'datacenter': 'dc1'
|
'datacenter': 'dc1'
|
||||||
}
|
}
|
||||||
cluster, session = create_connection(config)
|
cluster, session = create_connection(config)
|
||||||
if session:
|
if session:
|
||||||
result = session.execute("SELECT * FROM my_table LIMIT 10")
|
result = session.execute("SELECT * FROM example_table LIMIT 10")
|
||||||
cluster.shutdown()
|
cluster.shutdown()
|
||||||
"""
|
"""
|
||||||
start_time = time.time()
|
start_time = time.time()
|
||||||
|
@@ -65,7 +65,7 @@ def get_redis_value_with_type(redis_client, key):
|
|||||||
- 数据异常:记录警告并提供基本信息
|
- 数据异常:记录警告并提供基本信息
|
||||||
|
|
||||||
示例:
|
示例:
|
||||||
>>> result = get_redis_value_with_type(client, "user:1001")
|
>>> result = get_redis_value_with_type(client, "user:example")
|
||||||
>>> print(result['type']) # 'string'
|
>>> print(result['type']) # 'string'
|
||||||
>>> print(result['value']) # 'John Doe'
|
>>> print(result['value']) # 'John Doe'
|
||||||
>>> print(result['exists']) # True
|
>>> print(result['exists']) # True
|
||||||
|
@@ -3356,14 +3356,14 @@ function showImportDialog(env) {
|
|||||||
<p class="text-muted mb-3">请粘贴配置数据,支持以下格式:</p>
|
<p class="text-muted mb-3">请粘贴配置数据,支持以下格式:</p>
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<small class="text-muted">示例格式:</small>
|
<small class="text-muted">示例格式:</small>
|
||||||
<pre class="bg-light p-2 rounded small">clusterName: "Hot Cluster"
|
<pre class="bg-light p-2 rounded small">clusterName: "Example Cluster"
|
||||||
clusterNodes: "10.20.2.22,10.20.2.23"
|
clusterNodes: "127.0.0.1,127.0.0.2"
|
||||||
port: 9042
|
port: 9042
|
||||||
datacenter: "cs01"
|
datacenter: "dc1"
|
||||||
username: "cbase"
|
username: "cassandra"
|
||||||
password: "antducbaseadmin@2022"
|
password: "example_password"
|
||||||
keyspace: "yuqing_skinny"
|
keyspace: "example_keyspace"
|
||||||
table: "status_test"</pre>
|
table: "example_table"</pre>
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label class="form-label">配置数据:</label>
|
<label class="form-label">配置数据:</label>
|
||||||
|
@@ -1665,30 +1665,30 @@ function updateConfigTemplate() {
|
|||||||
if (format === 'yaml') {
|
if (format === 'yaml') {
|
||||||
templateElement.textContent = `# Redis集群配置示例 (YAML格式)
|
templateElement.textContent = `# Redis集群配置示例 (YAML格式)
|
||||||
cluster1:
|
cluster1:
|
||||||
clusterName: "redis-production"
|
clusterName: "redis-example1"
|
||||||
clusterAddress: "10.20.2.109:6470"
|
clusterAddress: "127.0.0.1:6379"
|
||||||
clusterPassword: ""
|
clusterPassword: ""
|
||||||
cachePrefix: "message.status.Reader."
|
cachePrefix: "message.status.Reader."
|
||||||
cacheTtl: 2000
|
cacheTtl: 2000
|
||||||
async: true
|
async: true
|
||||||
nodes:
|
nodes:
|
||||||
- host: "10.20.2.109"
|
- host: "127.0.0.1"
|
||||||
port: 6470
|
port: 6379
|
||||||
- host: "10.20.2.110"
|
- host: "127.0.0.2"
|
||||||
port: 6470
|
port: 6379
|
||||||
|
|
||||||
cluster2:
|
cluster2:
|
||||||
clusterName: "redis-test"
|
clusterName: "redis-example2"
|
||||||
clusterAddress: "10.20.2.109:6471"
|
clusterAddress: "127.0.0.1:6380"
|
||||||
clusterPassword: ""
|
clusterPassword: ""
|
||||||
cachePrefix: "message.status.Reader."
|
cachePrefix: "message.status.Reader."
|
||||||
cacheTtl: 2000
|
cacheTtl: 2000
|
||||||
async: true
|
async: true
|
||||||
nodes:
|
nodes:
|
||||||
- host: "10.20.2.109"
|
- host: "127.0.0.1"
|
||||||
port: 6471
|
port: 6380
|
||||||
- host: "10.20.2.110"
|
- host: "127.0.0.2"
|
||||||
port: 6471
|
port: 6380
|
||||||
|
|
||||||
queryOptions:
|
queryOptions:
|
||||||
mode: "random" # random 或 specified
|
mode: "random" # random 或 specified
|
||||||
@@ -1697,32 +1697,32 @@ queryOptions:
|
|||||||
sourceCluster: "cluster2"
|
sourceCluster: "cluster2"
|
||||||
# 指定Key模式下的键值列表
|
# 指定Key模式下的键值列表
|
||||||
keys:
|
keys:
|
||||||
- "user:1001"
|
- "user:example1"
|
||||||
- "user:1002"`;
|
- "user:example2"`;
|
||||||
} else {
|
} else {
|
||||||
templateElement.textContent = `{
|
templateElement.textContent = `{
|
||||||
"cluster1": {
|
"cluster1": {
|
||||||
"clusterName": "redis-production",
|
"clusterName": "redis-example1",
|
||||||
"clusterAddress": "10.20.2.109:6470",
|
"clusterAddress": "127.0.0.1:6379",
|
||||||
"clusterPassword": "",
|
"clusterPassword": "",
|
||||||
"cachePrefix": "message.status.Reader.",
|
"cachePrefix": "message.status.Reader.",
|
||||||
"cacheTtl": 2000,
|
"cacheTtl": 2000,
|
||||||
"async": true,
|
"async": true,
|
||||||
"nodes": [
|
"nodes": [
|
||||||
{"host": "10.20.2.109", "port": 6470},
|
{"host": "127.0.0.1", "port": 6379},
|
||||||
{"host": "10.20.2.110", "port": 6470}
|
{"host": "127.0.0.2", "port": 6379}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"cluster2": {
|
"cluster2": {
|
||||||
"clusterName": "redis-test",
|
"clusterName": "redis-example2",
|
||||||
"clusterAddress": "10.20.2.109:6471",
|
"clusterAddress": "127.0.0.1:6380",
|
||||||
"clusterPassword": "",
|
"clusterPassword": "",
|
||||||
"cachePrefix": "message.status.Reader.",
|
"cachePrefix": "message.status.Reader.",
|
||||||
"cacheTtl": 2000,
|
"cacheTtl": 2000,
|
||||||
"async": true,
|
"async": true,
|
||||||
"nodes": [
|
"nodes": [
|
||||||
{"host": "10.20.2.109", "port": 6471},
|
{"host": "127.0.0.1", "port": 6380},
|
||||||
{"host": "10.20.2.110", "port": 6471}
|
{"host": "127.0.0.2", "port": 6380}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"queryOptions": {
|
"queryOptions": {
|
||||||
@@ -1730,7 +1730,7 @@ queryOptions:
|
|||||||
"count": 100,
|
"count": 100,
|
||||||
"pattern": "*",
|
"pattern": "*",
|
||||||
"sourceCluster": "cluster2",
|
"sourceCluster": "cluster2",
|
||||||
"keys": ["user:1001", "user:1002"]
|
"keys": ["user:example1", "user:example2"]
|
||||||
}
|
}
|
||||||
}`;
|
}`;
|
||||||
}
|
}
|
||||||
|
@@ -475,7 +475,7 @@
|
|||||||
<div class="row mt-2">
|
<div class="row mt-2">
|
||||||
<div class="col-8">
|
<div class="col-8">
|
||||||
<label class="form-label">集群节点 (逗号分隔)</label>
|
<label class="form-label">集群节点 (逗号分隔)</label>
|
||||||
<input type="text" class="form-control form-control-sm" id="pro_hosts" placeholder="10.20.2.22,10.20.2.23">
|
<input type="text" class="form-control form-control-sm" id="pro_hosts" placeholder="127.0.0.1,127.0.0.2">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-4">
|
<div class="col-4">
|
||||||
<label class="form-label">端口</label>
|
<label class="form-label">端口</label>
|
||||||
@@ -485,7 +485,7 @@
|
|||||||
<div class="row mt-2">
|
<div class="row mt-2">
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
<label class="form-label">用户名</label>
|
<label class="form-label">用户名</label>
|
||||||
<input type="text" class="form-control form-control-sm" id="pro_username" placeholder="cbase">
|
<input type="text" class="form-control form-control-sm" id="pro_username" placeholder="username">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
<label class="form-label">密码</label>
|
<label class="form-label">密码</label>
|
||||||
@@ -495,11 +495,11 @@
|
|||||||
<div class="row mt-2">
|
<div class="row mt-2">
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
<label class="form-label">Keyspace</label>
|
<label class="form-label">Keyspace</label>
|
||||||
<input type="text" class="form-control form-control-sm" id="pro_keyspace" placeholder="yuqing_skinny">
|
<input type="text" class="form-control form-control-sm" id="pro_keyspace" placeholder="keyspace">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
<label class="form-label">表名</label>
|
<label class="form-label">表名</label>
|
||||||
<input type="text" class="form-control form-control-sm" id="pro_table" placeholder="document">
|
<input type="text" class="form-control form-control-sm" id="pro_table" placeholder="tablename">
|
||||||
<small class="form-text text-muted" id="pro_table_hint">完整表名或基础表名(分表时)</small>
|
<small class="form-text text-muted" id="pro_table_hint">完整表名或基础表名(分表时)</small>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -528,7 +528,7 @@
|
|||||||
<div class="row mt-2">
|
<div class="row mt-2">
|
||||||
<div class="col-8">
|
<div class="col-8">
|
||||||
<label class="form-label">集群节点 (逗号分隔)</label>
|
<label class="form-label">集群节点 (逗号分隔)</label>
|
||||||
<input type="text" class="form-control form-control-sm" id="test_hosts" placeholder="10.20.2.22,10.20.2.23">
|
<input type="text" class="form-control form-control-sm" id="test_hosts" placeholder="127.0.0.1,127.0.0.2">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-4">
|
<div class="col-4">
|
||||||
<label class="form-label">端口</label>
|
<label class="form-label">端口</label>
|
||||||
@@ -538,7 +538,7 @@
|
|||||||
<div class="row mt-2">
|
<div class="row mt-2">
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
<label class="form-label">用户名</label>
|
<label class="form-label">用户名</label>
|
||||||
<input type="text" class="form-control form-control-sm" id="test_username" placeholder="cbase">
|
<input type="text" class="form-control form-control-sm" id="test_username" placeholder="username">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
<label class="form-label">密码</label>
|
<label class="form-label">密码</label>
|
||||||
@@ -548,11 +548,11 @@
|
|||||||
<div class="row mt-2">
|
<div class="row mt-2">
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
<label class="form-label">Keyspace</label>
|
<label class="form-label">Keyspace</label>
|
||||||
<input type="text" class="form-control form-control-sm" id="test_keyspace" placeholder="yuqing_skinny">
|
<input type="text" class="form-control form-control-sm" id="test_keyspace" placeholder="keyspace">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
<label class="form-label">表名</label>
|
<label class="form-label">表名</label>
|
||||||
<input type="text" class="form-control form-control-sm" id="test_table" placeholder="document_test">
|
<input type="text" class="form-control form-control-sm" id="test_table" placeholder="tablename">
|
||||||
<small class="form-text text-muted" id="test_table_hint">完整表名或基础表名(分表时)</small>
|
<small class="form-text text-muted" id="test_table_hint">完整表名或基础表名(分表时)</small>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -495,7 +495,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div id="specifiedOptions" class="mt-2" style="display: none;">
|
<div id="specifiedOptions" class="mt-2" style="display: none;">
|
||||||
<label class="form-label">Key列表 (每行一个)</label>
|
<label class="form-label">Key列表 (每行一个)</label>
|
||||||
<textarea class="form-control query-keys" id="specifiedKeys" rows="6" placeholder="输入要查询的Key,每行一个 例如: user:1001 user:1002 session:abc123"></textarea>
|
<textarea class="form-control query-keys" id="specifiedKeys" rows="6" placeholder="输入要查询的Key,每行一个 例如: user:example1 user:example2 session:abc123"></textarea>
|
||||||
<small class="form-text text-muted">支持大批量Key查询,建议单次不超过1000个</small>
|
<small class="form-text text-muted">支持大批量Key查询,建议单次不超过1000个</small>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -720,7 +720,7 @@
|
|||||||
<div id="textImportSection">
|
<div id="textImportSection">
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label for="configYamlText" class="form-label">YAML配置内容</label>
|
<label for="configYamlText" class="form-label">YAML配置内容</label>
|
||||||
<textarea class="form-control" id="configYamlText" rows="8" placeholder="请粘贴YAML格式的配置内容,例如: clusterName: "redis-test" clusterAddress: "10.20.2.109:6470,10.20.2.109:6570" clusterPassword: """></textarea>
|
<textarea class="form-control" id="configYamlText" rows="8" placeholder="请粘贴YAML格式的配置内容,例如: clusterName: "redis-example" clusterAddress: "127.0.0.1:6379" clusterPassword: """></textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user