| 1 |
/** @odoo-module */ |
| 2 |
|
| 3 |
import { Component, xml } from "@odoo/owl"; |
| 4 |
|
| 5 |
/** |
| 6 |
* @typedef {{ |
| 7 |
* logs: { error: number, warn: number }; |
| 8 |
* }} HootLogCountersProps |
| 9 |
*/ |
| 10 |
|
| 11 |
/** @extends {Component<HootLogCountersProps, import("../hoot").Environment>} */ |
| 12 |
export class HootLogCounters extends Component { |
| 13 |
static components = {}; |
| 14 |
static props = { |
| 15 |
logs: { |
| 16 |
type: Object, |
| 17 |
shape: { |
| 18 |
error: Number, |
| 19 |
warn: Number, |
| 20 |
}, |
| 21 |
}, |
| 22 |
}; |
| 23 |
static template = xml` |
| 24 |
<t t-if="props.logs.error"> |
| 25 |
<span |
| 26 |
class="flex items-center gap-1 text-rose" |
| 27 |
t-attf-title="{{ props.logs.error }} error log(s) (check the console)" |
| 28 |
> |
| 29 |
<i class="fa fa-times-circle" /> |
| 30 |
<strong t-esc="props.logs.error" /> |
| 31 |
</span> |
| 32 |
</t> |
| 33 |
<t t-if="props.logs.warn"> |
| 34 |
<span |
| 35 |
class="flex items-center gap-1 text-amber" |
| 36 |
t-attf-title="{{ props.logs.warn }} warning log(s) (check the console)" |
| 37 |
> |
| 38 |
<i class="fa fa-exclamation-triangle" /> |
| 39 |
<strong t-esc="props.logs.warn" /> |
| 40 |
</span> |
| 41 |
</t> |
| 42 |
`; |
| 43 |
} |