From f63b1bdca2d938f70b82cddfe69caa2c1cf0ba23 Mon Sep 17 00:00:00 2001 From: Thomas <78288562+Kiokuu@users.noreply.github.com> Date: Sun, 24 Aug 2025 01:00:08 +0100 Subject: [PATCH] Group add last visited (#1351) * Fixed compilation/project files on Visual Studio. * Add group instance last visit (#1286) * Fixed erroneous translation + remove x-link --- DBMerger/DBMerger.csproj | 4 +- Dotnet/VRCX-Cef.csproj | 4 +- Dotnet/VRCX-Electron.csproj | 4 +- VRCX.sln | 22 +-- .../dialogs/GroupDialog/GroupDialog.vue | 27 +++ .../PreviousInstancesGroupDialog.vue | 161 ++++++++++++++++++ .../dialogs/UserDialog/UserDialog.vue | 4 +- .../dialogs/WorldDialog/WorldDialog.vue | 2 +- src/localization/cz/en.json | 3 +- src/localization/en/en.json | 5 +- src/localization/es/en.json | 3 +- src/localization/fr/en.json | 3 +- src/localization/hu/en.json | 3 +- src/localization/ja/en.json | 5 +- src/localization/ko/en.json | 3 +- src/localization/pl/en.json | 3 +- src/localization/pt/en.json | 3 +- src/localization/ru/en.json | 5 +- src/localization/th/en.json | 5 +- src/localization/vi/en.json | 3 +- src/localization/zh-CN/en.json | 5 +- src/localization/zh-TW/en.json | 5 +- src/service/database/gameLog.js | 49 ++++++ src/stores/group.js | 8 + 24 files changed, 300 insertions(+), 39 deletions(-) create mode 100644 src/components/dialogs/PreviousInstancesDialog/PreviousInstancesGroupDialog.vue diff --git a/DBMerger/DBMerger.csproj b/DBMerger/DBMerger.csproj index a0102c28..f1d76bdc 100644 --- a/DBMerger/DBMerger.csproj +++ b/DBMerger/DBMerger.csproj @@ -5,7 +5,9 @@ Exe net9 - x64 + Debug;Release + x64 + x64 0 1.0.0.%2a DBMerger diff --git a/Dotnet/VRCX-Cef.csproj b/Dotnet/VRCX-Cef.csproj index 7fcbd514..79769a39 100644 --- a/Dotnet/VRCX-Cef.csproj +++ b/Dotnet/VRCX-Cef.csproj @@ -5,7 +5,9 @@ WinExe net9-windows10.0.19041.0 - x64 + Debug;Release + x64 + x64 true 0 1.0.0.%2a diff --git a/Dotnet/VRCX-Electron.csproj b/Dotnet/VRCX-Electron.csproj index 6b8d76c3..60bae5fe 100644 --- a/Dotnet/VRCX-Electron.csproj +++ b/Dotnet/VRCX-Electron.csproj @@ -7,7 +7,9 @@ net9.0 Library - x64 + Debug;Release + x64 + x64 0 1.0.0.%2a VRCX diff --git a/VRCX.sln b/VRCX.sln index 8debcde1..301c8f40 100644 --- a/VRCX.sln +++ b/VRCX.sln @@ -1,16 +1,10 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 +Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.8.34309.116 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VRCX-Cef", "Dotnet\VRCX-Cef.csproj", "{D9F66F2E-3ED9-4D53-A6AC-ADCC1513562A}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8612F19B-3C1F-4B17-8679-A2747A53EC6B}" - ProjectSection(SolutionItems) = preProject - .editorconfig = .editorconfig - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VRCX-Electron", "Dotnet\VRCX-Electron.csproj", "{B0275E4A-FE0F-410A-96F1-1D73DF2535FA}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VRCX-Electron", "Dotnet\VRCX-Electron.csproj", "{B0275E4A-FE0F-410A-96F1-1D73DF2535FA}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DBMerger", "DBMerger\DBMerger.csproj", "{9BE1DD2F-CABC-4CF9-A53E-C62923760887}" EndProject @@ -24,14 +18,16 @@ Global {D9F66F2E-3ED9-4D53-A6AC-ADCC1513562A}.Debug|x64.Build.0 = Debug|x64 {D9F66F2E-3ED9-4D53-A6AC-ADCC1513562A}.Release|x64.ActiveCfg = Release|x64 {D9F66F2E-3ED9-4D53-A6AC-ADCC1513562A}.Release|x64.Build.0 = Release|x64 + {B0275E4A-FE0F-410A-96F1-1D73DF2535FA}.Debug|x64.ActiveCfg = Debug|x64 {B0275E4A-FE0F-410A-96F1-1D73DF2535FA}.Debug|x64.Build.0 = Debug|x64 {B0275E4A-FE0F-410A-96F1-1D73DF2535FA}.Release|x64.ActiveCfg = Release|x64 {B0275E4A-FE0F-410A-96F1-1D73DF2535FA}.Release|x64.Build.0 = Release|x64 - {9BE1DD2F-CABC-4CF9-A53E-C62923760887}.Debug|x64.ActiveCfg = Debug|Any CPU - {9BE1DD2F-CABC-4CF9-A53E-C62923760887}.Debug|x64.Build.0 = Debug|Any CPU - {9BE1DD2F-CABC-4CF9-A53E-C62923760887}.Release|x64.ActiveCfg = Release|Any CPU - {9BE1DD2F-CABC-4CF9-A53E-C62923760887}.Release|x64.Build.0 = Release|Any CPU + + {9BE1DD2F-CABC-4CF9-A53E-C62923760887}.Debug|x64.ActiveCfg = Debug|x64 + {9BE1DD2F-CABC-4CF9-A53E-C62923760887}.Debug|x64.Build.0 = Debug|x64 + {9BE1DD2F-CABC-4CF9-A53E-C62923760887}.Release|x64.ActiveCfg = Release|x64 + {9BE1DD2F-CABC-4CF9-A53E-C62923760887}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -39,4 +35,4 @@ Global GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {797D384F-D118-4CBB-9450-17949F9EFCA4} EndGlobalSection -EndGlobal +EndGlobal \ No newline at end of file diff --git a/src/components/dialogs/GroupDialog/GroupDialog.vue b/src/components/dialogs/GroupDialog/GroupDialog.vue index 15da108a..21b3565f 100644 --- a/src/components/dialogs/GroupDialog/GroupDialog.vue +++ b/src/components/dialogs/GroupDialog/GroupDialog.vue @@ -611,6 +611,14 @@ {{ formatDateFilter(groupDialog.ref.createdAt, 'long') }} + +
+
+ {{ t('dialog.group.info.last_visited') }} + {{formatDateFilter(groupDialog.lastVisit,'long') }} +
+
+
{{ t('dialog.group.info.links') }} @@ -1166,6 +1174,10 @@ + @@ -1203,6 +1215,7 @@ } from '../../../stores'; import InviteGroupDialog from '../InviteGroupDialog.vue'; import GroupPostEditDialog from './GroupPostEditDialog.vue'; + import PreviousInstancesGroupDialog from "../PreviousInstancesDialog/PreviousInstancesGroupDialog.vue"; const { t } = useI18n(); @@ -1253,6 +1266,12 @@ groupId: '' }); + const previousInstancesGroupDialog = ref({ + visible: false, + openFlg: false, + groupRef: {} + }); + let loadMoreGroupMembersParams = ref({ n: 100, offset: 0, @@ -1285,6 +1304,14 @@ inviteGroupDialog.value.visible = true; } + function showPreviousInstancesGroupDialog(groupRef) { + const D = previousInstancesGroupDialog.value; + D.groupRef = groupRef; + D.visible = true; + D.openFlg = true; + nextTick(() => (D.openFlg = false)); + } + function setGroupRepresentation(groupId) { handleGroupRepresentationChange(groupId, true); } diff --git a/src/components/dialogs/PreviousInstancesDialog/PreviousInstancesGroupDialog.vue b/src/components/dialogs/PreviousInstancesDialog/PreviousInstancesGroupDialog.vue new file mode 100644 index 00000000..61fa321a --- /dev/null +++ b/src/components/dialogs/PreviousInstancesDialog/PreviousInstancesGroupDialog.vue @@ -0,0 +1,161 @@ + + + diff --git a/src/components/dialogs/UserDialog/UserDialog.vue b/src/components/dialogs/UserDialog/UserDialog.vue index 4be78099..e3337c75 100644 --- a/src/components/dialogs/UserDialog/UserDialog.vue +++ b/src/components/dialogs/UserDialog/UserDialog.vue @@ -847,7 +847,7 @@ + :content="t('dialog.user.info.open_previous_instance')">
@@ -886,7 +886,7 @@ + :content="t('dialog.user.info.open_previous_instance')">
diff --git a/src/components/dialogs/WorldDialog/WorldDialog.vue b/src/components/dialogs/WorldDialog/WorldDialog.vue index cd30dce7..06a591fd 100644 --- a/src/components/dialogs/WorldDialog/WorldDialog.vue +++ b/src/components/dialogs/WorldDialog/WorldDialog.vue @@ -682,7 +682,7 @@ + :content="t('dialog.user.info.open_previous_instance')">
diff --git a/src/localization/cz/en.json b/src/localization/cz/en.json index dee15f01..63c7dcd4 100644 --- a/src/localization/cz/en.json +++ b/src/localization/cz/en.json @@ -915,7 +915,8 @@ "role_description": "Description:", "role_updated_at": "Updated At:", "role_created_at": "Created At:", - "role_permissions": "Permissions:" + "role_permissions": "Permissions:", + "last_visited": "Last Visited" }, "posts": { "header": "Posts", diff --git a/src/localization/en/en.json b/src/localization/en/en.json index 15d454a4..3bfeeb1f 100644 --- a/src/localization/en/en.json +++ b/src/localization/en/en.json @@ -829,7 +829,7 @@ "instance_hard_closed": "hard closed", "close_instance": "Close Instance", "instance_age_gated": "age gated", - "open_previouse_instance": "Open Previous Instance" + "open_previous_instance": "Open Previous Instance" }, "groups": { "header": "Groups", @@ -1091,7 +1091,8 @@ "role_description": "Description:", "role_updated_at": "Updated At:", "role_created_at": "Created At:", - "role_permissions": "Permissions:" + "role_permissions": "Permissions:", + "last_visited": "Last Visited" }, "posts": { "header": "Posts", diff --git a/src/localization/es/en.json b/src/localization/es/en.json index 8d8cdaa7..9748fce1 100644 --- a/src/localization/es/en.json +++ b/src/localization/es/en.json @@ -1035,7 +1035,8 @@ "role_description": "Descripción:", "role_updated_at": "Actualizado el:", "role_created_at": "Creado el:", - "role_permissions": "Permisos:" + "role_permissions": "Permisos:", + "last_visited": "Última visita" }, "posts": { "header": "Publicaciones", diff --git a/src/localization/fr/en.json b/src/localization/fr/en.json index 254bcf2a..7b38abd6 100644 --- a/src/localization/fr/en.json +++ b/src/localization/fr/en.json @@ -985,7 +985,8 @@ "role_description": "Description :", "role_updated_at": "Mis à jour le :", "role_created_at": "Créé le :", - "role_permissions": "Permissions :" + "role_permissions": "Permissions :", + "last_visited": "Dernière visite" }, "posts": { "header": "Publications", diff --git a/src/localization/hu/en.json b/src/localization/hu/en.json index 5d78f9f1..ca190a9a 100644 --- a/src/localization/hu/en.json +++ b/src/localization/hu/en.json @@ -869,7 +869,8 @@ "role_description": "Description:", "role_updated_at": "Updated At:", "role_created_at": "Created At:", - "role_permissions": "Permissions:" + "role_permissions": "Permissions:", + "last_visited": "Last Visited" }, "posts": { "header": "Posts", diff --git a/src/localization/ja/en.json b/src/localization/ja/en.json index 2edfcc2f..0576fa99 100644 --- a/src/localization/ja/en.json +++ b/src/localization/ja/en.json @@ -798,7 +798,7 @@ "instance_hard_closed": "hard closed", "close_instance": "インスタンスを閉じる", "instance_age_gated": "年齢制限あり", - "open_previouse_instance": "前回のインスタンスを開く" + "open_previous_instance": "前回のインスタンスを開く" }, "groups": { "header": "グループ", @@ -1058,7 +1058,8 @@ "role_description": "説明:", "role_updated_at": "更新日:", "role_created_at": "作成日:", - "role_permissions": "権限:" + "role_permissions": "権限:", + "last_visited": "最終訪問" }, "posts": { "header": "投稿", diff --git a/src/localization/ko/en.json b/src/localization/ko/en.json index 0168e044..6cb2363c 100644 --- a/src/localization/ko/en.json +++ b/src/localization/ko/en.json @@ -869,7 +869,8 @@ "role_description": "설명:", "role_updated_at": "업데이트:", "role_created_at": "생성일:", - "role_permissions": "권한:" + "role_permissions": "권한:", + "last_visited": "마지막 방문" }, "posts": { "header": "Posts", diff --git a/src/localization/pl/en.json b/src/localization/pl/en.json index f375fe63..656868c3 100644 --- a/src/localization/pl/en.json +++ b/src/localization/pl/en.json @@ -869,7 +869,8 @@ "role_description": "Opis:", "role_updated_at": "Zaktualizowano:", "role_created_at": "Data utworzenia:", - "role_permissions": "Uprawnienia:" + "role_permissions": "Uprawnienia:", + "last_visited": "Ostatnia wizyta" }, "posts": { "header": "Posty", diff --git a/src/localization/pt/en.json b/src/localization/pt/en.json index 32c3109e..5bf0977d 100644 --- a/src/localization/pt/en.json +++ b/src/localization/pt/en.json @@ -869,7 +869,8 @@ "role_description": "Descrição:", "role_updated_at": "Atualizado Em:", "role_created_at": "Criado Em:", - "role_permissions": "Permissões:" + "role_permissions": "Permissões:", + "last_visited": "Última visita" }, "posts": { "header": "Publicações", diff --git a/src/localization/ru/en.json b/src/localization/ru/en.json index 3aedcf13..d132340d 100644 --- a/src/localization/ru/en.json +++ b/src/localization/ru/en.json @@ -783,7 +783,7 @@ "instance_hard_closed": "жёстко закрыт", "close_instance": "Закрыть инстанс", "instance_age_gated": "ограничение по возросту", - "open_previouse_instance": "Открыть предыдущий инстанс" + "open_previous_instance": "Открыть предыдущий инстанс" }, "groups": { "header": "Группы", @@ -1039,7 +1039,8 @@ "role_description": "Описание:", "role_updated_at": "Обновлена:", "role_created_at": "Создана:", - "role_permissions": "Права доступа:" + "role_permissions": "Права доступа:", + "last_visited": "Последний визит" }, "posts": { "header": "Объявления", diff --git a/src/localization/th/en.json b/src/localization/th/en.json index 0999c452..ee863211 100644 --- a/src/localization/th/en.json +++ b/src/localization/th/en.json @@ -802,7 +802,7 @@ "instance_hard_closed": "ปิดถาวร", "close_instance": "ปิดอินสแตนซ์", "instance_age_gated": "จำกัดอายุ", - "open_previouse_instance": "เปิดอินสแตนซ์ก่อนหน้า" + "open_previous_instance": "เปิดอินสแตนซ์ก่อนหน้า" }, "groups": { "header": "กลุ่ม", @@ -1064,7 +1064,8 @@ "role_description": "คำอธิบาย:", "role_updated_at": "อัปเดตเมื่อ:", "role_created_at": "สร้างเมื่อ:", - "role_permissions": "สิทธิ์:" + "role_permissions": "สิทธิ์:", + "last_visited": "เข้าชมล่าสุด" }, "posts": { "header": "โพสต์", diff --git a/src/localization/vi/en.json b/src/localization/vi/en.json index 9a3d565b..7ec7793e 100644 --- a/src/localization/vi/en.json +++ b/src/localization/vi/en.json @@ -869,7 +869,8 @@ "role_description": "Mô tả:", "role_updated_at": "Cập nhật lúc:", "role_created_at": "Tạo lúc:", - "role_permissions": "Quyền:" + "role_permissions": "Quyền:", + "last_visited": "Lần truy cập cuối" }, "posts": { "header": "Posts", diff --git a/src/localization/zh-CN/en.json b/src/localization/zh-CN/en.json index 7566a98b..f051a284 100644 --- a/src/localization/zh-CN/en.json +++ b/src/localization/zh-CN/en.json @@ -804,7 +804,7 @@ "instance_hard_closed": "房间已关闭", "close_instance": "关闭该房间", "instance_age_gated": "房间具有年龄限制", - "open_previouse_instance": "打开上次加入的房间" + "open_previous_instance": "打开上次加入的房间" }, "groups": { "header": "群组", @@ -1066,7 +1066,8 @@ "role_description": "描述:", "role_updated_at": "更新时间:", "role_created_at": "创建时间:", - "role_permissions": "权限:" + "role_permissions": "权限:", + "last_visited": "上次访问" }, "posts": { "header": "帖子", diff --git a/src/localization/zh-TW/en.json b/src/localization/zh-TW/en.json index ceab366f..52ee5873 100644 --- a/src/localization/zh-TW/en.json +++ b/src/localization/zh-TW/en.json @@ -823,7 +823,7 @@ "instance_hard_closed": "強制關閉", "close_instance": "關閉房間", "instance_age_gated": "年齡限制", - "open_previouse_instance": "開啟上個房間" + "open_previous_instance": "開啟上個房間" }, "groups": { "header": "群組", @@ -1085,7 +1085,8 @@ "role_description": "敘述:", "role_updated_at": "更新時間:", "role_created_at": "創建時間:", - "role_permissions": "權限:" + "role_permissions": "權限:", + "last_visited": "上次造訪" }, "posts": { "header": "貼文", diff --git a/src/service/database/gameLog.js b/src/service/database/gameLog.js index 59fcce1b..d5a00fe1 100644 --- a/src/service/database/gameLog.js +++ b/src/service/database/gameLog.js @@ -304,6 +304,55 @@ const gameLog = { return ref; }, + async getLastGroupVisit(groupName) { + var ref = { + created_at: '', + groupName: '' + }; + await sqliteService.execute( + (row) => { + ref = { + created_at: row[0], + groupName: row[1] + }; + }, + `SELECT created_at, group_name FROM gamelog_location WHERE group_name = @groupName ORDER BY id DESC LIMIT 1`, + { + '@groupName': groupName + } + ); + return ref; + }, + + async getPreviousInstancesByGroupName(groupName) { + var data = new Map(); + await sqliteService.execute( + (dbRow) => { + var time = 0; + if (dbRow[2]) { + time = dbRow[2]; + } + var ref = data.get(dbRow[1]); + if (typeof ref !== 'undefined') { + time += ref.time; + } + var row = { + created_at: dbRow[0], + location: dbRow[1], + time, + worldName: dbRow[3], + groupName: dbRow[4] + }; + data.set(row.location, row); + }, + `SELECT created_at, location, time, world_name, group_name FROM gamelog_location WHERE group_name = @groupName ORDER BY id DESC`, + { + '@groupName': groupName + } + ); + return data; + }, + async getLastSeen(input, inCurrentWorld) { if (inCurrentWorld) { var count = 2; diff --git a/src/stores/group.js b/src/stores/group.js index fa5c3068..8a6e2259 100644 --- a/src/stores/group.js +++ b/src/stores/group.js @@ -10,6 +10,7 @@ import { import { $app } from '../app'; import configRepository from '../service/config'; import { watchState } from '../service/watchState'; +import { database } from '../service/database.js'; import { groupDialogFilterOptions } from '../shared/constants/'; import { replaceBioSymbols, @@ -45,6 +46,7 @@ export const useGroupStore = defineStore('Group', () => { memberSearchResults: [], instances: [], memberRoles: [], + lastVisit: '', memberFilter: { name: 'dialog.group.members.filters.everyone', id: null @@ -183,6 +185,7 @@ export const useGroupStore = defineStore('Group', () => { D.postsFiltered = []; D.instances = []; D.memberRoles = []; + D.lastVisit = ''; D.memberSearch = ''; D.memberSearchResults = []; D.galleries = {}; @@ -215,6 +218,11 @@ export const useGroupStore = defineStore('Group', () => { D.ownerDisplayName = args1.ref.displayName; return args1; }); + database.getLastGroupVisit(D.ref.name).then((r) => { + if (D.id === args.ref.id) { + D.lastVisit = r.created_at; + } + }); instanceStore.applyGroupDialogInstances(); getGroupDialogGroup(groupId); }