mirror of
https://github.com/System-End/slack-end.git
synced 2026-04-19 15:18:22 +00:00
fix: chunk nextdns
This commit is contained in:
parent
5e7ee068f1
commit
de0957e71c
4 changed files with 12 additions and 3 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -132,3 +132,5 @@ dist
|
|||
data.json
|
||||
t.ts
|
||||
ctf/unenc
|
||||
*.bin
|
||||
*.txt
|
||||
1
.wakaignore
Normal file
1
.wakaignore
Normal file
|
|
@ -0,0 +1 @@
|
|||
.git
|
||||
|
|
@ -20,7 +20,7 @@ export interface Device {
|
|||
id: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export const chunks:string[] = []
|
||||
export function PrivateDNS(app: ModifiedApp, id: string, channel: string) {
|
||||
const client = new EventSource(
|
||||
`https://api.nextdns.io/profiles/${id}/logs/stream`,
|
||||
|
|
@ -34,10 +34,15 @@ export function PrivateDNS(app: ModifiedApp, id: string, channel: string) {
|
|||
//@ts-ignore
|
||||
delete realData.clientIp;
|
||||
// console.log(`${realData.status == 'blocked' ? ':x:' : ":white_check_mark:"} ${realData.encrypted ? ":lock: " : ""} - ${realData.domain} `)
|
||||
if(chunks.length < 10) {
|
||||
chunks.push(`${realData.status == "blocked" ? ":x:" : ":white_check_mark:"} ${realData.encrypted ? ":lock: " : ""} - ${realData.domain} `)
|
||||
} else {
|
||||
app.client.chat.postMessage({
|
||||
channel,
|
||||
text: `${realData.status == "blocked" ? ":x:" : ":white_check_mark:"} ${realData.encrypted ? ":lock: " : ""} - ${realData.domain} `,
|
||||
text: chunks.join("\n"),
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
// fetch(`https://api.nextdns.io/profiles/${id}/logs/stream`, {
|
||||
// headers: { "X-Api-Key": process.env.NEXTDNS_API_KEY },
|
||||
|
|
|
|||
3
wak.toml
3
wak.toml
|
|
@ -5,9 +5,10 @@ version = 1
|
|||
|
||||
[files]
|
||||
include = ["*"] # files to include in tracking
|
||||
exclude = ["/node_modules"] # files to exclude in tracking
|
||||
exclude = ["/node_modules", ".gits"] # files to exclude in tracking
|
||||
exclude_files = [
|
||||
".gitignore",
|
||||
".wakaignore"
|
||||
] # files whose contents will be used to exclude other files from tracking
|
||||
exclude_binary_files = true # whether to ignore binary files
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue