Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mmt-errorView
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Christian Maeder
mmt-errorView
Commits
e2d6e534
Commit
e2d6e534
authored
Feb 24, 2015
by
cmaeder
Browse files
Options
Downloads
Patches
Plain Diff
display groups and search table if groups are few
parent
9bc97106
No related branches found
No related tags found
1 merge request
!2
Search all fields and start with an overview by grouping identical short messages
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/resource/static/search.html
+22
-22
22 additions, 22 deletions
src/main/resource/static/search.html
src/main/resource/static/search.js
+7
-5
7 additions, 5 deletions
src/main/resource/static/search.js
with
29 additions
and
27 deletions
src/main/resource/static/search.html
+
22
−
22
View file @
e2d6e534
...
@@ -15,7 +15,25 @@
...
@@ -15,7 +15,25 @@
group by
group by
<select
ng-click=
"group()"
ng-model=
"field"
ng-init=
"columns[shortMsg].long"
<select
ng-click=
"group()"
ng-model=
"field"
ng-init=
"columns[shortMsg].long"
ng-options=
"columns[key].long for key in colProps | filter : '!id'"
></select>
ng-options=
"columns[key].long for key in colProps | filter : '!id'"
></select>
as overview with clickable content
as overview with clickable maximal rows:
<input
type=
"number"
min=
"0"
max=
"10000"
ng-click=
"group()"
ng-model=
"maxGroups"
/>
<table
ng-if=
"groupMode || groups.length <= 10 "
>
<thead>
<tr>
<th>
#
</th>
<th>
{{columns[field].long}} ({{groups.length}} rows)
</th>
</tr>
</thead>
<tbody>
<tr
ng-repeat=
"g in groups"
>
<td>
{{g.count}}
</td>
<td
ng-click=
"columns[field].search = g.content; search()"
style=
"cursor:pointer"
>
{{g.content}}
</td>
</tr>
</tbody>
</table>
<p/>
<p/>
display:
display:
...
@@ -29,17 +47,15 @@
...
@@ -29,17 +47,15 @@
entries).
</p>
entries).
</p>
<button
ng-click=
"clear()"
>
clear filters
</button>
<button
ng-click=
"clear()"
>
clear filters
</button>
<button
ng-click=
"search()"
>
search
</button>
<button
ng-click=
"search()"
>
search
</button>
<span>
maximal entries:
maximal entries:
<input
type=
"number"
min=
"0"
max=
"10000"
ng-model=
"maxNumber"
/>
<input
type=
"number"
min=
"0"
max=
"10000"
ng-model=
"maxNumber"
/>
</span>
<span
ng-show=
"!groupMode"
>
<span
ng-show=
"!groupMode"
>
<span
ng-show=
"number > results.length"
>
{{number}} entries (showing {{results.length}})
</span>
<span
ng-show=
"number > results.length"
>
{{number}} entries (showing {{results.length}})
</span>
<span
ng-show=
"number <= results.length"
>
result: {{results.length}}
</span>
<span
ng-show=
"number <= results.length"
>
result: {{results.length}}
</span>
</span>
</span>
<p/>
<p/>
<table
ng-if=
"!groupMode"
>
<table
ng-if=
"!groupMode
|| groups.length <= 10
"
>
<thead>
<thead>
<tr>
<tr>
<th
ng-repeat=
"key in colProps"
ng-if=
"columns[key].x"
>
<th
ng-repeat=
"key in colProps"
ng-if=
"columns[key].x"
>
...
@@ -64,22 +80,6 @@
...
@@ -64,22 +80,6 @@
</tr>
</tr>
</tbody>
</tbody>
</table>
</table>
<table
ng-if=
"groupMode"
>
<thead>
<tr>
<th>
#
</th>
<th>
{{columns[field].long}} ({{groups.length}} rows)
</th>
</tr>
</thead>
<tbody>
<tr
ng-repeat=
"g in groups"
>
<td>
{{g.count}}
</td>
<td
ng-click=
"columns[field].search = g.content; search()"
style=
"cursor:pointer"
>
{{g.content}}
</td>
</tr>
</tbody>
</table>
</div>
</div>
</body>
</body>
</html>
</html>
This diff is collapsed.
Click to expand it.
src/main/resource/static/search.js
+
7
−
5
View file @
e2d6e534
...
@@ -18,15 +18,16 @@ angular.module('searchApp', []).controller('SearchController',
...
@@ -18,15 +18,16 @@ angular.module('searchApp', []).controller('SearchController',
$scope
.
groups
=
[];
$scope
.
groups
=
[];
$scope
.
number
=
0
;
$scope
.
number
=
0
;
$scope
.
maxNumber
=
100
;
$scope
.
maxNumber
=
100
;
$scope
.
maxGroups
=
6
;
$scope
.
searchText
=
''
;
$scope
.
searchText
=
''
;
$scope
.
groupMode
=
false
;
$scope
.
groupMode
=
false
;
$scope
.
query
=
function
()
{
$scope
.
query
=
function
(
limit
)
{
var
res
=
''
;
var
res
=
''
;
for
(
k
in
$scope
.
columns
)
{
for
(
k
in
$scope
.
columns
)
{
var
str
=
escape
(
$scope
.
columns
[
k
].
search
);
var
str
=
escape
(
$scope
.
columns
[
k
].
search
);
res
=
res
+
'
&
'
+
k
+
"
=
"
+
str
;
res
=
res
+
'
&
'
+
k
+
"
=
"
+
str
;
};
};
return
'
?limit=
'
+
$scope
.
maxNumber
+
res
;
return
'
?limit=
'
+
limit
+
res
;
};
};
$scope
.
clear
=
function
()
{
$scope
.
clear
=
function
()
{
for
(
k
in
$scope
.
columns
)
{
for
(
k
in
$scope
.
columns
)
{
...
@@ -37,22 +38,23 @@ angular.module('searchApp', []).controller('SearchController',
...
@@ -37,22 +38,23 @@ angular.module('searchApp', []).controller('SearchController',
$scope
.
groupMode
=
true
;
$scope
.
groupMode
=
true
;
$scope
.
clear
();
$scope
.
clear
();
$scope
.
columns
[
$scope
.
field
].
x
=
true
;
$scope
.
columns
[
$scope
.
field
].
x
=
true
;
$http
.
get
(
'
/sally/error/group/
'
+
$scope
.
field
+
$scope
.
query
()).
success
(
function
(
data
)
{
$http
.
get
(
'
/sally/error/group/
'
+
$scope
.
field
+
$scope
.
query
(
$scope
.
maxGroups
)).
success
(
function
(
data
)
{
$scope
.
groups
=
data
;
$scope
.
groups
=
data
;
});
});
};
};
$scope
.
search
=
function
()
{
$scope
.
search
=
function
()
{
$scope
.
groupMode
=
false
;
$scope
.
groupMode
=
false
;
$http
.
get
(
'
/sally/error/search2
'
+
$scope
.
query
()).
success
(
function
(
data
)
{
$http
.
get
(
'
/sally/error/search2
'
+
$scope
.
query
(
$scope
.
maxNumber
)).
success
(
function
(
data
)
{
$scope
.
results
=
data
;
$scope
.
results
=
data
;
});
});
$scope
.
count
();
$scope
.
count
();
};
};
$scope
.
count
=
function
()
{
$scope
.
count
=
function
()
{
$http
.
get
(
'
/sally/error/count2
'
+
$scope
.
query
()).
success
(
function
(
data
)
{
$http
.
get
(
'
/sally/error/count2
'
+
$scope
.
query
(
$scope
.
maxNumber
)).
success
(
function
(
data
)
{
$scope
.
number
=
data
[
0
].
count
;
$scope
.
number
=
data
[
0
].
count
;
});
});
};
};
$scope
.
search
();
$scope
.
group
();
$scope
.
group
();
$scope
.
sort
=
{
$scope
.
sort
=
{
col
:
'
id
'
,
col
:
'
id
'
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment