fixed emoji pagation issue
This commit is contained in:
parent
ad6b108d3f
commit
977dd7e6d3
4 changed files with 71 additions and 14 deletions
|
@ -8,6 +8,7 @@
|
|||
const logger = require('../../utils/logger');
|
||||
|
||||
const { getFileName } = require('../../utils/file_utils');
|
||||
const { getProductEmoji } = require('../../utils/os_emojis');
|
||||
const FILE_NAME = getFileName(__filename);
|
||||
|
||||
/**
|
||||
|
@ -78,18 +79,8 @@ const getSearchResultBlocks = (keyword, results, pagination = {}) => {
|
|||
const ruleId = safeRule.id || 'unknown';
|
||||
logger.debug(`${FILE_NAME}: Adding result #${index + 1}: ${ruleId} - ${safeRule.title || 'Untitled'}`);
|
||||
|
||||
// Get OS emoji based on product
|
||||
const getOsEmoji = (product) => {
|
||||
if (!product) return '';
|
||||
|
||||
const productLower = product.toLowerCase();
|
||||
if (productLower.includes('windows')) return ':window: ';
|
||||
if (productLower.includes('mac') || productLower.includes('apple')) return ':apple: ';
|
||||
if (productLower.includes('linux')) return ':penguin: ';
|
||||
return '';
|
||||
};
|
||||
|
||||
const osEmoji = getOsEmoji(safeRule.logsource && safeRule.logsource.product);
|
||||
// Get product emoji
|
||||
const osEmoji = getProductEmoji(safeRule.logsource && safeRule.logsource.product);
|
||||
|
||||
// Rule information and action button - with OS emoji before title and no ID field
|
||||
blocks.push({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue