MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / append_subnet_scan_log

Method append_subnet_scan_log

shared.py:1809–1831  ·  view source on GitHub ↗

Append an entry to the subnet scan log visible in the UI. Args: cidr: The subnet that was scanned (or 'primary'). status: 'ok' | 'error' | 'info' | 'skip' message: Human-readable description. devices: Number of devices found (optional).

(self, cidr, status, message, devices=None)

Source from the content-addressed store, hash-verified

1807 self.money = self.load_image(os.path.join(self.staticpicdir, 'money.bmp'), scale=img_scale)
1808 self.zombie_status = self.load_image(os.path.join(self.staticpicdir, 'zombie.bmp'), scale=img_scale)
1809 self.attack = self.load_image(os.path.join(self.staticpicdir, 'attack.bmp'), scale=img_scale)
1810
1811 # Resize frise to span full display width (and scale height on large displays)
1812 if self.frise is not None and Image is not None and hasattr(self, 'width') and self.frise.width < self.width:
1813 new_h = max(self.frise.height, int(self.frise.height * img_scale)) if img_scale > 1.0 else self.frise.height
1814 self.frise = self.frise.resize((self.width - 2, new_h), Image.Resampling.NEAREST)
1815
1816 """ Load the images for the different actions status"""
1817 # Dynamically load status images based on actions.json
1818 try:
1819 with open(self.actions_file, 'r') as f:
1820 actions = json.load(f)
1821 for action in actions:
1822 b_class = action.get('b_class')
1823 if b_class:
1824 indiv_status_path = os.path.join(self.statuspicdir, b_class)
1825 image_path = os.path.join(indiv_status_path, f'{b_class}.bmp')
1826 image = self.load_image(image_path, scale=img_scale)
1827 setattr(self, b_class, image)
1828 logger.info(f"Loaded image for {b_class} from {image_path}")
1829 except Exception as e:
1830 logger.error(f"Error loading images from actions file: {e}")
1831
1832 # Load image series dynamically from subdirectories
1833 self.image_series = {}
1834 for status in self.status_list:

Callers 2

_bg_scanFunction · 0.80
scanMethod · 0.80

Calls 1

appendMethod · 0.80

Tested by

no test coverage detected