mirror of
https://github.com/System-End/slack-end.git
synced 2026-04-19 20:55:08 +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
|
data.json
|
||||||
t.ts
|
t.ts
|
||||||
ctf/unenc
|
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;
|
id: string;
|
||||||
name: string;
|
name: string;
|
||||||
}
|
}
|
||||||
|
export const chunks:string[] = []
|
||||||
export function PrivateDNS(app: ModifiedApp, id: string, channel: string) {
|
export function PrivateDNS(app: ModifiedApp, id: string, channel: string) {
|
||||||
const client = new EventSource(
|
const client = new EventSource(
|
||||||
`https://api.nextdns.io/profiles/${id}/logs/stream`,
|
`https://api.nextdns.io/profiles/${id}/logs/stream`,
|
||||||
|
|
@ -34,10 +34,15 @@ export function PrivateDNS(app: ModifiedApp, id: string, channel: string) {
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
delete realData.clientIp;
|
delete realData.clientIp;
|
||||||
// console.log(`${realData.status == 'blocked' ? ':x:' : ":white_check_mark:"} ${realData.encrypted ? ":lock: " : ""} - ${realData.domain} `)
|
// 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({
|
app.client.chat.postMessage({
|
||||||
channel,
|
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`, {
|
// fetch(`https://api.nextdns.io/profiles/${id}/logs/stream`, {
|
||||||
// headers: { "X-Api-Key": process.env.NEXTDNS_API_KEY },
|
// headers: { "X-Api-Key": process.env.NEXTDNS_API_KEY },
|
||||||
|
|
|
||||||
3
wak.toml
3
wak.toml
|
|
@ -5,9 +5,10 @@ version = 1
|
||||||
|
|
||||||
[files]
|
[files]
|
||||||
include = ["*"] # files to include in tracking
|
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 = [
|
exclude_files = [
|
||||||
".gitignore",
|
".gitignore",
|
||||||
|
".wakaignore"
|
||||||
] # files whose contents will be used to exclude other files from tracking
|
] # files whose contents will be used to exclude other files from tracking
|
||||||
exclude_binary_files = true # whether to ignore binary files
|
exclude_binary_files = true # whether to ignore binary files
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue