mirror of
https://github.com/SukkaW/Surge.git
synced 2026-01-28 17:41:54 +08:00
Minor changes
This commit is contained in:
@@ -6,12 +6,14 @@ import { ALL, NORTH_AMERICA, EU, HK, TW, JP, KR } from '../Source/stream';
|
||||
import { SHARED_DESCRIPTION } from './constants/description';
|
||||
import { RulesetOutput } from './lib/create-file';
|
||||
|
||||
export function createRulesetForStreamService(span: Span,
|
||||
function createRulesetForStreamService(
|
||||
span: Span,
|
||||
fileId: string, title: string,
|
||||
streamServices: Array<import('../Source/stream').StreamService>) {
|
||||
return span.traceChildAsync(fileId, async (childSpan) => Promise.all([
|
||||
streamServices: Array<import('../Source/stream').StreamService>
|
||||
) {
|
||||
return [
|
||||
// Domains
|
||||
new RulesetOutput(childSpan, fileId, 'non_ip')
|
||||
new RulesetOutput(span, fileId, 'non_ip')
|
||||
.withTitle(`Sukka's Ruleset - Stream Services: ${title}`)
|
||||
.withDescription([
|
||||
...SHARED_DESCRIPTION,
|
||||
@@ -21,7 +23,7 @@ export function createRulesetForStreamService(span: Span,
|
||||
.addFromRuleset(streamServices.flatMap((i) => i.rules))
|
||||
.write(),
|
||||
// IP
|
||||
new RulesetOutput(childSpan, fileId, 'ip')
|
||||
new RulesetOutput(span, fileId, 'ip')
|
||||
.withTitle(`Sukka's Ruleset - Stream Services IPs: ${title}`)
|
||||
.withDescription([
|
||||
...SHARED_DESCRIPTION,
|
||||
@@ -31,7 +33,7 @@ export function createRulesetForStreamService(span: Span,
|
||||
.bulkAddCIDR4NoResolve(streamServices.flatMap(i => i.ip?.v4 ?? []))
|
||||
.bulkAddCIDR6NoResolve(streamServices.flatMap(i => i.ip?.v6 ?? []))
|
||||
.write()
|
||||
]));
|
||||
];
|
||||
}
|
||||
|
||||
export const buildStreamService = task(require.main === module, __filename)(async (span) => Promise.all([
|
||||
@@ -44,4 +46,4 @@ export const buildStreamService = task(require.main === module, __filename)(asyn
|
||||
// createRulesetForStreamService('stream_au', 'Oceania', AU),
|
||||
createRulesetForStreamService(span, 'stream_kr', 'Korean', KR)
|
||||
// createRulesetForStreamService('stream_south_east_asia', 'South East Asia', SOUTH_EAST_ASIA)
|
||||
]));
|
||||
].flat()));
|
||||
|
||||
Reference in New Issue
Block a user