Skip to content

Commit

Permalink
chore(doc): 添加推送工具文档说明
Browse files Browse the repository at this point in the history
- 添加推送工具文档说明
- 企业微信代理支持https和http前缀
- 优化 注册推送 placeholder
  • Loading branch information
a76yyyy committed Jun 27, 2023
1 parent 0d9ed0c commit fc655a0
Show file tree
Hide file tree
Showing 11 changed files with 580 additions and 106 deletions.
2 changes: 1 addition & 1 deletion libs/funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ async def qywx_pusher_send(self, qywx_token, title:str, log:str):

if qywx[u'代理'][-1]!='/':
qywx[u'代理'] = qywx[u'代理'] + '/'
if qywx[u'代理'][:4] != 'http':
if 'http://' in qywx[u'代理'] or 'https://' in qywx[u'代理']:
qywx[u'代理'] = u'https://{0}'.format(qywx[u'代理'])
get_access_token_res = await self.get_access_token(qywx)
pic_url = config.push_pic if qywx[u'图片'] == '' else qywx[u'图片']
Expand Down
71 changes: 39 additions & 32 deletions web/docs/.vitepress/locales/en_US.ts
Original file line number Diff line number Diff line change
@@ -1,67 +1,74 @@
import { createRequire } from 'module'
import { defineConfig } from 'vitepress'
import { createRequire } from "module";
import { defineConfig } from "vitepress";

const require = createRequire(import.meta.url)
const pkg = require('vitepress/package.json')
const require = createRequire(import.meta.url);
const pkg = require("vitepress/package.json");

export default defineConfig({
lang: 'en-US',
description: 'A web framework for HTTP timed task automation.',
lang: "en-US",
description: "A web framework for HTTP timed task automation.",

themeConfig: {
nav: nav(),

logo: '/logo.png',
logo: "/logo.png",

lastUpdatedText: 'last Updated',
lastUpdatedText: "last Updated",

sidebar: {
'/guide/': sidebarGuide()
"/guide/": sidebarGuide(),
"/toolbox/": sidebarGuide(),
},

socialLinks: [
{ icon: 'github', link: 'https://github.com/qd-today/qd' },
{ icon: "github", link: "https://github.com/qd-today/qd" },
{
icon: {
svg: '<svg t="1676552188859" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2069" width="200" height="200"><path d="M512 1024C230.4 1024 0 793.6 0 512S230.4 0 512 0s512 230.4 512 512-230.4 512-512 512z m259.2-569.6H480c-12.8 0-25.6 12.8-25.6 25.6v64c0 12.8 12.8 25.6 25.6 25.6h176c12.8 0 25.6 12.8 25.6 25.6v12.8c0 41.6-35.2 76.8-76.8 76.8h-240c-12.8 0-25.6-12.8-25.6-25.6V416c0-41.6 35.2-76.8 76.8-76.8h355.2c12.8 0 25.6-12.8 25.6-25.6v-64c0-12.8-12.8-25.6-25.6-25.6H416c-105.6 0-188.8 86.4-188.8 188.8V768c0 12.8 12.8 25.6 25.6 25.6h374.4c92.8 0 169.6-76.8 169.6-169.6v-144c0-12.8-12.8-25.6-25.6-25.6z" fill="#888888" p-id="2070"></path></svg>'
}, link: 'https://gitee.com/qd-today/qd'
svg: '<svg t="1676552188859" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2069" width="200" height="200"><path d="M512 1024C230.4 1024 0 793.6 0 512S230.4 0 512 0s512 230.4 512 512-230.4 512-512 512z m259.2-569.6H480c-12.8 0-25.6 12.8-25.6 25.6v64c0 12.8 12.8 25.6 25.6 25.6h176c12.8 0 25.6 12.8 25.6 25.6v12.8c0 41.6-35.2 76.8-76.8 76.8h-240c-12.8 0-25.6-12.8-25.6-25.6V416c0-41.6 35.2-76.8 76.8-76.8h355.2c12.8 0 25.6-12.8 25.6-25.6v-64c0-12.8-12.8-25.6-25.6-25.6H416c-105.6 0-188.8 86.4-188.8 188.8V768c0 12.8 12.8 25.6 25.6 25.6h374.4c92.8 0 169.6-76.8 169.6-169.6v-144c0-12.8-12.8-25.6-25.6-25.6z" fill="#888888" p-id="2070"></path></svg>',
},
link: "https://gitee.com/qd-today/qd",
},
],

footer: {
message: 'Released under the MIT License.',
copyright: 'Copyright © 2023-present QD Developers'
message: "Released under the MIT License.",
copyright: "Copyright © 2023-present QD Developers",
},

editLink: {
pattern: 'https://github.com/qd-today/qd/edit/master/web/docs/:path',
text: 'Edit this page on GitHub'
pattern: "https://github.com/qd-today/qd/edit/master/web/docs/:path",
text: "Edit this page on GitHub",
},

outline: {
label: 'On this page',
label: "On this page",
level: [2, 3],
},

}
})
},
});

