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
09a9f891
Commit
09a9f891
authored
Jun 28, 2016
by
antoor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update clear-cache feature
更新删除缓存功能
parent
620b501e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
8 deletions
+24
-8
cache.js
modules/cache.js
+2
-4
contextmenu.js
source/modules/shellmanager/list/contextmenu.js
+22
-4
No files found.
modules/cache.js
View file @
09a9f891
...
@@ -9,12 +9,10 @@
...
@@ -9,12 +9,10 @@
const
fs
=
require
(
'fs'
),
const
fs
=
require
(
'fs'
),
path
=
require
(
'path'
),
path
=
require
(
'path'
),
CONF
=
require
(
'./config'
),
CONF
=
require
(
'./config'
),
// Logger = require('./logger'),
// logger = null,
// logger = require('log4js').getLogger('Cache'),
Datastore
=
require
(
'nedb'
);
Datastore
=
require
(
'nedb'
);
let
logger
var
logger
;
class
Cache
{
class
Cache
{
/**
/**
...
...
source/modules/shellmanager/list/contextmenu.js
View file @
09a9f891
...
@@ -48,7 +48,7 @@ class ContextMenu {
...
@@ -48,7 +48,7 @@ class ContextMenu {
[
'move'
,
'share-square'
,
selectedMultiData
,
null
,
this
.
parseMoveCategoryMenu
(
ids
)],
[
'move'
,
'share-square'
,
selectedMultiData
,
null
,
this
.
parseMoveCategoryMenu
(
ids
)],
[
'search'
,
'search'
,
true
],
[
'search'
,
'search'
,
true
],
false
,
false
,
[
'clearCache'
,
'trash-o'
,
selected
MultiData
,
this
.
clearCache
.
bind
(
this
,
ids
)],
[
'clearCache'
,
'trash-o'
,
selected
Data
,
this
.
clearCache
.
bind
(
this
,
id
)],
[
'clearAllCache'
,
'trash'
,
false
,
this
.
clearAllCache
.
bind
(
this
)]
[
'clearAllCache'
,
'trash'
,
false
,
this
.
clearAllCache
.
bind
(
this
)]
].
map
((
menu
)
=>
{
].
map
((
menu
)
=>
{
// 分隔符号
// 分隔符号
...
@@ -271,11 +271,29 @@ class ContextMenu {
...
@@ -271,11 +271,29 @@ class ContextMenu {
/**
/**
* 清空缓存
* 清空缓存
* @param {
array} ids [description]
* @param {
number} id ID
* @return {[type]} [description]
* @return {[type]} [description]
*/
*/
clearCache
(
ids
)
{
clearCache
(
id
)
{
layer
.
confirm
(
LANG
[
'list'
][
'clearCache'
][
'confirm'
],
{
icon
:
2
,
shift
:
6
,
title
:
`<i class="fa fa-trash"></i>
${
LANG
[
'list'
][
'clearCache'
][
'title'
]}
`
},
(
_
)
=>
{
layer
.
close
(
_
);
const
ret
=
antSword
[
'ipcRenderer'
].
sendSync
(
'cache-clear'
,
{
id
:
id
});
if
(
ret
===
true
)
{
toastr
.
success
(
LANG
[
'list'
][
'clearCache'
][
'success'
],
LANG_T
[
'success'
]);
}
else
{
toastr
.
error
(
LANG
[
'list'
][
'clearCache'
][
'error'
](
ret
[
'errno'
]
===
-
2
?
'Not cache file.'
:
ret
[
'errno'
]
),
LANG_T
[
'error'
]
);
}
});
}
}
/**
/**
...
...
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