1772367588

This commit is contained in:
Docker7530
2026-03-01 20:20:04 +08:00
parent c6125c117b
commit a2f5df43cc
24 changed files with 314 additions and 225 deletions
+4 -1
View File
@@ -21,5 +21,8 @@
"useTab": false, "useTab": false,
"showIndentGuide": false, "showIndentGuide": false,
"spellcheck": false, "spellcheck": false,
"foldIndent": false "foldIndent": false,
"userIgnoreFilters": [
"attachment/"
]
} }
+3 -2
View File
@@ -3,6 +3,7 @@
"myTheme" "myTheme"
], ],
"monospaceFontFamily": "JetBrainsMono Nerd Font Mono", "monospaceFontFamily": "JetBrainsMono Nerd Font Mono",
"textFontFamily": "微软雅黑", "textFontFamily": "思源黑体",
"interfaceFontFamily": "JetBrainsMono Nerd Font Mono" "interfaceFontFamily": "JetBrainsMono Nerd Font Mono",
"showViewHeader": true
} }
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"shouldConfirmBeforeCreate": false, "shouldConfirmBeforeCreate": false,
"weekStart": "locale", "weekStart": "locale",
"wordsPerDot": 9999, "wordsPerDot": 999999999,
"showWeeklyNote": true, "showWeeklyNote": true,
"weeklyNoteFormat": "", "weeklyNoteFormat": "",
"weeklyNoteTemplate": "", "weeklyNoteTemplate": "",
File diff suppressed because one or more lines are too long
+3 -3
View File
@@ -1,9 +1,9 @@
{ {
"id": "copy-url-in-preview", "id": "copy-url-in-preview",
"name": "Image Context Menus", "name": "Image Context Menus",
"version": "1.11.2", "version": "1.12.1",
"minAppVersion": "1.6.6", "minAppVersion": "1.12.3",
"description": "Copy to clipboard, Open in default app, Show in system explorer, Reveal file in navigation, Open in new tab, Rename context menus for images.", "description": "Copy to clipboard, Copy URL, Open in default app, Show in system explorer, Reveal file in navigation, Open in new tab, Rename context menus for images.",
"author": "NomarCub", "author": "NomarCub",
"authorUrl": "https://github.com/NomarCub", "authorUrl": "https://github.com/NomarCub",
"fundingUrl": "https://ko-fi.com/nomarcub", "fundingUrl": "https://ko-fi.com/nomarcub",
+2 -1
View File
@@ -42,6 +42,7 @@
"isLeftHanded": false, "isLeftHanded": false,
"desktopUIMode": "tray", "desktopUIMode": "tray",
"tabletUIMode": "compact", "tabletUIMode": "compact",
"phoneUIMode": "mobile",
"iframeMatchExcalidrawTheme": true, "iframeMatchExcalidrawTheme": true,
"matchTheme": false, "matchTheme": false,
"matchThemeAlways": false, "matchThemeAlways": false,
@@ -123,7 +124,7 @@
"mdBorderColor": "Black", "mdBorderColor": "Black",
"mdCSS": "", "mdCSS": "",
"scriptEngineSettings": {}, "scriptEngineSettings": {},
"previousRelease": "2.20.4", "previousRelease": "2.20.5",
"showReleaseNotes": true, "showReleaseNotes": true,
"compareManifestToPluginVersion": true, "compareManifestToPluginVersion": true,
"showNewVersionNotification": true, "showNewVersionNotification": true,
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"id": "obsidian-excalidraw-plugin", "id": "obsidian-excalidraw-plugin",
"name": "Excalidraw", "name": "Excalidraw",
"version": "2.20.4", "version": "2.20.5",
"minAppVersion": "1.5.7", "minAppVersion": "1.5.7",
"description": "Sketch Your Mind. An Obsidian plugin to edit and view Excalidraw drawings. Enter the world of 4D Visual PKM.", "description": "Sketch Your Mind. An Obsidian plugin to edit and view Excalidraw drawings. Enter the world of 4D Visual PKM.",
"author": "Zsolt Viczian", "author": "Zsolt Viczian",
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -274,7 +274,7 @@
"lintOnSave": true, "lintOnSave": true,
"recordLintOnSaveLogs": false, "recordLintOnSaveLogs": false,
"displayChanged": true, "displayChanged": true,
"suppressMessageWhenNoChange": false, "suppressMessageWhenNoChange": true,
"lintOnFileChange": true, "lintOnFileChange": true,
"displayLintOnFileChangeNotice": true, "displayLintOnFileChangeNotice": true,
"settingsConvertedToConfigKeyValues": true, "settingsConvertedToConfigKeyValues": true,
+40
View File
@@ -107,6 +107,46 @@
"focus": true, "focus": true,
"mode": "default" "mode": "default"
} }
},
{
"id": "83f6f73d-a391-4096-b07f-a9626f10980e",
"name": "openTerminal",
"type": "Macro",
"command": false,
"runOnStartup": false,
"macro": {
"name": "openTerminal",
"id": "2417c310-3ca2-4a95-9962-761529241e84",
"commands": [
{
"name": "openTerminal",
"type": "UserScript",
"id": "22516ce4-03d7-4f5b-b210-b15dd82340e5",
"path": "resource/工具/obsidian/scripts/openTerminal.js",
"settings": {}
}
]
}
},
{
"id": "34d69836-71c0-47f7-b7a5-a62f1b6c71cb",
"name": "rename",
"type": "Macro",
"command": false,
"runOnStartup": false,
"macro": {
"name": "rename",
"id": "7f4b2a06-0d83-4092-9e10-a2f3874e672a",
"commands": [
{
"name": "rename",
"type": "UserScript",
"id": "d213b1c5-5cf9-41ed-90f8-5d6e6ff34a0e",
"path": "resource/工具/obsidian/scripts/rename.js",
"settings": {}
}
]
}
} }
], ],
"inputPrompt": "multi-line", "inputPrompt": "multi-line",
+30 -101
View File
@@ -1,45 +1,49 @@
{ {
"recentFiles": [ "recentFiles": [
{ {
"basename": "常用命令", "basename": "20260301201841",
"path": "resource/常用命令.md" "path": "000-Inbox/20260301201841.md"
},
{
"basename": "This is the prompt",
"path": "resource/ai/This is the prompt.md"
},
{
"basename": "核心策略",
"path": "resource/ai/核心策略.md"
},
{
"basename": "结构化(Prompt",
"path": "resource/ai/结构化(Prompt.md"
},
{
"basename": "词性",
"path": "000-inbox/词性.md"
},
{
"basename": "PEPE",
"path": "finance/加密/学习记录/各类货币/PEPE.md"
},
{
"basename": "Rime 快捷键",
"path": "resource/工具/Rime 快捷键.md"
}, },
{ {
"basename": "服务器-香港", "basename": "服务器-香港",
"path": "personal/服务器-香港.md" "path": "personal/服务器-香港.md"
}, },
{ {
"basename": "20260228151875", "basename": "常用命令",
"path": "000-Inbox/20260228151875.md" "path": "resource/常用命令.md"
}, },
{ {
"basename": "ibs-ai 项目 AI 对话流程", "basename": "ibs-ai 项目 AI 对话流程",
"path": "000-inbox/ibs-ai 项目 AI 对话流程.md" "path": "000-inbox/ibs-ai 项目 AI 对话流程.md"
}, },
{
"basename": "20260228151875",
"path": "000-inbox/20260228151875.md"
},
{
"basename": "20260228121029",
"path": "000-inbox/20260228121029.md"
},
{ {
"basename": "React 工程师", "basename": "React 工程师",
"path": "000-inbox/React 工程师.md" "path": "000-inbox/React 工程师.md"
}, },
{
"basename": "20260228160576",
"path": "000-Inbox/20260228160576.md"
},
{
"basename": "20260228121029",
"path": "000-Inbox/20260228121029.md"
},
{
"basename": "词性",
"path": "000-inbox/词性.md"
},
{ {
"basename": "开发笔记", "basename": "开发笔记",
"path": "work/移动杭研/开发记录/7.18.0/开发笔记.md" "path": "work/移动杭研/开发记录/7.18.0/开发笔记.md"
@@ -52,38 +56,6 @@
"basename": "句子", "basename": "句子",
"path": "000-inbox/句子.md" "path": "000-inbox/句子.md"
}, },
{
"basename": "20260227091585",
"path": "000-Inbox/20260227091585.md"
},
{
"basename": "20260227085218",
"path": "000-Inbox/20260227085218.md"
},
{
"basename": "Rime 快捷键",
"path": "resource/工具/Rime 快捷键.md"
},
{
"basename": "20260226205814",
"path": "000-Inbox/20260226205814.md"
},
{
"basename": "20260226171537",
"path": "000-Inbox/20260226171537.md"
},
{
"basename": "20260226100117",
"path": "000-Inbox/20260226100117.md"
},
{
"basename": "20260226102970",
"path": "000-Inbox/20260226102970.md"
},
{
"basename": "20260226143206",
"path": "000-Inbox/20260226143206.md"
},
{ {
"basename": "ubuntu", "basename": "ubuntu",
"path": "resource/系统/ubuntu.md" "path": "resource/系统/ubuntu.md"
@@ -92,10 +64,6 @@
"basename": "服务器-华为", "basename": "服务器-华为",
"path": "personal/服务器-华为.md" "path": "personal/服务器-华为.md"
}, },
{
"basename": "20260225210630",
"path": "000-Inbox/20260225210630.md"
},
{ {
"basename": "tg-bot", "basename": "tg-bot",
"path": "000-inbox/tg-bot.md" "path": "000-inbox/tg-bot.md"
@@ -116,10 +84,6 @@
"basename": "ibs-export", "basename": "ibs-export",
"path": "work/移动杭研/业务梳理/ibs-export.md" "path": "work/移动杭研/业务梳理/ibs-export.md"
}, },
{
"basename": "20260223203842",
"path": "000-Inbox/20260223203842.md"
},
{ {
"basename": "Claude Code 配置文件", "basename": "Claude Code 配置文件",
"path": "resource/配置/Claude Code 配置文件.md" "path": "resource/配置/Claude Code 配置文件.md"
@@ -128,10 +92,6 @@
"basename": "Claude Code 提示词", "basename": "Claude Code 提示词",
"path": "resource/配置/Claude Code 提示词.md" "path": "resource/配置/Claude Code 提示词.md"
}, },
{
"basename": "20260211113769",
"path": "000-Inbox/20260211113769.md"
},
{ {
"basename": "Rime YAML Custom Patch 语法笔记", "basename": "Rime YAML Custom Patch 语法笔记",
"path": "resource/工具/Rime YAML Custom Patch 语法笔记.md" "path": "resource/工具/Rime YAML Custom Patch 语法笔记.md"
@@ -164,41 +124,9 @@
"basename": "idea jvm", "basename": "idea jvm",
"path": "resource/配置/idea jvm.md" "path": "resource/配置/idea jvm.md"
}, },
{
"basename": "20260208143789",
"path": "000-Inbox/20260208143789.md"
},
{
"basename": "20260207215002",
"path": "000-Inbox/20260207215002.md"
},
{
"basename": "20260207103531",
"path": "000-Inbox/20260207103531.md"
},
{
"basename": "20260206231116",
"path": "000-Inbox/20260206231116.md"
},
{ {
"basename": "开发笔记", "basename": "开发笔记",
"path": "work/移动杭研/开发记录/7.17.0/开发笔记.md" "path": "work/移动杭研/开发记录/7.17.0/开发笔记.md"
},
{
"basename": "20260206081367",
"path": "000-Inbox/20260206081367.md"
},
{
"basename": "信安业务流程及代码梳理",
"path": "work/移动杭研/业务梳理/信安信息/信安业务流程及代码梳理.md"
},
{
"basename": "域名配置需求工单-终止",
"path": "excalidraw/域名配置需求工单-终止.md"
},
{
"basename": "This is the prompt",
"path": "resource/ai/This is the prompt.md"
} }
], ],
"omittedPaths": [ "omittedPaths": [
@@ -207,5 +135,6 @@
], ],
"omittedTags": [], "omittedTags": [],
"updateOn": "file-open", "updateOn": "file-open",
"omitBookmarks": false "omitBookmarks": false,
"maxLength": null
} }
+43 -44
View File
@@ -4,11 +4,11 @@
"type": "split", "type": "split",
"children": [ "children": [
{ {
"id": "52c75605242e548c", "id": "980372c0424002f5",
"type": "tabs", "type": "tabs",
"children": [ "children": [
{ {
"id": "27e8f607bdc36b8c", "id": "fd1746dffb212136",
"type": "leaf", "type": "leaf",
"state": { "state": {
"type": "empty", "type": "empty",
@@ -50,7 +50,7 @@
"state": { "state": {
"type": "search", "type": "search",
"state": { "state": {
"query": "", "query": "file:2026-02-01",
"matchingCase": false, "matchingCase": false,
"explainSearch": false, "explainSearch": false,
"collapseAll": false, "collapseAll": false,
@@ -92,7 +92,7 @@
} }
], ],
"direction": "horizontal", "direction": "horizontal",
"width": 335.5 "width": 273.5
}, },
"right": { "right": {
"id": "ca733f6d5936ae40", "id": "ca733f6d5936ae40",
@@ -123,7 +123,6 @@
"state": { "state": {
"type": "backlink", "type": "backlink",
"state": { "state": {
"file": "000-Inbox/010-时间戳/20250516111714.md",
"collapseAll": false, "collapseAll": false,
"extraContext": false, "extraContext": false,
"sortOrder": "alphabetical", "sortOrder": "alphabetical",
@@ -133,7 +132,7 @@
"unlinkedCollapsed": true "unlinkedCollapsed": true
}, },
"icon": "links-coming-in", "icon": "links-coming-in",
"title": "20250516111714 的反向链接列表" "title": "反向链接"
} }
}, },
{ {
@@ -190,7 +189,8 @@
"title": "脚注" "title": "脚注"
} }
} }
] ],
"currentTab": 1
}, },
{ {
"id": "ea8a40d57ef90e62", "id": "ea8a40d57ef90e62",
@@ -211,13 +211,13 @@
} }
], ],
"direction": "horizontal", "direction": "horizontal",
"width": 306.5 "width": 416.5
}, },
"left-ribbon": { "left-ribbon": {
"hiddenItems": { "hiddenItems": {
"command-palette:打开命令面板": false, "command-palette:打开命令面板": true,
"switcher:打开快速切换": false, "switcher:打开快速切换": true,
"graph:查看关系图谱": false, "graph:查看关系图谱": true,
"daily-notes:打开/创建今天的日记": false, "daily-notes:打开/创建今天的日记": false,
"bases:新建数据库": false, "bases:新建数据库": false,
"obsidian-excalidraw-plugin:新建绘图文件": false, "obsidian-excalidraw-plugin:新建绘图文件": false,
@@ -226,37 +226,41 @@
"oz-clear-unused-images:Clear Unused Images": false "oz-clear-unused-images:Clear Unused Images": false
} }
}, },
"active": "27e8f607bdc36b8c", "active": "fd1746dffb212136",
"lastOpenFiles": [ "lastOpenFiles": [
"resource/常用命令.md",
"personal/服务器-香港.md",
"calendar/diary/2026-02-28.md",
"calendar/diary/2026-02-27.md",
"000-Inbox/20260228151875.md",
"000-inbox/ibs-ai 项目 AI 对话流程.md",
"000-inbox/20260228151875.md",
"000-inbox/20260228121029.md",
"000-inbox/React 工程师.md",
"000-Inbox/20260228160576.md",
"attachment/Pasted image 20260228121021.png",
"attachment/Pasted image 20260228121011.png", "attachment/Pasted image 20260228121011.png",
"attachment/Pasted image 20260228121002.png", "attachment/Pasted image 20260301201851.png",
"000-Inbox/20260228121029.md", "000-Inbox/20260301201841.md",
"calendar/diary/2026-02-26.md", "000-inbox/20260301201841.md",
"attachment/Pasted image 20260228121021.png",
"resource/ai/This is the prompt.md",
"resource/工具/obsidian/scripts/rename.js",
"resource/工具/obsidian/scripts/新建文本文档.txt",
"resource/工具/obsidian/scripts/openTerminal.js.md",
"resource/工具/obsidian/scripts/openTerminal.js",
"resource/工具/obsidian/scripts",
"000-inbox/测试.md",
"calendar/diary/2026-03-01.md",
"resource/ai/核心策略.md",
"resource/ai/结构化(Prompt.md",
"calendar/diary/2026-02-01.md",
"000-inbox/词性.md", "000-inbox/词性.md",
"work/移动杭研/开发记录/7.18.0/开发笔记.md", "000-inbox/测试一个.md",
"resource/组件/Ubuntu 24.04 LTS ELK 8 安装指南.md", "calendar/diary/2026-02-28.md",
"000-inbox/20260226171537.md", "000-inbox/202603011528081.md",
"000-inbox/句子.md", "000-inbox/0301-1.md",
"000-inbox/20260226205814.md", "000-Inbox/20260301152808.md",
"000-Inbox/20260227091585.md", "000-Inbox/0301-1.md",
"000-Inbox/20260227085218.md", "finance/加密/学习记录/各类货币/PEPE.md",
"resource/工具/Rime 快捷键.md", "resource/工具/Rime 快捷键.md",
"000-Inbox/20260226205814.md", "000-inbox/20260228151875.md",
"000-Inbox/20260226171537.md", "resource/工具/20260228121029.md",
"calendar/diary/2026-02-05.md", "000-inbox/202603011112321.md",
"calendar/diary/2026-02-11.md", "000-Inbox/20260301111232.md",
"calendar/diary/2026-02-09.md", "000-inbox/2026030.md",
"attachment/templates/时间戳笔记.md",
"personal/服务器-香港.md",
"attachment/Pasted image 20260228121002.png",
"attachment/images-uuid/64be7a370c2241658123dec75afa8ebb.png", "attachment/images-uuid/64be7a370c2241658123dec75afa8ebb.png",
"attachment/images-paste/image-20260206105036743.png", "attachment/images-paste/image-20260206105036743.png",
"resource/工具", "resource/工具",
@@ -264,15 +268,10 @@
"attachment/image-20260130172212583.png", "attachment/image-20260130172212583.png",
"attachment/image-20260130171118370.png", "attachment/image-20260130171118370.png",
"attachment/Pasted image 20260129215401.png", "attachment/Pasted image 20260129215401.png",
"attachment/images-paste/image-20260125202524521.png",
"personal/家人/小杨-年报-AI", "personal/家人/小杨-年报-AI",
"未命名", "未命名",
"resource/脚本", "resource/脚本",
"work/移动杭研/开发记录/7.18.0", "work/移动杭研/开发记录/7.18.0",
"attachment/霞鹜文楷-Mono-Bold.ttf", "attachment/霞鹜文楷-Mono-Bold.ttf"
"attachment/霞鹜文楷-Mono-Regular.ttf",
"excalidraw/fonts",
"resource/配置",
"gitleaks.toml"
] ]
} }
+2 -2
View File
@@ -1,5 +1,5 @@
{ {
"folder": "000-Inbox", "folder": "000-inbox",
"template": "100-Attachment/templates/时间戳笔记", "template": "",
"format": "" "format": ""
} }
-3
View File
@@ -1,3 +0,0 @@
![](../attachment/Pasted%20image%2020260228121011.png)
![](../attachment/Pasted%20image%2020260228121021.png)
-30
View File
@@ -1,30 +0,0 @@
```
curl --location 'http://183.252.183.117/api/v1/chats_openai/d06e1690377d11f0a5df0242ac120006/chat/completions' \
--header 'Authorization: Bearer ragflow-VjOWEyN2U0M2M2MTExZjBiM2UxMDI0Mm' \
--header 'Content-Type: application/json' \
--data '{
"model": "DeepSeek-R1-Distill-Qwen-32B",
"stream": true,
"messages": [
{
"role": "user",
"content": "你是谁?"
}
]
}'
curl --location 'http://183.252.183.117:30021/v1/chat/completions' \
--header 'Content-Type: application/json' \
--data '{
"model": "DeepSeek-R1-Distill-Qwen-32B",
"stream": true,
"messages": [
{
"role": "user",
"content": "你是谁?"
}
]
}'
```
+1
View File
@@ -0,0 +1 @@
![](../attachment/Pasted%20image%2020260301201851.png)
Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

