-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
72 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
|
||
.dashboard { | ||
.SharpDashboardPage { | ||
.row+.row { | ||
margin-top: 1rem; | ||
.SharpGrid > * { | ||
margin-bottom: 1rem; | ||
&:last-child { | ||
margin-bottom: 0; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,60 @@ | ||
<template> | ||
<div> | ||
<h2 class="SharpWidget__title mb-3"> | ||
{{ title }} | ||
</h2> | ||
<template v-if="title"> | ||
<h2 class="SharpWidget__title mb-2"> | ||
{{ title }} | ||
</h2> | ||
</template> | ||
<div class="d-flex align-items-center"> | ||
<p class="display-4 fw-bold mb-0" :style="{ color: value.data.color }"> | ||
<p class="display-5 fw-bold mb-0" :style="{ color: value.data.color }"> | ||
{{ value.data.figure }} | ||
<template v-if="value.data.unit"> | ||
<span class="fs-4 fw-normal">{{ value.data.unit }}</span> | ||
<span class="fs-5 fw-normal">{{ value.data.unit }}</span> | ||
</template> | ||
</p> | ||
<template v-if="value.data.evolution"> | ||
<div class="ms-3" :class="value.data.evolution.increase ? 'text-success' : 'text-danger'"> | ||
<div class="d-flex align-items-center ms-3" | ||
:style="{ color: value.data.evolution.increase ? '#198754' : '#dc3545' }" | ||
> | ||
<template v-if="value.data.evolution.increase"> | ||
↑ | ||
<!-- heroicons: 20/solid/arrow-up --> | ||
<svg width="20" height="20" viewBox="0 0 20 20" fill="currentColor"> | ||
<path fill-rule="evenodd" d="M10 17a.75.75 0 01-.75-.75V5.612L5.29 9.77a.75.75 0 01-1.08-1.04l5.25-5.5a.75.75 0 011.08 0l5.25 5.5a.75.75 0 11-1.08 1.04l-3.96-4.158V16.25A.75.75 0 0110 17z" clip-rule="evenodd" /> | ||
</svg> | ||
</template> | ||
<template v-else> | ||
↓ | ||
<!-- heroicons: 20/solid/arrow-down --> | ||
<svg width="20" height="20" viewBox="0 0 20 20" fill="currentColor"> | ||
<path fill-rule="evenodd" d="M10 3a.75.75 0 01.75.75v10.638l3.96-4.158a.75.75 0 111.08 1.04l-5.25 5.5a.75.75 0 01-1.08 0l-5.25-5.5a.75.75 0 111.08-1.04l3.96 4.158V3.75A.75.75 0 0110 3z" clip-rule="evenodd" /> | ||
</svg> | ||
</template> | ||
{{ value.data.evolution.value }} | ||
<span class="ms-1"> | ||
{{ value.data.evolution.value }} | ||
</span> | ||
</div> | ||
</template> | ||
</div> | ||
<template v-if="link"> | ||
<div class="text-start mt-2"> | ||
See details | ||
<a :href="link"> | ||
{{ lang('dashboard.widget.link_label') }} | ||
</a> | ||
</div> | ||
</template> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import { lang } from "sharp"; | ||
export default { | ||
props: { | ||
title: String, | ||
link: String, | ||
value: Object, | ||
} | ||
}, | ||
methods: { | ||
lang, | ||
}, | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,39 @@ | ||
<template> | ||
<div class="SharpWidgetPanel"> | ||
<template v-if="title"> | ||
<h2 class="SharpWidget__title mb-2"> | ||
{{ title }} | ||
</h2> | ||
</template> | ||
<TemplateRenderer name="WidgetPanel" :template="template" :template-data="value.data" /> | ||
<template v-if="link"> | ||
<a class="stretched-link" :href="link"> | ||
<span class="visually-hidden"> | ||
{{ lang('dashboard.widget.link_label') }} | ||
</span> | ||
</a> | ||
</template> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import { TemplateRenderer } from 'sharp/components'; | ||
import { lang } from "sharp"; | ||
export default { | ||
name:'SharpWidgetPanel', | ||
name: 'SharpWidgetPanel', | ||
inheritAttrs: false, | ||
components: { | ||
TemplateRenderer | ||
}, | ||
props: { | ||
value: Object, | ||
title: String, | ||
template: String, | ||
} | ||
link: String, | ||
}, | ||
methods: { | ||
lang, | ||
}, | ||
} | ||
</script> | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ | |
|
||
return [ | ||
'commands.dashboard.label' => 'Actions', | ||
'widget.link_label' => 'See details', | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ | |
|
||
return [ | ||
'commands.dashboard.label' => 'Actions', | ||
'widget.link_label' => 'See details', | ||
]; |