删除以前版本文件
This commit is contained in:
@@ -53,8 +53,8 @@ function toggleShardingMode() {
|
||||
shardingConfig.style.display = 'block';
|
||||
executeButton.textContent = '执行分表查询比对';
|
||||
keyInputHint.textContent = '分表模式:Key值应包含时间戳用于计算分表索引';
|
||||
keysField.placeholder = 'wmid (推荐使用包含时间戳的字段)';
|
||||
keysField.value = 'wmid';
|
||||
keysField.placeholder = ' (推荐使用包含时间戳的字段)';
|
||||
keysField.value = '';
|
||||
|
||||
// 更新查询Key输入框的占位符
|
||||
const queryValues = document.getElementById('query_values');
|
||||
@@ -64,8 +64,8 @@ function toggleShardingMode() {
|
||||
shardingConfig.style.display = 'none';
|
||||
executeButton.textContent = '执行查询比对';
|
||||
keyInputHint.textContent = '单表模式:输入普通Key值';
|
||||
keysField.placeholder = 'docid';
|
||||
keysField.value = 'docid';
|
||||
keysField.placeholder = '';
|
||||
keysField.value = '';
|
||||
|
||||
// 更新查询Key输入框的占位符
|
||||
const queryValues = document.getElementById('query_values');
|
||||
@@ -163,9 +163,33 @@ async function loadSelectedConfigGroup() {
|
||||
document.getElementById('test_table').value = config.test_config.table || '';
|
||||
|
||||
// 填充查询配置
|
||||
console.log('配置组查询配置:', config.query_config);
|
||||
document.getElementById('keys').value = (config.query_config.keys || []).join(',');
|
||||
document.getElementById('fields_to_compare').value = (config.query_config.fields_to_compare || []).join(',');
|
||||
document.getElementById('exclude_fields').value = (config.query_config.exclude_fields || []).join(',');
|
||||
console.log('填充后的字段值:');
|
||||
console.log('keys:', document.getElementById('keys').value);
|
||||
console.log('fields_to_compare:', document.getElementById('fields_to_compare').value);
|
||||
console.log('exclude_fields:', document.getElementById('exclude_fields').value);
|
||||
|
||||
// 加载分表配置
|
||||
if (config.sharding_config) {
|
||||
// 设置分表启用状态
|
||||
document.getElementById('enableSharding').checked = config.sharding_config.enabled || false;
|
||||
toggleShardingMode();
|
||||
|
||||
// 填充分表配置
|
||||
document.getElementById('use_sharding_for_pro').checked = config.sharding_config.use_sharding_for_pro || false;
|
||||
document.getElementById('use_sharding_for_test').checked = config.sharding_config.use_sharding_for_test || false;
|
||||
document.getElementById('pro_interval_seconds').value = config.sharding_config.interval_seconds || 604800;
|
||||
document.getElementById('pro_table_count').value = config.sharding_config.table_count || 14;
|
||||
document.getElementById('test_interval_seconds').value = config.sharding_config.interval_seconds || 604800;
|
||||
document.getElementById('test_table_count').value = config.sharding_config.table_count || 14;
|
||||
} else {
|
||||
// 禁用分表模式
|
||||
document.getElementById('enableSharding').checked = false;
|
||||
toggleShardingMode();
|
||||
}
|
||||
|
||||
showAlert('success', `配置组 "${config.name}" 加载成功`);
|
||||
} else {
|
||||
@@ -247,7 +271,9 @@ async function saveConfigGroup() {
|
||||
body: JSON.stringify({
|
||||
name: name,
|
||||
description: description,
|
||||
...config,
|
||||
pro_config: config.pro_config,
|
||||
test_config: config.test_config,
|
||||
query_config: config.query_config,
|
||||
sharding_config: shardingConfig
|
||||
})
|
||||
});
|
||||
@@ -492,11 +518,13 @@ function getCurrentConfig() {
|
||||
keyspace: document.getElementById('test_keyspace').value,
|
||||
table: document.getElementById('test_table').value
|
||||
},
|
||||
keys: document.getElementById('keys').value.split(',').map(k => k.trim()).filter(k => k),
|
||||
fields_to_compare: document.getElementById('fields_to_compare').value
|
||||
.split(',').map(f => f.trim()).filter(f => f),
|
||||
exclude_fields: document.getElementById('exclude_fields').value
|
||||
.split(',').map(f => f.trim()).filter(f => f),
|
||||
query_config: {
|
||||
keys: document.getElementById('keys').value.split(',').map(k => k.trim()).filter(k => k),
|
||||
fields_to_compare: document.getElementById('fields_to_compare').value
|
||||
.split(',').map(f => f.trim()).filter(f => f),
|
||||
exclude_fields: document.getElementById('exclude_fields').value
|
||||
.split(',').map(f => f.trim()).filter(f => f)
|
||||
},
|
||||
values: document.getElementById('query_values').value
|
||||
.split('\n').map(v => v.trim()).filter(v => v)
|
||||
};
|
||||
@@ -512,7 +540,7 @@ async function executeQuery() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!config.keys.length) {
|
||||
if (!config.query_config.keys.length) {
|
||||
showAlert('warning', '请输入主键字段');
|
||||
return;
|
||||
}
|
||||
@@ -573,12 +601,11 @@ function getShardingConfig() {
|
||||
return {
|
||||
...baseConfig,
|
||||
sharding_config: {
|
||||
enabled: document.getElementById('enableSharding').checked,
|
||||
use_sharding_for_pro: document.getElementById('use_sharding_for_pro').checked,
|
||||
use_sharding_for_test: document.getElementById('use_sharding_for_test').checked,
|
||||
pro_interval_seconds: parseInt(document.getElementById('pro_interval_seconds').value) || 604800,
|
||||
pro_table_count: parseInt(document.getElementById('pro_table_count').value) || 14,
|
||||
test_interval_seconds: parseInt(document.getElementById('test_interval_seconds').value) || 604800,
|
||||
test_table_count: parseInt(document.getElementById('test_table_count').value) || 14
|
||||
interval_seconds: parseInt(document.getElementById('pro_interval_seconds').value) || 604800,
|
||||
table_count: parseInt(document.getElementById('pro_table_count').value) || 14
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -2660,11 +2687,7 @@ async function saveHistoryRecord() {
|
||||
description: description,
|
||||
pro_config: config.pro_config,
|
||||
test_config: config.test_config,
|
||||
query_config: {
|
||||
keys: config.keys,
|
||||
fields_to_compare: config.fields_to_compare,
|
||||
exclude_fields: config.exclude_fields
|
||||
},
|
||||
query_config: config.query_config,
|
||||
query_keys: config.values,
|
||||
results_summary: currentResults.summary || {},
|
||||
execution_time: 0.0,
|
||||
|
Reference in New Issue
Block a user