Provide features in dashboard to injection in components
This commit is contained in:
@@ -108,6 +108,7 @@ const subscription = ref({
|
||||
});
|
||||
const config = ref({});
|
||||
const avatarUrl = ref('');
|
||||
const features = ref({});
|
||||
|
||||
function onSidebarClose() {
|
||||
sidebar.value.close();
|
||||
@@ -196,6 +197,7 @@ ProfileModel.onChange(ProfileModel.KEYS.AVATAR, (value) => {
|
||||
});
|
||||
|
||||
provide('subscriptionRequiredDialog', subscriptionRequiredDialog);
|
||||
provide('features', features);
|
||||
|
||||
onMounted(async () => {
|
||||
let [error, result] = await provisionModel.status();
|
||||
@@ -219,6 +221,7 @@ onMounted(async () => {
|
||||
[error, result] = await dashboardModel.config();
|
||||
if (error) return console.error(error);
|
||||
config.value = result;
|
||||
features.value = result.features;
|
||||
|
||||
avatarUrl.value = `https://${config.value.adminFqdn}/api/v1/cloudron/avatar`;
|
||||
window.document.title = result.cloudronName;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup>
|
||||
|
||||
import { ref, useTemplateRef, onMounted, computed } from 'vue';
|
||||
import { ref, useTemplateRef, onMounted, computed, inject } from 'vue';
|
||||
import { Dialog, Button, Icon, FormGroup, SingleSelect, Checkbox, TextInput, ProgressBar } from 'pankow';
|
||||
import { prettyLongDate } from 'pankow/utils';
|
||||
import Section from './Section.vue';
|
||||
@@ -22,7 +22,7 @@ const availableProviders = [
|
||||
];
|
||||
|
||||
const dialog = useTemplateRef('dialog');
|
||||
|
||||
const features = inject('features');
|
||||
const taskLogsMenu = ref([]);
|
||||
const tasks = ref([]);
|
||||
const config = ref({});
|
||||
|
||||
Reference in New Issue
Block a user