dsh-schedule-calendar 0.0.0-stage → 0.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +58 -2
- package/cordis.patch.yml +14 -0
- package/data/defaults.json +30 -0
- package/icon.svg +11 -0
- package/lib/client.js +1265 -0
- package/lib/index.js +510 -0
- package/package.json +54 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 loyalchiiina
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,59 @@
|
|
|
1
|
-
#
|
|
1
|
+
# dsh-schedule-calendar · 日程助手
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
DSH 桌面端的侧边栏「日程助手」插件:多城市天气、黄历宜忌、农历日历、日程与提醒、工作待办、日报周报、星座运势与配对、好运签到,以及按人设置的休息日(双休 / 大小周 / 单休 / 自定义)与上下班倒计时,全部收进一个侧边栏标签页。
|
|
4
|
+
|
|
5
|
+
> 依赖宿主插件 `dsh-better-sidebar`(提供侧边栏标签页能力)。
|
|
6
|
+
|
|
7
|
+
## 效果图
|
|
8
|
+
|
|
9
|
+
| 今日(天气 + 日程 + 星座运势) | 日历(农历 / 假期 / 休息日配色) |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
|  |  |
|
|
12
|
+
|
|
13
|
+
| 日程(重复 / 未来高亮) | 待办(截止日期 / 逾期) |
|
|
14
|
+
| --- | --- |
|
|
15
|
+
|  |  |
|
|
16
|
+
|
|
17
|
+
| 报告(日报 / 周报 / 批量) | 设置(人员班制 / 城市 / 配色 / 关于) |
|
|
18
|
+
| --- | --- |
|
|
19
|
+
|  |  |
|
|
20
|
+
|
|
21
|
+
## 功能
|
|
22
|
+
|
|
23
|
+
- **多城市天气**:按「省 / 市 / 区」级联或关键字搜索添加城市(区级用 Nominatim 地理编码,回退 Open-Meteo),横向表格显示今天 / 明天 / 后天 / 大后天 4 天预报;支持「🔄 刷新」与失败自动重试。
|
|
24
|
+
- **黄历(宜 / 忌)**:今日头部在星期右侧显示农历与当日宜忌(本地黄历算法,按日固定)。
|
|
25
|
+
- **农历日历**:显示农历与节气、法定节假日;周末 / 个人休息日 / 法定假期 / 补班上班 四类背景色可区分,且可在设置里自定义颜色;日历右侧分栏点日期看/加当天日程,支持右键加日程。
|
|
26
|
+
- **日程**:标题、日期、时间、备注、提前提醒;支持**不重复 / 每日 / 每周 / 每月 / 每年 / 农历每年(生日纪念)**;记录创建时间;列表按下次发生排序,**本周期已过发灰、未到的高亮**。
|
|
27
|
+
- **工作待办**:可设**截止日期**,未完成按截止日排序、逾期红色「⚠ 逾期」,已完成显示完成时间。
|
|
28
|
+
- **日报 / 周报**:日报可「一键生成(自动统计当日日程 / 未完成任务 / 已完成)」,支持按日期区间**批量一键生成**;周报自动汇总本周日报与完成情况,也可手动修改并保存。
|
|
29
|
+
- **星座运势**:在「设置」里为每人填写生日(可选**阳历 / 农历 + 年份**,自动识别星座);「今日」底部显示星座图案与每日气运(综合 / 恋爱 / 事业 / 财运 / 幸运色 / 幸运数字),并给出**星座配对**(最配 TOP3 + 与其余 11 星座的相处评分)。
|
|
30
|
+
- **好运签到**:今日顶部 Buff 条,每日签到随机抽取「鸿运当头 / 日进斗金 / 暴富」等好运词并附健康提醒,连续签到累计天数。
|
|
31
|
+
- **人员与班制**:多人管理;每人在「双休 / 大小周 / 单休 / 自定义星期」间切换。**大小周**语义:大周周六周日都休(双休),小周周六上班、周日休;可指定本周大 / 小周并自动交替。
|
|
32
|
+
- **上下班倒计时**:按当前人员班制实时倒计时(距上班 / 距下班),上下班到点提醒。
|
|
33
|
+
- **左侧栏入口**:在原生左侧栏脚部注入「日程助手」按钮,一键打开右侧面板;也可从右侧「新建标签页」选择「日程助手」。
|
|
34
|
+
- **数据随包走**:数据存在插件包内 `data/store.json`,便于整包打包 / 备份。
|
|
35
|
+
|
|
36
|
+
## 安装(桌面端 · desktop profile)
|
|
37
|
+
|
|
38
|
+
> 桌面端 profile 由 Electron 独占,`dsh plugin --profile desktop` 会被拒绝,需手改 profile。
|
|
39
|
+
|
|
40
|
+
1. 把本包放到 `~/.dsh/local-plugins/dsh-schedule-calendar`(或 `npm i dsh-schedule-calendar`)。
|
|
41
|
+
2. 编辑 `~/.dsh/profiles/desktop/package.json`:
|
|
42
|
+
- `dependencies` 增加:`"dsh-schedule-calendar": "link:<本包绝对路径>"`(npm 安装则写版本号)
|
|
43
|
+
- `dsh.profile.bundles` 增加:`"dsh-schedule-calendar"`
|
|
44
|
+
3. 在该 profile 目录执行 `pnpm install`。
|
|
45
|
+
4. **完全退出 DSH 再启动**(宿主端无热重载)。左侧栏脚部出现「日程助手」按钮,点击打开右侧面板。
|
|
46
|
+
|
|
47
|
+
## 数据与隐私
|
|
48
|
+
|
|
49
|
+
- 数据只写本机插件包内 `data/store.json`,不上传任何服务器。
|
|
50
|
+
- 天气 / 城市 / 节假日 / 黄历 / 星座运势由宿主端代理转发或本地生成;失败时界面降级提示,不影响日程与待办。
|
|
51
|
+
|
|
52
|
+
## 开发
|
|
53
|
+
|
|
54
|
+
- 宿主端:`lib/index.js`(`ctx.webServer.register` 前缀路由:`/ping` `/data` `/geocode` `/weather` `/holidays` `/lunar` `/divisions` `/resolve` `/almanac` `/horoscope` `/lunar2solar`)。
|
|
55
|
+
- 客户端:`lib/client.js`(`__ModuleLoader__.load` 手写 bundle,`ctx.betterSidebar.registerTab` + 左侧栏槽位)。
|
|
56
|
+
- 契约:`dsh.bundle.patch` + `dsh.client.platform: web`;bundle id / package name / patch name 三处一致。
|
|
57
|
+
- 本地探针:`scripts/probe.cjs`(迷你 React 运行时渲染七视图)、`scripts/probe-host.mjs`(假 req/res 跑宿主全路由)。
|
|
58
|
+
|
|
59
|
+
MIT License.
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# dsh-schedule-calendar bundle patch
|
|
2
|
+
#
|
|
3
|
+
# 安装方式(推荐,桌面端手改 profile):
|
|
4
|
+
# 1) 把本包目录放到 ~/.dsh/local-plugins/dsh-schedule-calendar
|
|
5
|
+
# 2) 在 ~/.dsh/profiles/desktop/package.json 的 dependencies 加:
|
|
6
|
+
# "dsh-schedule-calendar": "link:C:/Users/<你>/.dsh/local-plugins/dsh-schedule-calendar"
|
|
7
|
+
# 并在 dsh.profile.bundles 里加入 "dsh-schedule-calendar"
|
|
8
|
+
# 3) 在该 profile 目录 pnpm install
|
|
9
|
+
# 4) 完全退出 DSH 再启动(宿主无热重载)
|
|
10
|
+
#
|
|
11
|
+
# 本补丁只插入插件自身的 loader entry,勿重复注册。
|
|
12
|
+
- insert:
|
|
13
|
+
- id: dsh-schedule-calendar
|
|
14
|
+
name: 'dsh-schedule-calendar'
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"settings": {
|
|
4
|
+
"activePersonId": "p1",
|
|
5
|
+
"activeCityId": "c-bj",
|
|
6
|
+
"reminderSound": true,
|
|
7
|
+
"workReminder": true,
|
|
8
|
+
"weekStart": 1
|
|
9
|
+
},
|
|
10
|
+
"weatherCities": [
|
|
11
|
+
{ "id": "c-bj", "name": "北京", "latitude": 39.9042, "longitude": 116.4074, "country": "中国", "admin1": "北京市" },
|
|
12
|
+
{ "id": "c-sh", "name": "上海", "latitude": 31.2304, "longitude": 121.4737, "country": "中国", "admin1": "上海市" }
|
|
13
|
+
],
|
|
14
|
+
"persons": [
|
|
15
|
+
{
|
|
16
|
+
"id": "p1",
|
|
17
|
+
"name": "我",
|
|
18
|
+
"schedule": {
|
|
19
|
+
"type": "double",
|
|
20
|
+
"workStart": "09:00",
|
|
21
|
+
"workEnd": "18:00",
|
|
22
|
+
"bigWeekIsWork": true,
|
|
23
|
+
"anchorDate": "2026-01-05",
|
|
24
|
+
"customWorkdays": [1, 2, 3, 4, 5]
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"events": [],
|
|
29
|
+
"todos": []
|
|
30
|
+
}
|
package/icon.svg
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none">
|
|
2
|
+
<rect x="3" y="6" width="26" height="23" rx="4" fill="#4d6bfe" fill-opacity="0.14" stroke="#4d6bfe" stroke-width="2"/>
|
|
3
|
+
<rect x="3" y="6" width="26" height="6.5" rx="4" fill="#4d6bfe"/>
|
|
4
|
+
<rect x="9" y="3" width="2.4" height="6" rx="1.2" fill="#4d6bfe"/>
|
|
5
|
+
<rect x="20.6" y="3" width="2.4" height="6" rx="1.2" fill="#4d6bfe"/>
|
|
6
|
+
<circle cx="10.5" cy="18" r="1.7" fill="#4d6bfe"/>
|
|
7
|
+
<circle cx="16" cy="18" r="1.7" fill="#4d6bfe"/>
|
|
8
|
+
<circle cx="21.5" cy="18" r="1.7" fill="#4d6bfe"/>
|
|
9
|
+
<circle cx="10.5" cy="23" r="1.7" fill="#4d6bfe" fill-opacity="0.5"/>
|
|
10
|
+
<circle cx="16" cy="23" r="1.7" fill="#4d6bfe" fill-opacity="0.5"/>
|
|
11
|
+
</svg>
|