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
67da0283
Commit
67da0283
authored
Sep 12, 2015
by
Liang Ding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#12029
parent
bbcde74c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
22 deletions
+45
-22
core/src/main/java/org/b3log/solo/processor/console/AdminConsole.java
...n/java/org/b3log/solo/processor/console/AdminConsole.java
+43
-20
war/src/main/resources/lang_en_US.properties
war/src/main/resources/lang_en_US.properties
+1
-1
war/src/main/resources/lang_zh_CN.properties
war/src/main/resources/lang_zh_CN.properties
+1
-1
No files found.
core/src/main/java/org/b3log/solo/processor/console/AdminConsole.java
View file @
67da0283
...
...
@@ -15,7 +15,7 @@
*/
package
org
.
b3log
.
solo
.
processor
.
console
;
import
com.qiniu.util.Auth
;
import
java.util.Calendar
;
import
java.util.Locale
;
import
java.util.Map
;
...
...
@@ -43,21 +43,22 @@ import org.b3log.latke.servlet.renderer.freemarker.AbstractFreeMarkerRenderer;
import
org.b3log.latke.util.Strings
;
import
org.b3log.solo.SoloServletListener
;
import
org.b3log.solo.model.Common
;
import
org.b3log.solo.model.Option
;
import
org.b3log.solo.model.Preference
;
import
org.b3log.solo.model.Skin
;
import
org.b3log.solo.processor.renderer.ConsoleRenderer
;
import
org.b3log.solo.processor.util.Filler
;
import
org.b3log.solo.service.OptionQueryService
;
import
org.b3log.solo.service.PreferenceQueryService
;
import
org.b3log.solo.service.UserQueryService
;
import
org.b3log.solo.util.Thumbnails
;
import
org.json.JSONObject
;
/**
* Admin console render processing.
*
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.
0.0.7, Jul 11, 2013
* @version 1.
2.0.7, Sep 12, 2015
* @since 0.4.1
*/
@RequestProcessor
...
...
@@ -80,6 +81,12 @@ public class AdminConsole {
@Inject
private
PreferenceQueryService
preferenceQueryService
;
/**
* Option query service.
*/
@Inject
private
OptionQueryService
optionQueryService
;
/**
* User query service.
*/
...
...
@@ -100,7 +107,7 @@ public class AdminConsole {
/**
* Shows administrator index with the specified context.
*
*
* @param request the specified request
* @param context the specified context
*/
...
...
@@ -133,6 +140,22 @@ public class AdminConsole {
dataModel
.
put
(
Common
.
GRAVATAR
,
gravatar
);
try
{
final
JSONObject
qiniu
=
optionQueryService
.
getOptions
(
Option
.
CATEGORY_C_QINIU
);
dataModel
.
put
(
Option
.
ID_C_QINIU_ACCESS_KEY
,
""
);
dataModel
.
put
(
Option
.
ID_C_QINIU_BUCKET
,
""
);
dataModel
.
put
(
Option
.
ID_C_QINIU_DOMAIN
,
""
);
dataModel
.
put
(
Option
.
ID_C_QINIU_SECRET_KEY
,
""
);
if
(
null
!=
qiniu
)
{
final
Auth
auth
=
Auth
.
create
(
qiniu
.
optString
(
Option
.
ID_C_QINIU_ACCESS_KEY
),
qiniu
.
optString
(
Option
.
ID_C_QINIU_SECRET_KEY
));
final
String
uploadToken
=
auth
.
uploadToken
(
qiniu
.
optString
(
Option
.
ID_C_QINIU_BUCKET
));
dataModel
.
put
(
"qiniuUploadToken"
,
uploadToken
);
dataModel
.
put
(
Option
.
ID_C_QINIU_DOMAIN
,
qiniu
.
optString
(
Option
.
ID_C_QINIU_DOMAIN
));
}
final
JSONObject
preference
=
preferenceQueryService
.
getPreference
();
dataModel
.
put
(
Preference
.
LOCALE_STRING
,
preference
.
getString
(
Preference
.
LOCALE_STRING
));
...
...
@@ -158,22 +181,22 @@ public class AdminConsole {
/**
* Shows administrator functions with the specified context.
*
*
* @param request the specified request
* @param context the specified context
*/
@RequestProcessing
(
value
=
{
"/admin-article.do"
,
"/admin-article-list.do"
,
"/admin-comment-list.do"
,
"/admin-link-list.do"
,
"/admin-page-list.do"
,
"/admin-others.do"
,
"/admin-draft-list.do"
,
"/admin-user-list.do"
,
"/admin-plugin-list.do"
,
"/admin-main.do"
,
"/admin-about.do"
},
method
=
HTTPRequestMethod
.
GET
)
@RequestProcessing
(
value
=
{
"/admin-article.do"
,
"/admin-article-list.do"
,
"/admin-comment-list.do"
,
"/admin-link-list.do"
,
"/admin-page-list.do"
,
"/admin-others.do"
,
"/admin-draft-list.do"
,
"/admin-user-list.do"
,
"/admin-plugin-list.do"
,
"/admin-main.do"
,
"/admin-about.do"
},
method
=
HTTPRequestMethod
.
GET
)
public
void
showAdminFunctions
(
final
HttpServletRequest
request
,
final
HTTPRequestContext
context
)
{
final
AbstractFreeMarkerRenderer
renderer
=
new
ConsoleRenderer
();
...
...
@@ -200,7 +223,7 @@ public class AdminConsole {
/**
* Shows administrator preference function with the specified context.
*
*
* @param request the specified request
* @param context the specified context
*/
...
...
@@ -252,7 +275,7 @@ public class AdminConsole {
/**
* Fires FreeMarker action event with the host template name and data model.
*
*
* @param hostTemplateName the specified host template name
* @param dataModel the specified data model
*/
...
...
war/src/main/resources/lang_en_US.properties
View file @
67da0283
...
...
@@ -25,7 +25,7 @@
accessKey1Label
=
Access Key:
secretKey1Label
=
Secret Key:
domain1Label
=
\u
57df
\u
540d:
bucket
Key
1Label
=
Bucket:
bucket1Label
=
Bucket:
qiniuLabel
=
Qiniu
contributorsLabel
=
Contributors
developersLabel
=
Developers
...
...
war/src/main/resources/lang_zh_CN.properties
View file @
67da0283
...
...
@@ -25,7 +25,7 @@
accessKey1Label
=
Access Key
\u
ff1a
secretKey1Label
=
Secret Key
\u
ff1a
domain1Label
=
\u
57df
\u
540d
\u
ff1a
bucket
Key
1Label
=
Bucket
\u
ff1a
bucket1Label
=
Bucket
\u
ff1a
qiniuLabel
=
\u
4e03
\u
725b
contributorsLabel
=
\u
8d21
\u
732e
\u8005
developersLabel
=
\u
5f00
\u
53d1
\u8005
...
...
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