@live-change/task-frontend 0.8.24
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/.nx/cache/file-map.json +257 -0
- package/.nx/cache/project-graph.json +6 -0
- package/Dockerfile +55 -0
- package/LICENSE +21 -0
- package/data/GeoLite2-Country.mmdb +0 -0
- package/dev.Dockerfile +35 -0
- package/docker/app.initd.sh +73 -0
- package/docker/build-and-upload.sh +30 -0
- package/docker/build-docker-and-upload.sh +33 -0
- package/docker/commit-new-version.sh +17 -0
- package/docker/k8s-rsync-helper.sh +4 -0
- package/docker/onlyDependencies.js +12 -0
- package/docker/parse-args-and-config.sh +19 -0
- package/docker/restore-backup-with-service.sh +14 -0
- package/docker/restore-backup.sh +22 -0
- package/docker/start-service.sh +4 -0
- package/docker/upload-backup-and-restore.sh +12 -0
- package/front/index.html +65 -0
- package/front/locales/en.js +26 -0
- package/front/locales/en.json +7 -0
- package/front/public/favicon.ico +0 -0
- package/front/public/images/empty-photo.svg +38 -0
- package/front/public/images/empty-user-photo.svg +33 -0
- package/front/public/images/logo.svg +34 -0
- package/front/public/images/logo128.png +0 -0
- package/front/src/App.vue +61 -0
- package/front/src/Index.vue +16 -0
- package/front/src/analytics/index.js +15 -0
- package/front/src/components/Clock.vue +22 -0
- package/front/src/config.js +26 -0
- package/front/src/entry-client.js +8 -0
- package/front/src/entry-server.js +8 -0
- package/front/src/router.js +76 -0
- package/front/tsconfig.json +26 -0
- package/front/tsconfig.node.json +11 -0
- package/front/vite.config.ts +41 -0
- package/index.js +2 -0
- package/package.json +106 -0
- package/server/app.config.js +100 -0
- package/server/init.js +10 -0
- package/server/page.documentType.js +103 -0
- package/server/security.config.js +53 -0
- package/server/services.list.js +49 -0
- package/server/start.js +11 -0
- package/server/testTasks.js +0 -0
- package/start-dev-docker.sh +4 -0
package/front/index.html
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<!--head-->
|
|
5
|
+
</head>
|
|
6
|
+
<body>
|
|
7
|
+
<!--body-tags-open-->
|
|
8
|
+
<div id="app"><!--app-html--></div>
|
|
9
|
+
<!--app-data-->
|
|
10
|
+
<!--body-tags-->
|
|
11
|
+
<script type="module" src="/src/entry-client.js"></script>
|
|
12
|
+
|
|
13
|
+
<div>
|
|
14
|
+
<div id="not-supported" style="display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
|
|
15
|
+
z-index: 1000; background-color: black; color: white; font-size: 20px; font-family: sans-serif;
|
|
16
|
+
align-items: center; justify-content: center; overflow-y: auto">
|
|
17
|
+
<div style=" padding: 2em;">
|
|
18
|
+
<h1 style="margin-bottom: 1.23em">Your browser is not supported.</h1>
|
|
19
|
+
<p>We apologize for the inconvenience, but it seems that your current web browser version does not support our web application.</p>
|
|
20
|
+
<p>In order to use our service, you would need to upgrade to, or install, one of the following browsers:</p>
|
|
21
|
+
<ul>
|
|
22
|
+
<li>Microsoft Edge 88 or later</li>
|
|
23
|
+
<li>Mozilla Firefox 78 or later</li>
|
|
24
|
+
<li>Google Chrome 87 or later</li>
|
|
25
|
+
<li>Apple Safari 14 or later</li>
|
|
26
|
+
</ul>
|
|
27
|
+
<p>Please note that our application does not function with older browser versions. We've optimized our service for the above-mentioned browsers to ensure robust functionality and a smooth user experience.</p>
|
|
28
|
+
<p>If you need assistance with updating your browser or installing a new one, please consult your browser's help documentation or contact your IT support.</p>
|
|
29
|
+
<p>Thank you for your understanding and cooperation. We're eager to deliver a great experience with our web application.</p>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
<script>
|
|
34
|
+
const oses = ['Windows', 'Android', 'Linux', 'iPhone', 'iPad', 'iPod', 'Mac OS']
|
|
35
|
+
const browsers = ['Edg', 'Edge', 'CriOS', 'OPR', 'Chrome', 'SamsungBrowser', 'Firefox', 'Opera', 'Safari']
|
|
36
|
+
const ua = window.navigator.userAgent
|
|
37
|
+
const detected = {}
|
|
38
|
+
for(const browser of browsers) {
|
|
39
|
+
const match = ua.match(new RegExp(`(${browser})/([^ ;)]*)`,'i'))
|
|
40
|
+
if(match) {
|
|
41
|
+
detected.browser = match[1]
|
|
42
|
+
detected.browserVersion = match[2]
|
|
43
|
+
break
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
for(const os of oses) {
|
|
47
|
+
const match = ua.match(new RegExp(`(${os}) ?([^;)]*)`,'i'))
|
|
48
|
+
if(match) {
|
|
49
|
+
detected.os = match[1]
|
|
50
|
+
detected.osVersion = match[2]
|
|
51
|
+
break
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
document.body.classList.add('on-browser-' + detected.browser.toLowerCase())
|
|
55
|
+
document.body.classList.add('on-os-' + detected.os.replace(' ','-').toLowerCase())
|
|
56
|
+
window.onload = function() { setTimeout(function() {
|
|
57
|
+
if(!window.appStarted) {
|
|
58
|
+
document.getElementById('not-supported').style.display = 'flex'
|
|
59
|
+
console.error("App not started")
|
|
60
|
+
}
|
|
61
|
+
}, 1000) }
|
|
62
|
+
</script>
|
|
63
|
+
|
|
64
|
+
</body>
|
|
65
|
+
</html>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import messages from "./en.json"
|
|
2
|
+
export { messages }
|
|
3
|
+
|
|
4
|
+
export const numberFormats ={
|
|
5
|
+
"usd": {
|
|
6
|
+
"style": "currency",
|
|
7
|
+
"currency": "USD",
|
|
8
|
+
"notation": "standard"
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const datetimeFormats = {
|
|
13
|
+
"short": {
|
|
14
|
+
"year": "numeric", "month": "short", "day": "numeric"
|
|
15
|
+
},
|
|
16
|
+
"shortTime": {
|
|
17
|
+
"dateStyle": "short", "timeStyle": "short", "hour12": false
|
|
18
|
+
},
|
|
19
|
+
"shortestTime": {
|
|
20
|
+
"month": "numeric", "day": "numeric", "hour": "numeric", "minute": "numeric", "hour12": false
|
|
21
|
+
},
|
|
22
|
+
"long": {
|
|
23
|
+
"year": "numeric", "month": "short", "day": "numeric",
|
|
24
|
+
"weekday": "short", "hour": "numeric", "minute": "numeric"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
|
3
|
+
|
|
4
|
+
<svg
|
|
5
|
+
version="1.1"
|
|
6
|
+
id="Layer_1"
|
|
7
|
+
x="0px"
|
|
8
|
+
y="0px"
|
|
9
|
+
width="512px"
|
|
10
|
+
height="512px"
|
|
11
|
+
viewBox="0 0 512 512"
|
|
12
|
+
enable-background="new 0 0 512 512"
|
|
13
|
+
xml:space="preserve"
|
|
14
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
15
|
+
xmlns:svg="http://www.w3.org/2000/svg"
|
|
16
|
+
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
17
|
+
xmlns:cc="http://creativecommons.org/ns#"
|
|
18
|
+
xmlns:dc="http://purl.org/dc/elements/1.1/"><metadata
|
|
19
|
+
id="metadata9"><rdf:RDF><cc:Work
|
|
20
|
+
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
|
21
|
+
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
|
|
22
|
+
id="defs7" />
|
|
23
|
+
<rect
|
|
24
|
+
style="fill:#dbdbdb;fill-opacity:1;stroke:none;stroke-width:1.88976383;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
|
25
|
+
id="rect821"
|
|
26
|
+
width="512.54236"
|
|
27
|
+
height="512.54236"
|
|
28
|
+
x="0.54237288"
|
|
29
|
+
y="0.54237235" />
|
|
30
|
+
<path
|
|
31
|
+
style="fill:#f6f6f6;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
|
32
|
+
d="M 0.54237288,470.23729 125.83051,306.44068 l 60.20339,70.50847 130.71186,-174.10169 195.79661,261.42373 0.54235,48.81353 H 0.54237288 Z"
|
|
33
|
+
id="path816" /><circle
|
|
34
|
+
style="fill:#f6f6f6;fill-opacity:1;stroke:none;stroke-width:4.80000019;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
|
35
|
+
id="path818"
|
|
36
|
+
cx="118.50848"
|
|
37
|
+
cy="106.57627"
|
|
38
|
+
r="57.762711" /></svg>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
|
3
|
+
|
|
4
|
+
<svg
|
|
5
|
+
version="1.1"
|
|
6
|
+
id="Layer_1"
|
|
7
|
+
x="0px"
|
|
8
|
+
y="0px"
|
|
9
|
+
width="512px"
|
|
10
|
+
height="512px"
|
|
11
|
+
viewBox="0 0 512 512"
|
|
12
|
+
enable-background="new 0 0 512 512"
|
|
13
|
+
xml:space="preserve"
|
|
14
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
15
|
+
xmlns:svg="http://www.w3.org/2000/svg"
|
|
16
|
+
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
17
|
+
xmlns:cc="http://creativecommons.org/ns#"
|
|
18
|
+
xmlns:dc="http://purl.org/dc/elements/1.1/"><metadata
|
|
19
|
+
id="metadata9"><rdf:RDF><cc:Work
|
|
20
|
+
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
|
21
|
+
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
|
|
22
|
+
id="defs7" />
|
|
23
|
+
<rect
|
|
24
|
+
style="fill:#dbdbdb;fill-opacity:1;stroke:none;stroke-width:1.88976383;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
|
25
|
+
id="rect821"
|
|
26
|
+
width="512.54236"
|
|
27
|
+
height="512.54236"
|
|
28
|
+
x="0.54237288"
|
|
29
|
+
y="0.54237235" /><path
|
|
30
|
+
d="m 313.14122,310.64877 c 9.02181,-8.85097 12.15686,-31.23733 20.41627,-39.3056 11.69771,-11.43183 24.39381,-25.50218 27.98588,-43.06851 4.82003,-23.34203 -4.96846,-26.30516 -4.96846,-34.3713 0,-16.90002 -0.15376,-44.65739 -5.43081,-62.68607 -0.30326,-23.7809 -4.20499,-34.123578 -12.38858,-43.031138 -7.72017,-8.33522 -26.68637,-6.366203 -36.59125,-11.85361 C 286.83605,67.825407 274.23818,64.594254 258.15823,64.17461 v -0.09503 c -0.47624,0 -0.93539,0.05659 -1.41162,0.05659 -0.78484,0 -1.53123,-0.05659 -2.35343,-0.05659 l 0.0395,0.151627 c -39.17105,1.472492 -80.84608,26.170627 -95.16524,65.895863 -5.31335,14.71958 -3.28881,46.87521 -3.28881,63.77522 0,8.06721 -9.78742,11.02927 -4.96846,34.37131 3.61129,17.56632 16.28817,31.63668 27.98588,43.06851 8.26048,8.06827 11.39446,30.45462 20.39705,39.30559 1.96902,13.0378 2.1986,9.31012 2.12278,21.23954 -0.0203,4.03307 0.11426,10.28502 -6.32669,16.4398 -12.17822,11.6614 -40.14595,36.95324 -63.08756,46.79832 -30.24,12.98014 -79.41203,33.74237 -90.746691,39.59069 -11.334661,5.84833 -41.2532541,21.69763 -41.2532541,31.79045 0,10.11417 0,47.33542 0,47.33542 h 253.3742451 5.79494 253.37318 c 0,0 0,-37.22125 0,-47.33542 0,-10.09282 -29.89723,-25.94212 -41.25645,-31.79045 -11.35389,-5.84938 -60.48321,-26.61055 -90.72641,-39.59069 -22.32976,-9.57707 -49.43685,-33.81712 -62.09344,-45.84158 -4.2808,-4.05228 -7.3016,-8.29784 -7.3411,-18.62023 -0.0737,-12.00417 0.23278,-7.41692 2.14306,-20.01478"
|
|
31
|
+
id="path2"
|
|
32
|
+
style="clip-rule:evenodd;fill-rule:evenodd;stroke-width:1.06779659;fill:#f6f6f6;fill-opacity:1" />
|
|
33
|
+
</svg>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<svg
|
|
3
|
+
width="512"
|
|
4
|
+
height="512"
|
|
5
|
+
viewBox="0 0 135.46667 135.46667"
|
|
6
|
+
version="1.1"
|
|
7
|
+
id="svg977"
|
|
8
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
9
|
+
xmlns:svg="http://www.w3.org/2000/svg"
|
|
10
|
+
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
11
|
+
xmlns:cc="http://creativecommons.org/ns#"
|
|
12
|
+
xmlns:dc="http://purl.org/dc/elements/1.1/">
|
|
13
|
+
<defs
|
|
14
|
+
id="defs971" />
|
|
15
|
+
<metadata
|
|
16
|
+
id="metadata974">
|
|
17
|
+
<rdf:RDF>
|
|
18
|
+
<cc:Work
|
|
19
|
+
rdf:about="">
|
|
20
|
+
<dc:format>image/svg+xml</dc:format>
|
|
21
|
+
<dc:type
|
|
22
|
+
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
|
23
|
+
</cc:Work>
|
|
24
|
+
</rdf:RDF>
|
|
25
|
+
</metadata>
|
|
26
|
+
<g
|
|
27
|
+
id="layer1"
|
|
28
|
+
style="fill:#666666">
|
|
29
|
+
<path
|
|
30
|
+
style="fill:#666666;fill-opacity:1;stroke:none;stroke-width:2.70907px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
|
31
|
+
d="M 54.181439,13.558436 67.726801,0.01304296 135.45359,67.739804 67.726801,135.46667 29.799793,97.539626 V 65.030766 L 13.545362,81.285197 0,67.739804 40.636077,27.103727 81.272154,67.739804 67.726801,81.285197 51.472371,65.030766 V 92.12155 l 16.25443,16.25433 40.636069,-40.636076 z"
|
|
32
|
+
id="path892" />
|
|
33
|
+
</g>
|
|
34
|
+
</svg>
|
|
Binary file
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view-root>
|
|
3
|
+
<template #navbar>
|
|
4
|
+
<NavBar />
|
|
5
|
+
<UpdateBanner />
|
|
6
|
+
</template>
|
|
7
|
+
</view-root>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script setup>
|
|
11
|
+
import 'primevue/resources/themes/saga-green/theme.css'
|
|
12
|
+
import "@fortawesome/fontawesome-free/css/all.min.css"
|
|
13
|
+
|
|
14
|
+
import { useLocale } from '@live-change/vue3-components'
|
|
15
|
+
const locale = useLocale()
|
|
16
|
+
locale.captureLocale()
|
|
17
|
+
|
|
18
|
+
import { ViewRoot, NavBar, UpdateBanner } from "@live-change/frontend-base"
|
|
19
|
+
|
|
20
|
+
import { computed } from 'vue'
|
|
21
|
+
import { useHead } from '@vueuse/head'
|
|
22
|
+
|
|
23
|
+
import { useI18n } from 'vue-i18n'
|
|
24
|
+
const i18n = useI18n()
|
|
25
|
+
|
|
26
|
+
useHead(computed(() => ({
|
|
27
|
+
title: ENV_BRAND_NAME,
|
|
28
|
+
meta: [
|
|
29
|
+
{ charset: 'utf-8' },
|
|
30
|
+
{ name: 'viewport',
|
|
31
|
+
content: "user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1," +
|
|
32
|
+
" width=device-width, viewport-fit=cover" }
|
|
33
|
+
],
|
|
34
|
+
htmlAttrs: {
|
|
35
|
+
lang: i18n.locale.value,
|
|
36
|
+
amp: true
|
|
37
|
+
},
|
|
38
|
+
})))
|
|
39
|
+
|
|
40
|
+
import { watch } from 'vue'
|
|
41
|
+
import { client as useClient, useApi } from '@live-change/vue3-ssr'
|
|
42
|
+
const client = useClient()
|
|
43
|
+
watch(client, (newClient, oldClient) => {
|
|
44
|
+
console.log("WATCH CLIENT", oldClient, '=>', newClient)
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
const api = useApi()
|
|
48
|
+
import emailValidator from "@live-change/email-service/clientEmailValidator.js"
|
|
49
|
+
import passwordValidator from "@live-change/password-authentication-service/clientPasswordValidator.js"
|
|
50
|
+
api.validators.email = emailValidator
|
|
51
|
+
api.validators.password = passwordValidator
|
|
52
|
+
|
|
53
|
+
import { defaultHighlightStyle } from "@codemirror/language"
|
|
54
|
+
import { StyleModule } from "style-mod"
|
|
55
|
+
if(typeof window != 'undefined') {
|
|
56
|
+
StyleModule.mount(window.document, defaultHighlightStyle.module)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
import "./analytics"
|
|
60
|
+
|
|
61
|
+
</script>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<h1>Hello world!</h1>
|
|
4
|
+
<p>{{ currentTime }}</p>
|
|
5
|
+
<Clock :time="currentTime" />
|
|
6
|
+
</div>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script setup>
|
|
10
|
+
import { currentTime } from "@live-change/frontend-base";
|
|
11
|
+
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<style scoped>
|
|
15
|
+
|
|
16
|
+
</style>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { analytics } from "@live-change/vue3-components"
|
|
2
|
+
|
|
3
|
+
analytics.on('*', (type, e) => console.log('ANALYTICS EVENT', type, e) )
|
|
4
|
+
|
|
5
|
+
analytics.on('formDone', ({ service, action }) => {
|
|
6
|
+
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
analytics.on('menuOpen', e => {
|
|
10
|
+
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
analytics.on('pageView', ({ to, fullPath }) => {
|
|
14
|
+
|
|
15
|
+
})
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
|
|
2
|
+
<template>
|
|
3
|
+
<div class="surface-card p-3 shadow-2 border-round">
|
|
4
|
+
{{ d(new Date(), 'long') }}
|
|
5
|
+
</div>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script setup lang="ts">
|
|
9
|
+
import { defineProps, toRefs } from 'vue'
|
|
10
|
+
import { useI18n } from 'vue-i18n'
|
|
11
|
+
const { t, d, n } = useI18n()
|
|
12
|
+
|
|
13
|
+
const props = defineProps<{
|
|
14
|
+
time: number
|
|
15
|
+
}>()
|
|
16
|
+
|
|
17
|
+
const { time } = toRefs(props)
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<style scoped>
|
|
21
|
+
|
|
22
|
+
</style>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import deepmerge from 'deepmerge';
|
|
2
|
+
|
|
3
|
+
import * as en from "../locales/en.js"
|
|
4
|
+
import { locales as autoFormLocales } from "@live-change/frontend-auto-form"
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
defaultLocale: 'en',
|
|
8
|
+
i18n: {
|
|
9
|
+
messages: {
|
|
10
|
+
en: deepmerge.all([
|
|
11
|
+
autoFormLocales.en,
|
|
12
|
+
en.messages
|
|
13
|
+
])
|
|
14
|
+
},
|
|
15
|
+
numberFormats: {
|
|
16
|
+
en: deepmerge.all([
|
|
17
|
+
en.numberFormats
|
|
18
|
+
])
|
|
19
|
+
},
|
|
20
|
+
datetimeFormats: {
|
|
21
|
+
en: deepmerge.all([
|
|
22
|
+
en.datetimeFormats
|
|
23
|
+
])
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { serverEntry, sitemapEntry } from '@live-change/frontend-base/server-entry.js'
|
|
2
|
+
import App from './App.vue'
|
|
3
|
+
import { createRouter, sitemap as routerSitemap } from './router'
|
|
4
|
+
import config from './config.js'
|
|
5
|
+
|
|
6
|
+
const render = serverEntry(App, createRouter)
|
|
7
|
+
const sitemap = sitemapEntry(App, createRouter, routerSitemap)
|
|
8
|
+
export { render, sitemap }
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createMemoryHistory,
|
|
3
|
+
createRouter as _createRouter,
|
|
4
|
+
createWebHistory
|
|
5
|
+
} from 'vue-router'
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
installRouterAnalytics
|
|
9
|
+
} from '@live-change/vue3-components'
|
|
10
|
+
|
|
11
|
+
import { dbAdminRoutes } from "@live-change/db-admin"
|
|
12
|
+
import { userRoutes } from "@live-change/user-frontend"
|
|
13
|
+
import { catchAllPagesRoute, contentEditRoutes, pagesSitemap } from "@live-change/content-frontend"
|
|
14
|
+
|
|
15
|
+
import pagesRoutes from '~pages'
|
|
16
|
+
|
|
17
|
+
export function routes(config = {}) {
|
|
18
|
+
const { prefix = '/', route = (r) => r } = config
|
|
19
|
+
return [
|
|
20
|
+
...userRoutes({ ...config, prefix: prefix + 'user/' }),
|
|
21
|
+
|
|
22
|
+
route({
|
|
23
|
+
name: 'index', path: prefix, meta: { },
|
|
24
|
+
component: () => import("./Index.vue")
|
|
25
|
+
}),
|
|
26
|
+
|
|
27
|
+
...pagesRoutes,
|
|
28
|
+
|
|
29
|
+
...contentEditRoutes({ ...config }),
|
|
30
|
+
|
|
31
|
+
...dbAdminRoutes({ prefix: '/_db', route: r => ({ ...r, meta: { ...r.meta, raw: true }}) }),
|
|
32
|
+
...catchAllPagesRoute({ ...config }),
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export async function sitemap(route, api) {
|
|
37
|
+
route({
|
|
38
|
+
name: 'index'
|
|
39
|
+
})
|
|
40
|
+
await pagesSitemap(route, api)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
import { client as useClient } from '@live-change/vue3-ssr'
|
|
44
|
+
|
|
45
|
+
export function createRouter(app, config) {
|
|
46
|
+
const client = useClient(app._context)
|
|
47
|
+
|
|
48
|
+
const router = _createRouter({
|
|
49
|
+
// use appropriate history implementation for server/client
|
|
50
|
+
// import.meta.env.SSR is injected by Vite.
|
|
51
|
+
history: import.meta.env.SSR ? createMemoryHistory() : createWebHistory(),
|
|
52
|
+
routes: routes(config)
|
|
53
|
+
})
|
|
54
|
+
installRouterAnalytics(router)
|
|
55
|
+
router.beforeEach(async (to, from) => {
|
|
56
|
+
if(to?.matched.find(m => m?.meta.signedIn)) {
|
|
57
|
+
if(!client.value.user) {
|
|
58
|
+
console.log("REDIRECT TO LOGIN BECAUSE PAGE REQUIRES LOGIN!")
|
|
59
|
+
router.redirectAfterSignIn = to.fullPath
|
|
60
|
+
return { name: 'user:signIn' }
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if(to?.matched.find(m => m?.meta.signedOut)) {
|
|
64
|
+
if(client.value.user) {
|
|
65
|
+
console.log("REDIRECT TO USER INDEX BECAUSE PAGE REQUIRES LOGOUT!")
|
|
66
|
+
return { name: 'user:settings' }
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
if(to && to.name == 'user:signIn' && from?.matched.find(m => m?.meta.saveForSignIn)) {
|
|
70
|
+
console.log("SAVE FOR LOGIN", from.fullPath)
|
|
71
|
+
localStorage.redirectAfterLogin = from.fullPath
|
|
72
|
+
}
|
|
73
|
+
})
|
|
74
|
+
return router
|
|
75
|
+
}
|
|
76
|
+
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"useDefineForClassFields": true,
|
|
5
|
+
"module": "ESNext",
|
|
6
|
+
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
|
|
9
|
+
/* Bundler mode */
|
|
10
|
+
"moduleResolution": "bundler",
|
|
11
|
+
"allowImportingTsExtensions": true,
|
|
12
|
+
"resolveJsonModule": true,
|
|
13
|
+
"isolatedModules": true,
|
|
14
|
+
"noEmit": true,
|
|
15
|
+
"jsx": "preserve",
|
|
16
|
+
|
|
17
|
+
/* Linting */
|
|
18
|
+
"strict": true,
|
|
19
|
+
"noUnusedLocals": true,
|
|
20
|
+
"noUnusedParameters": true,
|
|
21
|
+
"noFallthroughCasesInSwitch": true
|
|
22
|
+
},
|
|
23
|
+
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"],
|
|
24
|
+
"references": [{ "path": "./tsconfig.node.json" }]
|
|
25
|
+
}
|
|
26
|
+
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { defineConfig } from 'vite'
|
|
2
|
+
import Pages from 'vite-plugin-pages'
|
|
3
|
+
|
|
4
|
+
let version = process.env.VERSION ?? 'unknown'
|
|
5
|
+
|
|
6
|
+
// @ts-ignore
|
|
7
|
+
import baseViteConfig from '@live-change/frontend-base/vite-config.js'
|
|
8
|
+
|
|
9
|
+
export default defineConfig(async ({ command, mode }) => {
|
|
10
|
+
const baseConfig = (await baseViteConfig({ command, mode }))
|
|
11
|
+
return {
|
|
12
|
+
...baseConfig,
|
|
13
|
+
|
|
14
|
+
define: {
|
|
15
|
+
...baseConfig.define,
|
|
16
|
+
ENV_VERSION: JSON.stringify(version),
|
|
17
|
+
ENV_BRAND_NAME: JSON.stringify("Example"),
|
|
18
|
+
ENV_BRAND_DOMAIN: JSON.stringify("example.com"),
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
plugins: [
|
|
22
|
+
...baseConfig.plugins,
|
|
23
|
+
Pages({
|
|
24
|
+
dirs: [
|
|
25
|
+
// basic
|
|
26
|
+
{ dir: 'src/pages', baseRoute: '' },
|
|
27
|
+
// blog
|
|
28
|
+
// { dir: 'src/blog', baseRoute: 'blog' },
|
|
29
|
+
],
|
|
30
|
+
extensions: ['vue', 'md'],
|
|
31
|
+
}),
|
|
32
|
+
],
|
|
33
|
+
|
|
34
|
+
resolve: {
|
|
35
|
+
...baseConfig.resolve,
|
|
36
|
+
alias: [
|
|
37
|
+
...baseConfig.resolve.alias,
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
})
|
package/index.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@live-change/task-frontend",
|
|
3
|
+
"version": "0.8.24",
|
|
4
|
+
"scripts": {
|
|
5
|
+
"memDev": "node server/start.js memDev --enableSessions --initScript ./init.js --dbAccess",
|
|
6
|
+
"localDevInit": "rm tmp.db; node server/start.js localDev --enableSessions --initScript ./init.js",
|
|
7
|
+
"localDev": "node server/start.js localDev --enableSessions --dbAccess",
|
|
8
|
+
"dev": "node server/start.js dev --enableSessions",
|
|
9
|
+
"ssrDev": "node server/start.js ssrDev --enableSessions",
|
|
10
|
+
"serveAllMem": "cross-env NODE_ENV=production node server/start.js ssrServer --withApi --withServices --updateServices --enableSessions --withDb --dbBackend mem --createDb",
|
|
11
|
+
"serveAll": "cross-env NODE_ENV=production node server/start.js ssrServer --withApi --withServices --updateServices --enableSessions",
|
|
12
|
+
"serve": "cross-env NODE_ENV=production node server/start.js ssrServer --enableSessions",
|
|
13
|
+
"memDev:spa": "node server/start.js memDev --enableSessions --initScript ./init.js --dbAccess --spa",
|
|
14
|
+
"localDevInit:spa": "rm tmp.db; node server/start.js localDev --enableSessions --initScript ./init.js --spa",
|
|
15
|
+
"localDev:spa": "node server/start.js localDev --enableSessions --spa",
|
|
16
|
+
"dev:spa": "node server/start.js dev --enableSessions --spa",
|
|
17
|
+
"ssrDev:spa": "node server/start.js ssrDev --enableSessions --spa",
|
|
18
|
+
"serveAllMem:spa": "cross-env NODE_ENV=production node server/start.js server --withApi --withServices --updateServices --enableSessions --withDb --dbBackend mem --createDb --spa",
|
|
19
|
+
"serveAll:spa": "cross-env NODE_ENV=production node server/start.js server --withApi --withServices --updateServices --enableSessions --spa",
|
|
20
|
+
"serve:spa": "cross-env NODE_ENV=production node server/start.js server --enableSessions --spa",
|
|
21
|
+
"apiServer": "node server/start.js apiServer --enableSessions",
|
|
22
|
+
"devApiServer": "node server/start.js devApiServer --enableSessions",
|
|
23
|
+
"memApiServer": "node server/start.js memApiServer --enableSessions",
|
|
24
|
+
"build": "cd front; yarn build:client && yarn build:server",
|
|
25
|
+
"build:client": "cd front; dotenvx run -f ../.env -- vite build --ssrManifest --outDir dist/client",
|
|
26
|
+
"build:server": "cd front; dotenvx run -f ../.env -- vite build --ssr src/entry-server.js --outDir dist/server",
|
|
27
|
+
"build:spa": "cd front; dotenvx run -f ../.env -- vite build --outDir dist/spa",
|
|
28
|
+
"generate": "vite build --ssrManifest --outDir dist/static && yarn build:server && node prerender",
|
|
29
|
+
"debug": "node --inspect-brk server",
|
|
30
|
+
"describe": "node server/start.js describe",
|
|
31
|
+
"changes": "node server/start.js changes"
|
|
32
|
+
},
|
|
33
|
+
"type": "module",
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@codemirror/language": "6.10.1",
|
|
36
|
+
"@dotenvx/dotenvx": "0.27.0",
|
|
37
|
+
"@fortawesome/fontawesome-free": "^6.4.2",
|
|
38
|
+
"@live-change/access-control-frontend": "^0.8.24",
|
|
39
|
+
"@live-change/access-control-service": "^0.8.24",
|
|
40
|
+
"@live-change/backup-service": "^0.8.24",
|
|
41
|
+
"@live-change/blog-frontend": "^0.8.24",
|
|
42
|
+
"@live-change/blog-service": "^0.8.24",
|
|
43
|
+
"@live-change/cli": "^0.8.24",
|
|
44
|
+
"@live-change/content-frontend": "^0.8.24",
|
|
45
|
+
"@live-change/content-service": "^0.8.24",
|
|
46
|
+
"@live-change/dao": "^0.8.24",
|
|
47
|
+
"@live-change/dao-vue3": "^0.8.24",
|
|
48
|
+
"@live-change/dao-websocket": "^0.8.24",
|
|
49
|
+
"@live-change/db-client": "^0.8.24",
|
|
50
|
+
"@live-change/email-service": "^0.8.24",
|
|
51
|
+
"@live-change/framework": "^0.8.24",
|
|
52
|
+
"@live-change/frontend-auto-form": "^0.8.24",
|
|
53
|
+
"@live-change/frontend-base": "^0.8.24",
|
|
54
|
+
"@live-change/geoip-service": "^0.8.24",
|
|
55
|
+
"@live-change/image-frontend": "^0.8.24",
|
|
56
|
+
"@live-change/locale-settings-service": "^0.8.24",
|
|
57
|
+
"@live-change/password-authentication-service": "^0.8.24",
|
|
58
|
+
"@live-change/prosemirror-service": "^0.8.24",
|
|
59
|
+
"@live-change/secret-code-service": "^0.8.24",
|
|
60
|
+
"@live-change/secret-link-service": "^0.8.24",
|
|
61
|
+
"@live-change/session-service": "^0.8.24",
|
|
62
|
+
"@live-change/task-service": "^0.8.24",
|
|
63
|
+
"@live-change/upload-frontend": "^0.8.24",
|
|
64
|
+
"@live-change/url-frontend": "^0.8.24",
|
|
65
|
+
"@live-change/url-service": "^0.8.24",
|
|
66
|
+
"@live-change/user-frontend": "^0.8.24",
|
|
67
|
+
"@live-change/user-identification-service": "^0.8.24",
|
|
68
|
+
"@live-change/user-service": "^0.8.24",
|
|
69
|
+
"@live-change/vote-service": "^0.8.24",
|
|
70
|
+
"@live-change/vue3-components": "^0.8.24",
|
|
71
|
+
"@live-change/vue3-ssr": "^0.8.24",
|
|
72
|
+
"@live-change/wysiwyg-frontend": "^0.8.24",
|
|
73
|
+
"@vueuse/core": "^10.9.0",
|
|
74
|
+
"codeceptjs-assert": "^0.0.5",
|
|
75
|
+
"compression": "^1.7.4",
|
|
76
|
+
"cross-env": "^7.0.3",
|
|
77
|
+
"get-port-sync": "1.0.1",
|
|
78
|
+
"pica": "^9.0.1",
|
|
79
|
+
"pretty-bytes": "^6.1.1",
|
|
80
|
+
"primeflex": "^3.3.1",
|
|
81
|
+
"primeicons": "^7.0.0",
|
|
82
|
+
"primevue": "^3.51.0",
|
|
83
|
+
"rollup-plugin-node-builtins": "^2.1.2",
|
|
84
|
+
"rollup-plugin-visualizer": "5.12.0",
|
|
85
|
+
"serialize-javascript": "^6.0.2",
|
|
86
|
+
"serve-static": "^1.15.0",
|
|
87
|
+
"v-shared-element": "3.1.1",
|
|
88
|
+
"vue": "^3.4.19",
|
|
89
|
+
"vue-i18n": "^9.10.1",
|
|
90
|
+
"vue-router": "^4.2.5",
|
|
91
|
+
"vue3-scroll-border": "0.1.6"
|
|
92
|
+
},
|
|
93
|
+
"devDependencies": {
|
|
94
|
+
"@live-change/codeceptjs-helper": "^0.8.24",
|
|
95
|
+
"codeceptjs": "^3.5.12",
|
|
96
|
+
"generate-password": "1.7.1",
|
|
97
|
+
"playwright": "^1.41.2",
|
|
98
|
+
"random-profile-generator": "^2.3.0",
|
|
99
|
+
"txtgen": "^3.0.6",
|
|
100
|
+
"webdriverio": "^8.31.1"
|
|
101
|
+
},
|
|
102
|
+
"author": "",
|
|
103
|
+
"license": "ISC",
|
|
104
|
+
"description": "",
|
|
105
|
+
"gitHead": "63e942caccbcb1c9bfbd1a3ef1d097124514c5a7"
|
|
106
|
+
}
|