mirror of https://github.com/lissy93/dashy
Merge 51002b4033
into 931915f366
This commit is contained in:
commit
8d0f68a327
|
@ -34,7 +34,6 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
// Import form elements, icons and utils
|
||||
import ErrorHandler from '@/utils/ErrorHandler';
|
||||
import Button from '@/components/FormElements/Button';
|
||||
import UpdateIcon from '@/assets/interface-icons/widget-update.svg';
|
||||
|
@ -125,7 +124,6 @@ const COMPAT = {
|
|||
export default {
|
||||
name: 'Widget',
|
||||
components: {
|
||||
// Register form elements
|
||||
Button,
|
||||
UpdateIcon,
|
||||
OpenIcon,
|
||||
|
@ -173,6 +171,7 @@ export default {
|
|||
return this.widget.hideControls;
|
||||
},
|
||||
component() {
|
||||
this.appendUserCustomComponents();
|
||||
const type = COMPAT[this.widgetType] || this.widget.type;
|
||||
if (!type) {
|
||||
ErrorHandler('Widget type was not found');
|
||||
|
@ -201,6 +200,15 @@ export default {
|
|||
setLoaderState(loading) {
|
||||
this.loading = loading;
|
||||
},
|
||||
/* If user has specified custom widgets, append them to list */
|
||||
appendUserCustomComponents() {
|
||||
const customWidgets = this.appConfig?.customWidgets;
|
||||
if (customWidgets && Array.isArray(customWidgets)) {
|
||||
customWidgets.forEach((widget) => {
|
||||
COMPAT[widget.identifier] = widget.component;
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue