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
011b3a53
Unverified
Commit
011b3a53
authored
Aug 18, 2019
by
Liang Ding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🎨
#12825
parent
c7c00323
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
104 additions
and
3 deletions
+104
-3
src/main/java/org/b3log/solo/processor/console/PreferenceConsole.java
...a/org/b3log/solo/processor/console/PreferenceConsole.java
+2
-0
src/main/java/org/b3log/solo/upgrade/V363_364.java
src/main/java/org/b3log/solo/upgrade/V363_364.java
+89
-0
src/main/resources/lang_en_US.properties
src/main/resources/lang_en_US.properties
+2
-1
src/main/resources/lang_zh_CN.properties
src/main/resources/lang_zh_CN.properties
+2
-1
src/main/webapp/admin/admin-preference.ftl
src/main/webapp/admin/admin-preference.ftl
+6
-0
src/main/webapp/js/admin/preference.js
src/main/webapp/js/admin/preference.js
+3
-1
No files found.
src/main/java/org/b3log/solo/processor/console/PreferenceConsole.java
View file @
011b3a53
...
@@ -163,6 +163,7 @@ public class PreferenceConsole {
...
@@ -163,6 +163,7 @@ public class PreferenceConsole {
* "feedOutputCnt": int,
* "feedOutputCnt": int,
* "faviconURL": "",
* "faviconURL": "",
* "syncGitHub": boolean,
* "syncGitHub": boolean,
* "pullGitHub": boolean,
* "customVars" "", // 支持配置自定义参数 https://github.com/b3log/solo/issues/12535
* "customVars" "", // 支持配置自定义参数 https://github.com/b3log/solo/issues/12535
* }
* }
* }
* }
...
@@ -240,6 +241,7 @@ public class PreferenceConsole {
...
@@ -240,6 +241,7 @@ public class PreferenceConsole {
* "feedOutputCnt": int,
* "feedOutputCnt": int,
* "faviconURL": "",
* "faviconURL": "",
* "syncGitHub": boolean,
* "syncGitHub": boolean,
* "pullGitHub": boolean,
* "customVars" "", // 支持配置自定义参数 https://github.com/b3log/solo/issues/12535
* "customVars" "", // 支持配置自定义参数 https://github.com/b3log/solo/issues/12535
* }
* }
* }
* }
...
...
src/main/java/org/b3log/solo/upgrade/V363_364.java
0 → 100644
View file @
011b3a53
/*
* Solo - A small and beautiful blogging system written in Java.
* Copyright (c) 2010-present, b3log.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package
org
.
b3log
.
solo
.
upgrade
;
import
org.apache.commons.lang.StringUtils
;
import
org.b3log.latke.Keys
;
import
org.b3log.latke.ioc.BeanManager
;
import
org.b3log.latke.logging.Level
;
import
org.b3log.latke.logging.Logger
;
import
org.b3log.latke.repository.Query
;
import
org.b3log.latke.repository.Transaction
;
import
org.b3log.solo.model.Article
;
import
org.b3log.solo.model.Option
;
import
org.b3log.solo.repository.ArticleRepository
;
import
org.b3log.solo.repository.OptionRepository
;
import
org.b3log.solo.util.Images
;
import
org.json.JSONObject
;
import
java.util.List
;
/**
* Upgrade script from v3.6.3 to v3.6.4.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.0.0, Aug 18, 2019
* @since 3.6.4
*/
public
final
class
V363_364
{
/**
* Logger.
*/
private
static
final
Logger
LOGGER
=
Logger
.
getLogger
(
V363_364
.
class
);
/**
* Performs upgrade from v3.6.3 to v3.6.4.
*
* @throws Exception upgrade fails
*/
public
static
void
perform
()
throws
Exception
{
final
String
fromVer
=
"3.6.3"
;
final
String
toVer
=
"3.6.4"
;
LOGGER
.
log
(
Level
.
INFO
,
"Upgrading from version ["
+
fromVer
+
"] to version ["
+
toVer
+
"]...."
);
final
BeanManager
beanManager
=
BeanManager
.
getInstance
();
final
OptionRepository
optionRepository
=
beanManager
.
getReference
(
OptionRepository
.
class
);
try
{
final
Transaction
transaction
=
optionRepository
.
beginTransaction
();
final
JSONObject
versionOpt
=
optionRepository
.
get
(
Option
.
ID_C_VERSION
);
versionOpt
.
put
(
Option
.
OPTION_VALUE
,
toVer
);
optionRepository
.
update
(
Option
.
ID_C_VERSION
,
versionOpt
);
JSONObject
pullGitHubOpt
=
optionRepository
.
get
(
Option
.
ID_C_PULL_GITHUB
);
if
(
null
==
pullGitHubOpt
)
{
pullGitHubOpt
=
new
JSONObject
();
pullGitHubOpt
.
put
(
Keys
.
OBJECT_ID
,
Option
.
ID_C_PULL_GITHUB
);
pullGitHubOpt
.
put
(
Option
.
OPTION_CATEGORY
,
Option
.
CATEGORY_C_PREFERENCE
);
pullGitHubOpt
.
put
(
Option
.
OPTION_VALUE
,
Option
.
DefaultPreference
.
DEFAULT_PULL_GITHUB
);
optionRepository
.
add
(
pullGitHubOpt
);
}
transaction
.
commit
();
LOGGER
.
log
(
Level
.
INFO
,
"Upgraded from version ["
+
fromVer
+
"] to version ["
+
toVer
+
"] successfully"
);
}
catch
(
final
Exception
e
)
{
LOGGER
.
log
(
Level
.
ERROR
,
"Upgrade failed!"
,
e
);
throw
new
Exception
(
"Upgrade failed from version ["
+
fromVer
+
"] to version ["
+
toVer
+
"]"
);
}
}
}
src/main/resources/lang_en_US.properties
View file @
011b3a53
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
#
#
# Description: Solo language configurations(en_US).
# Description: Solo language configurations(en_US).
# Version: 2.3
3.0.3, May 29
, 2019
# Version: 2.3
4.0.0, Aug 18
, 2019
# Author: Liang Ding
# Author: Liang Ding
# Author: Liyuan Li
# Author: Liyuan Li
# Author: Dongxu Wang
# Author: Dongxu Wang
...
@@ -31,6 +31,7 @@ hljsThemeLabel=hljs theme:
...
@@ -31,6 +31,7 @@ hljsThemeLabel=hljs theme:
tocLabel
=
ToC
tocLabel
=
ToC
removeUnusedArchivesLabel
=
Remove Unused Archives
removeUnusedArchivesLabel
=
Remove Unused Archives
syncGitHubLabel
=
<a href="https://hacpai.com/article/1557238327458" target="_blank">Allow sync GitHub repo</a>:
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>:
queryUserFailedLabel
=
Query user info failed
queryUserFailedLabel
=
Query user info failed
commentContentLabel
=
Content
commentContentLabel
=
Content
cancelLabel
=
Cancel
cancelLabel
=
Cancel
...
...
src/main/resources/lang_zh_CN.properties
View file @
011b3a53
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
#
#
# Description: Solo default language configurations(zh_CN).
# Description: Solo default language configurations(zh_CN).
# Version: 2.3
3.0.3, May 29
, 2019
# Version: 2.3
4.0.0, Aug 18
, 2019
# Author: Liang Ding
# Author: Liang Ding
# Author: Liyuan Li
# Author: Liyuan Li
# Author: Dongxu Wang
# Author: Dongxu Wang
...
@@ -31,6 +31,7 @@ hljsThemeLabel=\u4EE3\u7801\u9AD8\u4EAE\u4E3B\u9898\uFF1A
...
@@ -31,6 +31,7 @@ hljsThemeLabel=\u4EE3\u7801\u9AD8\u4EAE\u4E3B\u9898\uFF1A
tocLabel
=
\u
76EE
\u
5F55
tocLabel
=
\u
76EE
\u
5F55
removeUnusedArchivesLabel
=
\u
79FB
\u9664\u
672A
\u
4F7F
\u7528\u
5B58
\u6863
removeUnusedArchivesLabel
=
\u
79FB
\u9664\u
672A
\u
4F7F
\u7528\u
5B58
\u6863
syncGitHubLabel
=
<a href="https://hacpai.com/article/1557238327458" target="_blank">
\u5141\u
8BB8
\u
540C
\u
6B65 GitHub
\u
4ED3
\u
5E93</a>
\u
FF1A
syncGitHubLabel
=
<a href="https://hacpai.com/article/1557238327458" target="_blank">
\u5141\u
8BB8
\u
540C
\u
6B65 GitHub
\u
4ED3
\u
5E93</a>
\u
FF1A
pullGitHubLabel
=
<a href="https://hacpai.com/article/1557238327458" target="_blank">
\u5141\u
8BB8
\u
62C9
\u
53D6 GitHub
\u
4ED3
\u
5E93</a>
\u
FF1A
queryUserFailedLabel
=
\u
67E5
\u
8BE2
\u7528\u6237\u
4FE1
\u
606F
\u5931\u
8D25
queryUserFailedLabel
=
\u
67E5
\u
8BE2
\u7528\u6237\u
4FE1
\u
606F
\u5931\u
8D25
commentContentLabel
=
\u
8BC4
\u
8BBA
\u5185\u
5BB9
commentContentLabel
=
\u
8BC4
\u
8BBA
\u5185\u
5BB9
cancelLabel
=
\u
53D6
\u
6D88
cancelLabel
=
\u
53D6
\u
6D88
...
...
src/main/webapp/admin/admin-preference.ftl
View file @
011b3a53
...
@@ -229,6 +229,12 @@
...
@@ -229,6 +229,12 @@
<input id="syncGitHub" type="checkbox" class="normalInput"/>
<input id="syncGitHub" type="checkbox" class="normalInput"/>
</div>
</div>
</label>
</label>
<label>
<div class="fn__flex-inline">
${pullGitHubLabel}
<input id="pullGitHub" type="checkbox" class="normalInput"/>
</div>
</label>
<button class="fn__right" onclick="admin.preference.update()">${updateLabel}</button>
<button class="fn__right" onclick="admin.preference.update()">${updateLabel}</button>
<div class="fn__clear"></div>
<div class="fn__clear"></div>
</div>
</div>
...
...
src/main/webapp/js/admin/preference.js
View file @
011b3a53
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
*
*
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.3.0.
2, Mar 19
, 2019
* @version 1.3.0.
3, Aug 18
, 2019
*/
*/
/* preference 相关操作 */
/* preference 相关操作 */
...
@@ -76,6 +76,7 @@ admin.preference = {
...
@@ -76,6 +76,7 @@ admin.preference = {
'
true
'
===
preference
.
allowVisitDraftViaPermalink
?
$
(
'
#allowVisitDraftViaPermalink
'
).
attr
(
'
checked
'
,
'
checked
'
)
:
$
(
'
allowVisitDraftViaPermalink
'
).
removeAttr
(
'
checked
'
)
'
true
'
===
preference
.
allowVisitDraftViaPermalink
?
$
(
'
#allowVisitDraftViaPermalink
'
).
attr
(
'
checked
'
,
'
checked
'
)
:
$
(
'
allowVisitDraftViaPermalink
'
).
removeAttr
(
'
checked
'
)
'
true
'
===
preference
.
commentable
?
$
(
'
#commentable
'
).
attr
(
'
checked
'
,
'
checked
'
)
:
$
(
'
commentable
'
).
removeAttr
(
'
checked
'
)
'
true
'
===
preference
.
commentable
?
$
(
'
#commentable
'
).
attr
(
'
checked
'
,
'
checked
'
)
:
$
(
'
commentable
'
).
removeAttr
(
'
checked
'
)
'
true
'
===
preference
.
syncGitHub
?
$
(
'
#syncGitHub
'
).
attr
(
'
checked
'
,
'
checked
'
)
:
$
(
'
syncGitHub
'
).
removeAttr
(
'
checked
'
)
'
true
'
===
preference
.
syncGitHub
?
$
(
'
#syncGitHub
'
).
attr
(
'
checked
'
,
'
checked
'
)
:
$
(
'
syncGitHub
'
).
removeAttr
(
'
checked
'
)
'
true
'
===
preference
.
pullGitHub
?
$
(
'
#pullGitHub
'
).
attr
(
'
checked
'
,
'
checked
'
)
:
$
(
'
pullGitHub
'
).
removeAttr
(
'
checked
'
)
admin
.
preference
.
locale
=
preference
.
localeString
admin
.
preference
.
locale
=
preference
.
localeString
...
@@ -224,6 +225,7 @@ admin.preference = {
...
@@ -224,6 +225,7 @@ admin.preference = {
'
feedOutputCnt
'
:
$
(
'
#feedOutputCnt
'
).
val
(),
'
feedOutputCnt
'
:
$
(
'
#feedOutputCnt
'
).
val
(),
'
faviconURL
'
:
$
(
'
#faviconURL
'
).
val
(),
'
faviconURL
'
:
$
(
'
#faviconURL
'
).
val
(),
'
syncGitHub
'
:
$
(
'
#syncGitHub
'
).
prop
(
'
checked
'
),
'
syncGitHub
'
:
$
(
'
#syncGitHub
'
).
prop
(
'
checked
'
),
'
pullGitHub
'
:
$
(
'
#pullGitHub
'
).
prop
(
'
checked
'
),
'
commentable
'
:
$
(
'
#commentable
'
).
prop
(
'
checked
'
),
'
commentable
'
:
$
(
'
#commentable
'
).
prop
(
'
checked
'
),
'
customVars
'
:
$
(
'
#customVars
'
).
val
(),
'
customVars
'
:
$
(
'
#customVars
'
).
val
(),
},
},
...
...
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