Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
solo
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
Commits
1134f4d2
Commit
1134f4d2
authored
Jan 23, 2013
by
mainlove
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完成插件配置界面基本流程 后台还需要重新想
parent
9f1636d6
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
136 additions
and
3 deletions
+136
-3
core/src/main/java/org/b3log/solo/processor/console/PluginConsole.java
.../java/org/b3log/solo/processor/console/PluginConsole.java
+43
-0
core/src/main/java/org/b3log/solo/service/PluginQueryService.java
.../main/java/org/b3log/solo/service/PluginQueryService.java
+25
-0
war/src/main/webapp/admin-plugin-setting.ftl
war/src/main/webapp/admin-plugin-setting.ftl
+1
-0
war/src/main/webapp/js/admin/latkeAdmin.js
war/src/main/webapp/js/admin/latkeAdmin.js
+33
-1
war/src/main/webapp/js/admin/latkeAdmin.min.js
war/src/main/webapp/js/admin/latkeAdmin.min.js
+1
-1
war/src/main/webapp/js/admin/plugin.js
war/src/main/webapp/js/admin/plugin.js
+26
-0
war/src/main/webapp/js/admin/pluginList.js
war/src/main/webapp/js/admin/pluginList.js
+7
-1
No files found.
core/src/main/java/org/b3log/solo/processor/console/PluginConsole.java
View file @
1134f4d2
...
@@ -16,13 +16,17 @@
...
@@ -16,13 +16,17 @@
package
org
.
b3log
.
solo
.
processor
.
console
;
package
org
.
b3log
.
solo
.
processor
.
console
;
import
java.util.Map
;
import
java.util.logging.Level
;
import
java.util.logging.Level
;
import
java.util.logging.Logger
;
import
java.util.logging.Logger
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
org.b3log.latke.Keys
;
import
org.b3log.latke.Keys
;
import
org.b3log.latke.Latkes
;
import
org.b3log.latke.Latkes
;
import
org.b3log.latke.model.Plugin
;
import
org.b3log.latke.model.Plugin
;
import
org.b3log.latke.plugin.AbstractPlugin
;
import
org.b3log.latke.service.LangPropsService
;
import
org.b3log.latke.service.LangPropsService
;
import
org.b3log.latke.servlet.HTTPRequestContext
;
import
org.b3log.latke.servlet.HTTPRequestContext
;
import
org.b3log.latke.servlet.HTTPRequestMethod
;
import
org.b3log.latke.servlet.HTTPRequestMethod
;
...
@@ -32,6 +36,7 @@ import org.b3log.latke.servlet.annotation.RequestProcessor;
...
@@ -32,6 +36,7 @@ import org.b3log.latke.servlet.annotation.RequestProcessor;
import
org.b3log.latke.servlet.renderer.JSONRenderer
;
import
org.b3log.latke.servlet.renderer.JSONRenderer
;
import
org.b3log.latke.util.Requests
;
import
org.b3log.latke.util.Requests
;
import
org.b3log.solo.processor.console.common.ProcessAuthAdvice
;
import
org.b3log.solo.processor.console.common.ProcessAuthAdvice
;
import
org.b3log.solo.processor.renderer.ConsoleRenderer
;
import
org.b3log.solo.service.PluginMgmtService
;
import
org.b3log.solo.service.PluginMgmtService
;
import
org.b3log.solo.service.PluginQueryService
;
import
org.b3log.solo.service.PluginQueryService
;
import
org.b3log.solo.util.QueryResults
;
import
org.b3log.solo.util.QueryResults
;
...
@@ -175,4 +180,42 @@ public final class PluginConsole {
...
@@ -175,4 +180,42 @@ public final class PluginConsole {
jsonObject
.
put
(
Keys
.
MSG
,
langPropsService
.
get
(
"getFailLabel"
));
jsonObject
.
put
(
Keys
.
MSG
,
langPropsService
.
get
(
"getFailLabel"
));
}
}
}
}
/**
* get the info of the specified pluginoId,just fot the plugin-setting.
* @param request the specified http servlet request
* @param response the specified http servlet response
* @param context the specified http request context
* @param renderer the specified {@link ConsoleRenderer}
* @throws Exception exception
*/
@RequestProcessing
(
value
=
"/console/plugin/toSetting"
,
method
=
HTTPRequestMethod
.
POST
)
public
void
toSetting
(
final
HttpServletRequest
request
,
final
HttpServletResponse
response
,
final
HTTPRequestContext
context
,
final
ConsoleRenderer
renderer
)
throws
Exception
{
context
.
setRenderer
(
renderer
);
try
{
final
JSONObject
requestJSONObject
=
Requests
.
parseRequestJSONObject
(
request
,
response
);
final
String
pluginoId
=
requestJSONObject
.
getString
(
Keys
.
OBJECT_ID
);
final
AbstractPlugin
result
=
pluginQueryService
.
getPlugin
(
pluginoId
);
renderer
.
setTemplateName
(
"admin-plugin-setting.ftl"
);
final
Map
<
String
,
Object
>
dataModel
=
renderer
.
getDataModel
();
dataModel
.
put
(
Plugin
.
PLUGIN
,
result
);
}
catch
(
final
Exception
e
)
{
LOGGER
.
log
(
Level
.
SEVERE
,
e
.
getMessage
(),
e
);
final
JSONObject
jsonObject
=
QueryResults
.
defaultResult
();
final
JSONRenderer
jsonRenderer
=
new
JSONRenderer
();
jsonRenderer
.
setJSONObject
(
jsonObject
);
jsonObject
.
put
(
Keys
.
MSG
,
langPropsService
.
get
(
"getFailLabel"
));
}
}
}
}
core/src/main/java/org/b3log/solo/service/PluginQueryService.java
View file @
1134f4d2
...
@@ -120,6 +120,31 @@ public final class PluginQueryService {
...
@@ -120,6 +120,31 @@ public final class PluginQueryService {
}
}
}
}
/**
* get the {@link AbstractPlugin} by the specified pluginoId.
*
* @param pluginoId the specified pluginId
* @return the {@link AbstractPlugin}
* @throws ServiceException service exception
*/
public
AbstractPlugin
getPlugin
(
final
String
pluginoId
)
throws
ServiceException
{
final
List
<
AbstractPlugin
>
plugins
=
PluginManager
.
getInstance
().
getPlugins
();
AbstractPlugin
ret
=
null
;
for
(
final
AbstractPlugin
plugin
:
plugins
)
{
if
(
plugin
.
getId
().
equals
(
pluginoId
))
{
ret
=
plugin
;
}
}
if
(
ret
==
null
)
{
LOGGER
.
log
(
Level
.
SEVERE
,
"can not find plugin["
+
pluginoId
+
"]"
);
throw
new
ServiceException
(
"can not find plugin["
+
pluginoId
+
"]"
);
}
return
ret
;
}
/**
/**
* Gets the {@link PluginQueryService} singleton.
* Gets the {@link PluginQueryService} singleton.
*
*
...
...
war/src/main/webapp/admin-plugin-setting.ftl
0 → 100644
View file @
1134f4d2
kkkk
\ No newline at end of file
war/src/main/webapp/js/admin/latkeAdmin.js
View file @
1134f4d2
...
@@ -3053,7 +3053,7 @@ admin.pluginList = {
...
@@ -3053,7 +3053,7 @@ admin.pluginList = {
}
}
datas
[
i
].
expendRow
+=
"
</a>
"
;
datas
[
i
].
expendRow
+=
"
</a>
"
;
datas
[
i
].
expendRow
+=
"
<a href='javascript:void(0)'>
"
+
Label
.
settingLabel
+
"
</a>
"
;
datas
[
i
].
expendRow
+=
"
<a href='javascript:void(0)'
onclick=
\"
admin.plugin.toSetting('
"
+
datas
[
i
].
oId
+
"
')
\"
>
"
+
Label
.
settingLabel
+
"
</a>
"
;
}
}
that
.
tablePagination
.
updateTablePagination
(
result
.
plugins
,
pageNum
,
result
.
pagination
);
that
.
tablePagination
.
updateTablePagination
(
result
.
plugins
,
pageNum
,
result
.
pagination
);
...
@@ -3063,6 +3063,10 @@ admin.pluginList = {
...
@@ -3063,6 +3063,10 @@ admin.pluginList = {
});
});
},
},
toSetting
:
function
(
pluginId
){
},
changeStatus
:
function
(
pluginId
,
status
)
{
changeStatus
:
function
(
pluginId
,
status
)
{
if
(
status
===
"
ENABLED
"
)
{
if
(
status
===
"
ENABLED
"
)
{
status
=
"
DISABLED
"
;
status
=
"
DISABLED
"
;
...
@@ -3092,6 +3096,8 @@ admin.pluginList = {
...
@@ -3092,6 +3096,8 @@ admin.pluginList = {
}
}
});
});
}
}
};
};
/*
/*
...
@@ -3614,6 +3620,32 @@ admin.plugin = {
...
@@ -3614,6 +3620,32 @@ admin.plugin = {
}
}
},
},
toSetting
:
function
(
pluginId
){
var
requestJSONObject
=
{
"
oId
"
:
pluginId
};
$
.
ajax
({
url
:
latkeConfig
.
servePath
+
"
/console/plugin/toSetting
"
,
type
:
"
POST
"
,
cache
:
false
,
data
:
JSON
.
stringify
(
requestJSONObject
),
success
:
function
(
result
,
textStatus
){
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#tipMsg
"
).
text
(
result
.
msg
);
if
(
!
result
.
sc
)
{
$
(
"
#loadMsg
"
).
text
(
""
);
return
;
}
//where to put the id?
$
(
"
#PluginSetting
"
).
dialog
(
"
open
"
);
$
(
"
#loadMsg
"
).
text
(
""
);
}
});
},
/*
/*
* 根据当前 hash 初始化或刷新插件
* 根据当前 hash 初始化或刷新插件
*/
*/
...
...
war/src/main/webapp/js/admin/latkeAdmin.min.js
View file @
1134f4d2
This source diff could not be displayed because it is too large. You can
view the blob
instead.
war/src/main/webapp/js/admin/plugin.js
View file @
1134f4d2
...
@@ -39,6 +39,32 @@ admin.plugin = {
...
@@ -39,6 +39,32 @@ admin.plugin = {
}
}
},
},
toSetting
:
function
(
pluginId
){
var
requestJSONObject
=
{
"
oId
"
:
pluginId
};
$
.
ajax
({
url
:
latkeConfig
.
servePath
+
"
/console/plugin/toSetting
"
,
type
:
"
POST
"
,
cache
:
false
,
data
:
JSON
.
stringify
(
requestJSONObject
),
success
:
function
(
result
,
textStatus
){
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#tipMsg
"
).
text
(
result
.
msg
);
if
(
!
result
.
sc
)
{
$
(
"
#loadMsg
"
).
text
(
""
);
return
;
}
//where to put the id?
$
(
"
#PluginSetting
"
).
dialog
(
"
open
"
);
$
(
"
#loadMsg
"
).
text
(
""
);
}
});
},
/*
/*
* 根据当前 hash 初始化或刷新插件
* 根据当前 hash 初始化或刷新插件
*/
*/
...
...
war/src/main/webapp/js/admin/pluginList.js
View file @
1134f4d2
...
@@ -92,7 +92,7 @@ admin.pluginList = {
...
@@ -92,7 +92,7 @@ admin.pluginList = {
}
}
datas
[
i
].
expendRow
+=
"
</a>
"
;
datas
[
i
].
expendRow
+=
"
</a>
"
;
datas
[
i
].
expendRow
+=
"
<a href='javascript:void(0)'>
"
+
Label
.
settingLabel
+
"
</a>
"
;
datas
[
i
].
expendRow
+=
"
<a href='javascript:void(0)'
onclick=
\"
admin.plugin.toSetting('
"
+
datas
[
i
].
oId
+
"
')
\"
>
"
+
Label
.
settingLabel
+
"
</a>
"
;
}
}
that
.
tablePagination
.
updateTablePagination
(
result
.
plugins
,
pageNum
,
result
.
pagination
);
that
.
tablePagination
.
updateTablePagination
(
result
.
plugins
,
pageNum
,
result
.
pagination
);
...
@@ -102,6 +102,10 @@ admin.pluginList = {
...
@@ -102,6 +102,10 @@ admin.pluginList = {
});
});
},
},
toSetting
:
function
(
pluginId
){
},
changeStatus
:
function
(
pluginId
,
status
)
{
changeStatus
:
function
(
pluginId
,
status
)
{
if
(
status
===
"
ENABLED
"
)
{
if
(
status
===
"
ENABLED
"
)
{
status
=
"
DISABLED
"
;
status
=
"
DISABLED
"
;
...
@@ -131,6 +135,8 @@ admin.pluginList = {
...
@@ -131,6 +135,8 @@ admin.pluginList = {
}
}
});
});
}
}
};
};
/*
/*
...
...
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