function nav() {
return [
{ text: 'Guide', link: '/guide/what-is-qd' },
]
{ text: "Guide", link: "/guide/what-is-qd" },
{ text: "ToolBox", link: "/toolbox/pusher" },
];
}

function sidebarGuide() {
return [
{
text: 'Guide',
items: [
{ text: 'What is QD?', link: '/guide/what-is-qd' },
{ text: 'Deployment', link: '/guide/deployment' },
{ text: 'How to Use?', link: '/guide/how-to-use' },
{ text: 'Update', link: '/guide/update' },
{ text: 'FAQ', link: '/guide/faq' },
]
}
]
text: "Guide",
items: [
{ text: "What is QD?", link: "/guide/what-is-qd" },
{ text: "Deployment", link: "/guide/deployment" },
{ text: "How to Use?", link: "/guide/how-to-use" },
{ text: "Update", link: "/guide/update" },
{ text: "FAQ", link: "/guide/faq" },
],
},
{
text: "ToolBox",
items: [{ text: "Pusher", link: "/toolbox/pusher" }],
},
];
}
69 changes: 38 additions & 31 deletions web/docs/.vitepress/locales/zh_CN.ts
Original file line number Diff line number Diff line change
@@ -1,67 +1,74 @@
import { createRequire } from 'module'
import { defineConfig } from 'vitepress'
import { createRequire } from "module";
import { defineConfig } from "vitepress";

const require = createRequire(import.meta.url)
const pkg = require('vitepress/package.json')
const require = createRequire(import.meta.url);
const pkg = require("vitepress/package.json");

export default defineConfig({
lang: 'zh-CN',
description: 'HTTP定时任务自动执行Web框架',
lang: "zh-CN",
description: "HTTP定时任务自动执行Web框架",

themeConfig: {
nav: nav(),

logo: '/logo.png',
logo: "/logo.png",

lastUpdatedText: '最后更新',
lastUpdatedText: "最后更新",

sidebar: {
'/zh_CN/guide/': sidebarGuide()
"/zh_CN/guide/": sidebarGuide(),
"/zh_CN/toolbox/": sidebarGuide(),
},

socialLinks: [
{ icon: 'github', link: 'https://github.com/qd-today/qd' },
{ icon: "github", link: "https://github.com/qd-today/qd" },
{
icon: {
svg: '<svg t="1676552188859" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2069" width="200" height="200"><path d="M512 1024C230.4 1024 0 793.6 0 512S230.4 0 512 0s512 230.4 512 512-230.4 512-512 512z m259.2-569.6H480c-12.8 0-25.6 12.8-25.6 25.6v64c0 12.8 12.8 25.6 25.6 25.6h176c12.8 0 25.6 12.8 25.6 25.6v12.8c0 41.6-35.2 76.8-76.8 76.8h-240c-12.8 0-25.6-12.8-25.6-25.6V416c0-41.6 35.2-76.8 76.8-76.8h355.2c12.8 0 25.6-12.8 25.6-25.6v-64c0-12.8-12.8-25.6-25.6-25.6H416c-105.6 0-188.8 86.4-188.8 188.8V768c0 12.8 12.8 25.6 25.6 25.6h374.4c92.8 0 169.6-76.8 169.6-169.6v-144c0-12.8-12.8-25.6-25.6-25.6z" fill="#888888" p-id="2070"></path></svg>'
}, link: 'https://gitee.com/qd-today/qd'
svg: '<svg t="1676552188859" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2069" width="200" height="200"><path d="M512 1024C230.4 1024 0 793.6 0 512S230.4 0 512 0s512 230.4 512 512-230.4 512-512 512z m259.2-569.6H480c-12.8 0-25.6 12.8-25.6 25.6v64c0 12.8 12.8 25.6 25.6 25.6h176c12.8 0 25.6 12.8 25.6 25.6v12.8c0 41.6-35.2 76.8-76.8 76.8h-240c-12.8 0-25.6-12.8-25.6-25.6V416c0-41.6 35.2-76.8 76.8-76.8h355.2c12.8 0 25.6-12.8 25.6-25.6v-64c0-12.8-12.8-25.6-25.6-25.6H416c-105.6 0-188.8 86.4-188.8 188.8V768c0 12.8 12.8 25.6 25.6 25.6h374.4c92.8 0 169.6-76.8 169.6-169.6v-144c0-12.8-12.8-25.6-25.6-25.6z" fill="#888888" p-id="2070"></path></svg>',
},
link: "https://gitee.com/qd-today/qd",
},
],

footer: {
message: '基于 MIT 许可证发布.',
copyright: 'Copyright © 2023-当前 QD 开发者'
message: "基于 MIT 许可证发布.",
copyright: "Copyright © 2023-当前 QD 开发者",
},

editLink: {
pattern: 'https://github.com/qd-today/qd/edit/master/web/docs/:path',
text: '在 GitHub 中编辑此页面'
pattern: "https://github.com/qd-today/qd/edit/master/web/docs/:path",
text: "在 GitHub 中编辑此页面",
},

outline: {
label: '页面导航',
label: "页面导航",
level: [2, 3],
},

}
})
},
});

