@icvdeveloper/common-module 0.0.122 → 0.0.124
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/dist/module.json +1 -1
- package/dist/runtime/assets/svg/answer.svg +14 -14
- package/dist/runtime/assets/svg/avatar.svg +1 -1
- package/dist/runtime/assets/svg/bell-icon.svg +3 -3
- package/dist/runtime/assets/svg/checkmark-icon.svg +1 -1
- package/dist/runtime/assets/svg/close-icon.svg +1 -1
- package/dist/runtime/assets/svg/icon-avatar.svg +1 -1
- package/dist/runtime/assets/svg/icon-chevron.svg +4 -4
- package/dist/runtime/assets/svg/icon-circle-plus.svg +1 -1
- package/dist/runtime/assets/svg/icon-close.svg +1 -1
- package/dist/runtime/assets/svg/icon-info.svg +2 -2
- package/dist/runtime/assets/svg/icon-new-window.svg +11 -11
- package/dist/runtime/assets/svg/icon-offline.svg +3 -3
- package/dist/runtime/assets/svg/icon-online.svg +3 -3
- package/dist/runtime/assets/svg/icon-person.svg +2 -2
- package/dist/runtime/assets/svg/icon-play.svg +2 -2
- package/dist/runtime/assets/svg/icon-star-filled.svg +29 -29
- package/dist/runtime/assets/svg/icon-star.svg +24 -24
- package/dist/runtime/assets/svg/icon-video-chat.svg +14 -14
- package/dist/runtime/assets/svg/icon-website.svg +2 -2
- package/dist/runtime/assets/svg/icon-zoom.svg +10 -10
- package/dist/runtime/assets/svg/notification-icon.svg +32 -32
- package/dist/runtime/assets/svg/offline-icon.svg +1 -1
- package/dist/runtime/assets/svg/online-icon.svg +3 -3
- package/dist/runtime/assets/svg/peer2peer.svg +3 -3
- package/dist/runtime/assets/svg/phone.svg +1 -1
- package/dist/runtime/assets/svg/plus-icon.svg +1 -1
- package/dist/runtime/assets/svg/red-icon.svg +3 -3
- package/dist/runtime/assets/svg/reject.svg +14 -14
- package/dist/runtime/assets/svg/search-icon.svg +3 -3
- package/dist/runtime/components/affiliates/AffiliatePage.vue +17 -17
- package/dist/runtime/components/agenda/AgendaList.vue +259 -259
- package/dist/runtime/components/agenda/AgendaTabbed.vue +305 -305
- package/dist/runtime/components/agenda/components/AgendaListAccordion.vue +67 -67
- package/dist/runtime/components/agenda/components/Calendar.vue +67 -67
- package/dist/runtime/components/agenda/components/InfoLink.vue +56 -56
- package/dist/runtime/components/agenda/components/PlayIcon.vue +49 -49
- package/dist/runtime/components/agenda/components/PresentationLink.vue +137 -137
- package/dist/runtime/components/agenda/components/Sponsor.vue +132 -132
- package/dist/runtime/components/auth/LoginFullWidth.vue +78 -78
- package/dist/runtime/components/auth/PasswordReset.vue +60 -60
- package/dist/runtime/components/auth/Registration.vue +27 -27
- package/dist/runtime/components/auth/Ucc.vue +129 -129
- package/dist/runtime/components/core/Accordion.vue +97 -97
- package/dist/runtime/components/core/CountdownTimer.vue +336 -336
- package/dist/runtime/components/core/DynamicHtml.vue +1 -1
- package/dist/runtime/components/core/Modal.vue +111 -111
- package/dist/runtime/components/core/Navbar.vue +154 -154
- package/dist/runtime/components/core/SvgIcon.vue +157 -157
- package/dist/runtime/components/core/ZoomModal.vue +37 -37
- package/dist/runtime/components/events/EventHeader.vue +133 -133
- package/dist/runtime/components/events/ListEvents.vue +554 -554
- package/dist/runtime/components/forms/AlertBox.vue +21 -21
- package/dist/runtime/components/forms/ErrorField.vue +17 -17
- package/dist/runtime/components/forms/Message.vue +27 -27
- package/dist/runtime/components/forms/SearchInput.vue +38 -38
- package/dist/runtime/components/forms/SupportForm.vue +112 -112
- package/dist/runtime/components/forms/SwitchInput.vue +42 -42
- package/dist/runtime/components/forms/TextArea.vue +26 -26
- package/dist/runtime/components/forms/TextInput.vue +28 -28
- package/dist/runtime/components/layouts/Accordion.vue +78 -78
- package/dist/runtime/components/media/ArchivePlayerAndContentContainer.vue +160 -160
- package/dist/runtime/components/media/ArchiveVideoPlayer.vue +186 -186
- package/dist/runtime/components/media/PlayerAndContentContainer.vue +178 -178
- package/dist/runtime/components/media/WebcastVideoPlayer.vue +140 -172
- package/dist/runtime/components/media/components/AgendaPanel.vue +43 -43
- package/dist/runtime/components/media/components/ArchiveMediaContainer.vue +91 -91
- package/dist/runtime/components/media/components/CeCreditNotification.vue +95 -95
- package/dist/runtime/components/media/components/ContentAccordion.vue +63 -63
- package/dist/runtime/components/media/components/ContentArea.vue +158 -158
- package/dist/runtime/components/media/components/ContentTabs.vue +231 -231
- package/dist/runtime/components/media/components/DocumentsPanel.vue +31 -31
- package/dist/runtime/components/media/components/JsonApi.vue +31 -31
- package/dist/runtime/components/media/components/MediaContainer.vue +63 -63
- package/dist/runtime/components/media/components/OverviewPanel.vue +52 -52
- package/dist/runtime/components/media/components/PresentersPanel.vue +52 -52
- package/dist/runtime/components/media/components/SessionReporting.vue +101 -95
- package/dist/runtime/components/media/components/SponsorsPanel.vue +71 -71
- package/dist/runtime/components/media/components/WindowContent.vue +92 -92
- package/dist/runtime/components/media/components/WindowSlide.vue +72 -72
- package/dist/runtime/components/presenters/PresenterListing.vue +164 -164
- package/dist/runtime/components/presenters/PresenterModal.vue +223 -223
- package/dist/runtime/components/profile/Profile.vue +149 -149
- package/dist/runtime/components/profile/components/Sidebar.vue +27 -27
- package/dist/runtime/components/profile/components/SidebarNavItem.vue +39 -39
- package/dist/runtime/components/profile/tabs/Favorites.vue +21 -21
- package/dist/runtime/components/profile/tabs/GeneralInformation.vue +122 -122
- package/dist/runtime/components/profile/tabs/ProfileImage.vue +75 -75
- package/dist/runtime/components/support/FAQAccordion.vue +140 -140
- package/dist/runtime/composables/useUcc.mjs +0 -14
- package/dist/runtime/store/auth.mjs +0 -3
- package/package.json +1 -1
- package/dist/runtime/components/media/components/SessionReporting.vue.d.ts +0 -35
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { ref, toRefs } from "vue";
|
|
3
|
-
import { Conference, Presentation } from "../../../models/conference";
|
|
4
|
-
import {
|
|
5
|
-
MediaContainerClassObj,
|
|
6
|
-
MediaContainerCompObj,
|
|
7
|
-
WebcastPlayerClassObj,
|
|
8
|
-
} from "../../../@types/components";
|
|
9
|
-
import { useStream } from "../../../composables/useStream";
|
|
10
|
-
import { useClassBinding } from "../../../composables/useClassBinding";
|
|
11
|
-
import { useRuntimeConfig } from "#app";
|
|
12
|
-
|
|
13
|
-
const config = useRuntimeConfig();
|
|
14
|
-
|
|
15
|
-
type Props = {
|
|
16
|
-
webcastConference: Conference;
|
|
17
|
-
classObject?: MediaContainerClassObj;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
const props = withDefaults(defineProps<Props>(), {
|
|
21
|
-
classObject: () => {
|
|
22
|
-
return {
|
|
23
|
-
container: "",
|
|
24
|
-
components: ref<MediaContainerCompObj>({
|
|
25
|
-
webcastPlayer: ref<WebcastPlayerClassObj>({}),
|
|
26
|
-
}),
|
|
27
|
-
};
|
|
28
|
-
},
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
const { webcastConference } = toRefs(props);
|
|
32
|
-
|
|
33
|
-
const { classBinding } = useClassBinding();
|
|
34
|
-
|
|
35
|
-
// emits
|
|
36
|
-
const emit = defineEmits<{
|
|
37
|
-
(event: string, value: Presentation): void;
|
|
38
|
-
}>();
|
|
39
|
-
|
|
40
|
-
console.log(
|
|
41
|
-
config.public.awsDefaultRegion + ", " + config.public.resourcePrefix
|
|
42
|
-
);
|
|
43
|
-
|
|
44
|
-
const { currentStreamData, currentPresentation } = useStream(
|
|
45
|
-
config.public.awsDefaultRegion,
|
|
46
|
-
config.public.resourcePrefix,
|
|
47
|
-
Number(webcastConference.value.id),
|
|
48
|
-
emit
|
|
49
|
-
);
|
|
50
|
-
</script>
|
|
51
|
-
|
|
52
|
-
<template>
|
|
53
|
-
<div :class="classBinding(classObject, 'container', 'media-container')">
|
|
54
|
-
<CommonWebcastVideoPlayer
|
|
55
|
-
ref="mediaPlayer"
|
|
56
|
-
:stream="currentStreamData"
|
|
57
|
-
:presentation="currentPresentation"
|
|
58
|
-
:class-object="classObject.components.webcastPlayer"
|
|
59
|
-
></CommonWebcastVideoPlayer>
|
|
60
|
-
</div>
|
|
61
|
-
</template>
|
|
62
|
-
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { ref, toRefs } from "vue";
|
|
3
|
+
import { Conference, Presentation } from "../../../models/conference";
|
|
4
|
+
import {
|
|
5
|
+
MediaContainerClassObj,
|
|
6
|
+
MediaContainerCompObj,
|
|
7
|
+
WebcastPlayerClassObj,
|
|
8
|
+
} from "../../../@types/components";
|
|
9
|
+
import { useStream } from "../../../composables/useStream";
|
|
10
|
+
import { useClassBinding } from "../../../composables/useClassBinding";
|
|
11
|
+
import { useRuntimeConfig } from "#app";
|
|
12
|
+
|
|
13
|
+
const config = useRuntimeConfig();
|
|
14
|
+
|
|
15
|
+
type Props = {
|
|
16
|
+
webcastConference: Conference;
|
|
17
|
+
classObject?: MediaContainerClassObj;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
21
|
+
classObject: () => {
|
|
22
|
+
return {
|
|
23
|
+
container: "",
|
|
24
|
+
components: ref<MediaContainerCompObj>({
|
|
25
|
+
webcastPlayer: ref<WebcastPlayerClassObj>({}),
|
|
26
|
+
}),
|
|
27
|
+
};
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const { webcastConference } = toRefs(props);
|
|
32
|
+
|
|
33
|
+
const { classBinding } = useClassBinding();
|
|
34
|
+
|
|
35
|
+
// emits
|
|
36
|
+
const emit = defineEmits<{
|
|
37
|
+
(event: string, value: Presentation): void;
|
|
38
|
+
}>();
|
|
39
|
+
|
|
40
|
+
console.log(
|
|
41
|
+
config.public.awsDefaultRegion + ", " + config.public.resourcePrefix
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
const { currentStreamData, currentPresentation } = useStream(
|
|
45
|
+
config.public.awsDefaultRegion,
|
|
46
|
+
config.public.resourcePrefix,
|
|
47
|
+
Number(webcastConference.value.id),
|
|
48
|
+
emit
|
|
49
|
+
);
|
|
50
|
+
</script>
|
|
51
|
+
|
|
52
|
+
<template>
|
|
53
|
+
<div :class="classBinding(classObject, 'container', 'media-container')">
|
|
54
|
+
<CommonWebcastVideoPlayer
|
|
55
|
+
ref="mediaPlayer"
|
|
56
|
+
:stream="currentStreamData"
|
|
57
|
+
:presentation="currentPresentation"
|
|
58
|
+
:class-object="classObject.components.webcastPlayer"
|
|
59
|
+
></CommonWebcastVideoPlayer>
|
|
60
|
+
</div>
|
|
61
|
+
</template>
|
|
62
|
+
|
|
63
63
|
<style scoped>
|
|
64
64
|
.media-container {
|
|
65
65
|
display: grid;
|
|
@@ -105,4 +105,4 @@ const { currentStreamData, currentPresentation } = useStream(
|
|
|
105
105
|
opacity: 0.7;
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
|
-
</style>
|
|
108
|
+
</style>
|
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { toRefs, computed } from "vue";
|
|
3
|
-
import { Presentation } from "../../../models/conference";
|
|
4
|
-
import { OverviewPanelClassObj } from "../../../@types/components";
|
|
5
|
-
import { useClassBinding } from "../../../composables/useClassBinding";
|
|
6
|
-
type Props = {
|
|
7
|
-
presentation: Presentation;
|
|
8
|
-
classObject?: OverviewPanelClassObj;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
const props = withDefaults(defineProps<Props>(), {
|
|
12
|
-
classObject: () => {
|
|
13
|
-
return {
|
|
14
|
-
container: "",
|
|
15
|
-
htmlElement: "",
|
|
16
|
-
noOverviewElement: "",
|
|
17
|
-
};
|
|
18
|
-
},
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
const { presentation } = toRefs(props);
|
|
22
|
-
|
|
23
|
-
const { classBinding } = useClassBinding();
|
|
24
|
-
|
|
25
|
-
// computed
|
|
26
|
-
const sessionOverview = computed((): string | null => {
|
|
27
|
-
return presentation.value.description ? presentation.value.description : null;
|
|
28
|
-
});
|
|
29
|
-
</script>
|
|
30
|
-
|
|
31
|
-
<template>
|
|
32
|
-
<div
|
|
33
|
-
:class="
|
|
34
|
-
classBinding(
|
|
35
|
-
classObject,
|
|
36
|
-
'container',
|
|
37
|
-
'text-grey-800 px-2 py-4 text-base leading-normal font-light'
|
|
38
|
-
)
|
|
39
|
-
"
|
|
40
|
-
>
|
|
41
|
-
<span
|
|
42
|
-
v-if="sessionOverview"
|
|
43
|
-
:class="classBinding(classObject, 'htmlElement', '')"
|
|
44
|
-
v-html="sessionOverview"
|
|
45
|
-
></span>
|
|
46
|
-
<p v-else :class="classBinding(classObject, 'noOverviewElement', '')">
|
|
47
|
-
There is no overview for this presentation.
|
|
48
|
-
</p>
|
|
49
|
-
</div>
|
|
50
|
-
</template>
|
|
51
|
-
|
|
52
|
-
<style scoped></style>
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { toRefs, computed } from "vue";
|
|
3
|
+
import { Presentation } from "../../../models/conference";
|
|
4
|
+
import { OverviewPanelClassObj } from "../../../@types/components";
|
|
5
|
+
import { useClassBinding } from "../../../composables/useClassBinding";
|
|
6
|
+
type Props = {
|
|
7
|
+
presentation: Presentation;
|
|
8
|
+
classObject?: OverviewPanelClassObj;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
12
|
+
classObject: () => {
|
|
13
|
+
return {
|
|
14
|
+
container: "",
|
|
15
|
+
htmlElement: "",
|
|
16
|
+
noOverviewElement: "",
|
|
17
|
+
};
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
const { presentation } = toRefs(props);
|
|
22
|
+
|
|
23
|
+
const { classBinding } = useClassBinding();
|
|
24
|
+
|
|
25
|
+
// computed
|
|
26
|
+
const sessionOverview = computed((): string | null => {
|
|
27
|
+
return presentation.value.description ? presentation.value.description : null;
|
|
28
|
+
});
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<template>
|
|
32
|
+
<div
|
|
33
|
+
:class="
|
|
34
|
+
classBinding(
|
|
35
|
+
classObject,
|
|
36
|
+
'container',
|
|
37
|
+
'text-grey-800 px-2 py-4 text-base leading-normal font-light'
|
|
38
|
+
)
|
|
39
|
+
"
|
|
40
|
+
>
|
|
41
|
+
<span
|
|
42
|
+
v-if="sessionOverview"
|
|
43
|
+
:class="classBinding(classObject, 'htmlElement', '')"
|
|
44
|
+
v-html="sessionOverview"
|
|
45
|
+
></span>
|
|
46
|
+
<p v-else :class="classBinding(classObject, 'noOverviewElement', '')">
|
|
47
|
+
There is no overview for this presentation.
|
|
48
|
+
</p>
|
|
49
|
+
</div>
|
|
50
|
+
</template>
|
|
51
|
+
|
|
52
|
+
<style scoped></style>
|
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<span v-if="presenterLevelArray['presenters_all'].presenters.length > 0">
|
|
3
|
-
<presenters-detail
|
|
4
|
-
:presenters-by-level="presenterLevelArray"
|
|
5
|
-
:pres-format="layoutFormat"
|
|
6
|
-
:item-width="itemWidth"
|
|
7
|
-
:show-levels="false"
|
|
8
|
-
:is-compact="isCompact"
|
|
9
|
-
></presenters-detail>
|
|
10
|
-
</span>
|
|
11
|
-
<div v-else class="text-grey-800 px-2 py-4">
|
|
12
|
-
<p class="text-base leading-normal font-light">There are no presenters associated with this presentation.</p>
|
|
13
|
-
</div>
|
|
14
|
-
</template>
|
|
15
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<span v-if="presenterLevelArray['presenters_all'].presenters.length > 0">
|
|
3
|
+
<presenters-detail
|
|
4
|
+
:presenters-by-level="presenterLevelArray"
|
|
5
|
+
:pres-format="layoutFormat"
|
|
6
|
+
:item-width="itemWidth"
|
|
7
|
+
:show-levels="false"
|
|
8
|
+
:is-compact="isCompact"
|
|
9
|
+
></presenters-detail>
|
|
10
|
+
</span>
|
|
11
|
+
<div v-else class="text-grey-800 px-2 py-4">
|
|
12
|
+
<p class="text-base leading-normal font-light">There are no presenters associated with this presentation.</p>
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
16
|
<script>
|
|
17
|
-
import PresentersDetail from '@/components/presenters/PresentersDetail';
|
|
18
|
-
|
|
19
|
-
export default {
|
|
20
|
-
props: {
|
|
21
|
-
itemWidth: {
|
|
22
|
-
type: String,
|
|
23
|
-
default: '120'
|
|
24
|
-
},
|
|
25
|
-
layoutFormat: {
|
|
26
|
-
type: String,
|
|
27
|
-
default: 'PresenterItemGrid'
|
|
28
|
-
},
|
|
29
|
-
isCompact: {
|
|
30
|
-
default: true,
|
|
31
|
-
type: Boolean
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
components: {
|
|
35
|
-
PresentersDetail
|
|
36
|
-
},
|
|
37
|
-
provide() {
|
|
38
|
-
return {
|
|
39
|
-
itemWidth: this.itemWidth,
|
|
40
|
-
imageStyle: this.imageStyle,
|
|
41
|
-
};
|
|
42
|
-
},
|
|
43
|
-
computed: {
|
|
44
|
-
presenterLevelArray() {
|
|
45
|
-
let returnArray = [];
|
|
46
|
-
returnArray['presenters_all'] = { 'presenters': _.sortBy(this.$parent.currentPresentation.presenters, function (presenter) {
|
|
47
|
-
return presenter.pivot.order;
|
|
48
|
-
}) };
|
|
49
|
-
return returnArray;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
17
|
+
import PresentersDetail from '@/components/presenters/PresentersDetail';
|
|
18
|
+
|
|
19
|
+
export default {
|
|
20
|
+
props: {
|
|
21
|
+
itemWidth: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: '120'
|
|
24
|
+
},
|
|
25
|
+
layoutFormat: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: 'PresenterItemGrid'
|
|
28
|
+
},
|
|
29
|
+
isCompact: {
|
|
30
|
+
default: true,
|
|
31
|
+
type: Boolean
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
components: {
|
|
35
|
+
PresentersDetail
|
|
36
|
+
},
|
|
37
|
+
provide() {
|
|
38
|
+
return {
|
|
39
|
+
itemWidth: this.itemWidth,
|
|
40
|
+
imageStyle: this.imageStyle,
|
|
41
|
+
};
|
|
42
|
+
},
|
|
43
|
+
computed: {
|
|
44
|
+
presenterLevelArray() {
|
|
45
|
+
let returnArray = [];
|
|
46
|
+
returnArray['presenters_all'] = { 'presenters': _.sortBy(this.$parent.currentPresentation.presenters, function (presenter) {
|
|
47
|
+
return presenter.pivot.order;
|
|
48
|
+
}) };
|
|
49
|
+
return returnArray;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
52
|
};
|
|
53
|
-
</script>
|
|
54
|
-
|
|
53
|
+
</script>
|
|
54
|
+
|
|
55
55
|
<style scoped>
|
|
56
56
|
.presenter-grid {
|
|
57
57
|
display: grid;
|
|
@@ -1,96 +1,102 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
},
|
|
17
|
-
props: {
|
|
18
|
-
loggableType: {
|
|
19
|
-
type: String,
|
|
20
|
-
default: "App\\Presentation"
|
|
21
|
-
},
|
|
22
|
-
loggableId: {
|
|
23
|
-
type: Number
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
watch: {
|
|
27
|
-
loggableId(_newId, _oldId) {
|
|
28
|
-
this.updateSession();
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
methods: {
|
|
32
|
-
getSessionIdFromCookie() {
|
|
33
|
-
return (this.sessionId = cookies.get(this.sessionCookieName));
|
|
34
|
-
},
|
|
35
|
-
initSessionLoop() {
|
|
36
|
-
this.sessionLoop();
|
|
37
|
-
this.sessionLoopId = setInterval(
|
|
38
|
-
this.sessionLoop,
|
|
39
|
-
parseInt(this.sessionLoopIntervalMinutes * 60 * 1000)
|
|
40
|
-
);
|
|
41
|
-
},
|
|
42
|
-
sessionLoop() {
|
|
43
|
-
if (this.getSessionIdFromCookie()) {
|
|
44
|
-
this.updateSession();
|
|
45
|
-
} else {
|
|
46
|
-
this.initSession();
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
updateSessionCookie() {
|
|
50
|
-
let expireDate = new Date(
|
|
51
|
-
new Date().getTime() + this.cookieExpireMinutes * 60 * 1000
|
|
52
|
-
);
|
|
53
|
-
|
|
54
|
-
cookies.set(this.sessionCookieName, this.sessionId, {
|
|
55
|
-
expires: expireDate
|
|
56
|
-
});
|
|
57
|
-
},
|
|
58
|
-
initSession() {
|
|
59
|
-
this.$axios.$post("session-logs", {}).then(response => {
|
|
60
|
-
this.sessionId = response;
|
|
61
|
-
this.updateSession();
|
|
62
|
-
});
|
|
63
|
-
},
|
|
64
|
-
updateSession() {
|
|
65
|
-
if (!this.sessionId || !this.loggableType || !this.loggableId) {
|
|
66
|
-
return false;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
this.updateSessionCookie();
|
|
70
|
-
|
|
71
|
-
let inputs = {
|
|
72
|
-
_method: "PATCH",
|
|
73
|
-
resource_type: this.loggableType,
|
|
74
|
-
resource_id: this.loggableId
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
this.$axios
|
|
78
|
-
.$post(`session-logs/${this.sessionId}`, inputs)
|
|
79
|
-
.then(response => {
|
|
80
|
-
console.log("updateSession", response);
|
|
81
|
-
})
|
|
82
|
-
.catch(error => {
|
|
83
|
-
console.log("Error updating session-log", error);
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
mounted() {
|
|
88
|
-
console.log("SessionReporting component mounted");
|
|
89
|
-
this.initSessionLoop();
|
|
90
|
-
},
|
|
91
|
-
beforeRouteLeave(to, from, next) {
|
|
92
|
-
clearInterval(this.sessionLoopId);
|
|
93
|
-
next();
|
|
94
|
-
}
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { toRefs, watch, onMounted } from "vue";
|
|
3
|
+
import { onBeforeRouteLeave } from "vue-router";
|
|
4
|
+
import { useApi } from "../../../composables/useApi";
|
|
5
|
+
import { useCookie } from "#app";
|
|
6
|
+
// data
|
|
7
|
+
const sessionLoopIntervalMinutes = 5;
|
|
8
|
+
const cookieExpireMinutes = 20;
|
|
9
|
+
let cookie = useCookie("session-cookie");
|
|
10
|
+
let sessionId: any = null;
|
|
11
|
+
let sessionLoopId: any = null;
|
|
12
|
+
|
|
13
|
+
type Props = {
|
|
14
|
+
loggableType?: string;
|
|
15
|
+
loggableId: number | undefined;
|
|
95
16
|
};
|
|
96
|
-
|
|
17
|
+
|
|
18
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
19
|
+
loggableType: "App\\Presentation",
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const { loggableType, loggableId } = toRefs(props);
|
|
23
|
+
|
|
24
|
+
// methods
|
|
25
|
+
const updateSessionCookie = () => {
|
|
26
|
+
const expireDate = new Date(
|
|
27
|
+
new Date().getTime() + cookieExpireMinutes * 60 * 1000
|
|
28
|
+
);
|
|
29
|
+
cookie = useCookie("session-cookie", {
|
|
30
|
+
expires: expireDate,
|
|
31
|
+
});
|
|
32
|
+
cookie.value = sessionId;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const updateSession = () => {
|
|
36
|
+
if (!sessionId || !loggableType.value || !loggableId.value) {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
updateSessionCookie();
|
|
41
|
+
|
|
42
|
+
const inputs = {
|
|
43
|
+
method: "PATCH",
|
|
44
|
+
resource_type: loggableType,
|
|
45
|
+
resource_id: loggableId,
|
|
46
|
+
};
|
|
47
|
+
const url = `session-logs/${sessionId}`;
|
|
48
|
+
const request = useApi();
|
|
49
|
+
request(url, inputs)
|
|
50
|
+
.then((response) => {
|
|
51
|
+
console.log("updateSession", response);
|
|
52
|
+
})
|
|
53
|
+
.catch((error) => {
|
|
54
|
+
console.log("Error updating session-log", error);
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const initSession = () => {
|
|
59
|
+
const url = "session-logs";
|
|
60
|
+
const request = useApi();
|
|
61
|
+
request(url, { method: "POST" }).then((response) => {
|
|
62
|
+
sessionId = response;
|
|
63
|
+
console.log("initSession", response);
|
|
64
|
+
updateSession();
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const getSessionIdFromCookie = () => {
|
|
69
|
+
return (sessionId = cookie.value);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const sessionLoop = () => {
|
|
73
|
+
if (getSessionIdFromCookie()) {
|
|
74
|
+
updateSession();
|
|
75
|
+
} else {
|
|
76
|
+
initSession();
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
const initSessionLoop = () => {
|
|
81
|
+
sessionLoop();
|
|
82
|
+
sessionLoopId = setInterval(
|
|
83
|
+
sessionLoop,
|
|
84
|
+
sessionLoopIntervalMinutes * 60 * 1000
|
|
85
|
+
);
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
// watchers
|
|
89
|
+
watch(loggableId, (_newId: number, _oldId: number) => {
|
|
90
|
+
updateSession();
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
// mounted
|
|
94
|
+
onMounted(() => {
|
|
95
|
+
console.log("SessionReporting component mounted");
|
|
96
|
+
initSessionLoop();
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
onBeforeRouteLeave(() => {
|
|
100
|
+
clearInterval(sessionLoopId);
|
|
101
|
+
});
|
|
102
|
+
</script>
|