diff options
author | jdlugosz963 <jdlugosz963@gmail.com> | 2021-12-15 22:43:23 +0100 |
---|---|---|
committer | jdlugosz963 <jdlugosz963@gmail.com> | 2021-12-15 22:43:23 +0100 |
commit | cee635ff1db9ba7c9212547831287efe56c69a1f (patch) | |
tree | 7e66832ba85851257c179fad03b4250457328938 | |
parent | 1f60c86c538cda423a82554fc15cb95d3ca6a1d8 (diff) | |
download | lom_frontend-cee635ff1db9ba7c9212547831287efe56c69a1f.tar.gz lom_frontend-cee635ff1db9ba7c9212547831287efe56c69a1f.zip |
add working groups sender
-rw-r--r-- | package-lock.json | 221 | ||||
-rw-r--r-- | package.json | 2 | ||||
-rw-r--r-- | src/components/group/GroupSender.vue | 22 | ||||
-rw-r--r-- | src/components/group/Message.vue | 10 | ||||
-rw-r--r-- | src/store/index.js | 4 | ||||
-rw-r--r-- | src/views/Home.vue | 17 | ||||
-rw-r--r-- | vue.config.js | 10 |
7 files changed, 271 insertions, 15 deletions
diff --git a/package-lock.json b/package-lock.json index 66d32bf..59cfb94 100644 --- a/package-lock.json +++ b/package-lock.json | |||
@@ -10,6 +10,7 @@ | |||
10 | "dependencies": { | 10 | "dependencies": { |
11 | "axios": "^0.24.0", | 11 | "axios": "^0.24.0", |
12 | "core-js": "^3.6.5", | 12 | "core-js": "^3.6.5", |
13 | "socket.io-client": "^4.1.3", | ||
13 | "v-hotkey": "^0.9.0", | 14 | "v-hotkey": "^0.9.0", |
14 | "vue": "^2.6.11", | 15 | "vue": "^2.6.11", |
15 | "vue-notification": "^1.3.20", | 16 | "vue-notification": "^1.3.20", |
@@ -1749,6 +1750,11 @@ | |||
1749 | "@types/node": "*" | 1750 | "@types/node": "*" |
1750 | } | 1751 | } |
1751 | }, | 1752 | }, |
1753 | "node_modules/@types/component-emitter": { | ||
1754 | "version": "1.2.11", | ||
1755 | "resolved": "https://registry.npmjs.org/@types/component-emitter/-/component-emitter-1.2.11.tgz", | ||
1756 | "integrity": "sha512-SRXjM+tfsSlA9VuG8hGO2nft2p8zjXCK1VcC6N4NXbBbYbSia9kzCChYQajIjzIqOOOuh5Ock6MmV2oux4jDZQ==" | ||
1757 | }, | ||
1752 | "node_modules/@types/connect": { | 1758 | "node_modules/@types/connect": { |
1753 | "version": "3.4.35", | 1759 | "version": "3.4.35", |
1754 | "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", | 1760 | "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", |
@@ -3153,6 +3159,11 @@ | |||
3153 | "@babel/core": "^7.0.0-0" | 3159 | "@babel/core": "^7.0.0-0" |
3154 | } | 3160 | } |
3155 | }, | 3161 | }, |
3162 | "node_modules/backo2": { | ||
3163 | "version": "1.0.2", | ||
3164 | "resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz", | ||
3165 | "integrity": "sha1-MasayLEpNjRj41s+u2n038+6eUc=" | ||
3166 | }, | ||
3156 | "node_modules/balanced-match": { | 3167 | "node_modules/balanced-match": { |
3157 | "version": "1.0.2", | 3168 | "version": "1.0.2", |
3158 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", | 3169 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", |
@@ -3189,6 +3200,14 @@ | |||
3189 | "node": ">=0.10.0" | 3200 | "node": ">=0.10.0" |
3190 | } | 3201 | } |
3191 | }, | 3202 | }, |
3203 | "node_modules/base64-arraybuffer": { | ||
3204 | "version": "0.1.4", | ||
3205 | "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.4.tgz", | ||
3206 | "integrity": "sha1-mBjHngWbE1X5fgQooBfIOOkLqBI=", | ||
3207 | "engines": { | ||
3208 | "node": ">= 0.6.0" | ||
3209 | } | ||
3210 | }, | ||
3192 | "node_modules/base64-js": { | 3211 | "node_modules/base64-js": { |
3193 | "version": "1.5.1", | 3212 | "version": "1.5.1", |
3194 | "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", | 3213 | "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", |
@@ -4329,8 +4348,7 @@ | |||
4329 | "node_modules/component-emitter": { | 4348 | "node_modules/component-emitter": { |
4330 | "version": "1.3.0", | 4349 | "version": "1.3.0", |
4331 | "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", | 4350 | "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", |
4332 | "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", | 4351 | "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==" |
4333 | "dev": true | ||
4334 | }, | 4352 | }, |
4335 | "node_modules/compressible": { | 4353 | "node_modules/compressible": { |
4336 | "version": "2.0.18", | 4354 | "version": "2.0.18", |
@@ -5124,7 +5142,6 @@ | |||
5124 | "version": "4.3.2", | 5142 | "version": "4.3.2", |
5125 | "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", | 5143 | "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", |
5126 | "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", | 5144 | "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", |
5127 | "dev": true, | ||
5128 | "dependencies": { | 5145 | "dependencies": { |
5129 | "ms": "2.1.2" | 5146 | "ms": "2.1.2" |
5130 | }, | 5147 | }, |
@@ -5724,6 +5741,53 @@ | |||
5724 | "once": "^1.4.0" | 5741 | "once": "^1.4.0" |
5725 | } | 5742 | } |
5726 | }, | 5743 | }, |
5744 | "node_modules/engine.io-client": { | ||
5745 | "version": "5.1.2", | ||
5746 | "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-5.1.2.tgz", | ||
5747 | "integrity": "sha512-blRrgXIE0A/eurWXRzvfCLG7uUFJqfTGFsyJzXSK71srMMGJ2VraBLg8Mdw28uUxSpVicepBN9X7asqpD1mZcQ==", | ||
5748 | "dependencies": { | ||
5749 | "base64-arraybuffer": "0.1.4", | ||
5750 | "component-emitter": "~1.3.0", | ||
5751 | "debug": "~4.3.1", | ||
5752 | "engine.io-parser": "~4.0.1", | ||
5753 | "has-cors": "1.1.0", | ||
5754 | "parseqs": "0.0.6", | ||
5755 | "parseuri": "0.0.6", | ||
5756 | "ws": "~7.4.2", | ||
5757 | "yeast": "0.1.2" | ||
5758 | } | ||
5759 | }, | ||
5760 | "node_modules/engine.io-client/node_modules/ws": { | ||
5761 | "version": "7.4.6", | ||
5762 | "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz", | ||
5763 | "integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==", | ||
5764 | "engines": { | ||
5765 | "node": ">=8.3.0" | ||
5766 | }, | ||
5767 | "peerDependencies": { | ||
5768 | "bufferutil": "^4.0.1", | ||
5769 | "utf-8-validate": "^5.0.2" | ||
5770 | }, | ||
5771 | "peerDependenciesMeta": { | ||
5772 | "bufferutil": { | ||
5773 | "optional": true | ||
5774 | }, | ||
5775 | "utf-8-validate": { | ||
5776 | "optional": true | ||
5777 | } | ||
5778 | } | ||
5779 | }, | ||
5780 | "node_modules/engine.io-parser": { | ||
5781 | "version": "4.0.3", | ||
5782 | "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-4.0.3.tgz", | ||
5783 | "integrity": "sha512-xEAAY0msNnESNPc00e19y5heTPX4y/TJ36gr8t1voOaNmTojP9b3oK3BbJLFufW2XFPQaaijpFewm2g2Um3uqA==", | ||
5784 | "dependencies": { | ||
5785 | "base64-arraybuffer": "0.1.4" | ||
5786 | }, | ||
5787 | "engines": { | ||
5788 | "node": ">=8.0.0" | ||
5789 | } | ||
5790 | }, | ||
5727 | "node_modules/enhanced-resolve": { | 5791 | "node_modules/enhanced-resolve": { |
5728 | "version": "4.5.0", | 5792 | "version": "4.5.0", |
5729 | "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.5.0.tgz", | 5793 | "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.5.0.tgz", |
@@ -7152,6 +7216,11 @@ | |||
7152 | "url": "https://github.com/sponsors/ljharb" | 7216 | "url": "https://github.com/sponsors/ljharb" |
7153 | } | 7217 | } |
7154 | }, | 7218 | }, |
7219 | "node_modules/has-cors": { | ||
7220 | "version": "1.1.0", | ||
7221 | "resolved": "https://registry.npmjs.org/has-cors/-/has-cors-1.1.0.tgz", | ||
7222 | "integrity": "sha1-XkdHk/fqmEPRu5nCPu9J/xJv/zk=" | ||
7223 | }, | ||
7155 | "node_modules/has-flag": { | 7224 | "node_modules/has-flag": { |
7156 | "version": "3.0.0", | 7225 | "version": "3.0.0", |
7157 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", | 7226 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", |
@@ -9284,8 +9353,7 @@ | |||
9284 | "node_modules/ms": { | 9353 | "node_modules/ms": { |
9285 | "version": "2.1.2", | 9354 | "version": "2.1.2", |
9286 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", | 9355 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", |
9287 | "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", | 9356 | "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" |
9288 | "dev": true | ||
9289 | }, | 9357 | }, |
9290 | "node_modules/multicast-dns": { | 9358 | "node_modules/multicast-dns": { |
9291 | "version": "6.2.3", | 9359 | "version": "6.2.3", |
@@ -10126,6 +10194,16 @@ | |||
10126 | "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==", | 10194 | "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==", |
10127 | "dev": true | 10195 | "dev": true |
10128 | }, | 10196 | }, |
10197 | "node_modules/parseqs": { | ||
10198 | "version": "0.0.6", | ||
10199 | "resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.6.tgz", | ||
10200 | "integrity": "sha512-jeAGzMDbfSHHA091hr0r31eYfTig+29g3GKKE/PPbEQ65X0lmMwlEoqmhzu0iztID5uJpZsFlUPDP8ThPL7M8w==" | ||
10201 | }, | ||
10202 | "node_modules/parseuri": { | ||
10203 | "version": "0.0.6", | ||
10204 | "resolved": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.6.tgz", | ||
10205 | "integrity": "sha512-AUjen8sAkGgao7UyCX6Ahv0gIK2fABKmYjvP4xmy5JaKvcbTRueIqIPHLAfq30xJddqSE033IOMUSOMCcK3Sow==" | ||
10206 | }, | ||
10129 | "node_modules/parseurl": { | 10207 | "node_modules/parseurl": { |
10130 | "version": "1.3.3", | 10208 | "version": "1.3.3", |
10131 | "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", | 10209 | "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", |
@@ -12264,6 +12342,36 @@ | |||
12264 | "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", | 12342 | "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", |
12265 | "dev": true | 12343 | "dev": true |
12266 | }, | 12344 | }, |
12345 | "node_modules/socket.io-client": { | ||
12346 | "version": "4.1.3", | ||
12347 | "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-4.1.3.tgz", | ||
12348 | "integrity": "sha512-hISFn6PDpgDifVUiNklLHVPTMv1LAk8poHArfIUdXa+gKgbr0MZbAlquDFqCqsF30yBqa+jg42wgos2FK50BHA==", | ||
12349 | "dependencies": { | ||
12350 | "@types/component-emitter": "^1.2.10", | ||
12351 | "backo2": "~1.0.2", | ||
12352 | "component-emitter": "~1.3.0", | ||
12353 | "debug": "~4.3.1", | ||
12354 | "engine.io-client": "~5.1.2", | ||
12355 | "parseuri": "0.0.6", | ||
12356 | "socket.io-parser": "~4.0.4" | ||
12357 | }, | ||
12358 | "engines": { | ||
12359 | "node": ">=10.0.0" | ||
12360 | } | ||
12361 | }, | ||
12362 | "node_modules/socket.io-parser": { | ||
12363 | "version": "4.0.4", | ||
12364 | "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.0.4.tgz", | ||
12365 | "integrity": "sha512-t+b0SS+IxG7Rxzda2EVvyBZbvFPBCjJoyHuE0P//7OAsN23GItzDRdWa6ALxZI/8R5ygK7jAR6t028/z+7295g==", | ||
12366 | "dependencies": { | ||
12367 | "@types/component-emitter": "^1.2.10", | ||
12368 | "component-emitter": "~1.3.0", | ||
12369 | "debug": "~4.3.1" | ||
12370 | }, | ||
12371 | "engines": { | ||
12372 | "node": ">=10.0.0" | ||
12373 | } | ||
12374 | }, | ||
12267 | "node_modules/sockjs": { | 12375 | "node_modules/sockjs": { |
12268 | "version": "0.3.21", | 12376 | "version": "0.3.21", |
12269 | "resolved": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.21.tgz", | 12377 | "resolved": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.21.tgz", |
@@ -15225,6 +15333,11 @@ | |||
15225 | "node": ">=10" | 15333 | "node": ">=10" |
15226 | } | 15334 | } |
15227 | }, | 15335 | }, |
15336 | "node_modules/yeast": { | ||
15337 | "version": "0.1.2", | ||
15338 | "resolved": "https://registry.npmjs.org/yeast/-/yeast-0.1.2.tgz", | ||
15339 | "integrity": "sha1-AI4G2AlDIMNy28L47XagymyKxBk=" | ||
15340 | }, | ||
15228 | "node_modules/yorkie": { | 15341 | "node_modules/yorkie": { |
15229 | "version": "2.0.0", | 15342 | "version": "2.0.0", |
15230 | "resolved": "https://registry.npmjs.org/yorkie/-/yorkie-2.0.0.tgz", | 15343 | "resolved": "https://registry.npmjs.org/yorkie/-/yorkie-2.0.0.tgz", |
@@ -16510,6 +16623,11 @@ | |||
16510 | "@types/node": "*" | 16623 | "@types/node": "*" |
16511 | } | 16624 | } |
16512 | }, | 16625 | }, |
16626 | "@types/component-emitter": { | ||
16627 | "version": "1.2.11", | ||
16628 | "resolved": "https://registry.npmjs.org/@types/component-emitter/-/component-emitter-1.2.11.tgz", | ||
16629 | "integrity": "sha512-SRXjM+tfsSlA9VuG8hGO2nft2p8zjXCK1VcC6N4NXbBbYbSia9kzCChYQajIjzIqOOOuh5Ock6MmV2oux4jDZQ==" | ||
16630 | }, | ||
16513 | "@types/connect": { | 16631 | "@types/connect": { |
16514 | "version": "3.4.35", | 16632 | "version": "3.4.35", |
16515 | "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", | 16633 | "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", |
@@ -17683,6 +17801,11 @@ | |||
17683 | "@babel/helper-define-polyfill-provider": "^0.2.4" | 17801 | "@babel/helper-define-polyfill-provider": "^0.2.4" |
17684 | } | 17802 | } |
17685 | }, | 17803 | }, |
17804 | "backo2": { | ||
17805 | "version": "1.0.2", | ||
17806 | "resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz", | ||
17807 | "integrity": "sha1-MasayLEpNjRj41s+u2n038+6eUc=" | ||
17808 | }, | ||
17686 | "balanced-match": { | 17809 | "balanced-match": { |
17687 | "version": "1.0.2", | 17810 | "version": "1.0.2", |
17688 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", | 17811 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", |
@@ -17715,6 +17838,11 @@ | |||
17715 | } | 17838 | } |
17716 | } | 17839 | } |
17717 | }, | 17840 | }, |
17841 | "base64-arraybuffer": { | ||
17842 | "version": "0.1.4", | ||
17843 | "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.4.tgz", | ||
17844 | "integrity": "sha1-mBjHngWbE1X5fgQooBfIOOkLqBI=" | ||
17845 | }, | ||
17718 | "base64-js": { | 17846 | "base64-js": { |
17719 | "version": "1.5.1", | 17847 | "version": "1.5.1", |
17720 | "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", | 17848 | "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", |
@@ -18656,8 +18784,7 @@ | |||
18656 | "component-emitter": { | 18784 | "component-emitter": { |
18657 | "version": "1.3.0", | 18785 | "version": "1.3.0", |
18658 | "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", | 18786 | "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", |
18659 | "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", | 18787 | "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==" |
18660 | "dev": true | ||
18661 | }, | 18788 | }, |
18662 | "compressible": { | 18789 | "compressible": { |
18663 | "version": "2.0.18", | 18790 | "version": "2.0.18", |
@@ -19299,7 +19426,6 @@ | |||
19299 | "version": "4.3.2", | 19426 | "version": "4.3.2", |
19300 | "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", | 19427 | "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", |
19301 | "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", | 19428 | "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", |
19302 | "dev": true, | ||
19303 | "requires": { | 19429 | "requires": { |
19304 | "ms": "2.1.2" | 19430 | "ms": "2.1.2" |
19305 | } | 19431 | } |
@@ -19779,6 +19905,38 @@ | |||
19779 | "once": "^1.4.0" | 19905 | "once": "^1.4.0" |
19780 | } | 19906 | } |
19781 | }, | 19907 | }, |
19908 | "engine.io-client": { | ||
19909 | "version": "5.1.2", | ||
19910 | "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-5.1.2.tgz", | ||
19911 | "integrity": "sha512-blRrgXIE0A/eurWXRzvfCLG7uUFJqfTGFsyJzXSK71srMMGJ2VraBLg8Mdw28uUxSpVicepBN9X7asqpD1mZcQ==", | ||
19912 | "requires": { | ||
19913 | "base64-arraybuffer": "0.1.4", | ||
19914 | "component-emitter": "~1.3.0", | ||
19915 | "debug": "~4.3.1", | ||
19916 | "engine.io-parser": "~4.0.1", | ||
19917 | "has-cors": "1.1.0", | ||
19918 | "parseqs": "0.0.6", | ||
19919 | "parseuri": "0.0.6", | ||
19920 | "ws": "~7.4.2", | ||
19921 | "yeast": "0.1.2" | ||
19922 | }, | ||
19923 | "dependencies": { | ||
19924 | "ws": { | ||
19925 | "version": "7.4.6", | ||
19926 | "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz", | ||
19927 | "integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==", | ||
19928 | "requires": {} | ||
19929 | } | ||
19930 | } | ||
19931 | }, | ||
19932 | "engine.io-parser": { | ||
19933 | "version": "4.0.3", | ||
19934 | "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-4.0.3.tgz", | ||
19935 | "integrity": "sha512-xEAAY0msNnESNPc00e19y5heTPX4y/TJ36gr8t1voOaNmTojP9b3oK3BbJLFufW2XFPQaaijpFewm2g2Um3uqA==", | ||
19936 | "requires": { | ||
19937 | "base64-arraybuffer": "0.1.4" | ||
19938 | } | ||
19939 | }, | ||
19782 | "enhanced-resolve": { | 19940 | "enhanced-resolve": { |
19783 | "version": "4.5.0", | 19941 | "version": "4.5.0", |
19784 | "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.5.0.tgz", | 19942 | "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.5.0.tgz", |
@@ -20904,6 +21062,11 @@ | |||
20904 | "integrity": "sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA==", | 21062 | "integrity": "sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA==", |
20905 | "dev": true | 21063 | "dev": true |
20906 | }, | 21064 | }, |
21065 | "has-cors": { | ||
21066 | "version": "1.1.0", | ||
21067 | "resolved": "https://registry.npmjs.org/has-cors/-/has-cors-1.1.0.tgz", | ||
21068 | "integrity": "sha1-XkdHk/fqmEPRu5nCPu9J/xJv/zk=" | ||
21069 | }, | ||
20907 | "has-flag": { | 21070 | "has-flag": { |
20908 | "version": "3.0.0", | 21071 | "version": "3.0.0", |
20909 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", | 21072 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", |
@@ -22563,8 +22726,7 @@ | |||
22563 | "ms": { | 22726 | "ms": { |
22564 | "version": "2.1.2", | 22727 | "version": "2.1.2", |
22565 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", | 22728 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", |
22566 | "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", | 22729 | "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" |
22567 | "dev": true | ||
22568 | }, | 22730 | }, |
22569 | "multicast-dns": { | 22731 | "multicast-dns": { |
22570 | "version": "6.2.3", | 22732 | "version": "6.2.3", |
@@ -23246,6 +23408,16 @@ | |||
23246 | } | 23408 | } |
23247 | } | 23409 | } |
23248 | }, | 23410 | }, |
23411 | "parseqs": { | ||
23412 | "version": "0.0.6", | ||
23413 | "resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.6.tgz", | ||
23414 | "integrity": "sha512-jeAGzMDbfSHHA091hr0r31eYfTig+29g3GKKE/PPbEQ65X0lmMwlEoqmhzu0iztID5uJpZsFlUPDP8ThPL7M8w==" | ||
23415 | }, | ||
23416 | "parseuri": { | ||
23417 | "version": "0.0.6", | ||
23418 | "resolved": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.6.tgz", | ||
23419 | "integrity": "sha512-AUjen8sAkGgao7UyCX6Ahv0gIK2fABKmYjvP4xmy5JaKvcbTRueIqIPHLAfq30xJddqSE033IOMUSOMCcK3Sow==" | ||
23420 | }, | ||
23249 | "parseurl": { | 23421 | "parseurl": { |
23250 | "version": "1.3.3", | 23422 | "version": "1.3.3", |
23251 | "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", | 23423 | "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", |
@@ -25054,6 +25226,30 @@ | |||
25054 | } | 25226 | } |
25055 | } | 25227 | } |
25056 | }, | 25228 | }, |
25229 | "socket.io-client": { | ||
25230 | "version": "4.1.3", | ||
25231 | "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-4.1.3.tgz", | ||
25232 | "integrity": "sha512-hISFn6PDpgDifVUiNklLHVPTMv1LAk8poHArfIUdXa+gKgbr0MZbAlquDFqCqsF30yBqa+jg42wgos2FK50BHA==", | ||
25233 | "requires": { | ||
25234 | "@types/component-emitter": "^1.2.10", | ||
25235 | "backo2": "~1.0.2", | ||
25236 | "component-emitter": "~1.3.0", | ||
25237 | "debug": "~4.3.1", | ||
25238 | "engine.io-client": "~5.1.2", | ||
25239 | "parseuri": "0.0.6", | ||
25240 | "socket.io-parser": "~4.0.4" | ||
25241 | } | ||
25242 | }, | ||
25243 | "socket.io-parser": { | ||
25244 | "version": "4.0.4", | ||
25245 | "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.0.4.tgz", | ||
25246 | "integrity": "sha512-t+b0SS+IxG7Rxzda2EVvyBZbvFPBCjJoyHuE0P//7OAsN23GItzDRdWa6ALxZI/8R5ygK7jAR6t028/z+7295g==", | ||
25247 | "requires": { | ||
25248 | "@types/component-emitter": "^1.2.10", | ||
25249 | "component-emitter": "~1.3.0", | ||
25250 | "debug": "~4.3.1" | ||
25251 | } | ||
25252 | }, | ||
25057 | "sockjs": { | 25253 | "sockjs": { |
25058 | "version": "0.3.21", | 25254 | "version": "0.3.21", |
25059 | "resolved": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.21.tgz", | 25255 | "resolved": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.21.tgz", |
@@ -27462,6 +27658,11 @@ | |||
27462 | "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", | 27658 | "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", |
27463 | "dev": true | 27659 | "dev": true |
27464 | }, | 27660 | }, |
27661 | "yeast": { | ||
27662 | "version": "0.1.2", | ||
27663 | "resolved": "https://registry.npmjs.org/yeast/-/yeast-0.1.2.tgz", | ||
27664 | "integrity": "sha1-AI4G2AlDIMNy28L47XagymyKxBk=" | ||
27665 | }, | ||
27465 | "yorkie": { | 27666 | "yorkie": { |
27466 | "version": "2.0.0", | 27667 | "version": "2.0.0", |
27467 | "resolved": "https://registry.npmjs.org/yorkie/-/yorkie-2.0.0.tgz", | 27668 | "resolved": "https://registry.npmjs.org/yorkie/-/yorkie-2.0.0.tgz", |
diff --git a/package.json b/package.json index d1d42e8..f5251fc 100644 --- a/package.json +++ b/package.json | |||
@@ -2,7 +2,6 @@ | |||
2 | "name": "lom_frontend", | 2 | "name": "lom_frontend", |
3 | "version": "0.1.0", | 3 | "version": "0.1.0", |
4 | "private": true, | 4 | "private": true, |
5 | "proxy": "localhost:8000", | ||
6 | "scripts": { | 5 | "scripts": { |
7 | "serve": "vue-cli-service serve", | 6 | "serve": "vue-cli-service serve", |
8 | "build": "vue-cli-service build", | 7 | "build": "vue-cli-service build", |
@@ -11,6 +10,7 @@ | |||
11 | "dependencies": { | 10 | "dependencies": { |
12 | "axios": "^0.24.0", | 11 | "axios": "^0.24.0", |
13 | "core-js": "^3.6.5", | 12 | "core-js": "^3.6.5", |
13 | "socket.io-client": "^4.1.3", | ||
14 | "v-hotkey": "^0.9.0", | 14 | "v-hotkey": "^0.9.0", |
15 | "vue": "^2.6.11", | 15 | "vue": "^2.6.11", |
16 | "vue-notification": "^1.3.20", | 16 | "vue-notification": "^1.3.20", |
diff --git a/src/components/group/GroupSender.vue b/src/components/group/GroupSender.vue index 160ca76..ba36949 100644 --- a/src/components/group/GroupSender.vue +++ b/src/components/group/GroupSender.vue | |||
@@ -19,12 +19,13 @@ export default { | |||
19 | data() { | 19 | data() { |
20 | return { | 20 | return { |
21 | message: "", | 21 | message: "", |
22 | messages: [] | 22 | messages: [], |
23 | } | 23 | } |
24 | }, | 24 | }, |
25 | 25 | ||
26 | props: { | 26 | props: { |
27 | group: Object | 27 | group: Object, |
28 | socket: Object | ||
28 | }, | 29 | }, |
29 | 30 | ||
30 | methods: { | 31 | methods: { |
@@ -35,6 +36,7 @@ export default { | |||
35 | send_message(e) { | 36 | send_message(e) { |
36 | e.preventDefault() | 37 | e.preventDefault() |
37 | console.log(this.message) | 38 | console.log(this.message) |
39 | this.socket.emit("send_group_message", {message: this.message, group: this.group}) | ||
38 | this.message = "" | 40 | this.message = "" |
39 | }, | 41 | }, |
40 | 42 | ||
@@ -45,6 +47,11 @@ export default { | |||
45 | 47 | ||
46 | if(status===200) | 48 | if(status===200) |
47 | this.messages = data.messages | 49 | this.messages = data.messages |
50 | }, | ||
51 | |||
52 | push_message(message) { | ||
53 | if(message.receiver == this.group.id) | ||
54 | this.messages.push(message) | ||
48 | } | 55 | } |
49 | }, | 56 | }, |
50 | 57 | ||
@@ -56,6 +63,10 @@ export default { | |||
56 | this.$nextTick(function () { | 63 | this.$nextTick(function () { |
57 | this.$refs.input.focus() | 64 | this.$refs.input.focus() |
58 | 65 | ||
66 | this.socket.emit("join_group", {group_id: this.group.id}) | ||
67 | this.socket.on("receive_group_message", ({message}) => { | ||
68 | this.push_message(message) | ||
69 | }) | ||
59 | this.get_messages() | 70 | this.get_messages() |
60 | }) | 71 | }) |
61 | } | 72 | } |
@@ -63,5 +74,12 @@ export default { | |||
63 | </script> | 74 | </script> |
64 | 75 | ||
65 | <style scoped> | 76 | <style scoped> |
77 | .group_view { | ||
78 | width: 25%; | ||
79 | } | ||
66 | 80 | ||
81 | .messages { | ||
82 | overflow:auto; | ||
83 | height: 300px; | ||
84 | } | ||
67 | </style> | 85 | </style> |
diff --git a/src/components/group/Message.vue b/src/components/group/Message.vue index 56e2805..eedcc6e 100644 --- a/src/components/group/Message.vue +++ b/src/components/group/Message.vue | |||
@@ -1,5 +1,5 @@ | |||
1 | <template> | 1 | <template> |
2 | <div class="message"> | 2 | <div class="message" :class="{mine: is_message_mine}"> |
3 | <div class="sender">{{ get_message_user }}</div> | 3 | <div class="sender">{{ get_message_user }}</div> |
4 | <div class="content">{{ get_message_content }}</div> | 4 | <div class="content">{{ get_message_content }}</div> |
5 | <div class="date">{{ get_message_date }}</div> | 5 | <div class="date">{{ get_message_date }}</div> |
@@ -19,6 +19,8 @@ export default { | |||
19 | let date = new Date(this.message.create_date) | 19 | let date = new Date(this.message.create_date) |
20 | return `${date.getDate()}/${date.getMonth()} ${date.getHours()}:${date.getMinutes()}` | 20 | return `${date.getDate()}/${date.getMonth()} ${date.getHours()}:${date.getMinutes()}` |
21 | }, | 21 | }, |
22 | |||
23 | is_message_mine() { return this.message.is_mine } | ||
22 | }, | 24 | }, |
23 | 25 | ||
24 | created() { | 26 | created() { |
@@ -31,5 +33,11 @@ export default { | |||
31 | <style scoped> | 33 | <style scoped> |
32 | .message { | 34 | .message { |
33 | width: 100%; | 35 | width: 100%; |
36 | margin-bottom: 10px; | ||
37 | color: white; | ||
38 | } | ||
39 | |||
40 | .mine { | ||
41 | color: red; | ||
34 | } | 42 | } |
35 | </style> | 43 | </style> |
diff --git a/src/store/index.js b/src/store/index.js index 02e3efa..c131271 100644 --- a/src/store/index.js +++ b/src/store/index.js | |||
@@ -29,6 +29,10 @@ const store = new Vuex.Store({ | |||
29 | 29 | ||
30 | get_user: (state) => { | 30 | get_user: (state) => { |
31 | return state.user | 31 | return state.user |
32 | }, | ||
33 | |||
34 | get_token: (state) => { | ||
35 | return state.token | ||
32 | } | 36 | } |
33 | }, | 37 | }, |
34 | 38 | ||
diff --git a/src/views/Home.vue b/src/views/Home.vue index 7bd99a2..d85760b 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue | |||
@@ -5,6 +5,7 @@ | |||
5 | <div v-for="group in groups" :key="group.name" > | 5 | <div v-for="group in groups" :key="group.name" > |
6 | <GroupSender | 6 | <GroupSender |
7 | :group="group" | 7 | :group="group" |
8 | :socket="socket" | ||
8 | /> | 9 | /> |
9 | </div> | 10 | </div> |
10 | 11 | ||
@@ -26,6 +27,7 @@ | |||
26 | import Searcher from '@/components/searcher/Searcher.vue' | 27 | import Searcher from '@/components/searcher/Searcher.vue' |
27 | import GroupMaker from '@/components/group/GroupMaker.vue' | 28 | import GroupMaker from '@/components/group/GroupMaker.vue' |
28 | import GroupSender from '@/components/group/GroupSender.vue' | 29 | import GroupSender from '@/components/group/GroupSender.vue' |
30 | import io from 'socket.io-client' | ||
29 | 31 | ||
30 | const popups = { | 32 | const popups = { |
31 | searcher_show: false, | 33 | searcher_show: false, |
@@ -36,7 +38,8 @@ export default { | |||
36 | data() { | 38 | data() { |
37 | return { | 39 | return { |
38 | popups, | 40 | popups, |
39 | groups: [] | 41 | groups: [], |
42 | socket: Object | ||
40 | } | 43 | } |
41 | }, | 44 | }, |
42 | 45 | ||
@@ -92,6 +95,18 @@ export default { | |||
92 | if(!this.$store.getters['is_logged_in']) { | 95 | if(!this.$store.getters['is_logged_in']) { |
93 | this.$router.push('/login') | 96 | this.$router.push('/login') |
94 | } | 97 | } |
98 | |||
99 | this.socket = io() | ||
100 | this.socket.auth = { token: this.$store.getters.get_token }; | ||
101 | this.socket.connect(); | ||
102 | |||
103 | this.socket.on("connect", () => { | ||
104 | console.log("Socket connected!") | ||
105 | }); | ||
106 | |||
107 | this.socket.on("disconnect", () => { | ||
108 | console.log("Scoket dsiconected") | ||
109 | }) | ||
95 | } | 110 | } |
96 | 111 | ||
97 | } | 112 | } |
diff --git a/vue.config.js b/vue.config.js new file mode 100644 index 0000000..8ac410f --- /dev/null +++ b/vue.config.js | |||
@@ -0,0 +1,10 @@ | |||
1 | module.exports = { | ||
2 | devServer: { | ||
3 | proxy: { | ||
4 | '/': { | ||
5 | target: 'http://localhost:8001', | ||
6 | ws: true | ||
7 | }, | ||
8 | }, | ||
9 | } | ||
10 | } | ||