+19
View File
@@ -0,0 +1,19 @@
# 任务
# 日志
# 总结
上午早晨起来整理了一下自己的 OnePanel 面板,安装了 Git,也弄了一下 SonarQube。感觉这个 OnePanel 面板真的还挺好的。
今天学习了 Docker 网络与 UFW 网络的关系,发现 Docker 网络会优先于 UFW。
今天准备把 Obsidian 集成一下 AI 功能,顺便看一下 React 的最新课程。
上午小杨和妈妈去买菜了,甜宝看了电视。
最近感觉甜宝的整体思维特别清晰:
1. 他能记得自己想要什么
2. 会哭会闹,感觉成长了很多
3. 今天竟然还自己擦屁股,真是惊呆我了
+64 -29
View File
@@ -2,7 +2,7 @@
先删除 ssh 密钥和会话,防止第一次链接失败。 先删除 ssh 密钥和会话,防止第一次链接失败。
# 1Panel # 1Panel【域名】
[1Panel - 现代化、开源的Linux服务器运维管理面板](https://1panel.cn/) [1Panel - 现代化、开源的Linux服务器运维管理面板](https://1panel.cn/)
@@ -42,9 +42,67 @@ TLS 1.3
证书透明度监视 证书透明度监视
``` ```
# 安装 Openresty ---
# sub-store # OpenClaw【域名】
# Openresty
# MySQL
```
root
ykz2WKZ@vke6rmk*req
端口 13306
```
# Redis
```
jgw5wpe!HVB@vem2wmp
端口 16379
```
# Gitea
```
数据库 gitea
数据库用户 gitea
数据库密码 ykz2WKZ@vke6rmk*req
HTTP 端口 3000
SSH 端口 222
```
# PostgreSQL
```
user_kJd5rr
uPN2gbSgWI5yb5
端口 15432
```
# sonarqube
```
http://82.158.226.4:19000
数据库名 sonarqube
数据库用户 sonarqube
数据库用户密码 8hIu5ys14x7mbT
端口 19000
登录用户
admin
WhrNNu*Lcd5&2h
```
---
# Sub-Store【域名】
docker-compose.yml docker-compose.yml
@@ -74,25 +132,7 @@ services:
https://sub-store.excalicode.org?api=https://sub-store.excalicode.org/PVM!xwm7hkz4hek2xjy https://sub-store.excalicode.org?api=https://sub-store.excalicode.org/PVM!xwm7hkz4hek2xjy
``` ```
# 测试工具 # s-ui
```
bash <(curl -sL https://run.NodeQuality.com)
```
# MySQL
```
ykz2WKZ@vke6rmk*req
```
# Redis
```
jgw5wpe!HVB@vem2wmp
```
# SUI
安装 安装
@@ -169,13 +209,8 @@ ibs
8GE6Ccs7kWwiSzWA 8GE6Ccs7kWwiSzWA
``` ```
前端站点
``` ```
/opt/1panel/www/sites/82.158.226.4/ /opt/1panel/www/sites/82.158.226.4/
``` ```
# gitea
```
数据库密码
ykz2WKZ@vke6rmk*req
```
+4
View File
@@ -48,3 +48,7 @@
| 输入行为 | `/` 单独作为输入 | 斜杠被占用为引导键,配置里用双击 `/` 方式输入本身 | `wanxiang.schema.yaml` | | 输入行为 | `/` 单独作为输入 | 斜杠被占用为引导键,配置里用双击 `/` 方式输入本身 | `wanxiang.schema.yaml` |
| 候选存在 | `[` / `]` | 以词定字:取首字/末字 | `wanxiang.schema.yaml` | | 候选存在 | `[` / `]` | 以词定字:取首字/末字 | `wanxiang.schema.yaml` |
| 候选存在 | `,` | super_tips 上屏按键 | `wanxiang.schema.yaml` | | 候选存在 | `,` | super_tips 上屏按键 | `wanxiang.schema.yaml` |
![](../../attachment/Pasted%20image%2020260228121011.png)
![](../../attachment/Pasted%20image%2020260228121021.png)
@@ -0,0 +1,21 @@
module.exports = async (params) => {
const { app } = params;
// 获取当前仓库路径
const vaultPath = app.vault.adapter.basePath;
// 构建 Windows Terminal 命令
const command = `wt -d "${vaultPath}"`;
// 使用 Node.js child_process 执行命令
const { exec } = require('child_process');
exec(command, (error, stdout, stderr) => {
if (error) {
console.error('执行失败:', error);
new Notice('无法打开终端');
return;
}
console.log('终端已打开');
});
};
@@ -0,0 +1,69 @@
module.exports = async (params) => {
const { app, obsidian, quickAddApi } = params;
// 获取当前选中的文件或让用户选择图片文件
const activeFile = app.workspace.getActiveFile();
if (
!activeFile ||
!activeFile.extension.match(/(png|jpg|jpeg|gif|webp|svg)/i)
) {
new obsidian.Notice("请先选择一个图片文件");
return;
}
// 生成UUID
const uuid = crypto.randomUUID();
const newFileName = `${uuid}.${activeFile.extension}`;
const newPath = activeFile.path.replace(activeFile.name, newFileName);
// 获取所有引用该文件的笔记
const backlinks = app.metadataCache.getBacklinksForFile(activeFile);
// 确认操作
const confirm = await quickAddApi.yesNoPrompt(
"确认重命名",
`${activeFile.name} 重命名为 ${newFileName}\n` +
`将更新 ${backlinks.data.size} 个文件中的引用`,
);
if (!confirm) return;
try {
// 重命名文件
await app.fileManager.renameFile(activeFile, newPath);
// 更新所有引用
let updatedCount = 0;
for (const [file, links] of backlinks.data) {
const fileObj = app.vault.getAbstractFileByPath(file);
if (fileObj instanceof obsidian.TFile) {
let content = await app.vault.read(fileObj);
// 更新所有链接引用
for (const link of links) {
const oldLink = `[[${activeFile.path}]]`;
const newLink = `[[${newPath}]]`;
const oldEmbed = `![[${activeFile.path}]]`;
const newEmbed = `![[${newPath}]]`;
content = content.replace(
new RegExp(oldLink.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"),
newLink,
);
content = content.replace(
new RegExp(oldEmbed.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"),
newEmbed,
);
}
await app.vault.modify(fileObj, content);
updatedCount++;
}
}
new obsidian.Notice(`成功重命名并更新了 ${updatedCount} 个文件`);
} catch (error) {
console.error("重命名失败:", error);
new obsidian.Notice("重命名失败: " + error.message);
}
};