From 47630dbbfb50c18163e8b0501510e16159906fa9 Mon Sep 17 00:00:00 2001 From: DokoGen Date: Mon, 3 Aug 2026 10:56:35 +0400 Subject: [PATCH] =?UTF-8?q?feat:=20=D0=BF=D0=B5=D1=80=D0=B5=D0=BC=D0=B5?= =?UTF-8?q?=D0=BD=D0=BD=D0=B0=D1=8F=20=C2=AB=D0=A1=D1=82=D1=80=D1=83=D0=BA?= =?UTF-8?q?=D1=82=D1=83=D1=80=D0=B0=20=D0=98=D0=A1=C2=BB=20(structure)=20?= =?UTF-8?q?=D0=B2=20=D1=86=D0=B8=D0=BA=D0=BB=D0=B5=20information=5Fsystems?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - models.py: поле structure у InformationSystem - variables.py: {{item.structure}} / {{structure}} в цикле, {{is_structure_N}} в индексированных - ui.py: поле «Структура ИС» на вкладке ИС --- dokogen/models.py | 1 + dokogen/ui.py | 10 ++++++++++ dokogen/variables.py | 2 ++ 3 files changed, 13 insertions(+) diff --git a/dokogen/models.py b/dokogen/models.py index 8028c36..8f52556 100644 --- a/dokogen/models.py +++ b/dokogen/models.py @@ -36,6 +36,7 @@ class InformationSystem: personal_data_category: List[str] = field(default_factory=list) purpose: str = "" room: str = "" + structure: str = "" # Структура информационной системы @dataclass diff --git a/dokogen/ui.py b/dokogen/ui.py index e0dce99..f60469c 100644 --- a/dokogen/ui.py +++ b/dokogen/ui.py @@ -333,6 +333,11 @@ class DokoGenApp: self.is_pd_count_combo.grid(row=6, column=1, padx=10, sticky=tk.W) self.is_pd_count_combo.bind('<>', lambda e: self._on_categories_or_count_changed()) + # Структура ИС + ttk.Label(fields_frame, text="Структура ИС:").grid(row=7, column=0, sticky=tk.W, pady=2) + self.is_structure_entry = ttk.Entry(fields_frame, width=55) + self.is_structure_entry.grid(row=7, column=1, padx=10, sticky=tk.EW) + fields_frame.columnconfigure(1, weight=1) @@ -608,6 +613,8 @@ class DokoGenApp: isys = self.model.information_systems[self._current_is_idx] isys.name = self.is_name_entry.get().strip() isys.description = self.is_description_entry.get().strip() + if hasattr(self, 'is_structure_entry'): + isys.structure = self.is_structure_entry.get().strip() isys.is_local_network = self.is_lan_var.get() isys.is_internet = self.is_internet_var.get() isys.threat_type = self.is_threat_var.get() @@ -867,6 +874,9 @@ class DokoGenApp: self.is_name_entry.insert(0, isys.name or "") self.is_description_entry.delete(0, tk.END) self.is_description_entry.insert(0, isys.description or "") + if hasattr(self, 'is_structure_entry'): + self.is_structure_entry.delete(0, tk.END) + self.is_structure_entry.insert(0, isys.structure or "") self.is_lan_var.set(isys.is_local_network) self.is_internet_var.set(isys.is_internet) self.is_threat_var.set(isys.threat_type or "3") diff --git a/dokogen/variables.py b/dokogen/variables.py index d9b1840..06d3786 100644 --- a/dokogen/variables.py +++ b/dokogen/variables.py @@ -219,6 +219,7 @@ def _add_is_indexed_vars(replacements: Dict[str, str], isys, idx: int): 'is_users': ', '.join(isys.users_list or []) or '—', 'is_pd_count': str(isys.pd_count or '—'), 'is_purpose': isys.purpose or '—', + 'is_structure': getattr(isys, 'structure', '') or '—', } for f, v in fields.items(): replacements[f'{{{{{f}_{idx}}}}}'] = str(v) @@ -267,6 +268,7 @@ def _build_loop_data(company: Company, is_list: List) -> Dict[str, List[Dict]]: 'processing_modes': isys.processing_modes or '—', 'pd_subjects': '; '.join(isys.pd_subjects_list or []) or '—', 'is_purpose': isys.purpose or '—', + 'structure': getattr(isys, 'structure', '') or '—', }) loops['information_systems'] = items