function nav() {
return [
{ text: '指南', link: '/zh_CN/guide/what-is-qd' },
]
{ text: "指南", link: "/zh_CN/guide/what-is-qd" },
{ text: "工具箱", link: "/zh_CN/toolbox/pusher" },
];
}

function sidebarGuide() {
return [
{
text: '指南',
text: "指南",
items: [
{ text: '什么是 QD?', link: '/zh_CN/guide/what-is-qd' },
{ text: '部署', link: '/zh_CN/guide/deployment' },
{ text: '如何使用?', link: '/zh_CN/guide/how-to-use' },
{ text: '更新', link: '/zh_CN/guide/update' },
{ text: '常见问题', link: '/zh_CN/guide/faq' },
]
}
]
{ text: "什么是 QD?", link: "/zh_CN/guide/what-is-qd" },
{ text: "部署", link: "/zh_CN/guide/deployment" },
{ text: "如何使用?", link: "/zh_CN/guide/how-to-use" },
{ text: "更新", link: "/zh_CN/guide/update" },
{ text: "常见问题", link: "/zh_CN/guide/faq" },
],
},
{
text: "工具箱",
items: [{ text: "推送工具", link: "/zh_CN/toolbox/pusher" }],
},
];
}
2 changes: 1 addition & 1 deletion web/docs/guide/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ python ./chrole.py your@email.address admin
|PUSH_PIC_URL|No|[push_pic.png](https://fastly.jsdelivr.net/gh/qd-today/qd@master/web/static/img/push_pic.png)|The default is [push_pic.png](https ://fastly.jsdelivr.net/gh/qd-today/qd@master/web/static/img/push_pic.png)|
|PUSH_BATCH_SW|No|True|Whether to allow periodic push of QD task logs, the default is True|
|MAIL_SMTP|No|""|Email SMTP server|
|MAIL_PORT|No|""|Email SMTP server port|
|MAIL_PORT|No|465|Email SMTP server port|
|MAIL_USER|No|""|Email username|
|MAIL_PASSWORD|No|""|Email password|
|MAIL_FROM|No|MAIL_USER|The Email used when sending, the default is the same as MAIL_USER|
Expand Down
16 changes: 1 addition & 15 deletions web/docs/guide/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,21 +81,7 @@ However, `pycurl` is not required in this framework, if you don't need to use th

You can register different notification tools to receive notifications when specific events (such as failed check-ins) occur.

### TgBot

Assuming you have created a Telegram bot API with a custom domain::

`https://tg.mydomain.com/bot1111111111:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/sendMessage?chat_id=222222222&text=HelloWorld`

The above request will send a `HelloWorld` message to the chat with ID `222222222`. When registering TgBot as a notification method:

- `TG_TOKEN` should be filled with the combination of the bot ID and corresponding key, but without `bot`. That is, the token provided by BotFather when applying for TgBot: `1111111111:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA`
- `TG_USERID` should be filled with the `chat_id` field in the Telegram API, that is, `222222222`
- `TG_HOST` should be filled with `tg.mydomain.com`, and it can also include the `http://` or `https://` prefix

Therefore, the final result looks like:

`1111111111:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA;222222222;tg.mydomain.com`
Please refer to [Pusher](/toolbox/pusher) for details.

## Subscribe updating page prompts undefined error

Expand Down
Loading

0 comments on commit fc655a0

Please sign in to comment.