-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add internal kernel API /api/block/getTailChildBlocks
#9884
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
最后 1 个似乎就够了,n 个的场景没有必要吧? |
另外,可以用 appendBlock 接口 |
@88250 您好,appendBlock之前我确实没看到,但还需要查询。因为append已经做出修改了,我需要判断下。 另外,服务段已经加载整个文档了,只能返回一个有点浪费。返回多,还能做tail的功能。另外我还想判断是否 编辑器 的页面是否真正的到达底部,然后插入内容。 返回多个可以做模糊一点的判断,比较数据库会慢一点,而编辑的时候会一直插入/删除底部块,最后一个id会变化。 |
请说下具体场景,是什么场景下需要查询最后 n 个块? 另外,根据“顺序”(也就是所谓的“最前/最后”)可能会有问题,因为是个树型结构,除非是按某种遍历顺序否则不分前后,或者只取根节点下第一层,这样可以认为是个列表,可以前后取值。 |
@88250 D大您好,我就是想编辑器底部显示个面板,但又不想放到编辑器外面,这样距离内容较远。面板内放在工具按钮,或者反链提及等。如果可以给 getChildBlocks 加个参数,限制返回的部分也行。目前用 getChildBlocks 也能出稳定的效果。 |
那就是返回根节点下面第一层子块,按从后到前返回 n 个对吧? |
也可以的,谢谢,虽然对大列表不太友好,但目前也够用了。 最后n个,然后是正序吧。从上到下。 |
从给定 id 的块的最后一个子块开始往前放数组里返回。 |
没问题!太感谢了! |
/api/block/getTailChildBlocks
* commit '969a8d24fcdc648b3f88d28d47280869f4974396': 🎨 Improve web page clip code block content conversion siyuan-note#9896 🐛 Create doc failed on non-Windows siyuan-note#9890 🐛 fix siyuan-note#9850 🎨 Add Relation and Rollup column to database table view siyuan-note#9888 🐛 Do not remove .tmp file when listing doc tree https://ld246.com/article/1702621572239 ♻️ Refactor database table view 🐛 fix siyuan-note#9891 🎨 delete row by keydown 🎨 fix siyuan-note#9886 🎨 siyuan-note#9886 🎨 Enable or disable all CSS and JS code snippets siyuan-note#9860 🎨 Database table view template columns support reference date columns siyuan-note#9887 🎨 fix siyuan-note#9878 ⬆️ Upgrade kernel deps 🎨 Delete the corresponding data in the database attributes table after deleting the doc siyuan-note#9875 ⬆️ Upgrade Lute 🎨 Add internal kernel API `/api/block/getTailChildBlocks` siyuan-note#9884 🎨 siyuan-note#9882 🐛
希望提供一个API,以查询大文档的最后n个块ID。
In what scenarios do you need this feature?
有时想查询文档最后有哪些id,或者插入内容到文档底部。想要得到一个用于定位的id。目前是用的
"/api/block/getChildBlocks"
但大文档的内容太多,有些浪费资源。希望得到一个 getChildBlocks 的类似接口。但如果有其他方案能满足也行。Describe the optimal solution
比如,提供一个 getChildBlocks 的类似接口。可以查询尾部内容ID。
Describe the candidate solution
No response
Other information
No response
The text was updated successfully, but these errors were encountered: