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
ce831f7f
Commit
ce831f7f
authored
Apr 12, 2017
by
Medicean
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
数据管理定制隐藏列
parent
ffe4f1f7
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
154 additions
and
31 deletions
+154
-31
menubar.js
modules/menubar.js
+4
-0
en.js
source/language/en.js
+24
-30
zh.js
source/language/zh.js
+27
-0
display.js
source/modules/settings/display.js
+93
-0
index.js
source/modules/settings/index.js
+3
-1
grid.js
source/modules/shellmanager/list/grid.js
+3
-0
No files found.
modules/menubar.js
View file @
ce831f7f
...
...
@@ -55,6 +55,10 @@ class Menubar {
label
:
LANG
[
'main'
][
'aproxy'
],
accelerator
:
'Shift+CmdOrCtrl+A'
,
click
:
event
.
sender
.
send
.
bind
(
event
.
sender
,
'menubar'
,
'settings-aproxy'
)
},
{
label
:
LANG
[
'main'
][
'display'
],
accelerator
:
'Shift+CmdOrCtrl+D'
,
click
:
event
.
sender
.
send
.
bind
(
event
.
sender
,
'menubar'
,
'settings-display'
)
},
{
type
:
'separator'
},
{
...
...
source/language/en.js
View file @
ce831f7f
...
...
@@ -16,6 +16,7 @@ module.exports = {
settings
:
'System setting'
,
language
:
'Language setting'
,
aproxy
:
'Proxy setting'
,
display
:
'Display setting'
,
update
:
'Check update'
,
quit
:
'Quit'
},
...
...
@@ -486,39 +487,32 @@ module.exports = {
success
:
'Connect to proxy server successfully'
,
error
:
'Failed to connect to the proxy server'
}
}
},
aproxy
:
{
title
:
'Proxy Configuration'
,
toolbar
:
{
save
:
'Save'
,
test
:
'Test Connection'
},
form
:
{
label
:
'Configuring proxy access to the Internet'
,
mode
:{
noproxy
:
'No Proxy'
,
manualproxy
:
'Set the proxy manually'
display
:
{
title
:
'Display setting'
,
success
:
'Save display settings successfully!'
,
error
:
'Failed to save the display settings!'
,
confirm
:
{
content
:
'Restart the application to take effect, whether to restart?'
,
title
:
'Change display settings'
},
proxy
:
{
protocol
:
'Protocol'
,
server
:
'Server'
,
port
:
'Port'
,
username
:
'Username'
,
password
:
'Password'
,
authtip
:
'Leave blank if no authentication'
toolbar
:
{
save
:
'Save'
},
form
:{
shellmanager
:
{
title
:
'Shell Lists'
,
hiddencolumns
:
{
title
:
'Hide selected columns'
,
url
:
'URL'
,
ip
:
'IP'
,
addr
:
'ADDR'
,
note
:
'NOTE'
,
ctime
:
'CTIME'
,
utime
:
'UTIME'
}
}
}
},
success
:
'Successfully save the Proxy Configuration!'
,
error
:
'Failed to save the Proxy Configuration!'
,
confirm
:
{
content
:
'Restart the application?'
,
title
:
'Proxy Configuration'
},
prompt
:{
title
:
'Input the target URL'
,
success
:
'Successfully connect to the proxy server'
,
error
:
'Failed to connect to the proxy server'
}
},
plugin
:
{
...
...
source/language/zh.js
View file @
ce831f7f
...
...
@@ -17,6 +17,7 @@ module.exports = {
settings
:
'系统设置'
,
language
:
'语言设置'
,
aproxy
:
'代理设置'
,
display
:
'显示设置'
,
update
:
'检查更新'
,
quit
:
'退出程序'
},
...
...
@@ -487,6 +488,32 @@ module.exports = {
success
:
'连接到代理服务器成功'
,
error
:
'连接到代理服务器失败'
}
},
display
:
{
title
:
'显示设置'
,
success
:
'保存显示设置成功!'
,
error
:
'保存显示设置失败!'
,
confirm
:
{
content
:
'重启应用生效,是否重启?'
,
title
:
'更改显示设置'
},
toolbar
:
{
save
:
'保存'
},
form
:{
shellmanager
:
{
title
:
'数据管理'
,
hiddencolumns
:
{
title
:
'隐藏选中列'
,
url
:
'URL地址'
,
ip
:
'IP地址'
,
addr
:
'物理位置'
,
note
:
'网站备注'
,
ctime
:
'创建时间'
,
utime
:
'更新时间'
}
}
}
}
},
plugin
:
{
...
...
source/modules/settings/display.js
0 → 100644
View file @
ce831f7f
/**
* 设置中心::界面
*/
const
LANG
=
antSword
[
'language'
][
'settings'
][
'display'
];
const
LANG_T
=
antSword
[
'language'
][
'toastr'
];
class
Display
{
constructor
(
sidebar
)
{
sidebar
.
addItem
({
id
:
'display'
,
text
:
`<i class="fa fa-television"></i>
${
LANG
[
'title'
]}
`
});
const
cell
=
sidebar
.
cells
(
'display'
);
const
display_shellmanager_hiddencolumns
=
localStorage
.
hasOwnProperty
(
'display_shellmanager_hiddencolumns'
)
?
JSON
.
parse
(
localStorage
.
display_shellmanager_hiddencolumns
):[];
const
toolbar
=
cell
.
attachToolbar
();
toolbar
.
loadStruct
([
{
id
:
'save'
,
type
:
'button'
,
text
:
LANG
[
'toolbar'
][
'save'
],
icon
:
'save'
}
]);
// 表单
const
form
=
cell
.
attachForm
([{
type
:
'block'
,
name
:
'shellmanager'
,
list
:
[
{
type
:
"label"
,
label
:
LANG
[
'form'
][
'shellmanager'
][
'title'
]}
]}
]);
const
LANG_HC
=
LANG
[
'form'
][
'shellmanager'
][
'hiddencolumns'
];
// 数据管理隐藏列
form
.
addItem
(
'shellmanager'
,
{
type
:
"fieldset"
,
label
:
LANG_HC
[
'title'
],
list
:[
{
type
:
"block"
,
list
:
[
{
type
:
"checkbox"
,
label
:
LANG_HC
[
'url'
],
name
:
'hidden_columns[0]'
,
checked
:
display_shellmanager_hiddencolumns
.
indexOf
(
0
)
!=
-
1
,
position
:
"label-right"
,
value
:
1
,
disabled
:
true
},
{
type
:
'newcolumn'
,
offset
:
20
},
{
type
:
"checkbox"
,
label
:
LANG_HC
[
'ip'
],
name
:
'hidden_columns[1]'
,
checked
:
display_shellmanager_hiddencolumns
.
indexOf
(
1
)
!=
-
1
,
position
:
"label-right"
,
value
:
2
},
{
type
:
'newcolumn'
,
offset
:
20
},
{
type
:
"checkbox"
,
label
:
LANG_HC
[
'addr'
],
name
:
'hidden_columns[2]'
,
checked
:
display_shellmanager_hiddencolumns
.
indexOf
(
2
)
!=
-
1
,
position
:
"label-right"
,
value
:
3
},
{
type
:
'newcolumn'
,
offset
:
20
},
{
type
:
"checkbox"
,
label
:
LANG_HC
[
'note'
],
name
:
'hidden_columns[3]'
,
checked
:
display_shellmanager_hiddencolumns
.
indexOf
(
3
)
!=
-
1
,
position
:
"label-right"
,
value
:
4
},
{
type
:
'newcolumn'
,
offset
:
20
},
{
type
:
"checkbox"
,
label
:
LANG_HC
[
'ctime'
],
name
:
'hidden_columns[4]'
,
checked
:
display_shellmanager_hiddencolumns
.
indexOf
(
4
)
!=
-
1
,
position
:
"label-right"
,
value
:
5
},
{
type
:
'newcolumn'
,
offset
:
20
},
{
type
:
"checkbox"
,
label
:
LANG_HC
[
'utime'
],
name
:
'hidden_columns[5]'
,
checked
:
display_shellmanager_hiddencolumns
.
indexOf
(
5
)
!=
-
1
,
position
:
"label-right"
,
value
:
6
}
]}
]
}
);
// 保存
toolbar
.
attachEvent
(
'onClick'
,
(
id
)
=>
{
switch
(
id
){
case
'save'
:
var
_formvals
=
form
.
getValues
();
var
_display_shellmanager_hiddencolumns
=
[];
for
(
var
i
=
0
;
i
<
6
;
i
++
)
{
var
data
=
_formvals
[
'hidden_columns['
+
i
+
']'
];
if
(
data
)
{
_display_shellmanager_hiddencolumns
.
push
(
data
-
1
);
}
}
localStorage
.
setItem
(
'display_shellmanager_hiddencolumns'
,
JSON
.
stringify
(
_display_shellmanager_hiddencolumns
));
toastr
.
success
(
LANG
[
'success'
],
LANG_T
[
'success'
]);
// 重启应用
layer
.
confirm
(
LANG
[
'confirm'
][
'content'
],
{
icon
:
2
,
shift
:
6
,
title
:
LANG
[
'confirm'
][
'title'
]
},
(
_
)
=>
{
location
.
reload
();
});
break
;
}
});
}
}
module
.
exports
=
Display
;
source/modules/settings/index.js
View file @
ce831f7f
...
...
@@ -10,12 +10,13 @@ const About = require('./about');
// const Update = require('./update');
const
Language
=
require
(
'./language'
);
const
AProxy
=
require
(
'./aproxy'
);
const
Display
=
require
(
'./display'
);
class
Settings
{
constructor
()
{
antSword
[
'menubar'
].
reg
(
'settings'
,
this
.
open
.
bind
(
this
));
[
'about'
,
'update'
,
'language'
,
'aproxy'
].
map
((
_
)
=>
{
[
'about'
,
'update'
,
'language'
,
'aproxy'
,
'display'
].
map
((
_
)
=>
{
antSword
[
'menubar'
].
reg
(
`settings-
${
_
}
`
,
this
.
setActive
.
bind
(
this
,
_
));
});
return
this
;
...
...
@@ -42,6 +43,7 @@ class Settings {
this
.
language
=
new
Language
(
sidebar
);
// this.update = new Update(sidebar);
this
.
aproxy
=
new
AProxy
(
sidebar
);
this
.
display
=
new
Display
(
sidebar
);
this
.
cell
=
cell
;
this
.
sidebar
=
sidebar
;
...
...
source/modules/shellmanager/list/grid.js
View file @
ce831f7f
...
...
@@ -31,6 +31,9 @@ class Grid {
grid
.
setInitWidths
(
"200,120,*,*,140,140"
);
grid
.
setColAlign
(
"left,left,left,left,center,center"
);
grid
.
enableMultiselect
(
true
);
// 根据设置隐藏相应的列
const
dis_smhc
=
localStorage
.
hasOwnProperty
(
'display_shellmanager_hiddencolumns'
)
?
JSON
.
parse
(
localStorage
.
display_shellmanager_hiddencolumns
):[];
dis_smhc
.
map
((
_
)
=>
{
grid
.
setColumnHidden
(
_
,
true
)});
// 隐藏右键菜单
grid
.
attachEvent
(
'onRowSelect'
,
bmenu
.
hide
);
...
...
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