Skip to content

Commit e9faba5

Browse files
committed
add wallboard view
closes codecentric#313
1 parent ce430e2 commit e9faba5

File tree

8 files changed

+514
-23
lines changed

8 files changed

+514
-23
lines changed

spring-boot-admin-server-ui/package-lock.json

Lines changed: 45 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

spring-boot-admin-server-ui/package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"moment": "^2.21.0",
3131
"moment-shortformat": "^2.1.0",
3232
"pretty-bytes": "^4.0.2",
33+
"resize-observer-polyfill": "^1.5.0",
3334
"rxjs": "^5.5.7",
3435
"vue": "^2.5.16",
3536
"vue-clickaway": "^2.1.0",
@@ -50,9 +51,9 @@
5051
"clean-webpack-plugin": "^0.1.19",
5152
"cross-env": "^5.1.4",
5253
"css-hot-loader": "^1.3.8",
53-
"css-loader": "^0.28.10",
54+
"css-loader": "^0.28.11",
5455
"css-mqpacker": "^6.0.2",
55-
"eslint": "^4.18.2",
56+
"eslint": "^4.19.0",
5657
"eslint-loader": "^1.9.0",
5758
"eslint-plugin-html": "^4.0.2",
5859
"eslint-plugin-vue": "^4.3.0",
@@ -66,11 +67,11 @@
6667
"lodash-webpack-plugin": "^0.11.4",
6768
"node-sass": "^4.8.2",
6869
"optimize-css-assets-webpack-plugin": "^3.2.0",
69-
"postcss-loader": "^2.1.1",
70+
"postcss-loader": "^2.1.2",
7071
"sass-loader": "^6.0.7",
7172
"style-loader": "^0.20.3",
7273
"url-loader": "^0.6.2",
73-
"vue-jest": "^2.1.1",
74+
"vue-jest": "^2.2.1",
7475
"vue-loader": "^14.2.1",
7576
"vue-svg-loader": "^0.5.0",
7677
"vue-template-compiler": "^2.5.16",

spring-boot-admin-server-ui/src/main/frontend/assets/css/base.scss

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,24 @@
1818
@import "~bulma/bulma";
1919
@import "~bulma-badge/dist/bulma-badge";
2020

21+
html {
22+
min-height: 100vh;
23+
display: flex;
24+
flex-direction: column;
25+
}
26+
27+
body {
28+
flex-grow: 1;
29+
display: flex;
30+
flex-direction: column;
31+
32+
& > div {
33+
flex-grow: 1;
34+
display: flex;
35+
flex-direction: column;
36+
}
37+
}
38+
2139
.is-breakable {
2240
word-break: break-all;
2341
}
@@ -50,7 +68,6 @@
5068
}
5169
}
5270

53-
5471
//Loading spinner
5572
.section.is-loading,
5673
.content.is-loading {
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
* Copyright 2014-2018 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
import ResizeObserver from 'resize-observer-polyfill';
18+
19+
const observers = new WeakMap();
20+
21+
const bind = (el, binding) => {
22+
unbind(el);
23+
const observer = new ResizeObserver(binding.value);
24+
observer.observe(el);
25+
observers.set(el, observer);
26+
27+
};
28+
29+
const unbind = (el) => {
30+
const observer = observers.get(el);
31+
if (observer) {
32+
observer.disconnect();
33+
observers.delete(el);
34+
}
35+
};
36+
37+
export default {
38+
bind,
39+
update(el, binding) {
40+
if (binding.value === binding.oldValue) {
41+
return
42+
}
43+
bind(el, binding)
44+
},
45+
unbind
46+
}
47+

spring-boot-admin-server-ui/src/main/frontend/views/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {view as aboutView} from './about';
1818
import {view as applicationView} from './applications';
1919
import instanceViews from './instances';
2020
import {view as journalView} from './journal';
21+
import {view as wallboardView} from './wallboard';
2122

2223
export default router => {
2324
const views = [];
@@ -49,9 +50,11 @@ export default router => {
4950
views.register(applicationView);
5051
views.register(journalView);
5152
views.register(aboutView);
53+
views.register(wallboardView);
5254
instanceViews.forEach(views.register);
55+
views.sort((a, b) => a.order - b.order);
5356

5457
router.addRoutes([{path: '/', redirect: {name: 'applications'}}]);
5558

5659
return views;
57-
}
60+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* Copyright 2014-2018 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
import * as hm from './hex-mesh'
18+
19+
describe('calcLayout', () => {
20+
21+
it('should calculate optimum layout for 12 in 1594x879', () => {
22+
const result = hm.calcLayout(12, 1594, 879);
23+
24+
expect(result).toEqual({
25+
rows: 3,
26+
cols: 5,
27+
sidelength: 175.8
28+
});
29+
});
30+
31+
it('should calculate optimum layout for 1 in 100x100', () => {
32+
const result = hm.calcLayout(1, 100, 100);
33+
34+
expect(result).toEqual({
35+
rows: 1,
36+
cols: 1,
37+
sidelength: 50
38+
});
39+
});
40+
41+
});

0 commit comments

Comments
 (0)