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
3af9f1e9
Commit
3af9f1e9
authored
Apr 19, 2016
by
antoor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Repair repeatedly prompted information
修复多次提示信息
parent
a2649f46
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
14 deletions
+26
-14
update.jsx
source/modules/settings/update.jsx
+26
-14
No files found.
source/modules/settings/update.jsx
View file @
3af9f1e9
/
/
// 检查更新
//
/
**
* 检查更新模块
*/
const
LANG
=
antSword
[
'language'
][
'settings'
][
'update'
];
const
LANG_T
=
antSword
[
'language'
][
'toastr'
];
...
...
@@ -13,7 +13,7 @@ class Update {
});
const
cell
=
sidebar
.
cells
(
'update'
);
// toolbar
//
初始化
toolbar
const
toolbar
=
cell
.
attachToolbar
();
toolbar
.
loadStruct
([
{
...
...
@@ -34,24 +34,26 @@ class Update {
}
});
//
status
//
显示当前版本号
cell
.
attachHTMLString
(
`
${
LANG
[
'current'
]}
:
${
antSword
[
'package'
][
'version'
]}
`
);
this
.
cell
=
cell
;
}
// 检查更新
/**
* 检查更新
* @return {None} [description]
*/
checkUpdate
()
{
this
.
cell
.
progressOn
();
toastr
.
info
(
LANG
[
'check'
][
'ing'
],
LANG_T
[
'info'
]);
// 后台检查更新
antSword
[
'ipcRenderer'
]
.
on
(
'update-check'
,
(
event
,
ret
)
=>
{
.
on
ce
(
'update-check'
,
(
event
,
ret
)
=>
{
this
.
cell
.
progressOff
();
cons
t
info
=
ret
[
'retVal'
];
le
t
info
=
ret
[
'retVal'
];
// 木有更新
if
(
!
ret
[
'hasUpdate'
])
{
return
typeof
info
===
'string'
...
...
@@ -89,7 +91,7 @@ class Update {
this
.
updateLoading
();
// 通知后台
antSword
[
'ipcRenderer'
]
.
on
(
'update-download'
,
(
event
,
ret
)
=>
{
.
on
ce
(
'update-download'
,
(
event
,
ret
)
=>
{
// 下载失败
console
.
log
(
ret
);
if
(
!
ret
[
'done'
])
{
...
...
@@ -121,7 +123,10 @@ class Update {
});
}
// 更新动画
/**
* 更新动画进度
* @return {[type]} [description]
*/
updateLoading
()
{
// 删除按钮
$
(
'.layui-layer-btn'
).
remove
();
...
...
@@ -138,7 +143,11 @@ class Update {
`
);
}
// 更新失败提示界面
/**
* 更新失败提示界面
* @param {String} tip 失败信息
* @return {[type]} [description]
*/
updateFail
(
tip
)
{
$
(
'.layui-layer-content'
).
html
(
`
<div align="center" style="color: red">
...
...
@@ -150,7 +159,10 @@ class Update {
setTimeout
(
layer
.
closeAll
,
1024
*
5
);
}
// 更新成功提示界面
/**
* 更新成功提示界面
* @return {None} [description]
*/
updateSuccess
()
{
$
(
'.layui-layer-content'
).
html
(
`
<div align="center" style="color: green">
...
...
@@ -165,4 +177,4 @@ class Update {
}
}
export
default
Update
;
\ No newline at end of file
export
default
Update
;
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