Skip to content

Commit

Permalink
Just updating for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
akadlec committed Nov 6, 2023
1 parent aa012c6 commit 815ba68
Show file tree
Hide file tree
Showing 7 changed files with 1,440 additions and 949 deletions.
86 changes: 5 additions & 81 deletions assets/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,35 +64,14 @@
</template>

<script lang="ts">
import { computed, inject, onBeforeMount, onBeforeUnmount, onMounted, ref, watch } from 'vue';
import { inject, onBeforeMount, onBeforeUnmount, onMounted, ref } from 'vue';
import { useRouter } from 'vue-router';
import { useMeta } from 'vue-meta';
import get from 'lodash/get';
import { FbSizeTypes, FbUiLoadingBox } from '@fastybird/web-ui-library';
import { useWsExchangeClient } from '@fastybird/ws-exchange-plugin';
import {
useSession,
SettingsAccountModal,
SettingsPasswordModal,
useEmails,
useIdentities,
useRoles,
useAccount,
useAccounts,
} from '@fastybird/accounts-module';
import {
useChannelControls,
useChannelProperties,
useChannels,
useConnectorControls,
useConnectorProperties,
useConnectors,
useDeviceControls,
useDeviceProperties,
useDevices,
} from '@fastybird/devices-module';
import { useWampV1Client } from '@fastybird/vue-wamp-v1';
import { useSession, SettingsAccountModal, SettingsPasswordModal } from '@fastybird/accounts-module';
import { AppSidebar } from '@/components';
import { eventBusInjectionKey } from '@/plugins';
Expand All @@ -118,36 +97,14 @@ export default {
setup(): any {
const router = useRouter();
const sessionStore = useSession();
const wampV1Client = useWsExchangeClient();
const wampV1Client = useWampV1Client();
const eventBus = inject(eventBusInjectionKey);
const loadingOverlay = ref<boolean>(false);
const activeView = ref<ViewTypes>(ViewTypes.NONE);
const menuCollapsed = ref<boolean>(true);
const stores = computed<any[]>(() => {
return [
// Accounts module
useSession(),
useAccount(),
useAccounts(),
useEmails(),
useIdentities(),
useRoles(),
// Devices module
useChannels(),
useChannelControls(),
useChannelProperties(),
useConnectors(),
useConnectorControls(),
useConnectorProperties(),
useDevices(),
useDeviceControls(),
useDeviceProperties(),
];
});
// Processing timer
let overlayTimer: number;
Expand Down Expand Up @@ -197,26 +154,6 @@ export default {
menuCollapsed.value = !menuCollapsed.value;
};
const onWsMessage = (data: string): void => {
const body = JSON.parse(data);
if (
Object.prototype.hasOwnProperty.call(body, 'routing_key') &&
Object.prototype.hasOwnProperty.call(body, 'source') &&
Object.prototype.hasOwnProperty.call(body, 'data')
) {
stores.value.forEach((store) => {
if (Object.prototype.hasOwnProperty.call(store, 'socketData')) {
store.socketData({
source: get(body, 'source'),
routingKey: get(body, 'routing_key'),
data: JSON.stringify(get(body, 'data')),
});
}
});
}
};
onBeforeMount((): void => {
eventBus?.on('loadingOverlay', overlayLoadingListener);
eventBus?.on('userSigned', userSignStatusListener);
Expand All @@ -233,17 +170,6 @@ export default {
eventBus?.off('userSigned', userSignStatusListener);
});
watch(
(): boolean => wampV1Client.status.value,
(status): void => {
if (status) {
wampV1Client.client.subscribe('/io/exchange', onWsMessage);
} else {
wampV1Client.client.unsubscribe('/io/exchange', onWsMessage);
}
}
);
useMeta({
title: 'IoT control',
meta: [
Expand Down Expand Up @@ -283,8 +209,6 @@ export default {
sizeTypes: FbSizeTypes,
viewTypes: ViewTypes,
stores,
};
},
};
Expand Down
6 changes: 3 additions & 3 deletions assets/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { createPinia } from 'pinia';
import { createMetaManager, plugin as metaPlugin } from 'vue-meta';
import toast from 'vue-toastification';
import get from 'lodash/get';
import { createWsExchangeClient } from '@fastybird/ws-exchange-plugin';
import { createWampV1Client } from '@fastybird/vue-wamp-v1';

import { version } from './../package.json';

Expand All @@ -30,8 +30,8 @@ app.use(createMetaManager());
app.use(metaPlugin);
app.use(createPinia());
app.use(toast);
app.use(createWsExchangeClient(), {
wsuri: 'ws://localhost:3000/ws-exchange',
app.use(createWampV1Client(), {
host: 'ws://localhost:3000/ws-exchange',
debug: true,
});

Expand Down
13 changes: 8 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,21 @@
"extra": {
"enable-patching": false,
"patches": {
"nettrine/orm": {
"Enable connection overrides": "https://raw.githubusercontent.com/FastyBird/libraries-patches/master/nettrine-orm-src-managerregistry-php.patch"
},
"react/event-loop": {
"Bug: Use native return type": "https://raw.githubusercontent.com/FastyBird/libraries-patches/master/react-event-loop-src-loop-php.patch"
"dg/bypass-finals": {
"Bug: mkdir check": "https://raw.githubusercontent.com/FastyBird/libraries-patches/master/dg-bypass-finals-src-nativewrapper-php.patch"
},
"doctrine/orm": {
"Bug: Ramsey uuid not working - Part 1": "https://raw.githubusercontent.com/FastyBird/libraries-patches/master/doctrine-orm-lib-doctrine-orm-persisters-entity-basicentitypersister-php.patch",
"Bug: Ramsey uuid not working - Part 2": "https://raw.githubusercontent.com/FastyBird/libraries-patches/master/doctrine-orm-lib-doctrine-orm-persisters-entity-joinedsubclasspersister-php.patch"
},
"nettrine/orm": {
"Enable connection overrides": "https://raw.githubusercontent.com/FastyBird/libraries-patches/master/nettrine-orm-src-managerregistry-php.patch"
},
"ramsey/uuid-doctrine": {
"Bug: Ramsey uuid conversion fallback": "https://raw.githubusercontent.com/FastyBird/libraries-patches/master/ramsey-uuid-doctrine-src-uuidbinarytype-php.patch"
},
"react/event-loop": {
"Bug: Use native return type": "https://raw.githubusercontent.com/FastyBird/libraries-patches/master/react-event-loop-src-loop-php.patch"
}
}
},
Expand Down
Loading

0 comments on commit 815ba68

Please sign in to comment.