Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
antSword
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
HuangJunbo
antSword
Commits
5d75d49a
Commit
5d75d49a
authored
Mar 22, 2016
by
antoor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加shell管理界面数据分类重命名功能
parent
73a66dd1
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
94 additions
and
5 deletions
+94
-5
CHANGELOG.md
CHANGELOG.md
+16
-3
database.js
modules/database.js
+16
-0
en.jsx
source/language/en.jsx
+9
-1
zh.jsx
source/language/zh.jsx
+9
-1
category.jsx
source/modules/shellmanager/category.jsx
+44
-0
No files found.
CHANGELOG.md
View file @
5d75d49a
...
...
@@ -4,6 +4,9 @@
## 2016/03
### /22
1.
数据分类重命名
### /21
1.
优化UI组建自适应,在调整窗口大小的时候不刷新就能调整UI尺寸
...
...
@@ -21,8 +24,18 @@
### /13
1.
修复源码中
`jquery`
库缺失问题
# 待做事项
*
数据分类重命名
*
数据高级搜索功能
*
数据库配置编辑功能
*
数据发包代理功能
*
在线检测/下载/安装更新
*
重写优化数据处理截断算法
*
虚拟终端复制粘贴tab补全
*
文件管理双击文件进行编辑 //size < 1024kb
*
插件模块 //实时编写插件执行、UI以及各种操作API设计
*
扩展模块 //用于扩展一些高级的功能,懒人必备
*
代码重构
*
中文开发文档
*
英文说明+开发文档
*
nodejs服务端脚本支持
*
python服务端脚本支持
\ No newline at end of file
modules/database.js
View file @
5d75d49a
...
...
@@ -155,6 +155,22 @@ class Database {
event
.
returnValue
=
err
||
num
;
})
})
// 重命名分类
// {oldName, newName}
.
on
(
'shell-renameCategory'
,
(
event
,
arg
)
=>
{
logger
.
warn
(
'shell-renameCategory'
,
arg
);
this
.
cursor
.
update
({
category
:
arg
[
'oldName'
]
},
{
$set
:
{
category
:
arg
[
'newName'
]
}
},
{
multi
:
true
},
(
err
,
num
)
=>
{
event
.
returnValue
=
err
||
num
;
})
})
// 移动数据
.
on
(
'shell-move'
,
(
event
,
arg
)
=>
{
logger
.
info
(
'shell-move'
,
arg
);
...
...
source/language/en.jsx
View file @
5d75d49a
...
...
@@ -63,7 +63,8 @@ module.exports = {
default
:
'Default'
,
toolbar
:
{
add
:
'Add'
,
del
:
'Del'
del
:
'Del'
,
rename
:
'Rename'
},
add
:
{
title
:
'Add category'
...
...
@@ -73,6 +74,13 @@ module.exports = {
confirm
:
'Are you sure to delete this category?'
,
success
:
(
category
)
=>
antSword
.
noxss
(
`Delete category(
${
category
}
) success!`
),
error
:
(
category
,
err
)
=>
antSword
.
noxss
(
`Delete category(
${
category
}
failed!<br/>
${
err
}
`
)
},
rename
:
{
title
:
'Rename category'
,
disable
:
'Prohibited category name!'
,
exists
:
'This category name already exists!'
,
success
:
'Successful rename!'
,
error
:
'Rename category failed!'
}
},
list
:
{
...
...
source/language/zh.jsx
View file @
5d75d49a
...
...
@@ -64,7 +64,8 @@ module.exports = {
default
:
'默认分类'
,
toolbar
:
{
add
:
'添加'
,
del
:
'删除'
del
:
'删除'
,
rename
:
'重命名'
},
add
:
{
title
:
'添加分类'
...
...
@@ -74,6 +75,13 @@ module.exports = {
confirm
:
'确定删除此分类吗?(数据将清空)'
,
success
:
(
category
)
=>
antSword
.
noxss
(
`成功删除分类(
${
category
}
)!`
),
error
:
(
category
,
err
)
=>
antSword
.
noxss
(
`删除分类(
${
category
}
)失败!<br/>
${
err
}
`
)
},
rename
:
{
title
:
'重命名分类'
,
disable
:
'禁止的分类名称!'
,
exists
:
'此分类名已经存在!'
,
success
:
'重命名分类成功!'
,
error
:
'重命名分类失败!'
}
},
list
:
{
...
...
source/modules/shellmanager/category.jsx
View file @
5d75d49a
...
...
@@ -19,6 +19,8 @@ class Category {
toolbar
.
loadStruct
([
{
id
:
'add'
,
type
:
'button'
,
text
:
`<i class="fa fa-plus-circle"></i>
${
LANG
[
'category'
][
'toolbar'
][
'add'
]}
`
},
{
type
:
'separator'
},
{
id
:
'rename'
,
type
:
'button'
,
text
:
`<i class="fa fa-font"></i>
${
LANG
[
'category'
][
'toolbar'
][
'rename'
]}
`
,
disabled
:
true
},
{
type
:
'separator'
},
{
id
:
'del'
,
type
:
'button'
,
text
:
`<i class="fa fa-trash"></i>
${
LANG
[
'category'
][
'toolbar'
][
'del'
]}
`
,
disabled
:
true
}
]);
// toolbar点击
...
...
@@ -34,6 +36,47 @@ class Category {
sidebar
.
callEvent
(
'onSelect'
,
[
value
]);
});
break
;
case
'rename'
:
// 重命名分类
const
_category
=
sidebar
.
getActiveItem
();
layer
.
prompt
({
title
:
`<i class="fa fa-font"></i>
${
LANG
[
'category'
][
'rename'
][
'title'
]}
`
,
value
:
_category
},
(
value
,
index
,
ele
)
=>
{
// 禁止的分类名
if
(
value
===
'default'
)
{
return
toastr
.
warning
(
LANG
[
'category'
][
'rename'
][
'disable'
],
LANG_T
[
'warning'
]);
};
// 判断分类是否存在
if
(
sidebar
.
items
(
value
))
{
return
toastr
.
warning
(
LANG
[
'category'
][
'rename'
][
'exists'
],
LANG_T
[
'warning'
]);
};
layer
.
close
(
index
);
// 更新数据库
const
ret
=
antSword
[
'ipcRenderer'
].
sendSync
(
'shell-renameCategory'
,
{
oldName
:
_category
,
newName
:
value
});
if
(
typeof
ret
===
'number'
)
{
// 更新成功
toastr
.
success
(
LANG
[
'category'
][
'rename'
][
'success'
],
LANG_T
[
'success'
]);
// 删除旧分类
sidebar
.
items
(
_category
).
remove
();
// 添加新分类
sidebar
.
addItem
({
id
:
value
,
bubble
:
ret
,
text
:
`<i class="fa fa-folder-o"></i>
${
value
}
`
});
// 跳转分类
setTimeout
(()
=>
{
sidebar
.
items
(
value
).
setActive
();
},
233
);
}
else
{
toastr
.
error
(
LANG
[
'category'
][
'rename'
][
'error'
],
LANG_T
[
'error'
]);
}
});
break
;
case
'del'
:
// 删除分类
const
category
=
sidebar
.
getActiveItem
();
...
...
@@ -77,6 +120,7 @@ class Category {
sidebar
.
attachEvent
(
'onSelect'
,
(
id
)
=>
{
// 更改删除按钮状态
toolbar
[(
id
===
'default'
)
?
'disableItem'
:
'enableItem'
](
'del'
);
toolbar
[(
id
===
'default'
)
?
'disableItem'
:
'enableItem'
](
'rename'
);
manager
.
loadData
({
category
:
id
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment