Commit 2b77ed1b authored by Medicean's avatar Medicean

优化一些细节

parent 16239843
......@@ -265,17 +265,16 @@ class Database {
/**
* 修改数据库配置
* @param {Object} event ipcMain对象
* @param {Object} opts 配置(_id,data
* @param {Object} opts 配置(_id,id,data
*/
editDataConf(event, opts) {
logger.info('shell-editDataConf', opts);
logger.info('editDataConf', opts);
// 1. 获取原配置列表
this.cursor.findOne({
_id: opts['_id']
}, (err, ret) => {
let confs = ret['database'] || {};
// 添加到配置
logger.info('shell-editDataConf-opts["id"]', opts['id']);
confs[opts['id']] = opts['data'];
// 更新数据库
this.cursor.update({
......
......@@ -366,7 +366,8 @@ module.exports = {
title: 'Add conf',
toolbar: {
add: 'Add',
clear: 'Clear'
clear: 'Clear',
edit: 'Edit'
},
type: 'Database type',
encode: 'Database encode',
......
......@@ -367,7 +367,8 @@ module.exports = {
title: '添加配置',
toolbar: {
add: '添加',
clear: '清空'
clear: '清空',
edit: '编辑'
},
type: '数据库类型',
encode: '数据库编码',
......
......@@ -279,10 +279,10 @@ class PHP {
// 工具栏
const toolbar = win.attachToolbar();
toolbar.loadStruct([{
id: 'add',
id: 'edit',
type: 'button',
icon: 'plus-circle',
text: LANG['form']['toolbar']['add']
icon: 'edit',
text: LANG['form']['toolbar']['edit']
}, {
type: 'separator'
}, {
......@@ -371,7 +371,7 @@ class PHP {
case 'clear':
form.clear();
break;
case 'add':
case 'edit':
if (!form.validate()) {
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