Skip to content

Commit

Permalink
Merge pull request #75 from quick123official/hotfix/2.6.1
Browse files Browse the repository at this point in the history
Hotfix/2.6.1
  • Loading branch information
quick123official committed Dec 21, 2021
2 parents e6611d3 + dc0bf38 commit 4956549
Show file tree
Hide file tree
Showing 29 changed files with 291 additions and 131 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "QuickRedis",
"version": "2.6.0",
"version": "2.6.2",
"private": true,
"description": "QuickRedis",
"author": "https://quick123.net/",
Expand Down
1 change: 1 addition & 0 deletions public/locales/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"SystemConfig.start": "#### SystemConfig ####",
"SystemConfig.lang": "Vyberte jazyk",
"SystemConfig.tree.split": "Nastavit oddělovač",
"SystemConfig.auto.format.json": "Format json automatically",
"SystemConfig.title": "Konfigurace systému",
"SystemConfig.needRestart": "Abyste se projevili, musíte restartovat.",
"SystemConfig.end00": "#### SystemConfig ####",
Expand Down
1 change: 1 addition & 0 deletions public/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"SystemConfig.start": "#### SystemConfig ####",
"SystemConfig.lang": "Sprache auswählen",
"SystemConfig.tree.split": "Trennzeichen einstellen",
"SystemConfig.auto.format.json": "Format json automatically",
"SystemConfig.title": "Systemkonfiguration",
"SystemConfig.needRestart": "Sie müssen neu starten, um wirksam zu werden.",
"SystemConfig.end00": "#### SystemConfig ####",
Expand Down
1 change: 1 addition & 0 deletions public/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"SystemConfig.start": "#### SystemConfig ####",
"SystemConfig.lang": "Select language",
"SystemConfig.tree.split": "Set separator",
"SystemConfig.auto.format.json": "Format json automatically",
"SystemConfig.title": "System configuration",
"SystemConfig.needRestart": "You need to restart to take effect.",
"SystemConfig.end00": "#### SystemConfig ####",
Expand Down
1 change: 1 addition & 0 deletions public/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"SystemConfig.start": "#### SystemConfig ####",
"SystemConfig.lang": "Seleccionar idioma",
"SystemConfig.tree.split": "Establecer separador",
"SystemConfig.auto.format.json": "Format json automatically",
"SystemConfig.title": "Configuración del sistema",
"SystemConfig.needRestart": "Necesita reiniciar para que surta efecto",
"SystemConfig.end00": "#### SystemConfig ####",
Expand Down
1 change: 1 addition & 0 deletions public/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"SystemConfig.start": "#### SystemConfig ####",
"SystemConfig.lang": "Sélectionnez la langue",
"SystemConfig.tree.split": "Définir le séparateur",
"SystemConfig.auto.format.json": "Format json automatically",
"SystemConfig.title": "Configuration système",
"SystemConfig.needRestart": "Vous devez redémarrer pour prendre effet.",
"SystemConfig.end00": "#### SystemConfig ####",
Expand Down
1 change: 1 addition & 0 deletions public/locales/id.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"SystemConfig.start": "#### SystemConfig ####",
"SystemConfig.lang": "Pilih bahasa",
"SystemConfig.tree.split": "Atur pemisah",
"SystemConfig.auto.format.json": "Format json automatically",
"SystemConfig.title": "Konfigurasi sistem",
"SystemConfig.needRestart": "Anda perlu memulai ulang untuk menerapkannya.",
"SystemConfig.end00": "#### SystemConfig ####",
Expand Down
1 change: 1 addition & 0 deletions public/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"SystemConfig.start": "#### SystemConfig ####",
"SystemConfig.lang": "Seleziona lingua",
"SystemConfig.tree.split": "Imposta separatore",
"SystemConfig.auto.format.json": "Format json automatically",
"SystemConfig.title": "Configurazione del sistema",
"SystemConfig.needRestart": "È necessario riavviare per avere effetto.",
"SystemConfig.end00": "#### SystemConfig ####",
Expand Down
1 change: 1 addition & 0 deletions public/locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"SystemConfig.start": "#### SystemConfig ####",
"SystemConfig.lang": "言語を選択してください",
"SystemConfig.tree.split": "区切り文字を設定する",
"SystemConfig.auto.format.json": "Format json automatically",
"SystemConfig.title": "システム構成",
"SystemConfig.needRestart": "有効にするには再起動する必要があります。",
"SystemConfig.end00": "#### SystemConfig ####",
Expand Down
1 change: 1 addition & 0 deletions public/locales/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"SystemConfig.start": "#### SystemConfig ####",
"SystemConfig.lang": "언어 선택",
"SystemConfig.tree.split": "구분자 설정",
"SystemConfig.auto.format.json": "Format json automatically",
"SystemConfig.title": "시스템 구성",
"SystemConfig.needRestart": "적용하려면 다시 시작해야합니다.",
"SystemConfig.end00": "#### SystemConfig ####",
Expand Down
1 change: 1 addition & 0 deletions public/locales/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"SystemConfig.start": "#### SystemConfig ####",
"SystemConfig.lang": "Selecteer taal",
"SystemConfig.tree.split": "Scheidingsteken instellen",
"SystemConfig.auto.format.json": "Format json automatically",
"SystemConfig.title": "Systeemconfiguratie",
"SystemConfig.needRestart": "U moet opnieuw opstarten om van kracht te worden.",
"SystemConfig.end00": "#### SystemConfig ####",
Expand Down
1 change: 1 addition & 0 deletions public/locales/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"SystemConfig.start": "#### SystemConfig ####",
"SystemConfig.lang": "Wybierz język",
"SystemConfig.tree.split": "Ustaw separator",
"SystemConfig.auto.format.json": "Format json automatically",
"SystemConfig.title": "Konfiguracja systemu",
"SystemConfig.needRestart": "Musisz zrestartować, aby odniosły skutek.",
"SystemConfig.end00": "#### SystemConfig ####",
Expand Down
1 change: 1 addition & 0 deletions public/locales/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"SystemConfig.start": "#### SystemConfig ####",
"SystemConfig.lang": "Selecione o idioma",
"SystemConfig.tree.split": "Definir separador",
"SystemConfig.auto.format.json": "Format json automatically",
"SystemConfig.title": "Configuração do sistema",
"SystemConfig.needRestart": "Você precisa reiniciar para fazer efeito.",
"SystemConfig.end00": "#### SystemConfig ####",
Expand Down
1 change: 1 addition & 0 deletions public/locales/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"SystemConfig.start": "#### SystemConfig ####",
"SystemConfig.lang": "Выбрать язык",
"SystemConfig.tree.split": "Установить разделитель",
"SystemConfig.auto.format.json": "Format json automatically",
"SystemConfig.title": "Конфигурация системы",
"SystemConfig.needRestart": "Для вступления в силу необходимо перезапустить.",
"SystemConfig.end00": "#### SystemConfig ####",
Expand Down
1 change: 1 addition & 0 deletions public/locales/uk.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"SystemConfig.start": "#### SystemConfig ####",
"SystemConfig.lang": "Вибрати мову",
"SystemConfig.tree.split": "Встановити роздільник",
"SystemConfig.auto.format.json": "Format json automatically",
"SystemConfig.title": "Конфігурація системи",
"SystemConfig.needRestart": "Вам потрібно перезапуститися, щоб набути чинності.",
"SystemConfig.end00": "#### SystemConfig ####",
Expand Down
1 change: 1 addition & 0 deletions public/locales/vi.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"SystemConfig.start": "#### SystemConfig ####",
"SystemConfig.lang": "Chọn ngôn ngữ",
"SystemConfig.tree.split": "Đặt dấu phân cách",
"SystemConfig.auto.format.json": "Format json automatically",
"SystemConfig.title": "Cấu hình hệ thống",
"SystemConfig.needRestart": "Bạn cần khởi động lại để có hiệu lực.",
"SystemConfig.end00": "#### SystemConfig ####",
Expand Down
1 change: 1 addition & 0 deletions public/locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"SystemConfig.start": "#### SystemConfig ####",
"SystemConfig.lang": "选择语言",
"SystemConfig.tree.split": "设置分隔符",
"SystemConfig.auto.format.json": "自动格式化json",
"SystemConfig.title": "系统配置",
"SystemConfig.needRestart": "您需要重新启动才能生效。",
"SystemConfig.end00": "#### SystemConfig ####",
Expand Down
1 change: 1 addition & 0 deletions public/locales/zh-TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"SystemConfig.start": "#### SystemConfig ####",
"SystemConfig.lang": "選擇語言",
"SystemConfig.tree.split": "設置分隔符",
"SystemConfig.auto.format.json": "自動格式化json",
"SystemConfig.title": "系統配置",
"SystemConfig.needRestart": "您需要重新啟動才能生效。",
"SystemConfig.end00": "#### SystemConfig ####",
Expand Down
54 changes: 43 additions & 11 deletions src/components/SystemConfig/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { Modal, Row, Col, Select, Input, Tooltip } from "antd";
import { Modal, Row, Col, Select, Input, Tooltip, Checkbox } from "antd";
import LocaleUtils from "@/utils/LocaleUtils";
import intl from "react-intl-universal";
import { ExclamationCircleOutlined } from "@ant-design/icons";
Expand All @@ -10,7 +10,11 @@ const { ipcRenderer, remote } = window.require("electron");
* 系统配置
*/
class SystemConfig extends React.Component {
state = { visible: false, config: { lang: "", splitSign: "" } };
needRestart = false;
state = {
visible: false,
config: { lang: "", splitSign: "", autoFormatJson: true },
};
componentDidMount() {
// 重置连接事件
ipcRenderer.on("system-config", (event, arg) => {
Expand All @@ -30,18 +34,22 @@ class SystemConfig extends React.Component {
visible: false,
});
LocaleUtils.saveSystemConfig(this.state.config);
confirm({
title: intl.get("common.notice"),
icon: <ExclamationCircleOutlined />,
content: intl.get("SystemConfig.needRestart"),
onOk() {
remote.app.quit();
},
onCancel() {},
});
if (this.needRestart) {
this.needRestart = false;
confirm({
title: intl.get("common.notice"),
icon: <ExclamationCircleOutlined />,
content: intl.get("SystemConfig.needRestart"),
onOk() {
remote.app.quit();
},
onCancel() {},
});
}
};

handleCancel = (e) => {
this.needRestart = false;
this.setState({
visible: false,
});
Expand All @@ -56,6 +64,7 @@ class SystemConfig extends React.Component {
this.setState({
config: { ...this.state.config, lang: val },
});
this.needRestart = true;
}
/**
*修改分隔符
Expand All @@ -66,6 +75,20 @@ class SystemConfig extends React.Component {
this.setState({
config: { ...this.state.config, splitSign: event.target.value },
});
this.needRestart = true;
};
/**
*修改自动格式化json
*
* @memberof SystemConfig
*/
handleAutoFormatJsonChange = (event) => {
this.setState({
config: {
...this.state.config,
autoFormatJson: event.target.checked,
},
});
};

render() {
Expand Down Expand Up @@ -108,6 +131,15 @@ class SystemConfig extends React.Component {
/>
</Tooltip>
</Col>
<Col span={6}>
{intl.get("SystemConfig.auto.format.json")}
</Col>
<Col span={18}>
<Checkbox
onChange={this.handleAutoFormatJsonChange}
checked={this.state.config.autoFormatJson}
></Checkbox>
</Col>
</Row>
</Modal>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/HostContent/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class HostContent extends Component {
hostKeyShowType = HOST_KEY_SHOW_TYPE.TREE;
componentDidMount() {
this.updateDBCount();
let splitSign = LocaleUtils.readSystemConfig().splitSign;
let splitSign = LocaleUtils.readSystemConfig(false).splitSign;
if (splitSign === "" || splitSign === undefined || splitSign === null) {
this.hostKeyShowType = HOST_KEY_SHOW_TYPE.TABLE;
}
Expand Down
Loading

0 comments on commit 4956549

Please sign in to comment.