From eca6a784a1c77ba9055092b092e3dd6889f14813 Mon Sep 17 00:00:00 2001 From: Freeplay Date: Thu, 23 Feb 2023 20:50:58 -0500 Subject: [PATCH 01/40] fix not being able to click around there are new posts button --- packages/client/src/pages/timeline.vue | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/client/src/pages/timeline.vue b/packages/client/src/pages/timeline.vue index 3646e8d86..9357050c7 100644 --- a/packages/client/src/pages/timeline.vue +++ b/packages/client/src/pages/timeline.vue @@ -315,12 +315,14 @@ onMounted(() => { top: calc(var(--stickyTop, 0px) + 16px); z-index: 1000; width: 100%; + pointer-events: none; > button { display: block; margin: var(--margin) auto 0 auto; padding: 8px 16px; border-radius: 32px; + pointer-events: all; } } From ea5725b986a6922c0a1c21994231d65109af0756 Mon Sep 17 00:00:00 2001 From: Masaya Suzuki <15100604+massongit@users.noreply.github.com> Date: Fri, 24 Feb 2023 14:09:17 +0900 Subject: [PATCH 02/40] Check redis connection --------- Co-authored-by: tamaina --- package.json | 2 +- packages/backend/check_connect.js | 10 ++++++++++ packages/backend/package.json | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 packages/backend/check_connect.js diff --git a/package.json b/package.json index 11a539409..cc44c6468 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "scripts": { "rebuild": "pnpm run clean && pnpm -r run build && pnpm run gulp", "build": "pnpm -r run build && pnpm run gulp", - "start": "pnpm --filter backend run start", + "start": "pnpm check:connect && pnpm --filter backend run start", "start:test": "pnpm --filter backend run start:test", "init": "pnpm run migrate", "migrate": "pnpm --filter backend run migrate", diff --git a/packages/backend/check_connect.js b/packages/backend/check_connect.js new file mode 100644 index 000000000..8bf134a10 --- /dev/null +++ b/packages/backend/check_connect.js @@ -0,0 +1,10 @@ +import {loadConfig} from './built/config.js'; +import {createRedisConnection} from "./built/redis.js"; + +const config = loadConfig(); +const redis = createRedisConnection(config); + +redis.on('connect', () => redis.disconnect()); +redis.on('error', (e) => { + throw e; +}); diff --git a/packages/backend/package.json b/packages/backend/package.json index 55a64191a..f3aaafc9a 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -8,6 +8,7 @@ "start:test": "NODE_ENV=test pnpm node ./built/index.js", "migrate": "typeorm migration:run -d ormconfig.js", "revertmigration": "typeorm migration:revert -d ormconfig.js", + "check:connect": "node ./check_connect.js", "build": "pnpm swc src -d built -D", "watch": "pnpm swc src -d built -D -w", "lint": "pnpm rome check \"src/**/*.ts\"", From fce27471ab66572a5ce84e0505f5f710043f1192 Mon Sep 17 00:00:00 2001 From: yawhn Date: Fri, 24 Feb 2023 13:58:45 +0200 Subject: [PATCH 03/40] fix: multiple Ads' bugs. feat: Ads widget https://codeberg.org/calckey/calckey/issues/9138 https://codeberg.org/calckey/calckey/issues/9080 --- .../client/src/components/global/MkAd.vue | 15 ++++++----- .../client/src/pages/admin/promotions.vue | 26 +++++++++---------- packages/client/src/ui/classic.widgets.vue | 13 +++++----- .../client/src/ui/deck/widgets-column.vue | 16 ++++++------ packages/client/src/ui/universal.widgets.vue | 12 ++++----- 5 files changed, 41 insertions(+), 41 deletions(-) diff --git a/packages/client/src/components/global/MkAd.vue b/packages/client/src/components/global/MkAd.vue index 0316a6bdf..7fa015266 100644 --- a/packages/client/src/components/global/MkAd.vue +++ b/packages/client/src/components/global/MkAd.vue @@ -56,10 +56,13 @@ const choseAd = (): Ad | null => { } const lowPriorityAds = ads.filter(ad => ad.ratio === 0); + const widgetAds = ads.filter(ad => ad.place === 'widget'); ads = ads.filter(ad => ad.ratio !== 0); - - if (ads.length === 0) { - if (lowPriorityAds.length !== 0) { + + if (widgetAds.length !== 0) { + return widgetAds; + } else if (ads.length === 0) { + if (lowPriorityAds.length !== 0) { return lowPriorityAds[Math.floor(Math.random() * lowPriorityAds.length)]; } else { return null; @@ -132,7 +135,7 @@ function reduceFrequency(): void { } } - &.square { + &.widget { > a , > a > img { max-width: min(300px, 100%); @@ -140,7 +143,7 @@ function reduceFrequency(): void { } } - &.horizontal { + &.inline { padding: 8px; > a , @@ -150,7 +153,7 @@ function reduceFrequency(): void { } } - &.horizontal-big { + &.inline-big { padding: 8px; > a , diff --git a/packages/client/src/pages/admin/promotions.vue b/packages/client/src/pages/admin/promotions.vue index 09b7bd542..d2e57586e 100644 --- a/packages/client/src/pages/admin/promotions.vue +++ b/packages/client/src/pages/admin/promotions.vue @@ -13,20 +13,12 @@ - - - + + + - - + @@ -56,23 +48,29 @@ import FormSplit from '@/components/form/split.vue'; import * as os from '@/os'; import { i18n } from '@/i18n'; import { definePageMetadata } from '@/scripts/page-metadata'; +import { formatDateTimeString } from '@/scripts/format-time-string'; let ads: any[] = $ref([]); os.api('admin/ad/list').then(adsResponse => { ads = adsResponse; + // The date format should be changed to yyyy-MM-dd in order to be properly displayed + for (let i in ads) { + ads[i].expiresAt = ads[i].expiresAt.substr(0, 10); + } }); function add() { + const tomorrow = formatDateTimeString(new Date(new Date().setDate(new Date().getDate() + 1)), 'yyyy-MM-dd'); ads.unshift({ id: null, memo: '', - place: 'square', + place: 'widget', priority: 'middle', ratio: 1, url: '', imageUrl: null, - expiresAt: null, + expiresAt: tomorrow, }); } diff --git a/packages/client/src/ui/classic.widgets.vue b/packages/client/src/ui/classic.widgets.vue index 04ca34b55..3ed838d9f 100644 --- a/packages/client/src/ui/classic.widgets.vue +++ b/packages/client/src/ui/classic.widgets.vue @@ -1,11 +1,10 @@ diff --git a/packages/client/src/pages/about-calckey.vue b/packages/client/src/pages/about-calckey.vue index 155faba81..a768be59c 100644 --- a/packages/client/src/pages/about-calckey.vue +++ b/packages/client/src/pages/about-calckey.vue @@ -20,17 +20,17 @@ @@ -209,6 +209,6 @@ const headerTabs = $computed(() => []); definePageMetadata({ title: i18n.ts.security, - icon: 'ph-lock-bold ph-lg', + icon: 'ph-lock ph-bold ph-lg', }); diff --git a/packages/client/src/pages/admin/settings.vue b/packages/client/src/pages/admin/settings.vue index 83eb12730..1a4589ab3 100644 --- a/packages/client/src/pages/admin/settings.vue +++ b/packages/client/src/pages/admin/settings.vue @@ -14,7 +14,7 @@ - + @@ -24,7 +24,7 @@ - + @@ -80,27 +80,27 @@ - + - + - + - + - + @@ -163,12 +163,12 @@ @@ -178,7 +178,7 @@ - + @@ -316,7 +316,7 @@ function save() { const headerActions = $computed(() => [{ asFullButton: true, - icon: 'ph-check-bold ph-lg', + icon: 'ph-check ph-bold ph-lg', text: i18n.ts.save, handler: save, }]); @@ -325,6 +325,6 @@ const headerTabs = $computed(() => []); definePageMetadata({ title: i18n.ts.general, - icon: 'ph-gear-six-bold ph-lg', + icon: 'ph-gear-six ph-bold ph-lg', }); diff --git a/packages/client/src/pages/admin/users.vue b/packages/client/src/pages/admin/users.vue index dc8079c0e..4a26ed07c 100644 --- a/packages/client/src/pages/admin/users.vue +++ b/packages/client/src/pages/admin/users.vue @@ -114,17 +114,17 @@ function show(user) { } const headerActions = $computed(() => [{ - icon: 'ph-magnifying-glass-bold ph-lg', + icon: 'ph-magnifying-glass ph-bold ph-lg', text: i18n.ts.search, handler: searchUser, }, { asFullButton: true, - icon: 'ph-plus-bold ph-lg', + icon: 'ph-plus ph-bold ph-lg', text: i18n.ts.addUser, handler: addUser, }, { asFullButton: true, - icon: 'ph-magnifying-glass-bold ph-lg', + icon: 'ph-magnifying-glass ph-bold ph-lg', text: i18n.ts.lookup, handler: lookupUser, }]); @@ -133,7 +133,7 @@ const headerTabs = $computed(() => []); definePageMetadata(computed(() => ({ title: i18n.ts.users, - icon: 'ph-users-bold ph-lg', + icon: 'ph-users ph-bold ph-lg', }))); diff --git a/packages/client/src/pages/announcements.vue b/packages/client/src/pages/announcements.vue index 94fc5ba26..452ab8014 100644 --- a/packages/client/src/pages/announcements.vue +++ b/packages/client/src/pages/announcements.vue @@ -10,7 +10,7 @@ @@ -46,7 +46,7 @@ const headerTabs = $computed(() => []); definePageMetadata({ title: i18n.ts.announcements, - icon: 'ph-megaphone-simple-bold ph-lg', + icon: 'ph-megaphone-simple ph-bold ph-lg', }); diff --git a/packages/client/src/pages/antenna-timeline.vue b/packages/client/src/pages/antenna-timeline.vue index 7624d6104..f883645e3 100644 --- a/packages/client/src/pages/antenna-timeline.vue +++ b/packages/client/src/pages/antenna-timeline.vue @@ -88,15 +88,15 @@ watch(() => props.antennaId, async () => { }, { immediate: true }); const headerActions = $computed(() => antenna ? [{ - icon: 'ph-calendar-blank-bold ph-lg', + icon: 'ph-calendar-blank ph-bold ph-lg', text: i18n.ts.jumpToSpecifiedDate, handler: timetravel, }, { - icon: 'ph-gear-six-bold ph-lg', + icon: 'ph-gear-six ph-bold ph-lg', text: i18n.ts.settings, handler: settings, }, { - icon: 'ph-check-bold ph-lg', + icon: 'ph-check ph-bold ph-lg', text: i18n.ts.markAllAsRead, handler: markRead, }] : []); @@ -105,7 +105,7 @@ const headerTabs = $computed(() => []); definePageMetadata(computed(() => antenna ? { title: antenna.name, - icon: 'ph-flying-saucer-bold ph-lg', + icon: 'ph-flying-saucer ph-bold ph-lg', } : null)); diff --git a/packages/client/src/pages/api-console.vue b/packages/client/src/pages/api-console.vue index e43f4c76d..0707f52f9 100644 --- a/packages/client/src/pages/api-console.vue +++ b/packages/client/src/pages/api-console.vue @@ -15,7 +15,7 @@ - +
@@ -84,6 +84,6 @@ const headerTabs = $computed(() => []); definePageMetadata({ title: 'API console', - icon: 'ph-terminal-window-bold ph-lg', + icon: 'ph-terminal-window ph-bold ph-lg', }); diff --git a/packages/client/src/pages/apps.vue b/packages/client/src/pages/apps.vue index 0bb4aa904..24d704571 100644 --- a/packages/client/src/pages/apps.vue +++ b/packages/client/src/pages/apps.vue @@ -13,9 +13,9 @@ @@ -119,6 +119,6 @@ const headerTabs = $computed(() => []); definePageMetadata({ title: i18n.ts._plugin.install, - icon: 'ph-download-simple-bold ph-lg', + icon: 'ph-download-simple ph-bold ph-lg', }); diff --git a/packages/client/src/pages/settings/plugin.vue b/packages/client/src/pages/settings/plugin.vue index 96c7314ca..7949bff03 100644 --- a/packages/client/src/pages/settings/plugin.vue +++ b/packages/client/src/pages/settings/plugin.vue @@ -1,6 +1,6 @@
@@ -46,8 +46,8 @@
- {{ i18n.ts.preview }} - {{ i18n.ts.default }} + {{ i18n.ts.preview }} + {{ i18n.ts.default }}
@@ -127,9 +127,9 @@ const headerTabs = $computed(() => []); definePageMetadata({ title: i18n.ts.reaction, - icon: 'ph-smiley-bold ph-lg', + icon: 'ph-smiley ph-bold ph-lg', action: { - icon: 'ph-eye-bold ph-lg', + icon: 'ph-eye ph-bold ph-lg', handler: preview, }, }); diff --git a/packages/client/src/pages/settings/security.vue b/packages/client/src/pages/settings/security.vue index a5fbc774e..86632234f 100644 --- a/packages/client/src/pages/settings/security.vue +++ b/packages/client/src/pages/settings/security.vue @@ -17,8 +17,8 @@
- - + + {{ item.ip }}
@@ -30,7 +30,7 @@ - {{ i18n.ts.regenerateLoginToken }} + {{ i18n.ts.regenerateLoginToken }} @@ -103,7 +103,7 @@ const headerTabs = $computed(() => []); definePageMetadata({ title: i18n.ts.security, - icon: 'ph-lock-bold ph-lg', + icon: 'ph-lock ph-bold ph-lg', }); diff --git a/packages/client/src/pages/settings/sounds.vue b/packages/client/src/pages/settings/sounds.vue index c2297e212..e7f2c8391 100644 --- a/packages/client/src/pages/settings/sounds.vue +++ b/packages/client/src/pages/settings/sounds.vue @@ -9,11 +9,11 @@ {{ i18n.t('_sfx.' + type) }} - + - {{ i18n.ts.default }} + {{ i18n.ts.default }}
@@ -38,7 +38,7 @@ const masterVolume = computed({ }, }); -const volumeIcon = computed(() => masterVolume.value === 0 ? 'ph-speaker-none-bold ph-lg' : 'ph-speaker-high-bold ph-lg'); +const volumeIcon = computed(() => masterVolume.value === 0 ? 'ph-speaker-none-bold ph-lg' : 'ph-speaker-high ph-bold ph-lg'); const sounds = ref({ note: ColdDeviceStorage.get('sound_note'), @@ -106,6 +106,6 @@ const headerTabs = $computed(() => []); definePageMetadata({ title: i18n.ts.sounds, - icon: 'ph-speaker-high-bold ph-lg', + icon: 'ph-speaker-high ph-bold ph-lg', }); diff --git a/packages/client/src/pages/settings/statusbar.vue b/packages/client/src/pages/settings/statusbar.vue index 52ad2abec..dd12576ac 100644 --- a/packages/client/src/pages/settings/statusbar.vue +++ b/packages/client/src/pages/settings/statusbar.vue @@ -48,7 +48,7 @@ const headerTabs = $computed(() => []); definePageMetadata({ title: i18n.ts.statusbar, - icon: 'ph-list-bullets-bold ph-lg', + icon: 'ph-list-bullets ph-bold ph-lg', bg: 'var(--bg)', }); diff --git a/packages/client/src/pages/settings/theme.install.vue b/packages/client/src/pages/settings/theme.install.vue index d3b94690d..03dcd24c1 100644 --- a/packages/client/src/pages/settings/theme.install.vue +++ b/packages/client/src/pages/settings/theme.install.vue @@ -5,8 +5,8 @@
- {{ i18n.ts.preview }} - {{ i18n.ts.install }} + {{ i18n.ts.preview }} + {{ i18n.ts.install }}
@@ -75,6 +75,6 @@ const headerTabs = $computed(() => []); definePageMetadata({ title: i18n.ts._theme.install, - icon: 'ph-download-simple-bold ph-lg', + icon: 'ph-download-simple ph-bold ph-lg', }); diff --git a/packages/client/src/pages/settings/theme.manage.vue b/packages/client/src/pages/settings/theme.manage.vue index 02eea112b..b0742b279 100644 --- a/packages/client/src/pages/settings/theme.manage.vue +++ b/packages/client/src/pages/settings/theme.manage.vue @@ -20,7 +20,7 @@ - {{ i18n.ts.uninstall }} + {{ i18n.ts.uninstall }} @@ -73,6 +73,6 @@ const headerTabs = $computed(() => []); definePageMetadata({ title: i18n.ts._theme.manage, - icon: 'ph-folder-notch-open-bold ph-lg', + icon: 'ph-folder-notch-open ph-bold ph-lg', }); diff --git a/packages/client/src/pages/settings/theme.vue b/packages/client/src/pages/settings/theme.vue index 4cb43be54..15c65bd10 100644 --- a/packages/client/src/pages/settings/theme.vue +++ b/packages/client/src/pages/settings/theme.vue @@ -29,7 +29,7 @@
- + @@ -40,7 +40,7 @@ - + @@ -53,10 +53,10 @@
- {{ i18n.ts._theme.manage }} - {{ i18n.ts._theme.explore }} - {{ i18n.ts._theme.install }} - {{ i18n.ts._theme.make }} + {{ i18n.ts._theme.manage }} + {{ i18n.ts._theme.explore }} + {{ i18n.ts._theme.install }} + {{ i18n.ts._theme.make }}
@@ -160,7 +160,7 @@ const headerTabs = $computed(() => []); definePageMetadata({ title: i18n.ts.theme, - icon: 'ph-palette-bold ph-lg', + icon: 'ph-palette ph-bold ph-lg', }); diff --git a/packages/client/src/pages/settings/webhook.edit.vue b/packages/client/src/pages/settings/webhook.edit.vue index d99de887d..7c4cc3460 100644 --- a/packages/client/src/pages/settings/webhook.edit.vue +++ b/packages/client/src/pages/settings/webhook.edit.vue @@ -9,7 +9,7 @@ - + @@ -28,7 +28,7 @@ Active
- {{ i18n.ts.save }} + {{ i18n.ts.save }}
@@ -89,6 +89,6 @@ const headerTabs = $computed(() => []); definePageMetadata({ title: 'Edit webhook', - icon: 'ph-lightning-bold ph-lg', + icon: 'ph-lightning ph-bold ph-lg', }); diff --git a/packages/client/src/pages/settings/webhook.new.vue b/packages/client/src/pages/settings/webhook.new.vue index c0ebd993d..ab16ccecd 100644 --- a/packages/client/src/pages/settings/webhook.new.vue +++ b/packages/client/src/pages/settings/webhook.new.vue @@ -9,7 +9,7 @@ - + @@ -26,7 +26,7 @@
- {{ i18n.ts.create }} + {{ i18n.ts.create }}
@@ -77,6 +77,6 @@ const headerTabs = $computed(() => []); definePageMetadata({ title: 'Create new webhook', - icon: 'ph-lightning-bold ph-lg', + icon: 'ph-lightning ph-bold ph-lg', }); diff --git a/packages/client/src/pages/settings/webhook.vue b/packages/client/src/pages/settings/webhook.vue index e0ad346dd..ae42f3e30 100644 --- a/packages/client/src/pages/settings/webhook.vue +++ b/packages/client/src/pages/settings/webhook.vue @@ -11,10 +11,10 @@