Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
solo-1
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Administrator
solo-1
Commits
5171aeac
Unverified
Commit
5171aeac
authored
Dec 15, 2019
by
Liang Ding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🎨
#13
parent
26e2872d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
13 deletions
+11
-13
src/main/java/org/b3log/solo/model/Option.java
src/main/java/org/b3log/solo/model/Option.java
+1
-1
src/main/java/org/b3log/solo/service/CronMgmtService.java
src/main/java/org/b3log/solo/service/CronMgmtService.java
+1
-1
src/main/java/org/b3log/solo/service/ExportService.java
src/main/java/org/b3log/solo/service/ExportService.java
+5
-7
src/main/resources/lang_en_US.properties
src/main/resources/lang_en_US.properties
+2
-2
src/main/resources/lang_zh_CN.properties
src/main/resources/lang_zh_CN.properties
+2
-2
No files found.
src/main/java/org/b3log/solo/model/Option.java
View file @
5171aeac
...
...
@@ -58,7 +58,7 @@ public final class Option {
public
static
final
String
ID_C_HLJS_THEME
=
"hljsTheme"
;
/**
* Key of enable
sync (push) GitHub. 导出文章到仓库
https://hacpai.com/article/1557238327458
* Key of enable
backup public articles to HacPai. 备份公开文章到社区
https://hacpai.com/article/1557238327458
*/
public
static
final
String
ID_C_SYNC_GITHUB
=
"syncGitHub"
;
...
...
src/main/java/org/b3log/solo/service/CronMgmtService.java
View file @
5171aeac
...
...
@@ -108,7 +108,7 @@ public class CronMgmtService {
SCHEDULED_EXECUTOR_SERVICE
.
scheduleAtFixedRate
(()
->
{
try
{
exportService
.
export
GitHubRepo
();
exportService
.
export
HacPai
();
}
catch
(
final
Exception
e
)
{
LOGGER
.
log
(
Level
.
ERROR
,
"Executes cron failed"
,
e
);
}
finally
{
...
...
src/main/java/org/b3log/solo/service/ExportService.java
View file @
5171aeac
...
...
@@ -259,10 +259,10 @@ public class ExportService {
}
/**
* Exports public articles to admin's
GitHub repos. 博文定时同步 GitHub 仓库 https://hacpai.com/article/1557238327458
* Exports public articles to admin's
HacPai account.
*/
public
void
export
GitHubRepo
()
{
LOGGER
.
log
(
Level
.
INFO
,
"
Github repo syncing
...."
);
public
void
export
HacPai
()
{
LOGGER
.
log
(
Level
.
INFO
,
"
Backup public articles to HacPai
...."
);
try
{
final
JSONObject
preference
=
optionQueryService
.
getPreference
();
if
(
null
==
preference
)
{
...
...
@@ -384,11 +384,9 @@ public class ExportService {
"file"
,
zipData
).
send
();
response
.
close
();
response
.
charset
(
"UTF-8"
);
LOGGER
.
info
(
"
Github repo sync
completed: "
+
response
.
bodyText
());
LOGGER
.
info
(
"
Backup public articles to HacPai
completed: "
+
response
.
bodyText
());
}
catch
(
final
Exception
e
)
{
LOGGER
.
log
(
Level
.
ERROR
,
"Exports articles to github repo failed"
,
e
);
}
finally
{
LOGGER
.
log
(
Level
.
INFO
,
"Github repo synced"
);
LOGGER
.
log
(
Level
.
ERROR
,
"Exports articles to github repo failed:"
+
e
.
getMessage
());
}
}
...
...
src/main/resources/lang_en_US.properties
View file @
5171aeac
...
...
@@ -29,8 +29,8 @@ configSiteLabel=Go to the site link to configure GitHub, Twitter, etc.
hljsThemeLabel
=
hljs theme:
tocLabel
=
ToC
removeUnusedArchivesLabel
=
Remove Unused Archives
syncGitHubLabel
=
<a href="https://hacpai.com/article/1557238327458" target="_blank">
Allow sync GitHub repo
</a>:
pullGitHubLabel
=
<a href="https://hacpai.com/article/1557238327458" target="_blank">Allow
pull GitHub repo
</a>:
syncGitHubLabel
=
<a href="https://hacpai.com/article/1557238327458" target="_blank">
Backup public articles to HacPai
</a>:
pullGitHubLabel
=
<a href="https://hacpai.com/article/1557238327458" target="_blank">Allow
to pull GitHub repositories
</a>:
queryUserFailedLabel
=
Query user info failed
commentContentLabel
=
Content
cancelLabel
=
Cancel
...
...
src/main/resources/lang_zh_CN.properties
View file @
5171aeac
...
...
@@ -29,8 +29,8 @@ configSiteLabel=\u524D\u5F80\u914D\u7F6E GitHub\uFF0CTwitter \u7B49\u7AD9\u70B9\
hljsThemeLabel
=
\u
4EE3
\u7801\u
9AD8
\u
4EAE
\u
4E3B
\u9898\u
FF1A
tocLabel
=
\u
76EE
\u
5F55
removeUnusedArchivesLabel
=
\u
79FB
\u9664\u
672A
\u
4F7F
\u7528\u
5B58
\u6863
syncGitHubLabel
=
<a href="https://hacpai.com/article/1557238327458" target="_blank">
\u5
141\u
8BB8
\u
540C
\u
6B65 GitHub
\u
4ED3
\u
5E93
</a>
\u
FF1A
pullGitHubLabel
=
<a href="https://hacpai.com/article/1557238327458" target="_blank">
\u
5141\u
8BB8
\u
62C9
\u
53D6 GitHub
\u
4ED3
\u
5E93
</a>
\u
FF1A
syncGitHubLabel
=
<a href="https://hacpai.com/article/1557238327458" target="_blank">
\u5
907\u
4EFD
\u
516C
\u
5F00
\u6587\u
7AE0
\u5230\u
793E
\u
533A
</a>
\u
FF1A
pullGitHubLabel
=
<a href="https://hacpai.com/article/1557238327458" target="_blank">
\u
62C9
\u
53D6 GitHub
\u
4ED3
\u
5E93
\u
4FE1
\u
606F
</a>
\u
FF1A
queryUserFailedLabel
=
\u
67E5
\u
8BE2
\u7528\u6237\u
4FE1
\u
606F
\u5931\u
8D25
commentContentLabel
=
\u
8BC4
\u
8BBA
\u5185\u
5BB9
cancelLabel
=
\u
53D6
\u
6D88
...
...
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