优化推送通知卡片的展示

This commit is contained in:
EasyChen
2022-05-28 23:53:02 +08:00
parent 55f65ee8c9
commit fe741f72ab
9 changed files with 22 additions and 18 deletions
+3 -3
View File
@@ -12,9 +12,9 @@
## 最新版本
- 插件·Chrome/Edge[2022.05.27.19.05](ckc.zip)
- 自架云端Docker镜像:2022.05.27.19.01
- 文档:2022.05.27.19.05
- 插件·Chrome/Edge2022.05.28.23.49 [下载](ckc.zip)
- 自架云端Docker镜像:2022.05.28.23.42 [Docker Hub](https://hub.docker.com/repository/docker/easychen/checkchan)
- 文档:2022.05.28.23.49
- 更新日志:[GitHub](https://github.com/easychen/checkchan-dist/commits/main)
自架云端 Docker 命令( 将`API Key``YouRAPiK1`替换成`任意你想要的安全密码不要带$`:
+2 -2
View File
@@ -12,8 +12,8 @@
## 最新版本
- 插件·Chrome/Edge[{ext-build}](ckc.zip)
- 自架云端Docker镜像:{img-build}
- 插件·Chrome/Edge{ext-build} [下载](ckc.zip)
- 自架云端Docker镜像:{img-build} [Docker Hub](https://hub.docker.com/repository/docker/easychen/checkchan)
- 文档:{doc-build}
- 更新日志:[GitHub](https://github.com/easychen/checkchan-dist/commits/main)
+1 -1
View File
@@ -1 +1 @@
"2022.05.27.19.05"
"2022.05.28.23.49"
BIN
View File
Binary file not shown.
+1 -1
View File
@@ -1 +1 @@
"2022.05.27.19.01"
"2022.05.28.23.42"
+4 -2
View File
@@ -165,7 +165,9 @@ for( const item of to_checks )
let desp = short(check_content,50) + (last_content && item.when == 'change' ? ('←' + short(last_content,50)):"");
const link = check_link || item.page || item.url;
desp += "\r\n\r\n [去看看]("+ link +") \r\n\r\n";
const short_content = desp;
desp += "\r\n\r\n[详情链接]("+ link +") \r\n\r\n";
if( check_html )
desp += "\r\n\r\n---\r\n\r\n" + to_markdown(check_html);
@@ -182,7 +184,7 @@ for( const item of to_checks )
// const desp = check_content.length > 50 ? (check_html ? to_markdown(check_html) : check_content) : check_content + (item.last_content ? ('←' + item.last_content):"") ;
await send_notify( title, desp , item.sendkey, item.send_channel || -1);
await send_notify( title, desp , item.sendkey, item.send_channel || -1, short_content);
}
}
}
+5 -3
View File
@@ -39,8 +39,8 @@ function short( maybe_string , len = 0 )
if( isNumeric( maybe_string )) return maybe_string;
if (typeof maybe_string === 'string' || maybe_string instanceof String)
{
if( len < 1 ) return maybe_string;
return maybe_string.substring( 0, len );
if( len < 1 ) return maybe_string.replace(/^"(.+)"$/ig, '\$1');
return maybe_string.replace(/^"(.+)"$/ig, '\$1').substring( 0, len );
}else
{
// maybe object
@@ -141,11 +141,12 @@ exports.get_cookies = () =>
return json_data.cookies;
}
exports.send_notify = async ( title, desp, sendkey, channel = -1) =>
exports.send_notify = async ( title, desp, sendkey, channel = -1, short = false) =>
{
try {
const form = new FormData();
if( channel >= 0 ) form.append( 'channel',parseInt(channel));
if( short ) form.append( 'short',short );
form.append( 'title',title );
form.append( 'desp',desp.substring(0,10000) );
const response = await fetch( 'https://sctapi.ftqq.com/'+sendkey+'.send', {
@@ -311,6 +312,7 @@ async function monitor_dom(url, path, delay , cookies, id)
args: ['--no-sandbox'],
defaultViewport: null,
headless: true,
timeout:delay+1000*10,
};
if( process.env.CHROMIUM_PATH )
+3 -3
View File
@@ -20,9 +20,9 @@
</ol>
<h2>最新版本</h2>
<ul>
<li>插件·Chrome/Edge<a href="ckc.zip">2022.05.27.19.05</a></li>
<li>自架云端Docker镜像:2022.05.27.19.01</li>
<li>文档:2022.05.27.19.05</li>
<li>插件·Chrome/Edge2022.05.28.23.49 <a href="ckc.zip">下载</a></li>
<li>自架云端Docker镜像:2022.05.28.23.42 <a href="https://hub.docker.com/repository/docker/easychen/checkchan" rel="nofollow">Docker Hub</a></li>
<li>文档:2022.05.28.23.49</li>
<li>更新日志:<a href="https://github.com/easychen/checkchan-dist/commits/main">GitHub</a></li>
</ul>
<p>自架云端 Docker 命令( 将<code class="notranslate">API Key</code><code class="notranslate">YouRAPiK1</code>替换成<code class="notranslate">任意你想要的安全密码不要带$</code>:</p>
+3 -3
View File
@@ -9,9 +9,9 @@
</ol>
<h2>最新版本</h2>
<ul>
<li>插件·Chrome/Edge<a href="ckc.zip">2022.05.27.19.05</a></li>
<li>自架云端Docker镜像:2022.05.27.19.01</li>
<li>文档:2022.05.27.19.05</li>
<li>插件·Chrome/Edge2022.05.28.23.49 <a href="ckc.zip">下载</a></li>
<li>自架云端Docker镜像:2022.05.28.23.42 <a href="https://hub.docker.com/repository/docker/easychen/checkchan" rel="nofollow">Docker Hub</a></li>
<li>文档:2022.05.28.23.49</li>
<li>更新日志:<a href="https://github.com/easychen/checkchan-dist/commits/main">GitHub</a></li>
</ul>
<p>自架云端 Docker 命令( 将<code class="notranslate">API Key</code><code class="notranslate">YouRAPiK1</code>替换成<code class="notranslate">任意你想要的安全密码不要带$</code>:</p>