Commit 2b77ed1b authored by Medicean's avatar Medicean

优化一些细节

parent 16239843
...@@ -265,17 +265,16 @@ class Database { ...@@ -265,17 +265,16 @@ class Database {
/** /**
* 修改数据库配置 * 修改数据库配置
* @param {Object} event ipcMain对象 * @param {Object} event ipcMain对象
* @param {Object} opts 配置(_id,data * @param {Object} opts 配置(_id,id,data
*/ */
editDataConf(event, opts) { editDataConf(event, opts) {
logger.info('shell-editDataConf', opts); logger.info('editDataConf', opts);
// 1. 获取原配置列表 // 1. 获取原配置列表
this.cursor.findOne({ this.cursor.findOne({
_id: opts['_id'] _id: opts['_id']
}, (err, ret) => { }, (err, ret) => {
let confs = ret['database'] || {}; let confs = ret['database'] || {};
// 添加到配置 // 添加到配置
logger.info('shell-editDataConf-opts["id"]', opts['id']);
confs[opts['id']] = opts['data']; confs[opts['id']] = opts['data'];
// 更新数据库 // 更新数据库
this.cursor.update({ this.cursor.update({
......
...@@ -366,7 +366,8 @@ module.exports = { ...@@ -366,7 +366,8 @@ module.exports = {
title: 'Add conf', title: 'Add conf',
toolbar: { toolbar: {
add: 'Add', add: 'Add',
clear: 'Clear' clear: 'Clear',
edit: 'Edit'
}, },
type: 'Database type', type: 'Database type',
encode: 'Database encode', encode: 'Database encode',
......
...@@ -367,7 +367,8 @@ module.exports = { ...@@ -367,7 +367,8 @@ module.exports = {
title: '添加配置', title: '添加配置',
toolbar: { toolbar: {
add: '添加', add: '添加',
clear: '清空' clear: '清空',
edit: '编辑'
}, },
type: '数据库类型', type: '数据库类型',
encode: '数据库编码', encode: '数据库编码',
......
...@@ -279,10 +279,10 @@ class PHP { ...@@ -279,10 +279,10 @@ class PHP {
// 工具栏 // 工具栏
const toolbar = win.attachToolbar(); const toolbar = win.attachToolbar();
toolbar.loadStruct([{ toolbar.loadStruct([{
id: 'add', id: 'edit',
type: 'button', type: 'button',
icon: 'plus-circle', icon: 'edit',
text: LANG['form']['toolbar']['add'] text: LANG['form']['toolbar']['edit']
}, { }, {
type: 'separator' type: 'separator'
}, { }, {
...@@ -371,7 +371,7 @@ class PHP { ...@@ -371,7 +371,7 @@ class PHP {
case 'clear': case 'clear':
form.clear(); form.clear();
break; break;
case 'add': case 'edit':
if (!form.validate()) { if (!form.validate()) {
return toastr.warning(LANG['form']['warning'], LANG_T['warning']); return toastr.warning(LANG['form']['warning'], LANG_T['warning']);
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment