Skip to content
This repository has been archived by the owner on Apr 8, 2021. It is now read-only.

Commit

Permalink
Merge pull request #2 from SvenC56/next
Browse files Browse the repository at this point in the history
Next
  • Loading branch information
SvenC56 authored Sep 20, 2020
2 parents a3384d8 + 597d6f3 commit 041b5da
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 92 deletions.
4 changes: 2 additions & 2 deletions frontend/nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ export default {
// Doc: https://github.com/nuxt-community/stylelint-module
'@nuxtjs/stylelint-module',
'@nuxtjs/vuetify',
// Doc: https://github.com/nuxt-community/moment-module#readme
'@nuxtjs/moment',
// Doc: https://github.com/nuxt-community/dayjs-module
'@nuxtjs/dayjs',
],
/*
** Nuxt.js modules
Expand Down
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"dependencies": {
"@nuxtjs/axios": "^5.12.2",
"@nuxtjs/moment": "^1.6.1",
"@nuxtjs/dayjs": "^1.2.0",
"@nuxtjs/proxy": "^2.0.1",
"@nuxtjs/pwa": "^3.0.2",
"nuxt": "^2.14.5"
Expand Down
7 changes: 4 additions & 3 deletions frontend/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@
</template>

<script>
import relativeTime from 'dayjs/plugin/relativeTime'
export default {
data() {
return {
Expand Down Expand Up @@ -229,6 +231,7 @@ export default {
},
async mounted() {
this.$dayjs.extend(relativeTime)
await this.getData()
},
Expand All @@ -248,9 +251,7 @@ export default {
},
getRelativeTimestamp(timestamp) {
return timestamp !== null
? this.$moment(timestamp).startOf('minute').fromNow()
: ''
return timestamp !== null ? this.$dayjs(timestamp).fromNow() : ''
},
editItem(item) {
Expand Down
59 changes: 15 additions & 44 deletions frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1224,6 +1224,14 @@
consola "^2.15.0"
defu "^3.1.0"

"@nuxtjs/dayjs@^1.2.0":
version "1.2.0"
resolved "https://registry.yarnpkg.com/@nuxtjs/dayjs/-/dayjs-1.2.0.tgz#5c2ddb45092187532926469f3b825bce003f19e9"
integrity sha512-3SmiHKV8yaMAKII9pj7iYdboH8Xi9ekIXb21JaAQV+qIpLnb107w1EAO1y9Mylc0VVRA0GvxCHr9crPZ7cuuZw==
dependencies:
consola "^2.3.2"
dayjs "^1.8.9"

"@nuxtjs/eslint-config@^3.1.0":
version "3.1.0"
resolved "https://registry.yarnpkg.com/@nuxtjs/eslint-config/-/eslint-config-3.1.0.tgz#7e73aa08035a743b99e64ee4337cf526a09c9973"
Expand All @@ -1246,16 +1254,6 @@
consola "^2.11.3"
eslint-loader "^4.0.2"

"@nuxtjs/moment@^1.6.1":
version "1.6.1"
resolved "https://registry.yarnpkg.com/@nuxtjs/moment/-/moment-1.6.1.tgz#a4e98a861c9d21e34f983046143f4c9bb92bdb7c"
integrity sha512-Mo2/3NQB0XryMQuNCTVnAclrDvt9I9sr6dwVm56KhYCoiWTKgQ78tDV9tmrxw7lahw1IBwyPGhw+3pwkM4phAA==
dependencies:
moment "^2.25.3"
moment-locales-webpack-plugin "^1.2.0"
moment-timezone "^0.5.28"
moment-timezone-data-webpack-plugin "^1.3.0"

"@nuxtjs/proxy@^2.0.1":
version "2.0.1"
resolved "https://registry.yarnpkg.com/@nuxtjs/proxy/-/proxy-2.0.1.tgz#2469b6e316311aa8c60d348502a54bfe6d5536aa"
Expand Down Expand Up @@ -2782,7 +2780,7 @@ connect@^3.7.0:
parseurl "~1.3.3"
utils-merge "1.0.1"

consola@^2.10.0, consola@^2.10.1, consola@^2.11.3, consola@^2.12.1, consola@^2.14.0, consola@^2.15.0, consola@^2.6.0, consola@^2.9.0:
consola@^2.10.0, consola@^2.10.1, consola@^2.11.3, consola@^2.12.1, consola@^2.14.0, consola@^2.15.0, consola@^2.3.2, consola@^2.6.0, consola@^2.9.0:
version "2.15.0"
resolved "https://registry.yarnpkg.com/consola/-/consola-2.15.0.tgz#40fc4eefa4d2f8ef2e2806147f056ea207fcc0e9"
integrity sha512-vlcSGgdYS26mPf7qNi+dCisbhiyDnrN1zaRbw3CSuc2wGOMEGGPsp46PdRG5gqXwgtJfjxDkxRNAgRPr1B77vQ==
Expand Down Expand Up @@ -3173,6 +3171,11 @@ cyclist@^1.0.1:
resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-1.0.1.tgz#596e9698fd0c80e12038c2b82d6eb1b35b6224d9"
integrity sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk=

dayjs@^1.8.9:
version "1.8.36"
resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.8.36.tgz#be36e248467afabf8f5a86bae0de0cdceecced50"
integrity sha512-3VmRXEtw7RZKAf+4Tv1Ym9AGeo8r8+CjDi26x+7SYQil1UqtqdaokhzoEJohqlzt0m5kacJSDhJQkG/LWhpRBw==

de-indent@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/de-indent/-/de-indent-1.0.2.tgz#b2038e846dc33baa5796128d0804b455b8c1e21d"
Expand Down Expand Up @@ -5613,11 +5616,6 @@ lodash._reinterpolate@^3.0.0:
resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d"
integrity sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0=

lodash.difference@^4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/lodash.difference/-/lodash.difference-4.5.0.tgz#9ccb4e505d486b91651345772885a2df27fd017c"
integrity sha1-nMtOUF1Ia5FlE0V3KIWi3yf9AXw=

lodash.get@^4.4.2:
version "4.4.2"
resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99"
Expand Down Expand Up @@ -5734,7 +5732,7 @@ make-dir@^2.0.0:
pify "^4.0.1"
semver "^5.6.0"

make-dir@^3.0.0, make-dir@^3.0.2:
make-dir@^3.0.2:
version "3.1.0"
resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f"
integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==
Expand Down Expand Up @@ -6048,33 +6046,6 @@ mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@~0.5.1:
dependencies:
minimist "^1.2.5"

moment-locales-webpack-plugin@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/moment-locales-webpack-plugin/-/moment-locales-webpack-plugin-1.2.0.tgz#9af83876a44053706b868ceece5119584d10d7aa"
integrity sha512-QAi5v0OlPUP7GXviKMtxnpBAo8WmTHrUNN7iciAhNOEAd9evCOvuN0g1N7ThIg3q11GLCkjY1zQ2saRcf/43nQ==
dependencies:
lodash.difference "^4.5.0"

moment-timezone-data-webpack-plugin@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/moment-timezone-data-webpack-plugin/-/moment-timezone-data-webpack-plugin-1.3.0.tgz#8d5b7ffe42f0506933195779063a74cfff11aab1"
integrity sha512-0V0xnHZpdHLsSerIQ2yNEPBC3uJWfU/zNT3nB0PO+tjmGHuNeUWqNDiw7ZpLo54uER6/OAE75EJ7ThmlwkGuZw==
dependencies:
find-cache-dir "^3.0.0"
make-dir "^3.0.0"

moment-timezone@^0.5.28:
version "0.5.31"
resolved "https://registry.yarnpkg.com/moment-timezone/-/moment-timezone-0.5.31.tgz#9c40d8c5026f0c7ab46eda3d63e49c155148de05"
integrity sha512-+GgHNg8xRhMXfEbv81iDtrVeTcWt0kWmTEY1XQK14dICTXnWJnT0dxdlPspwqF3keKMVPXwayEsk1DI0AA/jdA==
dependencies:
moment ">= 2.9.0"

"moment@>= 2.9.0", moment@^2.25.3:
version "2.28.0"
resolved "https://registry.yarnpkg.com/moment/-/moment-2.28.0.tgz#cdfe73ce01327cee6537b0fafac2e0f21a237d75"
integrity sha512-Z5KOjYmnHyd/ukynmFd/WwyXHd7L4J9vTI/nn5Ap9AVUgaAE15VvQ9MOGmJJygEUklupqIrFnor/tjTwRU+tQw==

move-concurrently@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/move-concurrently/-/move-concurrently-1.0.1.tgz#be2c005fda32e0b29af1f05d7c4b33214c701f92"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"jest": "^26.4.2",
"prettier": "^2.1.2",
"supertest": "^4.0.2",
"ts-jest": "^26.3.0",
"ts-jest": "^26.4.0",
"ts-loader": "^8.0.4",
"ts-node": "^9.0.0",
"tsconfig-paths": "^3.9.0",
Expand Down
15 changes: 2 additions & 13 deletions src/sync/interface/create-channel.interface.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
import { Codec } from 'ts3-nodejs-library';
import { Assignment } from 'src/assignment/assignment.entity';

export interface CreateChannel {
channelName: string;
id: number;
parent: number;
prefix: string;
min: number;
max: number;
codec: Codec;
quality: number;
joinPower: number;
topic: string;
description: string;
createdAt: Date;
updatedAt: Date;
assignment: Assignment;
}
21 changes: 12 additions & 9 deletions src/sync/sync.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,14 @@ export class SyncService {
if (filteredChannels[filteredChannels.length - 1]) {
const highestChannelNumber = this.getChannelNumber(filteredChannels);
toCreate.push({
...element,
assignment: element,
channelName: `${element.prefix} ${highestChannelNumber + 1}`,
});
} else {
toCreate.push({ ...element, channelName: `${element.prefix} 1` });
toCreate.push({
assignment: element,
channelName: `${element.prefix} 1`,
});
}
} else {
const markDelete = filteredChannels.filter((x) => x.totalClients === 0);
Expand All @@ -91,17 +94,17 @@ export class SyncService {
try {
const channelName = channel.channelName;
const properties: ChannelEdit = {
cpid: '' + channel.parent,
channelCodec: channel.codec,
channelCodecQuality: channel.quality,
cpid: '' + channel.assignment.parent,
channelCodec: channel.assignment.codec,
channelCodecQuality: channel.assignment.quality,
channelFlagPermanent: true,
channelTopic: channel.topic,
channelDescription: channel.description,
channelTopic: channel.assignment.topic,
channelDescription: channel.assignment.description,
};
const perms: Permission.PermType[] = [
{
permname: 'i_channel_needed_join_power',
permvalue: channel.joinPower,
permvalue: channel.assignment.joinPower,
},
{ permname: 'i_channel_needed_modify_power', permvalue: 75 },
];
Expand All @@ -111,7 +114,7 @@ export class SyncService {
perms,
);
this.logger.log(
`Create channel '${channel.channelName}' with Parent ID: ${channel.parent}`,
`Create channel '${channel.channelName}' with Parent ID: ${channel.assignment.parent}`,
);
} catch (error) {
this.logger.error(error.message);
Expand Down
43 changes: 24 additions & 19 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2779,11 +2779,11 @@ debug@^3.1.0, debug@^3.2.6:
ms "^2.1.1"

debug@^4.0.1, debug@^4.1.0, debug@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791"
integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==
version "4.2.0"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.2.0.tgz#7f150f93920e94c58f5574c2fd01a3110effe7f1"
integrity sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==
dependencies:
ms "^2.1.1"
ms "2.1.2"

decache@^4.5.1:
version "4.6.0"
Expand Down Expand Up @@ -5318,7 +5318,7 @@ jest-snapshot@^26.4.2:
pretty-format "^26.4.2"
semver "^7.3.2"

jest-util@26.x, jest-util@^26.3.0:
jest-util@^26.1.0, jest-util@^26.3.0:
version "26.3.0"
resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-26.3.0.tgz#a8974b191df30e2bf523ebbfdbaeb8efca535b3e"
integrity sha512-4zpn6bwV0+AMFN0IYhH/wnzIQzRaYVrz1A8sYnRnj4UXDXbOVtWmlaZkO9mipFqZ13okIfN87aDoJWB7VH6hcw==
Expand Down Expand Up @@ -6022,7 +6022,7 @@ [email protected]:
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a"
integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==

ms@^2.1.1:
ms@2.1.2, ms@^2.1.1:
version "2.1.2"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==
Expand Down Expand Up @@ -8420,22 +8420,22 @@ [email protected]:
resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.2.tgz#4ca09a9092c88b73a7cdc5e8a01b507b0790a0cc"
integrity sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==

ts-jest@^26.3.0:
version "26.3.0"
resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-26.3.0.tgz#6b2845045347dce394f069bb59358253bc1338a9"
integrity sha512-Jq2uKfx6bPd9+JDpZNMBJMdMQUC3sJ08acISj8NXlVgR2d5OqslEHOR2KHMgwymu8h50+lKIm0m0xj/ioYdW2Q==
ts-jest@^26.4.0:
version "26.4.0"
resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-26.4.0.tgz#903c7827f3d3bc33efc2f91be294b164400c32e3"
integrity sha512-ofBzoCqf6Nv/PoWb/ByV3VNKy2KJSikamOBxvR3E6eVdIw10GwAXoyvMWXXjZJK2s6S27ZE8fI+JBTnGaovl6Q==
dependencies:
"@types/jest" "26.x"
bs-logger "0.x"
buffer-from "1.x"
fast-json-stable-stringify "2.x"
jest-util "26.x"
jest-util "^26.1.0"
json5 "2.x"
lodash.memoize "4.x"
make-error "1.x"
mkdirp "1.x"
semver "7.x"
yargs-parser "18.x"
yargs-parser "20.x"

ts-loader@^8.0.4:
version "8.0.4"
Expand Down Expand Up @@ -9147,13 +9147,10 @@ yargonaut@^1.1.2:
figlet "^1.1.1"
parent-require "^1.0.0"

[email protected], yargs-parser@^18.1.2:
version "18.1.3"
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.3.tgz#be68c4975c6b2abf469236b0c870362fab09a7b0"
integrity sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==
dependencies:
camelcase "^5.0.0"
decamelize "^1.2.0"
[email protected]:
version "20.1.0"
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.1.0.tgz#9abade5095ac4391156496743e60d5ec9a5b486c"
integrity sha512-RV4YEjMLfjWkK9jNV/aZytlJ5uz+JBk7t29FofILa41jJAU/yCwghgsjH2xT0h7eu7b6MrCDJb1qZjeDJ/jI1w==

yargs-parser@^13.1.2:
version "13.1.2"
Expand All @@ -9163,6 +9160,14 @@ yargs-parser@^13.1.2:
camelcase "^5.0.0"
decamelize "^1.2.0"

yargs-parser@^18.1.2:
version "18.1.3"
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.3.tgz#be68c4975c6b2abf469236b0c870362fab09a7b0"
integrity sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==
dependencies:
camelcase "^5.0.0"
decamelize "^1.2.0"

yargs@^13.2.1:
version "13.3.2"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.2.tgz#ad7ffefec1aa59565ac915f82dccb38a9c31a2dd"
Expand Down

0 comments on commit 041b5da

Please sign in to comment.