Skip to content

Commit a56ae58

Browse files
committed
feat(ui): added loading spinner
1 parent 4bb5dd9 commit a56ae58

2 files changed

Lines changed: 36 additions & 0 deletions

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/**
2+
* @license
3+
* Copyright CERN and copyright holders of ALICE O2. This software is
4+
* distributed under the terms of the GNU General Public License v3 (GPL
5+
* Version 3), copied verbatim in the file "COPYING".
6+
*
7+
* See http://alice-o2.web.cern.ch/license for full licensing information.
8+
*
9+
* In applying this license CERN does not waive the privileges and immunities
10+
* granted to it by virtue of its status as an Intergovernmental Organization
11+
* or submit itself to any jurisdiction.
12+
*/
13+
14+
import { h } from '/js/src/index.js';
15+
16+
/**
17+
* Generic page loading placeholder.
18+
*
19+
* @param {number} size The size of the spinner.
20+
* @return {vnode} The spinner.
21+
*/
22+
const spinner = (size = 10) => h('.w-100.flex-row.justify-center.items-center.absolute-fill', [
23+
h('span.pageLoading', {
24+
style: `font-size: ${size}em;`,
25+
}, h('.atom-spinner', h('.spinner-inner', [
26+
h('.spinner-line'),
27+
h('.spinner-line'),
28+
h('.spinner-line'),
29+
h('.spinner-circle', h('div', '●')),
30+
]))),
31+
]);
32+
33+
export default spinner;

lib/public/views/Logs/Details/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* or submit itself to any jurisdiction.
1212
*/
1313
import { h } from '/js/src/index.js';
14+
import spinner from '../../../components/common/spinner.js';
1415
import PostBox from '../../../components/Post/index.js';
1516

1617
/**
@@ -55,6 +56,8 @@ const logDetailScreen = (model) => {
5556
onclick: () => model.router.go('?page=home'),
5657
}, 'Return to Overview'),
5758
]);
59+
} else {
60+
return spinner();
5861
}
5962
};
6063

0 commit comments

Comments
 (0)