Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Genesys Backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
45
Issues
45
List
Boards
Labels
Service Desk
Milestones
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Genesys PGR
Genesys Backend
Commits
5e6fefa9
Commit
5e6fefa9
authored
Apr 12, 2016
by
Matija Obreza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ES admin buttons moved
parent
d5396e45
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
25 deletions
+21
-25
src/main/java/org/genesys2/server/servlet/controller/admin/ElasticSearchController.java
...ver/servlet/controller/admin/ElasticSearchController.java
+8
-8
src/main/webapp/WEB-INF/jsp/admin/elastic/index.jsp
src/main/webapp/WEB-INF/jsp/admin/elastic/index.jsp
+12
-2
src/main/webapp/WEB-INF/jsp/admin/index.jsp
src/main/webapp/WEB-INF/jsp/admin/index.jsp
+0
-15
src/main/webapp/WEB-INF/jsp/admin/menu.jsp
src/main/webapp/WEB-INF/jsp/admin/menu.jsp
+1
-0
No files found.
src/main/java/org/genesys2/server/servlet/controller/admin/ElasticSearchController.java
View file @
5e6fefa9
...
...
@@ -42,7 +42,7 @@ import java.util.List;
import
java.util.Map
;
@Controller
@RequestMapping
(
"/admin"
)
@RequestMapping
(
"/admin
/elastic
"
)
@PreAuthorize
(
"hasRole('ADMINISTRATOR')"
)
public
class
ElasticSearchController
{
public
static
final
Log
LOG
=
LogFactory
.
getLog
(
ElasticSearchController
.
class
);
...
...
@@ -64,7 +64,7 @@ public class ElasticSearchController {
* @param model
* @return
*/
@RequestMapping
(
"/
elastic
"
)
@RequestMapping
(
"/"
)
public
String
viewIndexesAndAliases
(
Model
model
)
{
ImmutableOpenMap
<
String
,
IndexMetaData
>
indicesImmutableMap
=
client
.
admin
().
cluster
()
.
prepareState
().
execute
()
...
...
@@ -90,10 +90,10 @@ public class ElasticSearchController {
*
* @return
*/
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/
elastic
"
,
params
=
{
"regenerate"
})
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/
action
"
,
params
=
{
"regenerate"
})
public
String
regenerateElastic
()
{
elasticService
.
regenerateIndexes
();
return
"redirect:/admin/"
;
return
"redirect:/admin/
elastic/
"
;
}
/**
...
...
@@ -103,12 +103,12 @@ public class ElasticSearchController {
* @param jsonFilter
* @throws IOException
*/
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/
elastic
"
,
params
=
{
"reindex"
,
"filter"
})
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/
action
"
,
params
=
{
"reindex"
,
"filter"
})
public
String
reindexElasticFiltered
(
@RequestParam
(
value
=
"filter"
,
required
=
true
)
String
jsonFilter
)
throws
IOException
{
FilterHandler
.
AppliedFilters
filters
=
mapper
.
readValue
(
jsonFilter
,
FilterHandler
.
AppliedFilters
.
class
);
elasticService
.
reindex
(
filters
);
return
"redirect:/admin/"
;
return
"redirect:/admin/
elastic/
"
;
}
/**
...
...
@@ -116,9 +116,9 @@ public class ElasticSearchController {
*
* @return
*/
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/
elastic
"
,
params
=
{
"clear-queues"
})
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/
action
"
,
params
=
{
"clear-queues"
})
public
String
clearElasticQueues
()
{
elasticUpdater
.
clearQueues
();
return
"redirect:/admin/"
;
return
"redirect:/admin/
elastic/
"
;
}
}
src/main/webapp/WEB-INF/jsp/admin/elastic/index.jsp
View file @
5e6fefa9
...
...
@@ -9,9 +9,19 @@
<body>
<%@ include
file=
"/WEB-INF/jsp/admin/menu.jsp"
%>
<a
href=
"
<c:url
value=
"/admin/"
/>
"
class=
"btn btn-default"
>
Back
</a>
<form
method=
"post"
action=
"
<c:url
value=
"/admin/elastic/action"
/>
"
>
<input
type=
"hidden"
name=
"${_csrf.parameterName}"
value=
"${_csrf.token}"
/>
<input
type=
"text"
name=
"filter"
placeholder=
"Genesys filter {}"
value=
"{}"
/>
<button
type=
"submit"
class=
"btn btn-default"
name=
"reindex"
>
Reindex
</button>
<button
type=
"submit"
class=
"btn btn-default"
name=
"regenerate"
>
Regenerate
</button>
</form>
<form
method=
"post"
action=
"
<c:url
value=
"/admin/elastic/action"
/>
"
>
<input
type=
"hidden"
name=
"${_csrf.parameterName}"
value=
"${_csrf.token}"
/>
<button
type=
"submit"
class=
"btn btn-default"
name=
"clear-queues"
>
Clear ES update queues
</button>
</form>
<h3>
Indexes and their aliases
</h3>
<h3>
Indexes and their aliases
</h3>
<c:if
test=
"
${
empty
indexes
}
"
>
<h5>
No indexes found.
</h5>
</c:if>
...
...
src/main/webapp/WEB-INF/jsp/admin/index.jsp
View file @
5e6fefa9
...
...
@@ -33,21 +33,6 @@
<input
type=
"hidden"
name=
"${_csrf.parameterName}"
value=
"${_csrf.token}"
/>
</form>
<h3>
Full-text Search
</h3>
<form
method=
"post"
action=
"
<c:url
value=
"/admin/elastic"
/>
"
>
<input
type=
"hidden"
name=
"${_csrf.parameterName}"
value=
"${_csrf.token}"
/>
<input
type=
"text"
name=
"filter"
placeholder=
"Genesys filter {}"
value=
"{}"
/>
<button
type=
"submit"
class=
"btn btn-default"
name=
"reindex"
>
Reindex
</button>
<button
type=
"submit"
class=
"btn btn-default"
name=
"regenerate"
>
Regenerate
</button>
</form>
<form
method=
"post"
action=
"
<c:url
value=
"/admin/elastic"
/>
"
>
<input
type=
"hidden"
name=
"${_csrf.parameterName}"
value=
"${_csrf.token}"
/>
<button
type=
"submit"
class=
"btn btn-default"
name=
"clear-queues"
>
Clear ES update queues
</button>
</form>
<a
href=
"
<c:url
value=
"/admin/elastic"
/>
"
class=
"btn btn-default"
>
Show indexes and aliases
</a>
<h3>
Country data
</h3>
<form
method=
"post"
action=
"
<c:url
value=
"/admin/refreshCountries"
/>
"
>
<input
type=
"submit"
class=
"btn btn-default"
value=
"Refresh country data"
/>
...
...
src/main/webapp/WEB-INF/jsp/admin/menu.jsp
View file @
5e6fefa9
...
...
@@ -6,5 +6,6 @@
><spring:message
code=
"menu.admin.loggers"
/></a>
<a
class=
""
href=
"
<c:url
value=
"/admin/ds2/"
/>
"
><spring:message
code=
"menu.admin.ds2"
/></a>
<a
class=
""
href=
"
<c:url
value=
"/admin/kpi/"
/>
"
><spring:message
code=
"menu.admin.kpi"
/></a>
<a
href=
"
<c:url
value=
"/admin/elastic/"
/>
"
class=
""
>
Elasticsearch
</a>
</div>
</div>
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