mirror of
https://ghfast.top/https://github.com/discourse/docker_manager.git
synced 2026-05-23 00:04:03 +08:00
gjs, helper invocation case, typos, latest license template, unnecessary tracking, concatClass, unnecessary service injection, new imports, whitespace, pure function helper, htmlSafe calling convention, this. in template, unused vars in ruby, update linting, qunit-dom
25 lines
628 B
Text
25 lines
628 B
Text
import Component from "@glimmer/component";
|
|
import { htmlSafe } from "@ember/template";
|
|
import concatClass from "discourse/helpers/concat-class";
|
|
|
|
export default class ProgressBar extends Component {
|
|
get active() {
|
|
return parseInt(this.args.percent, 10) !== 100;
|
|
}
|
|
|
|
get barStyle() {
|
|
let percent = parseInt(this.args.percent, 10);
|
|
|
|
if (percent > 100) {
|
|
percent = 100;
|
|
}
|
|
|
|
return htmlSafe(`width: ${percent}%`);
|
|
}
|
|
|
|
<template>
|
|
<div class={{concatClass "progress-bar" (if this.active "active")}}>
|
|
<div class="progress-bar-inner" style={{this.barStyle}}></div>
|
|
</div>
|
|
</template>
|
|
}
|