mirror of
https://github.com/docmost/docmost.git
synced 2026-06-11 02:36:56 +08:00
feat: internal page links and mentions (#604)
* Work on mentions * fix: properly parse page slug * fix editor suggestion bugs * mentions must start with whitespace * add icon to page mention render * feat: backlinks - WIP * UI - WIP * permissions check * use FTS for page suggestion * cleanup * WIP * page title fallback * feat: handle internal link paste * link styling * WIP * Switch back to LIKE operator for search suggestion * WIP * scope to workspaceId * still create link for pages not found * select necessary columns * cleanups
This commit is contained in:
@@ -31,7 +31,7 @@ export function parseRedisUrl(redisUrl: string): RedisConfig {
|
||||
// extract db value if present
|
||||
if (pathname.length > 1) {
|
||||
const value = pathname.slice(1);
|
||||
if (!isNaN(parseInt(value))){
|
||||
if (!isNaN(parseInt(value))) {
|
||||
db = parseInt(value, 10);
|
||||
}
|
||||
}
|
||||
@@ -44,3 +44,12 @@ export function createRetryStrategy() {
|
||||
return Math.max(Math.min(Math.exp(times), 20000), 3000);
|
||||
};
|
||||
}
|
||||
|
||||
export function extractDateFromUuid7(uuid7: string) {
|
||||
//https://park.is/blog_posts/20240803_extracting_timestamp_from_uuid_v7/
|
||||
const parts = uuid7.split('-');
|
||||
const highBitsHex = parts[0] + parts[1].slice(0, 4);
|
||||
const timestamp = parseInt(highBitsHex, 16);
|
||||
|
||||
return new Date(timestamp);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user