refactor: Group Dialog (#1207)

This commit is contained in:
pa
2025-04-08 19:49:25 +09:00
committed by GitHub
parent dc5f48808f
commit 63cd5421e2
28 changed files with 5553 additions and 4465 deletions

View File

@@ -448,5 +448,46 @@ export default {
return `https://vrchat.com/home/launch?worldId=${encodeURIComponent(
L.worldId
)}`;
},
getFaviconUrl(resource) {
try {
const url = new URL(resource);
return `https://icons.duckduckgo.com/ip2/${url.host}.ico`;
} catch (err) {
return '';
}
},
copyToClipboard(text) {
navigator.clipboard
.writeText(text)
.then(() => {
window.$app.$message({
message: 'Copied successfully!',
type: 'success'
});
})
.catch((err) => {
console.error('Copy failed:', err);
this.$message.error('Copy failed!');
});
},
hasGroupPermission(ref, permission) {
if (
ref &&
ref.myMember &&
ref.myMember.permissions &&
(ref.myMember.permissions.includes('*') ||
ref.myMember.permissions.includes(permission))
) {
return true;
}
return false;
},
getAuditLogTypeName(auditLogType) {
if (!auditLogType) return '';
return auditLogType
.replace('group.', '')
.replace(/\./g, ' ')
.replace(/\b\w/g, (l) => l.toUpperCase());
}
};