diff --git a/src/RedisView/AppView/CheckCodeDialog.cpp b/src/RedisView/AppView/CheckCodeDialog.cpp
index ba1dbec..ba7546f 100644
--- a/src/RedisView/AppView/CheckCodeDialog.cpp
+++ b/src/RedisView/AppView/CheckCodeDialog.cpp
@@ -1,11 +1,3 @@
-/**
-* @file CheckCodeDialog.cpp
-* @brief 模拟注册功能
-* @author 王长春
-* @date 2019-6-23
-* @version 001
-* @copyright Copyright (c) 2018
-*/
#include "CheckCodeDialog.h"
#include "ui_checkcodedialog.h"
diff --git a/src/RedisView/AppView/CheckCodeDialog.h b/src/RedisView/AppView/CheckCodeDialog.h
index 5e79238..9ba1a97 100644
--- a/src/RedisView/AppView/CheckCodeDialog.h
+++ b/src/RedisView/AppView/CheckCodeDialog.h
@@ -1,11 +1,3 @@
-/**
-* @file CheckCodeDialog.h
-* @brief 模拟注册功能
-* @author 王长春
-* @date 2019-6-23
-* @version 001
-* @copyright Copyright (c) 2018
-*/
#ifndef CHECKCODEDIALOG_H
#define CHECKCODEDIALOG_H
diff --git a/src/RedisView/AppView/ContributorDialog.cpp b/src/RedisView/AppView/ContributorDialog.cpp
index 08437fa..6ff3c6e 100644
--- a/src/RedisView/AppView/ContributorDialog.cpp
+++ b/src/RedisView/AppView/ContributorDialog.cpp
@@ -16,12 +16,13 @@ ContributorDialog::ContributorDialog(QWidget *parent) :
ui->setupUi(this);
setWindowTitle(tr("鸣谢"));
setFixedSize(this->size());
- ui->label->setText("
Developer:
"
- " cc20110101
"
- "
"
- "
Sponsor:
"
- " *才
"
- );
+ ui->_textBrowser->setEnabled(false);
+ ui->_textBrowser->setText("
Sponsor:
"
+ " *才"
+ " *帅"
+ " *惜"
+ " 列"
+ );
}
ContributorDialog::~ContributorDialog()
@@ -29,7 +30,7 @@ ContributorDialog::~ContributorDialog()
delete ui;
}
-void ContributorDialog::on_pushButton_clicked()
+void ContributorDialog::on__pushButton_clicked()
{
accept();
}
diff --git a/src/RedisView/AppView/ContributorDialog.h b/src/RedisView/AppView/ContributorDialog.h
index 8ab8f55..3245422 100644
--- a/src/RedisView/AppView/ContributorDialog.h
+++ b/src/RedisView/AppView/ContributorDialog.h
@@ -24,7 +24,7 @@ class ContributorDialog : public QDialog
~ContributorDialog();
private slots:
- void on_pushButton_clicked();
+ void on__pushButton_clicked();
private:
Ui::ContributorDialog *ui;
diff --git a/src/RedisView/AppView/DataView.cpp b/src/RedisView/AppView/DataView.cpp
index abcdd0a..e010f0c 100644
--- a/src/RedisView/AppView/DataView.cpp
+++ b/src/RedisView/AppView/DataView.cpp
@@ -102,14 +102,16 @@ DataView::DataView(QWidget *parent) :
_time = 0;
_key.clear();
- _type.clear();
+ _type = KEY_NONE;
_vCmdMsg.clear();
_recvEnd = false;
_inputDialog = new InputDialog(this);
+ _valueDialog = new ValueDialog(this);
_countAc = new QAction(QIcon(ICON_COUNT), tr("统计条数"));
_resetAc = new QAction(QIcon(ICON_FLUSH), tr("刷新重置"));
_addAc = new QAction(QIcon(ICON_ADD), tr("插入数据"));
_delAc = new QAction(QIcon(ICON_DEL), tr("删除数据"));
+ _seeAc = new QAction(QIcon(ICON_DETAILS), tr("查看数据"));
_commitAc = new QAction(QIcon(ICON_COMMIT), tr("提交操作"));
_inheadAc = new QAction(QIcon(ICON_IHEAD), tr("链头插入"));
_intailAc = new QAction(QIcon(ICON_ITAIL), tr("链尾插入"));
@@ -119,6 +121,7 @@ DataView::DataView(QWidget *parent) :
_intailAc->setVisible(false);
_delheadAc->setVisible(false);
_deltailAc->setVisible(false);
+ _tableView->addAction(_seeAc);
_tableView->addAction(_resetAc);
_tableView->addAction(_countAc);
_tableView->addAction(_inheadAc);
@@ -133,6 +136,7 @@ DataView::DataView(QWidget *parent) :
connect(_resetAc, SIGNAL(triggered()), this, SLOT(flush()));
connect(_addAc, SIGNAL(triggered()), this, SLOT(add()));
connect(_delAc, SIGNAL(triggered()), this, SLOT(del()));
+ connect(_seeAc, SIGNAL(triggered()), this, SLOT(see()));
connect(_commitAc, SIGNAL(triggered()), this, SLOT(commit()));
connect(_inheadAc, SIGNAL(triggered()), this, SLOT(addHead()));
connect(_intailAc, SIGNAL(triggered()), this, SLOT(addTail()));
@@ -165,11 +169,11 @@ void DataView::count() {
void DataView::commit() {
- if(_type != "string" &&
- _type != "hash" &&
- _type != "set" &&
- _type != "zset" &&
- _type != "list")
+ if(_type != KEY_LIST &&
+ _type != KEY_STRING &&
+ _type != KEY_HASH &&
+ _type != KEY_SET &&
+ _type != KEY_ZSET)
return;
QString str = _timeLineEdit->text().trimmed();
@@ -209,7 +213,7 @@ void DataView::commit() {
}
void DataView::addHead() {
- if(_type == "list") {
+ if(_type == KEY_LIST) {
_inputDialog->clear();
_inputDialog->setTip("member1 member2 ...");
_inputDialog->setType(_type);
@@ -234,7 +238,7 @@ void DataView::addHead() {
}
void DataView::addTail() {
- if(_type == "list") {
+ if(_type == KEY_LIST) {
_inputDialog->clear();
_inputDialog->setTip("member1 member2 ...");
_inputDialog->setType(_type);
@@ -269,7 +273,7 @@ void DataView::delHead() {
_cmdMsg.init();
_cmdMsg._dbIndex = _dbIndex;
_cmdMsg._clientIndex = _clientIndex;
- if(_type == "list") {
+ if(_type == KEY_LIST) {
_cmdMsg._key = _key;
_cmdMsg._type = _type;
_cmdMsg._valueIndex = -1;
@@ -289,7 +293,7 @@ void DataView::delTail() {
_cmdMsg.init();
_cmdMsg._dbIndex = _dbIndex;
_cmdMsg._clientIndex = _clientIndex;
- if(_type == "list") {
+ if(_type == KEY_LIST) {
_cmdMsg._key = _key;
_cmdMsg._type = _type;
_cmdMsg._valueIndex = 1;
@@ -300,7 +304,7 @@ void DataView::delTail() {
}
void DataView::add() {
- if(_type == "hash") {
+ if(_type == KEY_HASH) {
_inputDialog->clear();
_inputDialog->setTip("filed1 value1 filed2 value2 ...");
_inputDialog->setType(_type);
@@ -328,7 +332,7 @@ void DataView::add() {
}
_vCmdMsg << _cmdMsg;
}
- } else if(_type == "set") {
+ } else if(_type == KEY_SET) {
_inputDialog->clear();
_inputDialog->setTip("member1 member2 ...");
_inputDialog->setType(_type);
@@ -348,7 +352,7 @@ void DataView::add() {
_cmdMsg._operate = OPERATION_ADD;
_vCmdMsg << _cmdMsg;
}
- } else if(_type == "zset") {
+ } else if(_type == KEY_ZSET) {
_inputDialog->clear();
_inputDialog->setTip("member1 score1 member2 score2 ...");
_inputDialog->setType(_type);
@@ -381,11 +385,11 @@ void DataView::add() {
void DataView::del() {
- if(_type != "string" &&
- _type != "hash" &&
- _type != "set" &&
- _type != "zset" &&
- _type != "list")
+ if(_type != KEY_STRING &&
+ _type != KEY_HASH &&
+ _type != KEY_SET &&
+ _type != KEY_ZSET &&
+ _type != KEY_LIST)
return;
if(_itemTableModel->rowCount() <= 0) {
@@ -418,7 +422,7 @@ void DataView::del() {
_cmdMsg.init();
_cmdMsg._dbIndex = _dbIndex;
_cmdMsg._clientIndex = _clientIndex;
- if(_type == "hash") {
+ if(_type == KEY_HASH) {
_cmdMsg._key = _key;
_cmdMsg._type = _type;
_cmdMsg._filed = _tableSubItem->text();
@@ -426,7 +430,7 @@ void DataView::del() {
if(_vCmdMsg.contains(_cmdMsg)) {
_vCmdMsg.removeAll(_cmdMsg);
}
- } else if(_type == "set" || _type == "zset") {
+ } else if(_type == KEY_SET || _type == KEY_ZSET) {
_cmdMsg._key = _key;
_cmdMsg._type = _type;
_cmdMsg._value = _tableSubItem->text();
@@ -439,6 +443,43 @@ void DataView::del() {
}
}
+void DataView::see() {
+
+ // 通过_view去获取被选中的部分的数据model
+ QItemSelectionModel *selectModel = _tableView->selectionModel();
+ // 通过选中的数据结构,获取这些格子的ModelIndex
+ QModelIndexList selectList = selectModel->selectedIndexes();
+
+ if(selectList.size() <= 0) {
+ QMessageBox::critical(this, tr("提示"), tr("请先选择单元格!"));
+ return;
+ }
+
+ if(selectList.size() > 1) {
+ QMessageBox::critical(this, tr("提示"), tr("请选择单个单元格!"));
+ return;
+ }
+
+ QModelIndex index = selectList.at(0);
+ _tableSubItem = _itemTableModel->item(index.row());
+ QString value = _tableSubItem->data(index.column()).toString();
+
+ _valueDialog->clear();
+ _valueDialog->setText(value);
+
+ if(_type == KEY_SET || _type == KEY_ZSET ||
+ (_type == KEY_HASH && index.column() == 0)) {
+ _valueDialog->setEnableEdit(false);
+ } else { //KEY_STRING KEY_LIST
+ _valueDialog->setEnableEdit(true);
+ }
+
+ if(_valueDialog->exec() == QDialog::Accepted) {
+ _tableSubItem->setData(index.column(), _valueDialog->getText());
+ valueChanged(_tableSubItem, index.column());
+ }
+}
+
void DataView::valueChanged(ValueTableItem *item, int column) {
_cmdMsg.init();
_cmdMsg._dbIndex = _dbIndex;
@@ -446,12 +487,12 @@ void DataView::valueChanged(ValueTableItem *item, int column) {
_cmdMsg._operate = OPERATION_ALTER;
_cmdMsg._type = _type;
_cmdMsg._key = _key;
- if(_type == "string") {
+ if(_type == KEY_STRING) {
_cmdMsg._value = item->text(column);
if(_vCmdMsg.contains(_cmdMsg)) {
_vCmdMsg.removeAll(_cmdMsg);
}
- } else if(_type == "hash") {
+ } else if(_type == KEY_HASH) {
if(item)
_cmdMsg._filed = item->text();
else
@@ -460,7 +501,7 @@ void DataView::valueChanged(ValueTableItem *item, int column) {
if(_vCmdMsg.contains(_cmdMsg)) {
_vCmdMsg.removeAll(_cmdMsg);
}
- } else if(_type == "list") {
+ } else if(_type == KEY_LIST) {
_cmdMsg._valueIndex = _itemTableModel->childNumber(item);
_cmdMsg._value = item->text(column);
} else {
@@ -502,31 +543,31 @@ void DataView::initValueListData() {
_initValueMsg._valuePattern = _valuePattern;
_tableView->setSortingEnabled(true);
- if(_type == "string") {
+ if(_type == KEY_STRING) {
_itemTableModel->setColumnCount(1);
_itemTableModel->setHeaderData(0,Qt::Horizontal, "VALUE");
_itemTableModel->setFlags(0,_itemTableModel->flags(0) | Qt::ItemIsEditable);
emit getData(_initValueMsg);
- } else if(_type == "hash") {
+ } else if(_type == KEY_HASH) {
_itemTableModel->setColumnCount(2);
_itemTableModel->setHeaderData(0,Qt::Horizontal, "FIELD");
_itemTableModel->setHeaderData(1,Qt::Horizontal, "VALUE");
_itemTableModel->setFlags(0,_itemTableModel->flags(0) & (~Qt::ItemIsEditable));
_itemTableModel->setFlags(1,_itemTableModel->flags(1) | Qt::ItemIsEditable);
emit getData(_initValueMsg);
- } else if(_type == "list") {
+ } else if(_type == KEY_LIST) {
_listIndex = 0;
_tableView->setSortingEnabled(false);
_itemTableModel->setColumnCount(1);
_itemTableModel->setHeaderData(0,Qt::Horizontal, "VALUE");
_itemTableModel->setFlags(0,_itemTableModel->flags(0) | Qt::ItemIsEditable);
emit getData(_initValueMsg);
- } else if(_type == "set") {
+ } else if(_type == KEY_SET) {
_itemTableModel->setColumnCount(1);
_itemTableModel->setHeaderData(0,Qt::Horizontal, "MEMBER");
_itemTableModel->setFlags(0,_itemTableModel->flags(0) & (~Qt::ItemIsEditable));
emit getData(_initValueMsg);
- } else if(_type == "zset") {
+ } else if(_type == KEY_ZSET) {
_itemTableModel->setColumnCount(2);
_itemTableModel->setHeaderData(0,Qt::Horizontal, "MEMBER");
_itemTableModel->setHeaderData(1,Qt::Horizontal, "SCORE");
@@ -536,8 +577,8 @@ void DataView::initValueListData() {
}
}
-void DataView::appendValue(const TaskMsg & taskMsg, const QByteArray flag) {
- if(flag == "hash") {
+void DataView::appendValue(const TaskMsg & taskMsg, const int flag) {
+ if(flag == KEY_HASH) {
for(int i = 0; i < taskMsg._respResult._arrayValue[1]._arrayValue.size(); ++++i) {
vRowData.clear();
_value = QTextCodec::codecForLocale()->toUnicode(taskMsg._respResult._arrayValue[1]._arrayValue[i]._stringValue);
@@ -547,7 +588,7 @@ void DataView::appendValue(const TaskMsg & taskMsg, const QByteArray flag) {
_tableItemValue = new ValueTableItem(vRowData);
_itemTableModel->insertRow(_tableItemValue);
}
- } else if(flag == "zset") {
+ } else if(flag == KEY_ZSET) {
for(int i = 0; i < taskMsg._respResult._arrayValue[1]._arrayValue.size(); ++++i) {
vRowData.clear();
_value = QTextCodec::codecForLocale()->toUnicode(taskMsg._respResult._arrayValue[1]._arrayValue[i]._stringValue);
@@ -556,20 +597,20 @@ void DataView::appendValue(const TaskMsg & taskMsg, const QByteArray flag) {
_tableItemValue = new ValueTableItem(vRowData);
_itemTableModel->insertRow(_tableItemValue);
}
- } else if(flag == "set") {
+ } else if(flag == KEY_SET) {
for(int i = 0; i < taskMsg._respResult._arrayValue[1]._arrayValue.size(); ++i) {
_value = QTextCodec::codecForLocale()->toUnicode(taskMsg._respResult._arrayValue[1]._arrayValue[i]._stringValue);
_tableItemValue = new ValueTableItem(_value);
_itemTableModel->insertRow(_tableItemValue);
}
- } else if(flag == "string") {
+ } else if(flag == KEY_STRING) {
for(int i = 0; i < taskMsg._list.size(); ++i) {
_value = QTextCodec::codecForLocale()->toUnicode(taskMsg._list[i]);
_tableItemValue = new ValueTableItem(_value);
_itemTableModel->insertRow(_tableItemValue);
break;
}
- } else if(flag == "list") {
+ } else if(flag == KEY_LIST) {
for(int i = 0; i < taskMsg._list.size(); ++i) {
_value = QTextCodec::codecForLocale()->toUnicode(taskMsg._list[i]);
_tableItemValue = new ValueTableItem(_value);
@@ -601,7 +642,7 @@ void DataView::setValue(const QString &value) {
_value = value;
}
-void DataView::setType(const QByteArray &type) {
+void DataView::setType(const int &type) {
_type = type;
_bodyAddHeadButton->setVisible(false);
_bodyAddTailButton->setVisible(false);
@@ -613,17 +654,17 @@ void DataView::setType(const QByteArray &type) {
_deltailAc->setVisible(false);
_addAc->setVisible(true);
_delAc->setVisible(true);
- if(_type == "string") {
+ if(_type == KEY_STRING) {
_addAc->setVisible(false);
_delAc->setVisible(false);
_typeLineEdit->setText("String");
_bodyAddButton->setVisible(false);
_bodyDelButton->setVisible(false);
- } else if(_type == "hash") {
+ } else if(_type == KEY_HASH) {
_typeLineEdit->setText("Hash");
_bodyAddButton->setVisible(true);
_bodyDelButton->setVisible(true);
- } else if(_type == "list") {
+ } else if(_type == KEY_LIST) {
_addAc->setVisible(false);
_delAc->setVisible(false);
_inheadAc->setVisible(true);
@@ -637,11 +678,11 @@ void DataView::setType(const QByteArray &type) {
_bodyDelHeadButton->setVisible(true);
_bodyDelTailButton->setVisible(true);
_typeLineEdit->setText("List");
- } else if(_type == "set") {
+ } else if(_type == KEY_SET) {
_bodyAddButton->setVisible(true);
_bodyDelButton->setVisible(true);
_typeLineEdit->setText("Set");
- } else if(_type == "zset") {
+ } else if(_type == KEY_ZSET) {
_bodyAddButton->setVisible(true);
_bodyDelButton->setVisible(true);
_typeLineEdit->setText("Zset");
diff --git a/src/RedisView/AppView/DataView.h b/src/RedisView/AppView/DataView.h
index 046f79e..d277900 100644
--- a/src/RedisView/AppView/DataView.h
+++ b/src/RedisView/AppView/DataView.h
@@ -10,6 +10,7 @@
#define DATAVIEW_H
#include "AppView/InputDialog.h"
+#include "AppView/ValueDialog.h"
#include "Model/ValueTableModel.h"
#include "Model/ItemDelegate.h"
@@ -27,12 +28,12 @@ class DataView : public QWidget
void clearData();
void initValueListData();
- void appendValue(const TaskMsg & taskMsg, const QByteArray flag);
+ void appendValue(const TaskMsg & taskMsg, const int flag);
void setDbIndex(const int &index);
void setIndex(const int &index);
void setKey(const QString &key);
void setValue(const QString &value);
- void setType(const QByteArray &type);
+ void setType(const int &type);
void setTimeMs(const qlonglong &timeMs);
void setEncode(const QByteArray &encode);
void setRefcount(const qlonglong &count);
@@ -46,10 +47,10 @@ class DataView : public QWidget
bool _recvEnd; //暂时未使用
int _clientIndex;
int _dbIndex;
+ int _type;
QString _valuePattern;
QString _key;
QString _value;
- QByteArray _type;
qlonglong _time;
qlonglong _listIndex;
qlonglong _longLong;
@@ -60,6 +61,7 @@ class DataView : public QWidget
QAction *_resetAc;
QAction *_addAc;
QAction *_delAc;
+ QAction *_seeAc;
QAction *_commitAc;
QAction *_inheadAc;
QAction *_intailAc;
@@ -91,6 +93,7 @@ class DataView : public QWidget
ValueTableModel* _itemTableModel;
QTableView *_tableView;
InputDialog *_inputDialog;
+ ValueDialog *_valueDialog;
ValueTableItem *_tableItemValue;
ValueTableItem *_tableSubItem;
QVector vRowData;
@@ -104,6 +107,7 @@ public slots:
void valueChanged(ValueTableItem *item, int column);
void commit();
void del();
+ void see();
void add();
void addHead();
void addTail();
diff --git a/src/RedisView/AppView/DbCfgdialog.cpp b/src/RedisView/AppView/DbCfgdialog.cpp
index 439bb1f..a3f7e49 100644
--- a/src/RedisView/AppView/DbCfgdialog.cpp
+++ b/src/RedisView/AppView/DbCfgdialog.cpp
@@ -6,7 +6,7 @@
* @version 001
* @copyright Copyright (c) 2018
*/
-#include "AppView/DbCfgdialog.h"
+#include "DbCfgDialog.h"
DbCfgDialog::DbCfgDialog(int dbtype, QWidget *parent) :
QDialog(parent) {
diff --git a/src/RedisView/AppView/InputDialog.cpp b/src/RedisView/AppView/InputDialog.cpp
index 6a78e5f..c733092 100644
--- a/src/RedisView/AppView/InputDialog.cpp
+++ b/src/RedisView/AppView/InputDialog.cpp
@@ -35,7 +35,7 @@ void InputDialog::setTip(const QString & info) {
ui->_inputTextEdit->setPlaceholderText(info);
}
-void InputDialog::setType(const QByteArray & type) {
+void InputDialog::setType(const int & type) {
_type = type;
}
@@ -47,17 +47,17 @@ void InputDialog::on__pushButtonY_clicked()
return;
}
- if(_type == "hash") {
+ if(_type == KEY_HASH) {
_textList.clear();
PubLib::getList(_text,_textList);
if(_textList.size() % 2) {
QMessageBox::critical(this, tr("错误"), tr("数据错误,哈希字段值个数不匹配"));
return;
}
- } else if(_type == "set" || _type == "list") {
+ } else if(_type == KEY_SET || _type == KEY_LIST) {
_textList.clear();
PubLib::getList(_text,_textList);
- } else if(_type == "zset") {
+ } else if(_type == KEY_ZSET) {
_textList.clear();
PubLib::getList(_text,_textList);
if(_textList.size() % 2) {
@@ -89,8 +89,3 @@ void InputDialog::on__pushButtonN_clicked()
{
reject();
}
-
-void InputDialog::setFlag(int flag)
-{
- _flag = flag;
-}
diff --git a/src/RedisView/AppView/InputDialog.h b/src/RedisView/AppView/InputDialog.h
index ec95f71..5ef6890 100644
--- a/src/RedisView/AppView/InputDialog.h
+++ b/src/RedisView/AppView/InputDialog.h
@@ -24,8 +24,7 @@ class InputDialog : public QDialog
~InputDialog();
void setTip(const QString & info);
- void setType(const QByteArray & type);
- void setFlag(int flag);
+ void setType(const int &type);
void clear();
QString getText();
QList getTextList();
@@ -36,9 +35,8 @@ private slots:
void on__pushButtonN_clicked();
private:
- int _flag;
Ui::InputDialog *ui;
- QByteArray _type;
+ int _type;
QString _text;
QList _textList;
};
diff --git a/src/RedisView/AppView/MainWidget.cpp b/src/RedisView/AppView/MainWidget.cpp
index f52768f..883ea2d 100644
--- a/src/RedisView/AppView/MainWidget.cpp
+++ b/src/RedisView/AppView/MainWidget.cpp
@@ -586,8 +586,8 @@ void MainWidget::showTreeRightMenu(const QPoint &pos) {
if(_isClusterMode) {
_idbIndex = 0;
if(_subTreeItem == _treeItemKey) {
- _treeMenu->addAction(_mCount);
_treeMenu->addAction(_mRefresh);
+ _treeMenu->addAction(_mCount);
_treeMenu->addAction(_mKeySort);
_treeMenu->addAction(_mCreated);
} else {
@@ -597,13 +597,13 @@ void MainWidget::showTreeRightMenu(const QPoint &pos) {
} else {
_idbIndex = _vTreeItemKey.indexOf(_subTreeItem);
if(_idbIndex != -1) {
- _treeMenu->addAction(_mCount);
_treeMenu->addAction(_mRefresh);
+ _treeMenu->addAction(_mCount);
_treeMenu->addAction(_mKeySort);
_treeMenu->addAction(_mCreated);
} else if(_treeItemKey == _subTreeItem) {
- _treeMenu->addAction(_mCount);
_treeMenu->addAction(_mRefresh);
+ _treeMenu->addAction(_mCount);
_treeMenu->addAction(_mKeySort);
_idbIndex = -1;
} else {
@@ -1017,9 +1017,11 @@ void MainWidget::treeClicked(const QModelIndex &index) {
QMessageBox::critical(this, tr("错误"), tr("获取键类型失败!"));
return;
}
- _dataView->setType(byteArray);
- if(byteArray == "string") {
+ int keyType = PubLib::getKeyType(byteArray);
+ _dataView->setType(keyType);
+
+ if(keyType == KEY_STRING) {
if(!_redisClient->get(key, byteArray)) {
QMessageBox::critical(this, tr("错误"), tr("获取键值失败!"));
return;
diff --git a/src/RedisView/AppView/MainWindow.cpp b/src/RedisView/AppView/MainWindow.cpp
index 47546da..7ebea55 100644
--- a/src/RedisView/AppView/MainWindow.cpp
+++ b/src/RedisView/AppView/MainWindow.cpp
@@ -1292,33 +1292,16 @@ void MainWindow::about() {
"
"
"RedisView
"
"作者 :王长春
"
- "版本 :Community v1.7.0
"
+ "版本 :Community v1.7.1
"
"邮箱 :cc20110101@126.com
"
- "地址 :RedisView GitHub
"
+ "地址 :RedisView GitHub SourceForge
"
"版权 :Copyright 2019 Powered By CC
"
)
);
}
void MainWindow::history() {
- QMessageBox::about(this, tr("版本历史"),
- tr(
- "
2019/06/26 Version 1.7.0 新增主题设置和数据库导入导出.
"
- "
2019/06/01 Version 1.6.7 密码AES加密存储.
"
- "
2019/05/30 Version 1.6.6 新增集群信息查看分析功能.
"
- "
2019/05/08 Version 1.6.5 修复设置含空格值失败Bug.
"
- "
2019/04/08 Version 1.6.4 修复值初始化模式Bug.
"
- "
2019/04/05 Version 1.6.3 修复键值过长显示不全Bug.
"
- "
2019/03/24 Version 1.6.2 增加操作进度提示,修复中文乱码Bug.
"
- "
2019/03/15 Version 1.6.1 支持编码选择.
"
- "
2019/02/21 Version 1.6.0 支持复制集模式.
"
- "
2019/01/20 Version 1.5.0 增加批量删除键功能.
"
- "
2019/01/19 Version 1.4.0 增加订阅发布模式.
"
- "
2019/01/10 Version 1.3.0 界面调整,增加键值初始化扫描模式.
"
- "
2019/01/07 Version 1.2.0 自定义值模型,内存优化;新增Mac、Linux版本.
"
- "
2018/12/30 Version 1.1.0 自定义键模型,内存优化.
"
- "
2018/12/25 Version 1.0.0 Windows初版发布.
"
- )
- );
+ QRect availableGeometry = QApplication::desktop()->availableGeometry(this);
+ VersionHistory versionHistory(availableGeometry.width(), availableGeometry.height(), this);
+ versionHistory.exec();
}
-
diff --git a/src/RedisView/AppView/MainWindow.h b/src/RedisView/AppView/MainWindow.h
index 2cf76db..3c44291 100644
--- a/src/RedisView/AppView/MainWindow.h
+++ b/src/RedisView/AppView/MainWindow.h
@@ -10,6 +10,7 @@
#define MAINWINDOW_H
#include "AppView/Instructions.h"
+#include "AppView/VersionHistory.h"
#include "AppView/Donation.h"
#include "AppView/MainWidget.h"
#include "AppView/ClientDialog.h"
diff --git a/src/RedisView/AppView/UpdateSystem.cpp b/src/RedisView/AppView/UpdateSystem.cpp
index 18154fe..f5050fd 100644
--- a/src/RedisView/AppView/UpdateSystem.cpp
+++ b/src/RedisView/AppView/UpdateSystem.cpp
@@ -14,9 +14,14 @@ UpdateView::UpdateView() {
~Qt::WindowMaximizeButtonHint &
~Qt::WindowMinimizeButtonHint);
setWindowModality(Qt::ApplicationModal);
+ setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
+ setFixedSize(333,380);
UpdateWidget *_native = new UpdateWidget(&_updater, this);
+ _native->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
_nativeLabel = new QLabel(tr("努力检查中,请稍后..."));
+ _nativeLabel->setWordWrap(true);
+ _nativeLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
_nativeLabel->setAlignment(Qt::AlignHCenter);
QGridLayout *layout = new QGridLayout;
@@ -39,7 +44,6 @@ void UpdateView::noupdate() {
_timer->stop();
}
-
Updater::Updater() {
QLinearGradient gradient(QPointF(50, -20), QPointF(80, 20));
gradient.setColorAt(0.0, Qt::white);
@@ -55,7 +59,7 @@ Updater::Updater() {
void Updater::paint(QPainter *painter, QPaintEvent *event, int elapsed) {
painter->fillRect(event->rect(), _background);
- painter->translate(100, 100);
+ painter->translate(150, 150);
painter->save();
painter->setBrush(_circleBrush);
@@ -63,27 +67,26 @@ void Updater::paint(QPainter *painter, QPaintEvent *event, int elapsed) {
painter->rotate(elapsed * 0.030);
qreal r = elapsed / 1000.0;
- int n = 30;
+ int n = 35;
for(int i = 0; i < n; ++i) {
painter->rotate(30);
qreal factor = (i + r) / n;
qreal radius = 0 + 120.0 * factor;
qreal circleRadius = 1 + factor * 20;
painter->drawEllipse(QRectF(radius, -circleRadius,
- circleRadius * 2, circleRadius * 2));
+ circleRadius * 2.5, circleRadius * 2.5));
}
painter->restore();
painter->setPen(_textPen);
painter->setFont(_textFont);
- painter->drawText(QRect(-50, -50, 100, 100), Qt::AlignCenter,
+ painter->drawText(QRect(-75, -75, 150, 150), Qt::AlignCenter,
QStringLiteral("RV"));
}
-
UpdateWidget::UpdateWidget(Updater *updater, QWidget *parent)
: QWidget(parent), _updater(updater) {
_elapsed = 0;
- setFixedSize(200, 200);
+ setFixedSize(300, 300);
}
void UpdateWidget::animate() {
diff --git a/src/RedisView/AppView/ValueDialog.cpp b/src/RedisView/AppView/ValueDialog.cpp
new file mode 100644
index 0000000..14d98a4
--- /dev/null
+++ b/src/RedisView/AppView/ValueDialog.cpp
@@ -0,0 +1,121 @@
+/**
+* @file ValueDialog.cpp
+* @brief 键值查看
+* @author 王长春
+* @date 2021-04-21
+* @version 001
+* @copyright Copyright (c) 2021
+*/
+#include "AppView/ValueDialog.h"
+#include "ui_valuedialog.h"
+
+ValueDialog::ValueDialog(QWidget *parent) :
+ QDialog(parent),
+ ui(new Ui::ValueDialog)
+{
+ ui->setupUi(this);
+ setWindowTitle(tr("查看"));
+ ui->_radioButtonJson->setChecked(false);
+ ui->_radioButtonText->setChecked(true);
+ ui->_radioButtonXml->setChecked(false);
+}
+
+ValueDialog::~ValueDialog()
+{
+ delete ui;
+}
+
+QString ValueDialog::getText() {
+ return ui->_valueTextEdit->document()->toPlainText();
+}
+
+void ValueDialog::on__pushButtonY_clicked()
+{
+ accept();
+}
+
+void ValueDialog::clear() {
+ ui->_valueTextEdit->clear();
+}
+
+void ValueDialog::on__pushButtonN_clicked()
+{
+ reject();
+}
+
+void ValueDialog::setEnableEdit(bool enableEdit)
+{
+ _enableEdit = enableEdit;
+ ui->_valueTextEdit->setReadOnly(!_enableEdit);
+ ui->_pushButtonY->setEnabled(_enableEdit);
+}
+
+bool ValueDialog::getEnableEdit() const
+{
+ return _enableEdit;
+}
+
+void ValueDialog::setText(const QString &text)
+{
+ if(ui->_radioButtonJson->isChecked()) {
+ QJsonDocument jsonDocument = QJsonDocument::fromJson(text.toLocal8Bit().data());
+ if(jsonDocument.isNull()) {
+ ui->_radioButtonText->setChecked(true);
+ ui->_valueTextEdit->setPlainText(text);
+ } else {
+ ui->_valueTextEdit->setPlainText(jsonDocument.toJson(QJsonDocument::JsonFormat::Indented));
+ }
+ } else if(ui->_radioButtonXml->isChecked()) {
+ QDomDocument domDocument;
+ if(domDocument.setContent(text)) {
+ ui->_valueTextEdit->setPlainText(domDocument.toString(4));
+ } else {
+ ui->_radioButtonText->setChecked(true);
+ ui->_valueTextEdit->setPlainText(text);
+ }
+ } else if(ui->_radioButtonHtml->isChecked()) {
+ ui->_valueTextEdit->setHtml(text);
+ } else {
+ ui->_valueTextEdit->setPlainText(text);
+ }
+}
+
+void ValueDialog::on__radioButtonXml_toggled(bool checked)
+{
+ if(!checked)
+ return;
+ QDomDocument domDocument;
+ if(domDocument.setContent(getText())) {
+ ui->_valueTextEdit->setPlainText(domDocument.toString(4));
+ } else {
+ ui->_radioButtonText->setChecked(true);
+ QMessageBox::critical(this, tr("错误"), tr("非xml格式"));
+ }
+}
+
+void ValueDialog::on__radioButtonJson_toggled(bool checked)
+{
+ if(!checked)
+ return;
+
+ QJsonDocument jsonDocument = QJsonDocument::fromJson(getText().toLocal8Bit().data());
+ if(jsonDocument.isNull()) {
+ ui->_radioButtonText->setChecked(true);
+ QMessageBox::critical(this, tr("错误"), tr("非json格式"));
+ } else {
+ ui->_valueTextEdit->setPlainText(jsonDocument.toJson(QJsonDocument::JsonFormat::Indented));
+ }
+}
+
+void ValueDialog::on__radioButtonText_toggled(bool checked)
+{
+ if(!checked)
+ return;
+}
+
+void ValueDialog::on__radioButtonHtml_toggled(bool checked)
+{
+ if(!checked)
+ return;
+ ui->_valueTextEdit->setHtml(getText());
+}
diff --git a/src/RedisView/AppView/ValueDialog.h b/src/RedisView/AppView/ValueDialog.h
new file mode 100644
index 0000000..8abd7d7
--- /dev/null
+++ b/src/RedisView/AppView/ValueDialog.h
@@ -0,0 +1,47 @@
+/**
+* @file ValueDialog.h
+* @brief 键值查看
+* @author 王长春
+* @date 2021-04-21
+* @version 001
+* @copyright Copyright (c) 2021
+*/
+#ifndef VALUEDIALOG_H
+#define VALUEDIALOG_H
+
+#include "Public/Publib.h"
+
+namespace Ui {
+class ValueDialog;
+}
+
+class ValueDialog : public QDialog
+{
+ Q_OBJECT
+
+public:
+ explicit ValueDialog(QWidget *parent = nullptr);
+ ~ValueDialog();
+
+ void clear();
+ QString getText();
+ void setText(const QString &text);
+
+ bool getEnableEdit() const;
+ void setEnableEdit(bool enableEdit);
+
+private slots:
+ void on__pushButtonY_clicked();
+ void on__pushButtonN_clicked();
+ void on__radioButtonXml_toggled(bool checked);
+ void on__radioButtonJson_toggled(bool checked);
+ void on__radioButtonText_toggled(bool checked);
+ void on__radioButtonHtml_toggled(bool checked);
+
+private:
+ Ui::ValueDialog *ui;
+ QString _text;
+ bool _enableEdit;
+};
+
+#endif // VALUEDIALOG_H
diff --git a/src/RedisView/AppView/VersionHistory.cpp b/src/RedisView/AppView/VersionHistory.cpp
new file mode 100644
index 0000000..9b655dc
--- /dev/null
+++ b/src/RedisView/AppView/VersionHistory.cpp
@@ -0,0 +1,52 @@
+/**
+* @file VersionHistory.cpp
+* @brief 说明信息
+* @author 王长春
+* @date 2021-04-21
+* @version 001
+* @copyright Copyright (c) 2021
+*/
+#include "AppView/VersionHistory.h"
+#include "ui_versionhistory.h"
+
+VersionHistory::VersionHistory(int width, int height, QWidget *parent) :
+ QDialog(parent),
+ ui(new Ui::VersionHistory)
+{
+ ui->setupUi(this);
+
+ setWindowTitle(tr("版本历史"));
+ setFixedSize(width * 1 / 2, height * 1 / 2);
+ ui->_textBrowser->setOpenExternalLinks(true);
+ ui->_textBrowser->setText(tr(
+ "
2021/04/21 Version 1.7.1 新增键值查看功能.
"
+ "
2019/06/26 Version 1.7.0 新增主题设置和数据库导入导出.
"
+ "
2019/06/01 Version 1.6.7 密码AES加密存储.
"
+ "
2019/05/30 Version 1.6.6 新增集群信息查看分析功能.
"
+ "
2019/05/08 Version 1.6.5 修复设置含空格值失败Bug.
"
+ "
2019/04/08 Version 1.6.4 修复值初始化模式Bug.
"
+ "
2019/04/05 Version 1.6.3 修复键值过长显示不全Bug.
"
+ "
2019/03/24 Version 1.6.2 增加操作进度提示,修复中文乱码Bug.
"
+ "
2019/03/15 Version 1.6.1 支持编码选择.
"
+ "
2019/02/21 Version 1.6.0 支持复制集模式.
"
+ "
2019/01/20 Version 1.5.0 增加批量删除键功能.
"
+ "
2019/01/19 Version 1.4.0 增加订阅发布模式.
"
+ "
2019/01/10 Version 1.3.0 界面调整,增加键值初始化扫描模式.
"
+ "
2019/01/07 Version 1.2.0 自定义值模型,内存优化;新增Mac、Linux版本.
"
+ "
2018/12/30 Version 1.1.0 自定义键模型,内存优化.
"
+ "
2018/12/25 Version 1.0.0 Windows初版发布.
"
+ )
+ );
+ ui->_textBrowser->setEnabled(true);
+ ui->_textBrowser->setReadOnly(true);
+}
+
+VersionHistory::~VersionHistory()
+{
+ delete ui;
+}
+
+void VersionHistory::on_pushButton_clicked()
+{
+ accept();
+}
diff --git a/src/RedisView/AppView/VersionHistory.h b/src/RedisView/AppView/VersionHistory.h
new file mode 100644
index 0000000..097cd5a
--- /dev/null
+++ b/src/RedisView/AppView/VersionHistory.h
@@ -0,0 +1,33 @@
+/**
+* @file VersionHistory.h
+* @brief 说明信息
+* @author 王长春
+* @date 2018-11-24
+* @version 001
+* @copyright Copyright (c) 2018
+*/
+#ifndef VERSIONHISTORY_H
+#define VERSIONHISTORY_H
+
+#include
+
+namespace Ui {
+class VersionHistory;
+}
+
+class VersionHistory : public QDialog
+{
+ Q_OBJECT
+
+public:
+ explicit VersionHistory(int width, int height, QWidget *parent = nullptr);
+ ~VersionHistory();
+
+private slots:
+ void on_pushButton_clicked();
+
+private:
+ Ui::VersionHistory *ui;
+};
+
+#endif // VERSIONHISTORY_H
diff --git a/src/RedisView/AppView/contributordialog.ui b/src/RedisView/AppView/contributordialog.ui
index 1b706a1..06b28cb 100644
--- a/src/RedisView/AppView/contributordialog.ui
+++ b/src/RedisView/AppView/contributordialog.ui
@@ -13,35 +13,39 @@
鸣谢
-
-
-
- 300
- 270
- 75
- 23
-
-
-
- 确定
-
-
-
-
-
- 10
- 10
- 381
- 251
-
-
-
- TextLabel
-
-
- Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop
-
-
+
+ -
+
+
-
+
+
+ -
+
+
-
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+ 确定
+
+
+
+
+
+
+
+
diff --git a/src/RedisView/AppView/valuedialog.ui b/src/RedisView/AppView/valuedialog.ui
new file mode 100644
index 0000000..6df2590
--- /dev/null
+++ b/src/RedisView/AppView/valuedialog.ui
@@ -0,0 +1,107 @@
+
+
+ ValueDialog
+
+
+
+ 0
+ 0
+ 825
+ 454
+
+
+
+ Dialog
+
+
+ -
+
+
-
+
+
+ 格式化:
+
+
+
+ -
+
+
+ text
+
+
+
+ -
+
+
+ json
+
+
+
+ -
+
+
+ xml
+
+
+
+ -
+
+
+ html
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 78
+ 20
+
+
+
+
+
+
+ -
+
+
+ -
+
+
-
+
+
+ Qt::Horizontal
+
+
+
+ 118
+ 20
+
+
+
+
+ -
+
+
+ 确定
+
+
+
+ -
+
+
+ 关闭
+
+
+
+
+
+
+
+
+
+
diff --git a/src/RedisView/AppView/versionHistory.ui b/src/RedisView/AppView/versionHistory.ui
new file mode 100644
index 0000000..3070279
--- /dev/null
+++ b/src/RedisView/AppView/versionHistory.ui
@@ -0,0 +1,61 @@
+
+
+ VersionHistory
+
+
+
+ 0
+ 0
+ 400
+ 300
+
+
+
+ Dialog
+
+
+ -
+
+
-
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+ 确定
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/RedisView/Public/Define.h b/src/RedisView/Public/Define.h
index 45329de..7beaf69 100644
--- a/src/RedisView/Public/Define.h
+++ b/src/RedisView/Public/Define.h
@@ -11,6 +11,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -69,12 +70,12 @@
#endif
// 定义字符串
-#define WindowTitle "RedisView Community v1.7.0"
+#define WindowTitle "RedisView Community v1.7.1"
#define IniFileName "conf.ini"
#define LogName "process.log"
#define OrganizationName "CC20110101"
#define ApplicationName "RedisView"
-#define ApplicationVersion "1.7.0"
+#define ApplicationVersion "1.7.1"
// 定义常量
#define BATCH_SCAN_NUM 5000
@@ -110,12 +111,20 @@
#define OPERATION_TIMEOUT 4
#define OPERATION_RENAME 5
+// 定义键类型
+#define KEY_NONE 0
+#define KEY_STRING 1
+#define KEY_HASH 2
+#define KEY_SET 3
+#define KEY_ZSET 4
+#define KEY_LIST 5
+
// 定义样式
-#define DEEPDARK_THEME "DeepDarkTheme"
-#define DARK_THEME "DarkTheme"
-#define GRAY_THEME "GrayTheme"
-#define PINK_THEME "PinkTheme"
-#define NO_THEME "NoTheme"
+#define DEEPDARK_THEME "DeepDarkTheme"
+#define DARK_THEME "DarkTheme"
+#define GRAY_THEME "GrayTheme"
+#define PINK_THEME "PinkTheme"
+#define NO_THEME "NoTheme"
// 定义样式文件
#define DARK_THEME_FILE ":/Resources/DarkTheme.qss"
@@ -166,6 +175,7 @@
#define ICON_REDISINFO ":/Resources/redisinfo.ico"
#define ICON_FEEDBACK ":/Resources/feedback.ico"
#define ICON_UPDATE ":/Resources/update.ico"
+#define ICON_DETAILS ":/Resources/details.ico"
#define GIF_WAIT ":/Resources/wait.gif"
extern QMutex G_DB_MUTEX;
@@ -233,8 +243,8 @@ class TaskMsg {
_taskid = 0;
_sequence = 0;
_clientIndex = 0;
+ _type = KEY_NONE;
_key.clear();
- _type.clear();
_host.clear();
_passwd.clear();
_list.clear();
@@ -271,8 +281,8 @@ class TaskMsg {
int _sequence;
int _clientIndex;
int _dbIndex;
+ int _type;
QString _key;
- QByteArray _type;
QString _host;
QString _passwd;
QString _keyPattern;
@@ -294,7 +304,7 @@ class CmdMsg {
_dbIndex = 0;
_clientIndex = 0;
_score = 0;
- _type.clear();
+ _type = KEY_NONE;
_key.clear();
_value.clear();
_filed.clear();
@@ -380,9 +390,9 @@ class CmdMsg {
int _operate; //1、2、3增删改
int _dbIndex;
int _clientIndex;
+ int _type;
double _score;
qlonglong _valueIndex;
- QByteArray _type;
QString _key;
QString _filed;
QString _value;
@@ -409,13 +419,13 @@ class InitValueMsg
_dbindex = -1;
_clientIndex = -1;
_key.clear();
- _type.clear();
+ _type = KEY_NONE;
_valuePattern.clear();
}
int _dbindex;
int _clientIndex;
- QByteArray _type;
+ int _type;
QString _key;
QString _valuePattern;
};
@@ -433,9 +443,9 @@ typedef struct DbCfg {
typedef struct ImpExpData
{
- int iState;
- qlonglong lWeight;
- qlonglong lTimeOut;
+ int32_t iState;
+ int64_t lWeight;
+ int64_t lTimeOut;
QString sKey;
QString sKeyType;
QString sFiled;
diff --git a/src/RedisView/Public/Publib.cpp b/src/RedisView/Public/Publib.cpp
index a587620..a19fadd 100644
--- a/src/RedisView/Public/Publib.cpp
+++ b/src/RedisView/Public/Publib.cpp
@@ -8,7 +8,7 @@
*/
#include "Public/Publib.h"
-qlonglong PubLib::_sequenceId = 0;
+int64_t PubLib::_sequenceId = 0;
void PubLib::log(QString info) {
QMutexLocker locker(&G_PUBLIC_LIB_MUTEX);
@@ -26,12 +26,28 @@ void PubLib::log(QString info) {
file.close();
}
-void PubLib::setSequenceId(qlonglong sequenceId) {
+int PubLib::getKeyType(const QByteArray & type) {
+ if(type == "hash") {
+ return KEY_HASH;
+ } else if(type == "zset") {
+ return KEY_ZSET;
+ } else if(type == "set") {
+ return KEY_SET;
+ } else if(type == "string") {
+ return KEY_STRING;
+ } else if(type == "list") {
+ return KEY_LIST;
+ } else {
+ return KEY_NONE;
+ }
+}
+
+void PubLib::setSequenceId(int64_t sequenceId) {
QMutexLocker locker(&G_SEQUENCE_MUTEX);
_sequenceId = sequenceId;
}
-qlonglong PubLib::getSequenceId() {
+int64_t PubLib::getSequenceId() {
QMutexLocker locker(&G_SEQUENCE_MUTEX);
++ _sequenceId;
return _sequenceId;
diff --git a/src/RedisView/Public/Publib.h b/src/RedisView/Public/Publib.h
index 4785221..4bfba80 100644
--- a/src/RedisView/Public/Publib.h
+++ b/src/RedisView/Public/Publib.h
@@ -19,8 +19,9 @@ class PubLib
static QString getConfig(const QString & key, const QString &defaultValue = "");
static void setConfigB(const QString & key, const bool & value);
static bool getConfigB(const QString & key, const bool &defaultValue = false);
- static void setSequenceId(qlonglong sequenceId);
- static qlonglong getSequenceId();
+ static void setSequenceId(int64_t sequenceId);
+ static int getKeyType(const QByteArray & type);
+ static int64_t getSequenceId();
static void log(QString info);
static QStringList getMacAddr();
static QString getCpuId();
@@ -32,7 +33,7 @@ class PubLib
private:
static void _getcpuid(unsigned int CPUInfo[4], unsigned int InfoType);
static void _getcpuidex(unsigned int CPUInfo[4], unsigned int InfoType, unsigned int ECXValue);
- static qlonglong _sequenceId;
+ static int64_t _sequenceId;
};
#endif // PUBLIB_H
diff --git a/src/RedisView/Public/WorkThread.cpp b/src/RedisView/Public/WorkThread.cpp
index 775a41c..2441d9d 100644
--- a/src/RedisView/Public/WorkThread.cpp
+++ b/src/RedisView/Public/WorkThread.cpp
@@ -506,15 +506,15 @@ int WorkThread::exportData(std::vector &vImpExpData, int taskid)
sql_query.prepare(_sql);
QVariantList v0, v1, v2, v3, v4, v5, v6, v7, v8;
for(std::size_t i = 0; i < vImpExpData.size(); ++i) {
- v0 << QVariant(PubLib::getSequenceId()) ;
- v1 << QVariant(vImpExpData[i].iState);
- v2 << QVariant(vImpExpData[i].lWeight);
- v3 << QVariant(vImpExpData[i].lTimeOut);
- v4 << QVariant(vImpExpData[i].sKey);
- v5 << QVariant(vImpExpData[i].sKeyType);
- v6 << QVariant(vImpExpData[i].sFiled);
- v7 << QVariant(vImpExpData[i].sValue);
- v8 << QVariant(vImpExpData[i].sExpDate);
+ v0 << PubLib::getSequenceId() ;
+ v1 << vImpExpData[i].iState;
+ v2 << vImpExpData[i].lWeight;
+ v3 << vImpExpData[i].lTimeOut;
+ v4 << vImpExpData[i].sKey;
+ v5 << vImpExpData[i].sKeyType;
+ v6 << vImpExpData[i].sFiled;
+ v7 << vImpExpData[i].sValue;
+ v8 << vImpExpData[i].sExpDate;
}
sql_query.addBindValue(v0);
sql_query.addBindValue(v1);
@@ -571,7 +571,7 @@ void WorkThread::doValueListWork() {
_sendMsg = *_taskMsg;
_sendMsg._list.clear();
_sendMsg._respResult.init();
- if(_taskMsg->_type == "hash") {
+ if(_taskMsg->_type == KEY_HASH) {
do {
if(_redisClient->hscan(_sendMsg._key, _sendMsg._keyPattern, _sendMsg._respResult, _cursor, BATCH_SCAN_NUM)) {
_cursor = _sendMsg._respResult._arrayValue[0]._stringValue.toLongLong();
@@ -583,7 +583,7 @@ void WorkThread::doValueListWork() {
}
_sendMsg._respResult.init();
} while(_cursor);
- } else if(_taskMsg->_type == "zset") {
+ } else if(_taskMsg->_type == KEY_ZSET) {
do {
if(_redisClient->zscan(_sendMsg._key, _sendMsg._keyPattern, _sendMsg._respResult, _cursor, BATCH_SCAN_NUM)) {
_cursor = _sendMsg._respResult._arrayValue[0]._stringValue.toLongLong();
@@ -595,7 +595,7 @@ void WorkThread::doValueListWork() {
}
_sendMsg._respResult.init();
} while(_cursor);
- } else if(_taskMsg->_type == "set") {
+ } else if(_taskMsg->_type == KEY_SET) {
do {
if(_redisClient->sscan(_sendMsg._key, _sendMsg._keyPattern, _sendMsg._respResult , _cursor, BATCH_SCAN_NUM)) {
_cursor = _sendMsg._respResult._arrayValue[0]._stringValue.toLongLong();
@@ -607,7 +607,7 @@ void WorkThread::doValueListWork() {
}
_sendMsg._respResult.init();
} while(_cursor);
- } else if(_taskMsg->_type == "list") {
+ } else if(_taskMsg->_type == KEY_LIST) {
int start = 0;
int stop = start + BATCH_SCAN_NUM;
do {
@@ -623,7 +623,7 @@ void WorkThread::doValueListWork() {
}
_sendMsg._list.clear();
} while(_cursor);
- } else if(_taskMsg->_type == "string") {
+ } else if(_taskMsg->_type == KEY_STRING) {
if(_redisClient->get(_sendMsg._key, _byteArray)) {
_sendMsg._list << _byteArray;
emit sendData(_sendMsg);
@@ -654,25 +654,25 @@ void WorkThread::doCommitValueWork() {
for(int i =0; i < _cmd.size(); ++i) {
switch (_cmd[i]._operate) {
case OPERATION_ADD:
- if(_cmd[i]._type == "hash") {
+ if(_cmd[i]._type == KEY_HASH) {
if(!_redisClient->hset(_cmd[i]._key,_cmd[i]._filed,_cmd[i]._value,llret)) {
_string = _redisClient->getErrorInfo();
emit runError(_taskMsg->_taskid,_string);
continue;
}
- } else if(_cmd[i]._type == "zset") {
+ } else if(_cmd[i]._type == KEY_ZSET) {
if(!_redisClient->zadd(_cmd[i]._key,_cmd[i]._value,_cmd[i]._score,llret)) {
_string = _redisClient->getErrorInfo();
emit runError(_taskMsg->_taskid,_string);
continue;
}
- } else if(_cmd[i]._type == "set") {
+ } else if(_cmd[i]._type == KEY_SET) {
if(!_redisClient->sadd(_cmd[i]._key,_cmd[i]._value,llret)) {
_string = _redisClient->getErrorInfo();
emit runError(_taskMsg->_taskid,_string);
continue;
}
- } else if(_cmd[i]._type == "list") {
+ } else if(_cmd[i]._type == KEY_LIST) {
if(_cmd[i]._valueIndex == 1) {
if(!_redisClient->rpush(_cmd[i]._key,_cmd[i]._value,llret)) {
_string = _redisClient->getErrorInfo();
@@ -689,25 +689,25 @@ void WorkThread::doCommitValueWork() {
}
break;
case OPERATION_DELETE:
- if(_cmd[i]._type == "hash") {
+ if(_cmd[i]._type == KEY_HASH) {
if(!_redisClient->hdel(_cmd[i]._key,_cmd[i]._filed,llret)) {
_string = _redisClient->getErrorInfo();
emit runError(_taskMsg->_taskid,_string);
continue;
}
- } else if(_cmd[i]._type == "zset") {
+ } else if(_cmd[i]._type == KEY_ZSET) {
if(!_redisClient->zrem(_cmd[i]._key,_cmd[i]._value,llret)) {
_string = _redisClient->getErrorInfo();
emit runError(_taskMsg->_taskid,_string);
continue;
}
- } else if(_cmd[i]._type == "set") {
+ } else if(_cmd[i]._type == KEY_SET) {
if(!_redisClient->srem(_cmd[i]._key,_cmd[i]._value,llret)) {
_string = _redisClient->getErrorInfo();
emit runError(_taskMsg->_taskid,_string);
continue;
}
- } else if(_cmd[i]._type == "list") {
+ } else if(_cmd[i]._type == KEY_LIST) {
if(_cmd[i]._valueIndex == 1) {
if(!_redisClient->rpop(_cmd[i]._key,_byteArray)) {
_string = _redisClient->getErrorInfo();
@@ -724,19 +724,19 @@ void WorkThread::doCommitValueWork() {
}
break;
case OPERATION_ALTER:
- if(_cmd[i]._type == "hash") {
+ if(_cmd[i]._type == KEY_HASH) {
if(!_redisClient->hset(_cmd[i]._key,_cmd[i]._filed,_cmd[i]._value,llret)) {
_string = _redisClient->getErrorInfo();
emit runError(_taskMsg->_taskid,_string);
continue;
}
- } else if(_cmd[i]._type == "string") {
+ } else if(_cmd[i]._type == KEY_STRING) {
if(!_redisClient->set(_cmd[i]._key,_cmd[i]._value)) {
_string = _redisClient->getErrorInfo();
emit runError(_taskMsg->_taskid,_string);
continue;
}
- } else if(_cmd[i]._type == "list") {
+ } else if(_cmd[i]._type == KEY_LIST) {
if(!_redisClient->lset(_cmd[i]._key,_cmd[i]._valueIndex,_cmd[i]._value)) {
_string = _redisClient->getErrorInfo();
emit runError(_taskMsg->_taskid,_string);
diff --git a/src/RedisView/RedisView.pro b/src/RedisView/RedisView.pro
index 2933ffe..074c097 100644
--- a/src/RedisView/RedisView.pro
+++ b/src/RedisView/RedisView.pro
@@ -7,6 +7,8 @@ SOURCES += \
AppView/MainWindow.cpp \
AppView/RedisInfoDialog.cpp \
AppView/UpdateSystem.cpp \
+ AppView/ValueDialog.cpp \
+ AppView/VersionHistory.cpp \
Public/AesEncrypt.cpp \
Public/DbMgr.cpp \
Public/Define.cpp \
@@ -44,6 +46,8 @@ HEADERS += \
AppView/MainWindow.h \
AppView/RedisInfoDialog.h \
AppView/UpdateSystem.h \
+ AppView/ValueDialog.h \
+ AppView/VersionHistory.h \
Public/AesEncrypt.h \
Public/DbMgr.h \
Public/Define.h \
@@ -78,7 +82,7 @@ TARGET = RedisView
RESOURCES += icon.qrc
-QT += gui widgets core network sql
+QT += gui widgets core network sql xml
RC_ICONS = Resources/tray.ico
@@ -95,6 +99,8 @@ FORMS += \
AppView/clientdialog.ui \
AppView/pubsubdialog.ui \
AppView/batchoperatedialog.ui \
- AppView/redisinfodialog.ui
+ AppView/redisinfodialog.ui \
+ AppView/valuedialog.ui \
+ AppView/versionHistory.ui
TRANSLATIONS = en.ts cn.ts
diff --git a/src/RedisView/Resources/PinkTheme.qss b/src/RedisView/Resources/PinkTheme.qss
index 6dd9a09..023d14b 100644
--- a/src/RedisView/Resources/PinkTheme.qss
+++ b/src/RedisView/Resources/PinkTheme.qss
@@ -96,7 +96,7 @@ QPushButton {
border-radius: 5;
padding: 3px;
min-width: 13ex;
- min-height: 3ex;
+ min-height: 5ex;
}
QPushButton:hover {
@@ -198,8 +198,12 @@ QDialogButtonBox {
button-layout: 0;
}
-QPushButton#_subscribeButton, QPushButton#_unSubcribeButton {
- min-width: 90px;
+QPushButton#_subscribeButton {
+ min-width: 100px;
+}
+
+QPushButton#_unSubcribeButton {
+ min-width: 120px;
}
QTextEdit {
diff --git a/src/RedisView/Resources/details.ico b/src/RedisView/Resources/details.ico
new file mode 100644
index 0000000..4a0adbe
Binary files /dev/null and b/src/RedisView/Resources/details.ico differ
diff --git a/src/RedisView/Resources/en.qm b/src/RedisView/Resources/en.qm
index d0b303a..e62527f 100644
Binary files a/src/RedisView/Resources/en.qm and b/src/RedisView/Resources/en.qm differ
diff --git a/src/RedisView/cn.ts b/src/RedisView/cn.ts
index 7f989d3..99df323 100644
--- a/src/RedisView/cn.ts
+++ b/src/RedisView/cn.ts
@@ -214,22 +214,22 @@
-
+
-
+
-
+
-
+
@@ -310,25 +310,25 @@
-
+
-
+
-
+
-
+
@@ -338,70 +338,87 @@
-
+
-
+
-
+
-
+
-
+
+
+
+
+
+
-
+
-
+
-
-
-
-
+
+
+
+
-
+
-
-
-
+
+
+
-
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
DbCfgDialog
@@ -772,7 +789,7 @@
-
+
@@ -1015,26 +1032,26 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1067,71 +1084,71 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
+
+
+
-
-
-
+
+
+
-
+
-
+
@@ -1916,7 +1933,6 @@
-
@@ -2062,13 +2078,7 @@
-
- <br><b>RedisView</b><br><br>作者 :王长春<br>版本 :Community v1.7.0<br>邮箱 :cc20110101@126.com<br>地址 :<a href='http://www.cc123.net.cn'>RedisView</a><a href='https://github.com/cc20110101/RedisView'>GitHub</a><br>版权 :Copyright 2019 Powered By CC<br>
-
-
-
-
-
+
@@ -2286,14 +2296,101 @@
-
+
-
+
+
+ ValueDialog
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ VersionHistory
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/RedisView/en.ts b/src/RedisView/en.ts
index 8b9bcc9..0fbc399 100644
--- a/src/RedisView/en.ts
+++ b/src/RedisView/en.ts
@@ -251,25 +251,25 @@
Cancel
-
+
Register
Register
-
+
Software Code
Software Code
-
+
Please enter the registration code
Please enter the registration code
-
+
Registration Failed
Registration Failed
@@ -364,28 +364,28 @@
-
+
InsertHead
InsertHead
-
+
InsertTail
InsertTail
-
+
DeleteHead
DeleteHead
-
+
DeleteTail
DeleteTail
@@ -397,82 +397,102 @@
Value Pattern:
-
+
Count
Count
-
+
Refresh
Refresh
-
+
Insert
Insert
-
+
Delete
Delete
-
+
+
+ View
+ View
+
+
+
Submit
Submit
-
+
The total number of value is
The total number of value is
-
+
Statistics
Statistics
-
-
-
-
+
+
+
+
Error
Error
-
+
New key cannot be empty!
New key cannot be empty!
-
-
-
+
+
+
No data rows need to be deleted!
No data rows need to be deleted!
-
+
+
+
Tips
Tips
-
+
Please select the record to delete!
Please select the record to delete!
+
+
+
+ Please select the cell first!
+ Please select the cell first!
+
+
+
+
+ Please select a single cell!
+ Please select a single cell!
+
DbCfgDialog
@@ -910,7 +930,7 @@ the best, everything goes well...
-
+
Command
Command
@@ -1194,26 +1214,26 @@ the best, everything goes well...
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Error
Error
@@ -1221,8 +1241,8 @@ the best, everything goes well...
- Failed to get the key expiration time!
- Failed to get the key expiration time!
+ Failed to get the key expiration time
+ Failed to get the key expiration time
@@ -1252,83 +1272,83 @@ the best, everything goes well...
Failed to get the key type!
-
+
Failed to get key value!
Failed to get key value!
-
+
Failed to get the key expiration time!
Failed to get the key expiration time!
-
+
Failed to get keycode information!
Failed to get keycode information!
-
+
Failed to get key reference coun!
Failed to get key reference coun!
-
+
Failed to get key idle time!
Failed to get key idle time!
-
+
When multiple commands are executed, the separator cannot be empty!
When multiple commands are executed, the separator cannot be empty!
-
+
Configuration error, not one of json, resp, text format
Configuration error, not one of json, resp, text format
-
+
Send channel can't be empty!
Send channel can't be empty!
-
+
Sending messages can't be empty!
Sending messages can't be empty!
-
-
-
+
+
+
Client connection information is empty!
Client connection information is empty!
-
-
-
+
+
+
Client connection failed!
Client connection failed!
-
+
Subscription channels cannot be empty!
Subscription channels cannot be empty!
-
+
No subscription, no cancellation!
No subscription, no cancellation!
@@ -2269,7 +2289,6 @@ the best, everything goes well...
-
Version Log
Version Log
@@ -2442,16 +2461,9 @@ the best, everything goes well...
-
- <br><b>RedisView</b><br><br>作者 :王长春<br>版本 :Community v1.7.0<br>邮箱 :cc20110101@126.com<br>地址 :<a href='http://www.cc123.net.cn'>RedisView</a><a href='https://github.com/cc20110101/RedisView'>GitHub</a><br>版权 :Copyright 2019 Powered By CC<br>
- <br><b>RedisView</b><br><br>Author :WangChangchun<br>Version : Community v1.7.0<br>Mailbox :cc20110101@126.com<br>Address :<a href='<br><b>RedisView</b><br><br>Author :WangChangchun<br>Version : Community v1.7.0<br>Mailbox :cc20110101@126.com<br>Address :<a href='http://www.cc123.net.cn'>RedisView</a> <a href='https://github.com/cc20110101/RedisView'>GitHub</a> <br>Copyright :Copyright 2019 Powered By CC<br>
- <br><b>RedisView</b><br><br>Author :WangChangchun<br>Version: Community v1.7.0<br>Mailbox :cc20110101@126.com<br>Address :<a href='<br><b>RedisView</b><br><br>Author :WangChangchun<br>Version : Community v1.7.0<br>Mailbox :cc20110101@126.com<br>Address :<a href='http://www.cc123.net.cn'>RedisView</a> <a href='https://github.com/cc20110101/RedisView'>GitHub</a><br>Copyright :Copyright 2019 Powered By CC<br>
-
-
-
-
- <br>2019/06/26 Version 1.7.7 New theme settings and database import and export.<br><br>2019/06/01 Version 1.6.7 Password AES encrypted storage.<br><br>2019/05/30 Version 1.6.6 Added cluster viewing and analysis capabilities.<br><br>2019/05/08 Version 1.6.5 Fix setting bug with space value failed.<br><br>2019/04/08 Version 1.6.4 Fix value initialization pattern bug.<br><br>2019/04/05 Version 1.6.3 Repair incomplete display bug when key value is too long.<br><br>2019/03/24 Version 1.6.2 Increase progress hints,fix chinese garbled bug.<br><br>2019/03/15 Version 1.6.1 Support coding settings.<br><br>2019/02/21 Version 1.6.0 Support replication mode.<br><br>2019/01/20 Version 1.5.0 Add batch deletion key function.<br><br>2019/01/19 Version 1.4.0 Adding subscription publishing mode.<br><br>2019/01/10 Version 1.3.0 Adjust view interface,adding keys and values to initialize scan mode.<br><br>2019/01/07 Version 1.2.0 Custom value model, memory optimization; add mac and linux version.<br><br>2018/12/30 Version 1.1.0 Custom key model, memory optimization.<br><br>2018/12/25 Version 1.0.0 Initial release of windows.<br>
- <br>2019/06/26 Version 1.7.7 New theme settings and database import and export.<br><br>2019/06/01 Version 1.6.7 Password AES encrypted storage.<br><br>2019/05/30 Version 1.6.6 Added cluster viewing and analysis capabilities.<br><br>2019/05/08 Version 1.6.5 Fix setting bug with space value failed.<br><br>2019/04/08 Version 1.6.4 Fix value initialization pattern bug.<br><br>2019/04/05 Version 1.6.3 Repair incomplete display bug when key value is too long.<br><br>2019/03/24 Version 1.6.2 Increase progress hints,fix chinese garbled bug.<br><br>2019/03/15 Version 1.6.1 Support coding settings.<br><br>2019/02/21 Version 1.6.0 Support replication mode.<br><br>2019/01/20 Version 1.5.0 Add batch deletion key function.<br><br>2019/01/19 Version 1.4.0 Adding subscription publishing mode.<br><br>2019/01/10 Version 1.3.0 Adjust view interface,adding keys and values to initialize scan mode.<br><br>2019/01/07 Version 1.2.0 Custom value model, memory optimization; add mac and linux version.<br><br>2018/12/30 Version 1.1.0 Custom key model, memory optimization.<br><br>2018/12/25 Version 1.0.0 Initial release of windows.<br>
+
+ <br><b>RedisView</b><br><br>Author : WangChangchun<br>Version : Community v1.7.1<br>Mailbox : cc20110101@126.com<br>Address : <a href='http://www.cc123.net.cn/'>RedisView</a> <a href='https://github.com/cc20110101/RedisView'>GitHub</a> <a href='https://sourceforge.net/projects/redisview/'>SourceForge</a><br>Copyright : Copyright 2019 Powered By CC<br>
+ <br><b>RedisView</b><br><br>Author : WangChangchun<br>Version : Community v1.7.1<br>Mailbox : cc20110101@126.com<br>Address : <a href='http://www.cc123.net.cn/'>RedisView</a> <a href='https://github.com/cc20110101/RedisView'>GitHub</a> <a href='https://sourceforge.net/projects/redisview/'>SourceForge</a><br>Copyright : Copyright 2019 Powered By CC<br>
@@ -2708,16 +2720,119 @@ the best, everything goes well...
Check Update
-
+
Try hard to check, please wait...
Try hard to check, please wait...
-
+
- Please check update from website
- Please check update from website
+ Please check the official website for updates...
+ Please check the official website for updates...
+
+
+
+ ValueDialog
+
+
+
+ Dialog
+ Dialog
+
+
+
+
+ Dormat:
+ Dormat:
+
+
+
+
+ text
+ text
+
+
+
+
+ json
+ json
+
+
+
+
+ xml
+ xml
+
+
+
+
+ html
+ html
+
+
+
+
+ ok
+ ok
+
+
+
+
+ no
+ no
+
+
+
+
+ View
+ View
+
+
+
+
+
+ Error
+ Error
+
+
+
+
+ Non-xml format
+ Non-xml format
+
+
+
+
+ Non-json format
+ Non-json format
+
+
+
+ VersionHistory
+
+
+
+ Dialog
+ Dialog
+
+
+
+
+ ok
+ ok
+
+
+
+
+ Version Log
+ Version Log
+
+
+
+
+ <br>2021/04/21 Version 1.7.1 Added key value view function.<br><br>2019/06/26 Version 1.7.0 New theme settings and database import and export.<br><br>2019/06/01 Version 1.6.7 Password AES encrypted storage.<br><br>2019/05/30 Version 1.6.6 Added cluster viewing and analysis capabilities.<br><br>2019/05/08 Version 1.6.5 Fix setting bug with space value failed.<br><br>2019/04/08 Version 1.6.4 Fix value initialization pattern bug.<br><br>2019/04/05 Version 1.6.3 Repair incomplete display bug when key value is too long.<br><br>2019/03/24 Version 1.6.2 Increase progress hints,fix chinese garbled bug.<br><br>2019/03/15 Version 1.6.1 Support coding settings.<br><br>2019/02/21 Version 1.6.0 Support replication mode.<br><br>2019/01/20 Version 1.5.0 Add batch deletion key function.<br><br>2019/01/19 Version 1.4.0 Adding subscription publishing mode.<br><br>2019/01/10 Version 1.3.0 Adjust view interface,adding keys and values to initialize scan mode.<br><br>2019/01/07 Version 1.2.0 Custom value model, memory optimization; add mac and linux version.<br><br>2018/12/30 Version 1.1.0 Custom key model, memory optimization.<br><br>2018/12/25 Version 1.0.0 Initial release of windows.<br>
+ <br>2021/04/21 Version 1.7.1 Added key value view function.<br><br>2019/06/26 Version 1.7.0 New theme settings and database import and export.<br><br>2019/06/01 Version 1.6.7 Password AES encrypted storage.<br><br>2019/05/30 Version 1.6.6 Added cluster viewing and analysis capabilities.<br><br>2019/05/08 Version 1.6.5 Fix setting bug with space value failed.<br><br>2019/04/08 Version 1.6.4 Fix value initialization pattern bug.<br><br>2019/04/05 Version 1.6.3 Repair incomplete display bug when key value is too long.<br><br>2019/03/24 Version 1.6.2 Increase progress hints,fix chinese garbled bug.<br><br>2019/03/15 Version 1.6.1 Support coding settings.<br><br>2019/02/21 Version 1.6.0 Support replication mode.<br><br>2019/01/20 Version 1.5.0 Add batch deletion key function.<br><br>2019/01/19 Version 1.4.0 Adding subscription publishing mode.<br><br>2019/01/10 Version 1.3.0 Adjust view interface,adding keys and values to initialize scan mode.<br><br>2019/01/07 Version 1.2.0 Custom value model, memory optimization; add mac and linux version.<br><br>2018/12/30 Version 1.1.0 Custom key model, memory optimization.<br><br>2018/12/25 Version 1.0.0 Initial release of windows.<br>
diff --git a/src/RedisView/icon.qrc b/src/RedisView/icon.qrc
index aeac495..5be4d7f 100644
--- a/src/RedisView/icon.qrc
+++ b/src/RedisView/icon.qrc
@@ -23,7 +23,6 @@
Resources/flush.ico
Resources/commit.ico
Resources/delhead.ico
- Resources/deltail.ico
Resources/inhead.ico
Resources/intail.ico
Resources/instruction.ico
@@ -51,5 +50,7 @@
Resources/GrayTheme.qss
Resources/DeepDarkTheme.qss
Resources/PinkTheme.qss
+ Resources/details.ico
+ Resources/deltail.ico