From 89166b9d356bbc2f66a49ece9846d15ee10706de Mon Sep 17 00:00:00 2001 From: grossmj Date: Tue, 6 Aug 2024 20:33:55 +0200 Subject: [PATCH 01/12] Development on 2.2.50.dev1 --- gns3/version.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gns3/version.py b/gns3/version.py index 49bb63f8c..058e61c40 100644 --- a/gns3/version.py +++ b/gns3/version.py @@ -23,8 +23,8 @@ # or negative for a release candidate or beta (after the base version # number has been incremented) -__version__ = "2.2.49" -__version_info__ = (2, 2, 49, 0) +__version__ = "2.2.50.dev1" +__version_info__ = (2, 2, 50, 99) if "dev" in __version__: try: From 9b882924c0bf3a36b8b4a95c9aea5f409a5e0d51 Mon Sep 17 00:00:00 2001 From: grossmj Date: Wed, 18 Sep 2024 16:30:22 +0700 Subject: [PATCH 02/12] Support for configuring MAC address in Docker containers --- gns3/modules/docker/docker_vm.py | 4 ++ .../pages/docker_vm_configuration_page.py | 33 ++++++++++++++- gns3/modules/docker/settings.py | 1 + .../docker/ui/docker_vm_configuration_page.ui | 40 ++++++++++++------- .../ui/docker_vm_configuration_page_ui.py | 39 ++++++++++-------- 5 files changed, 85 insertions(+), 32 deletions(-) diff --git a/gns3/modules/docker/docker_vm.py b/gns3/modules/docker/docker_vm.py index 525a55bd0..8b31b9e55 100644 --- a/gns3/modules/docker/docker_vm.py +++ b/gns3/modules/docker/docker_vm.py @@ -42,6 +42,7 @@ def __init__(self, module, server, project): docker_vm_settings = {"image": "", "usage": "", "adapters": DOCKER_CONTAINER_SETTINGS["adapters"], + "mac_address": DOCKER_CONTAINER_SETTINGS["mac_address"], "custom_adapters": DOCKER_CONTAINER_SETTINGS["custom_adapters"], "start_command": DOCKER_CONTAINER_SETTINGS["start_command"], "environment": DOCKER_CONTAINER_SETTINGS["environment"], @@ -88,6 +89,9 @@ def info(self): port_name=port.name(), port_description=port.description()) + if port.macAddress(): + port_info += " MAC address is {mac_address}\n".format(mac_address=port.macAddress()) + usage = "\n" + self._settings.get("usage") return info + port_info + usage diff --git a/gns3/modules/docker/pages/docker_vm_configuration_page.py b/gns3/modules/docker/pages/docker_vm_configuration_page.py index 76b29e619..9de063d3c 100644 --- a/gns3/modules/docker/pages/docker_vm_configuration_page.py +++ b/gns3/modules/docker/pages/docker_vm_configuration_page.py @@ -19,6 +19,8 @@ Configuration page for Docker images. """ +import re + from gns3.qt import QtWidgets from gns3.node import Node from gns3.dialogs.custom_adapters_configuration_dialog import CustomAdaptersConfigurationDialog @@ -69,15 +71,25 @@ def _customAdaptersConfigurationSlot(self): if self._node: adapters = self._settings["adapters"] + base_mac_address = self._settings["mac_address"] else: adapters = self.uiAdapterSpinBox.value() + mac = self.uiMacAddrLineEdit.text() + if mac != ":::::": + if not re.search(r"""^([0-9a-fA-F]{2}[:]){5}[0-9a-fA-F]{2}$""", mac): + QtWidgets.QMessageBox.critical(self, "MAC address", "Invalid MAC address (format required: hh:hh:hh:hh:hh:hh)") + return + else: + base_mac_address = mac + else: + base_mac_address = "" ports = [] for adapter_number in range(0, adapters): port_name = "eth{}".format(adapter_number) ports.append(port_name) - dialog = CustomAdaptersConfigurationDialog(ports, self._custom_adapters, parent=self) + dialog = CustomAdaptersConfigurationDialog(ports, self._custom_adapters, "TAP", {"TAP": "Default"}, base_mac_address, parent=self) dialog.show() dialog.exec_() @@ -150,6 +162,13 @@ def loadSettings(self, settings, node=None, group=False): self.uiSymbolLineEdit.hide() self.uiSymbolToolButton.hide() + # load the MAC address setting + self.uiMacAddrLineEdit.setInputMask("HH:HH:HH:HH:HH:HH;_") + if settings["mac_address"]: + self.uiMacAddrLineEdit.setText(settings["mac_address"]) + else: + self.uiMacAddrLineEdit.clear() + self.uiUsageTextEdit.setPlainText(settings["usage"]) def _networkConfigEditSlot(self): @@ -199,6 +218,18 @@ def saveSettings(self, settings, node=None, group=False): else: settings["name"] = name + # check and save the MAC address + mac = self.uiMacAddrLineEdit.text() + if mac != ":::::": + if not re.search(r"""^([0-9a-fA-F]{2}[:]){5}[0-9a-fA-F]{2}$""", mac): + QtWidgets.QMessageBox.critical(self, "MAC address", "Invalid MAC address (format required: hh:hh:hh:hh:hh:hh)") + if node: + raise ConfigurationError() + else: + settings["mac_address"] = mac + else: + settings["mac_address"] = None + if not node: # these are template settings settings["category"] = self.uiCategoryComboBox.itemData(self.uiCategoryComboBox.currentIndex()) diff --git a/gns3/modules/docker/settings.py b/gns3/modules/docker/settings.py index 0ae3c8ac2..255b5031f 100644 --- a/gns3/modules/docker/settings.py +++ b/gns3/modules/docker/settings.py @@ -35,6 +35,7 @@ "name": "", "image": "", "adapters": 1, + "mac_address": "", "custom_adapters": [], "environment": "", "console_type": "telnet", diff --git a/gns3/modules/docker/ui/docker_vm_configuration_page.ui b/gns3/modules/docker/ui/docker_vm_configuration_page.ui index 32f0ab347..251c4e530 100644 --- a/gns3/modules/docker/ui/docker_vm_configuration_page.ui +++ b/gns3/modules/docker/ui/docker_vm_configuration_page.ui @@ -6,8 +6,8 @@ 0 0 - 938 - 872 + 504 + 560 @@ -103,27 +103,37 @@ + + + Base MAC: + + + + + + + Custom adapters: - + &Configure custom adapters - + Console type: - + QLayout::SetNoConstraint @@ -166,14 +176,14 @@ - + VNC console resolution: - + @@ -227,14 +237,14 @@ - + HTTP port in the container: - + 1 @@ -244,17 +254,17 @@ - + HTTP path: - + - + Environment variables: @@ -268,17 +278,17 @@ - + - + Network configuration - + Edit diff --git a/gns3/modules/docker/ui/docker_vm_configuration_page_ui.py b/gns3/modules/docker/ui/docker_vm_configuration_page_ui.py index 772194205..55ab108b1 100644 --- a/gns3/modules/docker/ui/docker_vm_configuration_page_ui.py +++ b/gns3/modules/docker/ui/docker_vm_configuration_page_ui.py @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file '/home/grossmj/PycharmProjects/gns3-gui/gns3/modules/docker/ui/docker_vm_configuration_page.ui' # -# Created by: PyQt5 UI code generator 5.15.7 +# Created by: PyQt5 UI code generator 5.15.6 # # WARNING: Any manual changes made to this file will be lost when pyuic5 is # run again. Do not edit this file unless you know what you are doing. @@ -14,7 +14,7 @@ class Ui_dockerVMConfigPageWidget(object): def setupUi(self, dockerVMConfigPageWidget): dockerVMConfigPageWidget.setObjectName("dockerVMConfigPageWidget") - dockerVMConfigPageWidget.resize(938, 872) + dockerVMConfigPageWidget.resize(504, 560) self.verticalLayout = QtWidgets.QVBoxLayout(dockerVMConfigPageWidget) self.verticalLayout.setObjectName("verticalLayout") self.uiTabWidget = QtWidgets.QTabWidget(dockerVMConfigPageWidget) @@ -67,15 +67,21 @@ def setupUi(self, dockerVMConfigPageWidget): self.uiAdapterSpinBox.setMinimum(1) self.uiAdapterSpinBox.setObjectName("uiAdapterSpinBox") self.gridLayout.addWidget(self.uiAdapterSpinBox, 5, 1, 1, 1) + self.uiMacAddrLabel = QtWidgets.QLabel(self.tab) + self.uiMacAddrLabel.setObjectName("uiMacAddrLabel") + self.gridLayout.addWidget(self.uiMacAddrLabel, 6, 0, 1, 1) + self.uiMacAddrLineEdit = QtWidgets.QLineEdit(self.tab) + self.uiMacAddrLineEdit.setObjectName("uiMacAddrLineEdit") + self.gridLayout.addWidget(self.uiMacAddrLineEdit, 6, 1, 1, 1) self.uiCustomAdaptersLabel = QtWidgets.QLabel(self.tab) self.uiCustomAdaptersLabel.setObjectName("uiCustomAdaptersLabel") - self.gridLayout.addWidget(self.uiCustomAdaptersLabel, 6, 0, 1, 1) + self.gridLayout.addWidget(self.uiCustomAdaptersLabel, 7, 0, 1, 1) self.uiCustomAdaptersConfigurationPushButton = QtWidgets.QPushButton(self.tab) self.uiCustomAdaptersConfigurationPushButton.setObjectName("uiCustomAdaptersConfigurationPushButton") - self.gridLayout.addWidget(self.uiCustomAdaptersConfigurationPushButton, 6, 1, 1, 1) + self.gridLayout.addWidget(self.uiCustomAdaptersConfigurationPushButton, 7, 1, 1, 1) self.uiConsoleTypeLabel = QtWidgets.QLabel(self.tab) self.uiConsoleTypeLabel.setObjectName("uiConsoleTypeLabel") - self.gridLayout.addWidget(self.uiConsoleTypeLabel, 7, 0, 1, 1) + self.gridLayout.addWidget(self.uiConsoleTypeLabel, 8, 0, 1, 1) self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setSizeConstraint(QtWidgets.QLayout.SetNoConstraint) self.horizontalLayout.setObjectName("horizontalLayout") @@ -90,10 +96,10 @@ def setupUi(self, dockerVMConfigPageWidget): self.uiConsoleAutoStartCheckBox = QtWidgets.QCheckBox(self.tab) self.uiConsoleAutoStartCheckBox.setObjectName("uiConsoleAutoStartCheckBox") self.horizontalLayout.addWidget(self.uiConsoleAutoStartCheckBox) - self.gridLayout.addLayout(self.horizontalLayout, 7, 1, 1, 1) + self.gridLayout.addLayout(self.horizontalLayout, 8, 1, 1, 1) self.uiConsoleResolutionLabel = QtWidgets.QLabel(self.tab) self.uiConsoleResolutionLabel.setObjectName("uiConsoleResolutionLabel") - self.gridLayout.addWidget(self.uiConsoleResolutionLabel, 8, 0, 1, 1) + self.gridLayout.addWidget(self.uiConsoleResolutionLabel, 9, 0, 1, 1) self.uiConsoleResolutionComboBox = QtWidgets.QComboBox(self.tab) self.uiConsoleResolutionComboBox.setObjectName("uiConsoleResolutionComboBox") self.uiConsoleResolutionComboBox.addItem("") @@ -106,35 +112,35 @@ def setupUi(self, dockerVMConfigPageWidget): self.uiConsoleResolutionComboBox.addItem("") self.uiConsoleResolutionComboBox.addItem("") self.uiConsoleResolutionComboBox.addItem("") - self.gridLayout.addWidget(self.uiConsoleResolutionComboBox, 8, 1, 1, 1) + self.gridLayout.addWidget(self.uiConsoleResolutionComboBox, 9, 1, 1, 1) self.label = QtWidgets.QLabel(self.tab) self.label.setObjectName("label") - self.gridLayout.addWidget(self.label, 9, 0, 1, 1) + self.gridLayout.addWidget(self.label, 10, 0, 1, 1) self.uiConsoleHttpPortSpinBox = QtWidgets.QSpinBox(self.tab) self.uiConsoleHttpPortSpinBox.setMinimum(1) self.uiConsoleHttpPortSpinBox.setMaximum(65535) self.uiConsoleHttpPortSpinBox.setObjectName("uiConsoleHttpPortSpinBox") - self.gridLayout.addWidget(self.uiConsoleHttpPortSpinBox, 9, 1, 1, 1) + self.gridLayout.addWidget(self.uiConsoleHttpPortSpinBox, 10, 1, 1, 1) self.label_2 = QtWidgets.QLabel(self.tab) self.label_2.setObjectName("label_2") - self.gridLayout.addWidget(self.label_2, 10, 0, 1, 1) + self.gridLayout.addWidget(self.label_2, 11, 0, 1, 1) self.uiHttpConsolePathLineEdit = QtWidgets.QLineEdit(self.tab) self.uiHttpConsolePathLineEdit.setObjectName("uiHttpConsolePathLineEdit") - self.gridLayout.addWidget(self.uiHttpConsolePathLineEdit, 10, 1, 1, 1) + self.gridLayout.addWidget(self.uiHttpConsolePathLineEdit, 11, 1, 1, 1) self.uiEnvironmentLabel = QtWidgets.QLabel(self.tab) self.uiEnvironmentLabel.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter) self.uiEnvironmentLabel.setWordWrap(False) self.uiEnvironmentLabel.setObjectName("uiEnvironmentLabel") - self.gridLayout.addWidget(self.uiEnvironmentLabel, 11, 0, 1, 1) + self.gridLayout.addWidget(self.uiEnvironmentLabel, 12, 0, 1, 1) self.uiEnvironmentTextEdit = QtWidgets.QTextEdit(self.tab) self.uiEnvironmentTextEdit.setObjectName("uiEnvironmentTextEdit") - self.gridLayout.addWidget(self.uiEnvironmentTextEdit, 11, 1, 1, 1) + self.gridLayout.addWidget(self.uiEnvironmentTextEdit, 12, 1, 1, 1) self.uiNetworkConfigLabel = QtWidgets.QLabel(self.tab) self.uiNetworkConfigLabel.setObjectName("uiNetworkConfigLabel") - self.gridLayout.addWidget(self.uiNetworkConfigLabel, 12, 0, 1, 1) + self.gridLayout.addWidget(self.uiNetworkConfigLabel, 13, 0, 1, 1) self.uiNetworkConfigEditButton = QtWidgets.QPushButton(self.tab) self.uiNetworkConfigEditButton.setObjectName("uiNetworkConfigEditButton") - self.gridLayout.addWidget(self.uiNetworkConfigEditButton, 12, 1, 1, 1) + self.gridLayout.addWidget(self.uiNetworkConfigEditButton, 13, 1, 1, 1) self.uiTabWidget.addTab(self.tab, "") self.tab_2 = QtWidgets.QWidget() self.tab_2.setObjectName("tab_2") @@ -186,6 +192,7 @@ def retranslateUi(self, dockerVMConfigPageWidget): self.uiSymbolToolButton.setText(_translate("dockerVMConfigPageWidget", "&Browse...")) self.uiCMDLabel.setText(_translate("dockerVMConfigPageWidget", "Start command:")) self.uiAdapterLabel.setText(_translate("dockerVMConfigPageWidget", "Adapters:")) + self.uiMacAddrLabel.setText(_translate("dockerVMConfigPageWidget", "Base MAC:")) self.uiCustomAdaptersLabel.setText(_translate("dockerVMConfigPageWidget", "Custom adapters:")) self.uiCustomAdaptersConfigurationPushButton.setText(_translate("dockerVMConfigPageWidget", "&Configure custom adapters")) self.uiConsoleTypeLabel.setText(_translate("dockerVMConfigPageWidget", "Console type:")) From 6edb9c9303ef5f5820d8351ea0378cc08b85fbf0 Mon Sep 17 00:00:00 2001 From: grossmj Date: Sat, 21 Sep 2024 16:40:22 +0700 Subject: [PATCH 03/12] Fix to allow packet capture on more than 6 links. Fixes #3594 --- gns3/link.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gns3/link.py b/gns3/link.py index 4a9354ef0..6c761306c 100644 --- a/gns3/link.py +++ b/gns3/link.py @@ -23,7 +23,7 @@ from .qt import sip import uuid -from .qt import QtCore +from .qt import QtCore, QtNetwork from .controller import Controller @@ -78,6 +78,7 @@ def __init__(self, source_node, source_port, destination_node, destination_port, self._deleting = False self._capture_file_path = None self._capture_file = None + self._network_manager = None self._response_stream = None self._capture_compute_id = None self._initialized = False @@ -117,12 +118,15 @@ def _parseResponse(self, result): else: self._capture_file = QtCore.QFile(self._capture_file_path) self._capture_file.open(QtCore.QFile.WriteOnly) + if self._network_manager is None: + self._network_manager = QtNetwork.QNetworkAccessManager(self) self._response_stream = Controller.instance().get("/projects/{project_id}/links/{link_id}/pcap".format(project_id=self.project().id(), link_id=self._link_id), None, showProgress=False, downloadProgressCallback=self._downloadPcapProgress, ignoreErrors=True, # If something is wrong avoid disconnect us from server - timeout=None) + timeout=None, + networkManager=self._network_manager) log.debug("Has successfully started capturing packets on link {} to '{}'".format(self._link_id, self._capture_file_path)) else: self._response_stream = None From 74c55241cfd5c61a09491c6830a134c049156076 Mon Sep 17 00:00:00 2001 From: grossmj Date: Sun, 22 Sep 2024 18:29:05 +0700 Subject: [PATCH 04/12] Backport auxiliary console support for Qemu, Docker and Dynamips nodes --- gns3/modules/docker/docker_vm.py | 5 +- .../pages/docker_vm_configuration_page.py | 2 + .../pages/docker_vm_preferences_page.py | 1 + gns3/modules/docker/settings.py | 1 + .../docker/ui/docker_vm_configuration_page.ui | 307 ++++++++++-------- .../ui/docker_vm_configuration_page_ui.py | 209 ++++++------ gns3/modules/dynamips/nodes/router.py | 5 +- .../pages/ios_router_configuration_page.py | 8 + .../pages/ios_router_preferences_page.py | 1 + gns3/modules/dynamips/settings.py | 1 + .../ui/ios_router_configuration_page.ui | 283 +++++++++------- .../ui/ios_router_configuration_page_ui.py | 187 ++++++----- .../qemu/pages/qemu_vm_configuration_page.py | 5 + .../qemu/pages/qemu_vm_preferences_page.py | 1 + gns3/modules/qemu/qemu_vm.py | 14 +- gns3/modules/qemu/settings.py | 1 + .../qemu/ui/qemu_vm_configuration_page.ui | 250 ++++++++------ .../qemu/ui/qemu_vm_configuration_page_ui.py | 145 +++++---- gns3/node.py | 20 +- 19 files changed, 826 insertions(+), 620 deletions(-) diff --git a/gns3/modules/docker/docker_vm.py b/gns3/modules/docker/docker_vm.py index 8b31b9e55..0eaeeeec7 100644 --- a/gns3/modules/docker/docker_vm.py +++ b/gns3/modules/docker/docker_vm.py @@ -46,7 +46,7 @@ def __init__(self, module, server, project): "custom_adapters": DOCKER_CONTAINER_SETTINGS["custom_adapters"], "start_command": DOCKER_CONTAINER_SETTINGS["start_command"], "environment": DOCKER_CONTAINER_SETTINGS["environment"], - "aux": None, + "aux_type": DOCKER_CONTAINER_SETTINGS["aux_type"], "console_type": DOCKER_CONTAINER_SETTINGS["console_type"], "console_auto_start": DOCKER_CONTAINER_SETTINGS["console_auto_start"], "console_resolution": DOCKER_CONTAINER_SETTINGS["console_resolution"], @@ -69,6 +69,7 @@ def info(self): Local ID is {id} and server ID is {node_id} Docker image is "{image}" Console is on port {console} and type is {console_type} + Aux console is on port {aux} and type is {aux_type} """.format(name=self.name(), id=self.id(), node_id=self._node_id, @@ -77,6 +78,8 @@ def info(self): port=self.compute().port(), console=self._settings["console"], console_type=self._settings["console_type"], + aux=self._settings["aux"], + aux_type=self._settings["aux_type"], image=self._settings["image"]) port_info = "" diff --git a/gns3/modules/docker/pages/docker_vm_configuration_page.py b/gns3/modules/docker/pages/docker_vm_configuration_page.py index 9de063d3c..13913572d 100644 --- a/gns3/modules/docker/pages/docker_vm_configuration_page.py +++ b/gns3/modules/docker/pages/docker_vm_configuration_page.py @@ -112,6 +112,7 @@ def loadSettings(self, settings, node=None, group=False): self.uiEnvironmentTextEdit.setText(settings["environment"]) self.uiConsoleTypeComboBox.setCurrentIndex(self.uiConsoleTypeComboBox.findText(settings["console_type"])) self.uiConsoleAutoStartCheckBox.setChecked(settings["console_auto_start"]) + self.uiAuxTypeComboBox.setCurrentIndex(self.uiAuxTypeComboBox.findText(settings["aux_type"])) self.uiConsoleResolutionComboBox.setCurrentIndex(self.uiConsoleResolutionComboBox.findText(settings["console_resolution"])) self.uiConsoleHttpPortSpinBox.setValue(settings["console_http_port"]) self.uiHttpConsolePathLineEdit.setText(settings["console_http_path"]) @@ -191,6 +192,7 @@ def saveSettings(self, settings, node=None, group=False): settings["environment"] = self.uiEnvironmentTextEdit.toPlainText() settings["console_type"] = self.uiConsoleTypeComboBox.currentText() settings["console_auto_start"] = self.uiConsoleAutoStartCheckBox.isChecked() + settings["aux_type"] = self.uiAuxTypeComboBox.currentText() settings["console_resolution"] = self.uiConsoleResolutionComboBox.currentText() settings["console_http_port"] = self.uiConsoleHttpPortSpinBox.value() settings["console_http_path"] = self.uiHttpConsolePathLineEdit.text() diff --git a/gns3/modules/docker/pages/docker_vm_preferences_page.py b/gns3/modules/docker/pages/docker_vm_preferences_page.py index 4b69b033b..b088ef5bf 100644 --- a/gns3/modules/docker/pages/docker_vm_preferences_page.py +++ b/gns3/modules/docker/pages/docker_vm_preferences_page.py @@ -86,6 +86,7 @@ def _refreshInfo(self, docker_container): pass QtWidgets.QTreeWidgetItem(section_item, ["Console type:", str(docker_container["console_type"])]) QtWidgets.QTreeWidgetItem(section_item, ["Auto start console:", "{}".format(docker_container["console_auto_start"])]) + QtWidgets.QTreeWidgetItem(section_item, ["Auxiliary console type:", str(docker_container["aux_type"])]) QtWidgets.QTreeWidgetItem(section_item, ["Default name format:", docker_container["default_name_format"]]) QtWidgets.QTreeWidgetItem(section_item, ["Adapters:", str(docker_container["adapters"])]) if docker_container["start_command"]: diff --git a/gns3/modules/docker/settings.py b/gns3/modules/docker/settings.py index 255b5031f..88d22682c 100644 --- a/gns3/modules/docker/settings.py +++ b/gns3/modules/docker/settings.py @@ -40,6 +40,7 @@ "environment": "", "console_type": "telnet", "console_auto_start": False, + "aux_type": "none", "console_resolution": "1024x768", "console_http_port": 80, "console_http_path": "/", diff --git a/gns3/modules/docker/ui/docker_vm_configuration_page.ui b/gns3/modules/docker/ui/docker_vm_configuration_page.ui index 251c4e530..6a6764932 100644 --- a/gns3/modules/docker/ui/docker_vm_configuration_page.ui +++ b/gns3/modules/docker/ui/docker_vm_configuration_page.ui @@ -24,35 +24,121 @@ General settings - - + + - Name: + Custom adapters: - - + + + + 1 + + - - + + - Default name format + HTTP port in the container: - - + + + + &Configure custom adapters + + - - + + - Category + Network configuration - - + + + + + 2560x1440 + + + + + 1920x1080 + + + + + 1680x1050 + + + + + 1440x900 + + + + + 1366x768 + + + + + 1280x1024 + + + + + 1280x800 + + + + + 1024x768 + + + + + 800x600 + + + + + 640x480 + + + + + + + + 1 + + + 65535 + + + + + + + Start command: + + + + + + + Console type: + + + + + @@ -78,27 +164,27 @@ - - + + - Start command: + Environment variables: +(KEY=VALUE, one per line) + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + false - - + + - - + + - Adapters: - - - - - - - 1 + Default name format @@ -109,30 +195,6 @@ - - - - - - - Custom adapters: - - - - - - - &Configure custom adapters - - - - - - - Console type: - - - @@ -176,122 +238,81 @@ - - + + + + + - VNC console resolution: + HTTP path: - - - - - 2560x1440 - - - - - 1920x1080 - - - - - 1680x1050 - - - - - 1440x900 - - - - - 1366x768 - - - - - 1280x1024 - - - - - 1280x800 - - - - - 1024x768 - - - - - 800x600 - - - - - 640x480 - - - + + - - + + - HTTP port in the container: + Adapters: - - - - 1 - - - 65535 + + + + Edit - - + + - HTTP path: + VNC console resolution: - - + + - - + + + + + - Environment variables: -(KEY=VALUE, one per line) - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + Name: - - false + + + + + + Category - + - - - - Network configuration - + + + + + telnet + + + + + none + + - - + + - Edit + Auxiliary console type: diff --git a/gns3/modules/docker/ui/docker_vm_configuration_page_ui.py b/gns3/modules/docker/ui/docker_vm_configuration_page_ui.py index 55ab108b1..07c44f8e0 100644 --- a/gns3/modules/docker/ui/docker_vm_configuration_page_ui.py +++ b/gns3/modules/docker/ui/docker_vm_configuration_page_ui.py @@ -23,24 +23,49 @@ def setupUi(self, dockerVMConfigPageWidget): self.tab.setObjectName("tab") self.gridLayout = QtWidgets.QGridLayout(self.tab) self.gridLayout.setObjectName("gridLayout") - self.uiNameLabel = QtWidgets.QLabel(self.tab) - self.uiNameLabel.setObjectName("uiNameLabel") - self.gridLayout.addWidget(self.uiNameLabel, 0, 0, 1, 1) - self.uiNameLineEdit = QtWidgets.QLineEdit(self.tab) - self.uiNameLineEdit.setObjectName("uiNameLineEdit") - self.gridLayout.addWidget(self.uiNameLineEdit, 0, 1, 1, 1) - self.uiDefaultNameFormatLabel = QtWidgets.QLabel(self.tab) - self.uiDefaultNameFormatLabel.setObjectName("uiDefaultNameFormatLabel") - self.gridLayout.addWidget(self.uiDefaultNameFormatLabel, 1, 0, 1, 1) + self.uiCustomAdaptersLabel = QtWidgets.QLabel(self.tab) + self.uiCustomAdaptersLabel.setObjectName("uiCustomAdaptersLabel") + self.gridLayout.addWidget(self.uiCustomAdaptersLabel, 7, 0, 1, 1) + self.uiAdapterSpinBox = QtWidgets.QSpinBox(self.tab) + self.uiAdapterSpinBox.setMinimum(1) + self.uiAdapterSpinBox.setObjectName("uiAdapterSpinBox") + self.gridLayout.addWidget(self.uiAdapterSpinBox, 5, 1, 1, 1) + self.label = QtWidgets.QLabel(self.tab) + self.label.setObjectName("label") + self.gridLayout.addWidget(self.label, 11, 0, 1, 1) + self.uiCustomAdaptersConfigurationPushButton = QtWidgets.QPushButton(self.tab) + self.uiCustomAdaptersConfigurationPushButton.setObjectName("uiCustomAdaptersConfigurationPushButton") + self.gridLayout.addWidget(self.uiCustomAdaptersConfigurationPushButton, 7, 1, 1, 1) + self.uiNetworkConfigLabel = QtWidgets.QLabel(self.tab) + self.uiNetworkConfigLabel.setObjectName("uiNetworkConfigLabel") + self.gridLayout.addWidget(self.uiNetworkConfigLabel, 14, 0, 1, 1) + self.uiConsoleResolutionComboBox = QtWidgets.QComboBox(self.tab) + self.uiConsoleResolutionComboBox.setObjectName("uiConsoleResolutionComboBox") + self.uiConsoleResolutionComboBox.addItem("") + self.uiConsoleResolutionComboBox.addItem("") + self.uiConsoleResolutionComboBox.addItem("") + self.uiConsoleResolutionComboBox.addItem("") + self.uiConsoleResolutionComboBox.addItem("") + self.uiConsoleResolutionComboBox.addItem("") + self.uiConsoleResolutionComboBox.addItem("") + self.uiConsoleResolutionComboBox.addItem("") + self.uiConsoleResolutionComboBox.addItem("") + self.uiConsoleResolutionComboBox.addItem("") + self.gridLayout.addWidget(self.uiConsoleResolutionComboBox, 10, 1, 1, 1) + self.uiConsoleHttpPortSpinBox = QtWidgets.QSpinBox(self.tab) + self.uiConsoleHttpPortSpinBox.setMinimum(1) + self.uiConsoleHttpPortSpinBox.setMaximum(65535) + self.uiConsoleHttpPortSpinBox.setObjectName("uiConsoleHttpPortSpinBox") + self.gridLayout.addWidget(self.uiConsoleHttpPortSpinBox, 11, 1, 1, 1) + self.uiCMDLabel = QtWidgets.QLabel(self.tab) + self.uiCMDLabel.setObjectName("uiCMDLabel") + self.gridLayout.addWidget(self.uiCMDLabel, 4, 0, 1, 1) + self.uiConsoleTypeLabel = QtWidgets.QLabel(self.tab) + self.uiConsoleTypeLabel.setObjectName("uiConsoleTypeLabel") + self.gridLayout.addWidget(self.uiConsoleTypeLabel, 8, 0, 1, 1) self.uiDefaultNameFormatLineEdit = QtWidgets.QLineEdit(self.tab) self.uiDefaultNameFormatLineEdit.setObjectName("uiDefaultNameFormatLineEdit") self.gridLayout.addWidget(self.uiDefaultNameFormatLineEdit, 1, 1, 1, 1) - self.uiCategoryLabel = QtWidgets.QLabel(self.tab) - self.uiCategoryLabel.setObjectName("uiCategoryLabel") - self.gridLayout.addWidget(self.uiCategoryLabel, 2, 0, 1, 1) - self.uiCategoryComboBox = QtWidgets.QComboBox(self.tab) - self.uiCategoryComboBox.setObjectName("uiCategoryComboBox") - self.gridLayout.addWidget(self.uiCategoryComboBox, 2, 1, 1, 1) self.uiSymbolLabel = QtWidgets.QLabel(self.tab) self.uiSymbolLabel.setObjectName("uiSymbolLabel") self.gridLayout.addWidget(self.uiSymbolLabel, 3, 0, 1, 1) @@ -54,34 +79,20 @@ def setupUi(self, dockerVMConfigPageWidget): self.uiSymbolToolButton.setObjectName("uiSymbolToolButton") self.horizontalLayout_7.addWidget(self.uiSymbolToolButton) self.gridLayout.addLayout(self.horizontalLayout_7, 3, 1, 1, 1) - self.uiCMDLabel = QtWidgets.QLabel(self.tab) - self.uiCMDLabel.setObjectName("uiCMDLabel") - self.gridLayout.addWidget(self.uiCMDLabel, 4, 0, 1, 1) - self.uiCMDLineEdit = QtWidgets.QLineEdit(self.tab) - self.uiCMDLineEdit.setObjectName("uiCMDLineEdit") - self.gridLayout.addWidget(self.uiCMDLineEdit, 4, 1, 1, 1) - self.uiAdapterLabel = QtWidgets.QLabel(self.tab) - self.uiAdapterLabel.setObjectName("uiAdapterLabel") - self.gridLayout.addWidget(self.uiAdapterLabel, 5, 0, 1, 1) - self.uiAdapterSpinBox = QtWidgets.QSpinBox(self.tab) - self.uiAdapterSpinBox.setMinimum(1) - self.uiAdapterSpinBox.setObjectName("uiAdapterSpinBox") - self.gridLayout.addWidget(self.uiAdapterSpinBox, 5, 1, 1, 1) + self.uiEnvironmentLabel = QtWidgets.QLabel(self.tab) + self.uiEnvironmentLabel.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter) + self.uiEnvironmentLabel.setWordWrap(False) + self.uiEnvironmentLabel.setObjectName("uiEnvironmentLabel") + self.gridLayout.addWidget(self.uiEnvironmentLabel, 13, 0, 1, 1) + self.uiEnvironmentTextEdit = QtWidgets.QTextEdit(self.tab) + self.uiEnvironmentTextEdit.setObjectName("uiEnvironmentTextEdit") + self.gridLayout.addWidget(self.uiEnvironmentTextEdit, 13, 1, 1, 1) + self.uiDefaultNameFormatLabel = QtWidgets.QLabel(self.tab) + self.uiDefaultNameFormatLabel.setObjectName("uiDefaultNameFormatLabel") + self.gridLayout.addWidget(self.uiDefaultNameFormatLabel, 1, 0, 1, 1) self.uiMacAddrLabel = QtWidgets.QLabel(self.tab) self.uiMacAddrLabel.setObjectName("uiMacAddrLabel") self.gridLayout.addWidget(self.uiMacAddrLabel, 6, 0, 1, 1) - self.uiMacAddrLineEdit = QtWidgets.QLineEdit(self.tab) - self.uiMacAddrLineEdit.setObjectName("uiMacAddrLineEdit") - self.gridLayout.addWidget(self.uiMacAddrLineEdit, 6, 1, 1, 1) - self.uiCustomAdaptersLabel = QtWidgets.QLabel(self.tab) - self.uiCustomAdaptersLabel.setObjectName("uiCustomAdaptersLabel") - self.gridLayout.addWidget(self.uiCustomAdaptersLabel, 7, 0, 1, 1) - self.uiCustomAdaptersConfigurationPushButton = QtWidgets.QPushButton(self.tab) - self.uiCustomAdaptersConfigurationPushButton.setObjectName("uiCustomAdaptersConfigurationPushButton") - self.gridLayout.addWidget(self.uiCustomAdaptersConfigurationPushButton, 7, 1, 1, 1) - self.uiConsoleTypeLabel = QtWidgets.QLabel(self.tab) - self.uiConsoleTypeLabel.setObjectName("uiConsoleTypeLabel") - self.gridLayout.addWidget(self.uiConsoleTypeLabel, 8, 0, 1, 1) self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setSizeConstraint(QtWidgets.QLayout.SetNoConstraint) self.horizontalLayout.setObjectName("horizontalLayout") @@ -97,50 +108,47 @@ def setupUi(self, dockerVMConfigPageWidget): self.uiConsoleAutoStartCheckBox.setObjectName("uiConsoleAutoStartCheckBox") self.horizontalLayout.addWidget(self.uiConsoleAutoStartCheckBox) self.gridLayout.addLayout(self.horizontalLayout, 8, 1, 1, 1) - self.uiConsoleResolutionLabel = QtWidgets.QLabel(self.tab) - self.uiConsoleResolutionLabel.setObjectName("uiConsoleResolutionLabel") - self.gridLayout.addWidget(self.uiConsoleResolutionLabel, 9, 0, 1, 1) - self.uiConsoleResolutionComboBox = QtWidgets.QComboBox(self.tab) - self.uiConsoleResolutionComboBox.setObjectName("uiConsoleResolutionComboBox") - self.uiConsoleResolutionComboBox.addItem("") - self.uiConsoleResolutionComboBox.addItem("") - self.uiConsoleResolutionComboBox.addItem("") - self.uiConsoleResolutionComboBox.addItem("") - self.uiConsoleResolutionComboBox.addItem("") - self.uiConsoleResolutionComboBox.addItem("") - self.uiConsoleResolutionComboBox.addItem("") - self.uiConsoleResolutionComboBox.addItem("") - self.uiConsoleResolutionComboBox.addItem("") - self.uiConsoleResolutionComboBox.addItem("") - self.gridLayout.addWidget(self.uiConsoleResolutionComboBox, 9, 1, 1, 1) - self.label = QtWidgets.QLabel(self.tab) - self.label.setObjectName("label") - self.gridLayout.addWidget(self.label, 10, 0, 1, 1) - self.uiConsoleHttpPortSpinBox = QtWidgets.QSpinBox(self.tab) - self.uiConsoleHttpPortSpinBox.setMinimum(1) - self.uiConsoleHttpPortSpinBox.setMaximum(65535) - self.uiConsoleHttpPortSpinBox.setObjectName("uiConsoleHttpPortSpinBox") - self.gridLayout.addWidget(self.uiConsoleHttpPortSpinBox, 10, 1, 1, 1) + self.uiNameLineEdit = QtWidgets.QLineEdit(self.tab) + self.uiNameLineEdit.setObjectName("uiNameLineEdit") + self.gridLayout.addWidget(self.uiNameLineEdit, 0, 1, 1, 1) self.label_2 = QtWidgets.QLabel(self.tab) self.label_2.setObjectName("label_2") - self.gridLayout.addWidget(self.label_2, 11, 0, 1, 1) - self.uiHttpConsolePathLineEdit = QtWidgets.QLineEdit(self.tab) - self.uiHttpConsolePathLineEdit.setObjectName("uiHttpConsolePathLineEdit") - self.gridLayout.addWidget(self.uiHttpConsolePathLineEdit, 11, 1, 1, 1) - self.uiEnvironmentLabel = QtWidgets.QLabel(self.tab) - self.uiEnvironmentLabel.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter) - self.uiEnvironmentLabel.setWordWrap(False) - self.uiEnvironmentLabel.setObjectName("uiEnvironmentLabel") - self.gridLayout.addWidget(self.uiEnvironmentLabel, 12, 0, 1, 1) - self.uiEnvironmentTextEdit = QtWidgets.QTextEdit(self.tab) - self.uiEnvironmentTextEdit.setObjectName("uiEnvironmentTextEdit") - self.gridLayout.addWidget(self.uiEnvironmentTextEdit, 12, 1, 1, 1) - self.uiNetworkConfigLabel = QtWidgets.QLabel(self.tab) - self.uiNetworkConfigLabel.setObjectName("uiNetworkConfigLabel") - self.gridLayout.addWidget(self.uiNetworkConfigLabel, 13, 0, 1, 1) + self.gridLayout.addWidget(self.label_2, 12, 0, 1, 1) + self.uiCMDLineEdit = QtWidgets.QLineEdit(self.tab) + self.uiCMDLineEdit.setObjectName("uiCMDLineEdit") + self.gridLayout.addWidget(self.uiCMDLineEdit, 4, 1, 1, 1) + self.uiAdapterLabel = QtWidgets.QLabel(self.tab) + self.uiAdapterLabel.setObjectName("uiAdapterLabel") + self.gridLayout.addWidget(self.uiAdapterLabel, 5, 0, 1, 1) self.uiNetworkConfigEditButton = QtWidgets.QPushButton(self.tab) self.uiNetworkConfigEditButton.setObjectName("uiNetworkConfigEditButton") - self.gridLayout.addWidget(self.uiNetworkConfigEditButton, 13, 1, 1, 1) + self.gridLayout.addWidget(self.uiNetworkConfigEditButton, 14, 1, 1, 1) + self.uiConsoleResolutionLabel = QtWidgets.QLabel(self.tab) + self.uiConsoleResolutionLabel.setObjectName("uiConsoleResolutionLabel") + self.gridLayout.addWidget(self.uiConsoleResolutionLabel, 10, 0, 1, 1) + self.uiCategoryComboBox = QtWidgets.QComboBox(self.tab) + self.uiCategoryComboBox.setObjectName("uiCategoryComboBox") + self.gridLayout.addWidget(self.uiCategoryComboBox, 2, 1, 1, 1) + self.uiMacAddrLineEdit = QtWidgets.QLineEdit(self.tab) + self.uiMacAddrLineEdit.setObjectName("uiMacAddrLineEdit") + self.gridLayout.addWidget(self.uiMacAddrLineEdit, 6, 1, 1, 1) + self.uiNameLabel = QtWidgets.QLabel(self.tab) + self.uiNameLabel.setObjectName("uiNameLabel") + self.gridLayout.addWidget(self.uiNameLabel, 0, 0, 1, 1) + self.uiCategoryLabel = QtWidgets.QLabel(self.tab) + self.uiCategoryLabel.setObjectName("uiCategoryLabel") + self.gridLayout.addWidget(self.uiCategoryLabel, 2, 0, 1, 1) + self.uiHttpConsolePathLineEdit = QtWidgets.QLineEdit(self.tab) + self.uiHttpConsolePathLineEdit.setObjectName("uiHttpConsolePathLineEdit") + self.gridLayout.addWidget(self.uiHttpConsolePathLineEdit, 12, 1, 1, 1) + self.uiAuxTypeComboBox = QtWidgets.QComboBox(self.tab) + self.uiAuxTypeComboBox.setObjectName("uiAuxTypeComboBox") + self.uiAuxTypeComboBox.addItem("") + self.uiAuxTypeComboBox.addItem("") + self.gridLayout.addWidget(self.uiAuxTypeComboBox, 9, 1, 1, 1) + self.uiAuxTypeLabel = QtWidgets.QLabel(self.tab) + self.uiAuxTypeLabel.setObjectName("uiAuxTypeLabel") + self.gridLayout.addWidget(self.uiAuxTypeLabel, 9, 0, 1, 1) self.uiTabWidget.addTab(self.tab, "") self.tab_2 = QtWidgets.QWidget() self.tab_2.setObjectName("tab_2") @@ -185,24 +193,10 @@ def setupUi(self, dockerVMConfigPageWidget): def retranslateUi(self, dockerVMConfigPageWidget): _translate = QtCore.QCoreApplication.translate dockerVMConfigPageWidget.setWindowTitle(_translate("dockerVMConfigPageWidget", "Docker container template configuration")) - self.uiNameLabel.setText(_translate("dockerVMConfigPageWidget", "Name:")) - self.uiDefaultNameFormatLabel.setText(_translate("dockerVMConfigPageWidget", "Default name format")) - self.uiCategoryLabel.setText(_translate("dockerVMConfigPageWidget", "Category")) - self.uiSymbolLabel.setText(_translate("dockerVMConfigPageWidget", "Symbol:")) - self.uiSymbolToolButton.setText(_translate("dockerVMConfigPageWidget", "&Browse...")) - self.uiCMDLabel.setText(_translate("dockerVMConfigPageWidget", "Start command:")) - self.uiAdapterLabel.setText(_translate("dockerVMConfigPageWidget", "Adapters:")) - self.uiMacAddrLabel.setText(_translate("dockerVMConfigPageWidget", "Base MAC:")) self.uiCustomAdaptersLabel.setText(_translate("dockerVMConfigPageWidget", "Custom adapters:")) + self.label.setText(_translate("dockerVMConfigPageWidget", "HTTP port in the container:")) self.uiCustomAdaptersConfigurationPushButton.setText(_translate("dockerVMConfigPageWidget", "&Configure custom adapters")) - self.uiConsoleTypeLabel.setText(_translate("dockerVMConfigPageWidget", "Console type:")) - self.uiConsoleTypeComboBox.setItemText(0, _translate("dockerVMConfigPageWidget", "telnet")) - self.uiConsoleTypeComboBox.setItemText(1, _translate("dockerVMConfigPageWidget", "vnc")) - self.uiConsoleTypeComboBox.setItemText(2, _translate("dockerVMConfigPageWidget", "http")) - self.uiConsoleTypeComboBox.setItemText(3, _translate("dockerVMConfigPageWidget", "https")) - self.uiConsoleTypeComboBox.setItemText(4, _translate("dockerVMConfigPageWidget", "none")) - self.uiConsoleAutoStartCheckBox.setText(_translate("dockerVMConfigPageWidget", "Auto start console")) - self.uiConsoleResolutionLabel.setText(_translate("dockerVMConfigPageWidget", "VNC console resolution:")) + self.uiNetworkConfigLabel.setText(_translate("dockerVMConfigPageWidget", "Network configuration")) self.uiConsoleResolutionComboBox.setItemText(0, _translate("dockerVMConfigPageWidget", "2560x1440")) self.uiConsoleResolutionComboBox.setItemText(1, _translate("dockerVMConfigPageWidget", "1920x1080")) self.uiConsoleResolutionComboBox.setItemText(2, _translate("dockerVMConfigPageWidget", "1680x1050")) @@ -213,12 +207,29 @@ def retranslateUi(self, dockerVMConfigPageWidget): self.uiConsoleResolutionComboBox.setItemText(7, _translate("dockerVMConfigPageWidget", "1024x768")) self.uiConsoleResolutionComboBox.setItemText(8, _translate("dockerVMConfigPageWidget", "800x600")) self.uiConsoleResolutionComboBox.setItemText(9, _translate("dockerVMConfigPageWidget", "640x480")) - self.label.setText(_translate("dockerVMConfigPageWidget", "HTTP port in the container:")) - self.label_2.setText(_translate("dockerVMConfigPageWidget", "HTTP path:")) + self.uiCMDLabel.setText(_translate("dockerVMConfigPageWidget", "Start command:")) + self.uiConsoleTypeLabel.setText(_translate("dockerVMConfigPageWidget", "Console type:")) + self.uiSymbolLabel.setText(_translate("dockerVMConfigPageWidget", "Symbol:")) + self.uiSymbolToolButton.setText(_translate("dockerVMConfigPageWidget", "&Browse...")) self.uiEnvironmentLabel.setText(_translate("dockerVMConfigPageWidget", "Environment variables:\n" "(KEY=VALUE, one per line)")) - self.uiNetworkConfigLabel.setText(_translate("dockerVMConfigPageWidget", "Network configuration")) + self.uiDefaultNameFormatLabel.setText(_translate("dockerVMConfigPageWidget", "Default name format")) + self.uiMacAddrLabel.setText(_translate("dockerVMConfigPageWidget", "Base MAC:")) + self.uiConsoleTypeComboBox.setItemText(0, _translate("dockerVMConfigPageWidget", "telnet")) + self.uiConsoleTypeComboBox.setItemText(1, _translate("dockerVMConfigPageWidget", "vnc")) + self.uiConsoleTypeComboBox.setItemText(2, _translate("dockerVMConfigPageWidget", "http")) + self.uiConsoleTypeComboBox.setItemText(3, _translate("dockerVMConfigPageWidget", "https")) + self.uiConsoleTypeComboBox.setItemText(4, _translate("dockerVMConfigPageWidget", "none")) + self.uiConsoleAutoStartCheckBox.setText(_translate("dockerVMConfigPageWidget", "Auto start console")) + self.label_2.setText(_translate("dockerVMConfigPageWidget", "HTTP path:")) + self.uiAdapterLabel.setText(_translate("dockerVMConfigPageWidget", "Adapters:")) self.uiNetworkConfigEditButton.setText(_translate("dockerVMConfigPageWidget", "Edit")) + self.uiConsoleResolutionLabel.setText(_translate("dockerVMConfigPageWidget", "VNC console resolution:")) + self.uiNameLabel.setText(_translate("dockerVMConfigPageWidget", "Name:")) + self.uiCategoryLabel.setText(_translate("dockerVMConfigPageWidget", "Category")) + self.uiAuxTypeComboBox.setItemText(0, _translate("dockerVMConfigPageWidget", "telnet")) + self.uiAuxTypeComboBox.setItemText(1, _translate("dockerVMConfigPageWidget", "none")) + self.uiAuxTypeLabel.setText(_translate("dockerVMConfigPageWidget", "Auxiliary console type:")) self.uiTabWidget.setTabText(self.uiTabWidget.indexOf(self.tab), _translate("dockerVMConfigPageWidget", "General settings")) self.uiExtraHostsLabel.setText(_translate("dockerVMConfigPageWidget", "Extra hosts added\n" "to the /etc/hosts file.\n" diff --git a/gns3/modules/dynamips/nodes/router.py b/gns3/modules/dynamips/nodes/router.py index 21741792c..35c1b71b9 100644 --- a/gns3/modules/dynamips/nodes/router.py +++ b/gns3/modules/dynamips/nodes/router.py @@ -71,6 +71,7 @@ def __init__(self, module, server, project, platform="c7200"): "console_type": "telnet", "console_auto_start": False, "aux": None, + "aux_type": "none", "mac_addr": None, "system_id": "FTX0945W0MY", "slot0": None, @@ -242,7 +243,8 @@ def info(self): Local ID is {id} and server ID is {node_id} Dynamips ID is {dynamips_id} Hardware is Dynamips emulated Cisco {platform} {specific_info} with {ram}MB RAM and {nvram}KB NVRAM - Console is on port {console} and type is {console_type}, AUX console is on port {aux} + Console is on port {console} and type is {console_type} + Auxiliary console is on port {aux} and type is {aux_type} IOS image is "{image_name}" {idlepc_info} PCMCIA disks: disk0 is {disk0}MB and disk1 is {disk1}MB @@ -260,6 +262,7 @@ def info(self): console=self._settings["console"], console_type=self._settings["console_type"], aux=self._settings["aux"], + aux_type=self._settings["aux_type"], image_name=os.path.basename(self._settings["image"]), idlepc_info=idlepc_info, disk0=self._settings["disk0"], diff --git a/gns3/modules/dynamips/pages/ios_router_configuration_page.py b/gns3/modules/dynamips/pages/ios_router_configuration_page.py index 12fccab6f..b2afdfdfe 100644 --- a/gns3/modules/dynamips/pages/ios_router_configuration_page.py +++ b/gns3/modules/dynamips/pages/ios_router_configuration_page.py @@ -375,6 +375,11 @@ def loadSettings(self, settings, node=None, group=False): self.uiConsoleAutoStartCheckBox.setChecked(settings["console_auto_start"]) + # load the auxiliary console type + index = self.uiAuxTypeComboBox.findText(settings["aux_type"]) + if index != -1: + self.uiAuxTypeComboBox.setCurrentIndex(index) + # load the memories and disks settings self.uiRamSpinBox.setValue(settings["ram"]) self.uiNvramSpinBox.setValue(settings["nvram"]) @@ -580,6 +585,9 @@ def saveSettings(self, settings, node=None, group=False): settings["console_type"] = self.uiConsoleTypeComboBox.currentText().lower() settings["console_auto_start"] = self.uiConsoleAutoStartCheckBox.isChecked() + # save auxiliary console type + settings["aux_type"] = self.uiAuxTypeComboBox.currentText().lower() + # save the memories and disks settings settings["ram"] = self.uiRamSpinBox.value() settings["nvram"] = self.uiNvramSpinBox.value() diff --git a/gns3/modules/dynamips/pages/ios_router_preferences_page.py b/gns3/modules/dynamips/pages/ios_router_preferences_page.py index 58c36d0d1..45140c0a7 100644 --- a/gns3/modules/dynamips/pages/ios_router_preferences_page.py +++ b/gns3/modules/dynamips/pages/ios_router_preferences_page.py @@ -395,6 +395,7 @@ def _refreshInfo(self, ios_router): QtWidgets.QTreeWidgetItem(section_item, ["Image:", ios_router["image"]]) QtWidgets.QTreeWidgetItem(section_item, ["Console type:", ios_router["console_type"]]) QtWidgets.QTreeWidgetItem(section_item, ["Auto start console:", "{}".format(ios_router["console_auto_start"])]) + QtWidgets.QTreeWidgetItem(section_item, ["Auxiliary console type:", ios_router["aux_type"]]) if ios_router["idlepc"]: QtWidgets.QTreeWidgetItem(section_item, ["Idle-PC:", ios_router["idlepc"]]) if ios_router["startup_config"]: diff --git a/gns3/modules/dynamips/settings.py b/gns3/modules/dynamips/settings.py index 27ab13de8..021faa972 100644 --- a/gns3/modules/dynamips/settings.py +++ b/gns3/modules/dynamips/settings.py @@ -40,6 +40,7 @@ "private_config": "", "console_type": "telnet", "console_auto_start": False, + "aux_type": "none", "platform": "", "idlepc": "", "idlemax": 500, diff --git a/gns3/modules/dynamips/ui/ios_router_configuration_page.ui b/gns3/modules/dynamips/ui/ios_router_configuration_page.ui index d9a285249..764c1923a 100755 --- a/gns3/modules/dynamips/ui/ios_router_configuration_page.ui +++ b/gns3/modules/dynamips/ui/ios_router_configuration_page.ui @@ -6,8 +6,8 @@ 0 0 - 980 - 734 + 600 + 601 @@ -24,26 +24,37 @@ General - - + + + + + + + + + &Browse... + + + Qt::ToolButtonTextOnly + + + + + + + - Name: + - - - - - + + - Default name format: + IOS image path: - - - @@ -51,24 +62,13 @@ - - - - - - - - - - - Chassis: - - + + - - + + - + Console type: @@ -79,37 +79,36 @@ - - - - - - - - - &Browse... - - - Qt::ToolButtonTextOnly - - - - - - - + + - Category: + Initial private-config: - - + + + + true + + + + 0 + 0 + + + - - - - IOS image path: + + + + true + + + + 0 + 0 + @@ -130,6 +129,13 @@ + + + + NPE: + + + @@ -137,27 +143,17 @@ - - - - - - - - - &Browse... - - - Qt::ToolButtonTextOnly - - - - + + + + Name: + + - - + + - Initial private-config: + Chassis: @@ -178,53 +174,50 @@ - - + + - Midplane: + - - - - true - - - - 0 - 0 - - - + + - - + + - NPE: + Midplane: - - - - true - - - - 0 - 0 - - - + + + + + + + + + &Browse... + + + Qt::ToolButtonTextOnly + + + + - - + + - Console type: + Default name format: + + + @@ -250,7 +243,14 @@ - + + + + Category: + + + + Qt::Vertical @@ -263,6 +263,27 @@ + + + + + telnet + + + + + none + + + + + + + + Auxiliary console type: + + + @@ -270,7 +291,16 @@ Memories and disks - + + 10 + + + 10 + + + 10 + + 10 @@ -448,7 +478,16 @@ Slots - + + 10 + + + 10 + + + 10 + + 10 @@ -649,7 +688,16 @@ Advanced - + + 10 + + + 10 + + + 10 + + 10 @@ -828,7 +876,16 @@ Environment - + + 10 + + + 10 + + + 10 + + 10 diff --git a/gns3/modules/dynamips/ui/ios_router_configuration_page_ui.py b/gns3/modules/dynamips/ui/ios_router_configuration_page_ui.py index 4042eeeef..afa78f474 100644 --- a/gns3/modules/dynamips/ui/ios_router_configuration_page_ui.py +++ b/gns3/modules/dynamips/ui/ios_router_configuration_page_ui.py @@ -2,16 +2,19 @@ # Form implementation generated from reading ui file '/home/grossmj/PycharmProjects/gns3-gui/gns3/modules/dynamips/ui/ios_router_configuration_page.ui' # -# Created by: PyQt5 UI code generator 5.11.3 +# Created by: PyQt5 UI code generator 5.15.6 # -# WARNING! All changes made in this file will be lost! +# WARNING: Any manual changes made to this file will be lost when pyuic5 is +# run again. Do not edit this file unless you know what you are doing. + from PyQt5 import QtCore, QtGui, QtWidgets + class Ui_iosRouterConfigPageWidget(object): def setupUi(self, iosRouterConfigPageWidget): iosRouterConfigPageWidget.setObjectName("iosRouterConfigPageWidget") - iosRouterConfigPageWidget.resize(980, 734) + iosRouterConfigPageWidget.resize(600, 601) self.vboxlayout = QtWidgets.QVBoxLayout(iosRouterConfigPageWidget) self.vboxlayout.setObjectName("vboxlayout") self.uiTabWidget = QtWidgets.QTabWidget(iosRouterConfigPageWidget) @@ -20,35 +23,6 @@ def setupUi(self, iosRouterConfigPageWidget): self.uiGeneralPageWidget.setObjectName("uiGeneralPageWidget") self.gridLayout_2 = QtWidgets.QGridLayout(self.uiGeneralPageWidget) self.gridLayout_2.setObjectName("gridLayout_2") - self.uiNameLabel = QtWidgets.QLabel(self.uiGeneralPageWidget) - self.uiNameLabel.setObjectName("uiNameLabel") - self.gridLayout_2.addWidget(self.uiNameLabel, 0, 0, 1, 1) - self.uiNameLineEdit = QtWidgets.QLineEdit(self.uiGeneralPageWidget) - self.uiNameLineEdit.setObjectName("uiNameLineEdit") - self.gridLayout_2.addWidget(self.uiNameLineEdit, 0, 2, 1, 1) - self.uiDefaultNameFormatLabel = QtWidgets.QLabel(self.uiGeneralPageWidget) - self.uiDefaultNameFormatLabel.setObjectName("uiDefaultNameFormatLabel") - self.gridLayout_2.addWidget(self.uiDefaultNameFormatLabel, 1, 0, 1, 2) - self.uiDefaultNameFormatLineEdit = QtWidgets.QLineEdit(self.uiGeneralPageWidget) - self.uiDefaultNameFormatLineEdit.setObjectName("uiDefaultNameFormatLineEdit") - self.gridLayout_2.addWidget(self.uiDefaultNameFormatLineEdit, 1, 2, 1, 1) - self.uiPlatformLabel = QtWidgets.QLabel(self.uiGeneralPageWidget) - self.uiPlatformLabel.setObjectName("uiPlatformLabel") - self.gridLayout_2.addWidget(self.uiPlatformLabel, 2, 0, 1, 1) - self.uiPlatformTextLabel = QtWidgets.QLabel(self.uiGeneralPageWidget) - self.uiPlatformTextLabel.setText("") - self.uiPlatformTextLabel.setObjectName("uiPlatformTextLabel") - self.gridLayout_2.addWidget(self.uiPlatformTextLabel, 2, 2, 1, 1) - self.uiChassisLabel = QtWidgets.QLabel(self.uiGeneralPageWidget) - self.uiChassisLabel.setObjectName("uiChassisLabel") - self.gridLayout_2.addWidget(self.uiChassisLabel, 3, 0, 1, 1) - self.uiChassisTextLabel = QtWidgets.QLabel(self.uiGeneralPageWidget) - self.uiChassisTextLabel.setText("") - self.uiChassisTextLabel.setObjectName("uiChassisTextLabel") - self.gridLayout_2.addWidget(self.uiChassisTextLabel, 3, 2, 1, 1) - self.uiSymbolLabel = QtWidgets.QLabel(self.uiGeneralPageWidget) - self.uiSymbolLabel.setObjectName("uiSymbolLabel") - self.gridLayout_2.addWidget(self.uiSymbolLabel, 4, 0, 1, 1) self.horizontalLayout_7 = QtWidgets.QHBoxLayout() self.horizontalLayout_7.setObjectName("horizontalLayout_7") self.uiSymbolLineEdit = QtWidgets.QLineEdit(self.uiGeneralPageWidget) @@ -59,15 +33,46 @@ def setupUi(self, iosRouterConfigPageWidget): self.uiSymbolToolButton.setObjectName("uiSymbolToolButton") self.horizontalLayout_7.addWidget(self.uiSymbolToolButton) self.gridLayout_2.addLayout(self.horizontalLayout_7, 4, 2, 1, 1) - self.uiCategoryLabel = QtWidgets.QLabel(self.uiGeneralPageWidget) - self.uiCategoryLabel.setObjectName("uiCategoryLabel") - self.gridLayout_2.addWidget(self.uiCategoryLabel, 5, 0, 1, 1) - self.uiCategoryComboBox = QtWidgets.QComboBox(self.uiGeneralPageWidget) - self.uiCategoryComboBox.setObjectName("uiCategoryComboBox") - self.gridLayout_2.addWidget(self.uiCategoryComboBox, 5, 2, 1, 1) + self.uiPlatformTextLabel = QtWidgets.QLabel(self.uiGeneralPageWidget) + self.uiPlatformTextLabel.setText("") + self.uiPlatformTextLabel.setObjectName("uiPlatformTextLabel") + self.gridLayout_2.addWidget(self.uiPlatformTextLabel, 2, 2, 1, 1) self.uiIOSImageLabel = QtWidgets.QLabel(self.uiGeneralPageWidget) self.uiIOSImageLabel.setObjectName("uiIOSImageLabel") self.gridLayout_2.addWidget(self.uiIOSImageLabel, 6, 0, 1, 2) + self.uiPlatformLabel = QtWidgets.QLabel(self.uiGeneralPageWidget) + self.uiPlatformLabel.setObjectName("uiPlatformLabel") + self.gridLayout_2.addWidget(self.uiPlatformLabel, 2, 0, 1, 1) + self.uiNameLineEdit = QtWidgets.QLineEdit(self.uiGeneralPageWidget) + self.uiNameLineEdit.setObjectName("uiNameLineEdit") + self.gridLayout_2.addWidget(self.uiNameLineEdit, 0, 2, 1, 1) + self.uiConsoleTypeLabel = QtWidgets.QLabel(self.uiGeneralPageWidget) + self.uiConsoleTypeLabel.setObjectName("uiConsoleTypeLabel") + self.gridLayout_2.addWidget(self.uiConsoleTypeLabel, 11, 0, 1, 2) + self.uiSymbolLabel = QtWidgets.QLabel(self.uiGeneralPageWidget) + self.uiSymbolLabel.setObjectName("uiSymbolLabel") + self.gridLayout_2.addWidget(self.uiSymbolLabel, 4, 0, 1, 1) + self.uiPrivateConfigLabel = QtWidgets.QLabel(self.uiGeneralPageWidget) + self.uiPrivateConfigLabel.setObjectName("uiPrivateConfigLabel") + self.gridLayout_2.addWidget(self.uiPrivateConfigLabel, 8, 0, 1, 2) + self.uiMidplaneComboBox = QtWidgets.QComboBox(self.uiGeneralPageWidget) + self.uiMidplaneComboBox.setEnabled(True) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.uiMidplaneComboBox.sizePolicy().hasHeightForWidth()) + self.uiMidplaneComboBox.setSizePolicy(sizePolicy) + self.uiMidplaneComboBox.setObjectName("uiMidplaneComboBox") + self.gridLayout_2.addWidget(self.uiMidplaneComboBox, 9, 2, 1, 1) + self.uiNPEComboBox = QtWidgets.QComboBox(self.uiGeneralPageWidget) + self.uiNPEComboBox.setEnabled(True) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.uiNPEComboBox.sizePolicy().hasHeightForWidth()) + self.uiNPEComboBox.setSizePolicy(sizePolicy) + self.uiNPEComboBox.setObjectName("uiNPEComboBox") + self.gridLayout_2.addWidget(self.uiNPEComboBox, 10, 2, 1, 1) self.horizontalLayout_5 = QtWidgets.QHBoxLayout() self.horizontalLayout_5.setObjectName("horizontalLayout_5") self.uiIOSImageLineEdit = QtWidgets.QLineEdit(self.uiGeneralPageWidget) @@ -78,22 +83,18 @@ def setupUi(self, iosRouterConfigPageWidget): self.uiIOSImageToolButton.setObjectName("uiIOSImageToolButton") self.horizontalLayout_5.addWidget(self.uiIOSImageToolButton) self.gridLayout_2.addLayout(self.horizontalLayout_5, 6, 2, 1, 1) + self.uiNPELabel = QtWidgets.QLabel(self.uiGeneralPageWidget) + self.uiNPELabel.setObjectName("uiNPELabel") + self.gridLayout_2.addWidget(self.uiNPELabel, 10, 0, 1, 1) self.uiStartupConfigLabel = QtWidgets.QLabel(self.uiGeneralPageWidget) self.uiStartupConfigLabel.setObjectName("uiStartupConfigLabel") self.gridLayout_2.addWidget(self.uiStartupConfigLabel, 7, 0, 1, 2) - self.horizontalLayout_4 = QtWidgets.QHBoxLayout() - self.horizontalLayout_4.setObjectName("horizontalLayout_4") - self.uiStartupConfigLineEdit = QtWidgets.QLineEdit(self.uiGeneralPageWidget) - self.uiStartupConfigLineEdit.setObjectName("uiStartupConfigLineEdit") - self.horizontalLayout_4.addWidget(self.uiStartupConfigLineEdit) - self.uiStartupConfigToolButton = QtWidgets.QToolButton(self.uiGeneralPageWidget) - self.uiStartupConfigToolButton.setToolButtonStyle(QtCore.Qt.ToolButtonTextOnly) - self.uiStartupConfigToolButton.setObjectName("uiStartupConfigToolButton") - self.horizontalLayout_4.addWidget(self.uiStartupConfigToolButton) - self.gridLayout_2.addLayout(self.horizontalLayout_4, 7, 2, 1, 1) - self.uiPrivateConfigLabel = QtWidgets.QLabel(self.uiGeneralPageWidget) - self.uiPrivateConfigLabel.setObjectName("uiPrivateConfigLabel") - self.gridLayout_2.addWidget(self.uiPrivateConfigLabel, 8, 0, 1, 2) + self.uiNameLabel = QtWidgets.QLabel(self.uiGeneralPageWidget) + self.uiNameLabel.setObjectName("uiNameLabel") + self.gridLayout_2.addWidget(self.uiNameLabel, 0, 0, 1, 1) + self.uiChassisLabel = QtWidgets.QLabel(self.uiGeneralPageWidget) + self.uiChassisLabel.setObjectName("uiChassisLabel") + self.gridLayout_2.addWidget(self.uiChassisLabel, 3, 0, 1, 1) self.horizontalLayout_6 = QtWidgets.QHBoxLayout() self.horizontalLayout_6.setObjectName("horizontalLayout_6") self.uiPrivateConfigLineEdit = QtWidgets.QLineEdit(self.uiGeneralPageWidget) @@ -104,33 +105,32 @@ def setupUi(self, iosRouterConfigPageWidget): self.uiPrivateConfigToolButton.setObjectName("uiPrivateConfigToolButton") self.horizontalLayout_6.addWidget(self.uiPrivateConfigToolButton) self.gridLayout_2.addLayout(self.horizontalLayout_6, 8, 2, 1, 1) + self.uiChassisTextLabel = QtWidgets.QLabel(self.uiGeneralPageWidget) + self.uiChassisTextLabel.setText("") + self.uiChassisTextLabel.setObjectName("uiChassisTextLabel") + self.gridLayout_2.addWidget(self.uiChassisTextLabel, 3, 2, 1, 1) + self.uiCategoryComboBox = QtWidgets.QComboBox(self.uiGeneralPageWidget) + self.uiCategoryComboBox.setObjectName("uiCategoryComboBox") + self.gridLayout_2.addWidget(self.uiCategoryComboBox, 5, 2, 1, 1) self.uiMidplaneLabel = QtWidgets.QLabel(self.uiGeneralPageWidget) self.uiMidplaneLabel.setObjectName("uiMidplaneLabel") self.gridLayout_2.addWidget(self.uiMidplaneLabel, 9, 0, 1, 1) - self.uiMidplaneComboBox = QtWidgets.QComboBox(self.uiGeneralPageWidget) - self.uiMidplaneComboBox.setEnabled(True) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.uiMidplaneComboBox.sizePolicy().hasHeightForWidth()) - self.uiMidplaneComboBox.setSizePolicy(sizePolicy) - self.uiMidplaneComboBox.setObjectName("uiMidplaneComboBox") - self.gridLayout_2.addWidget(self.uiMidplaneComboBox, 9, 2, 1, 1) - self.uiNPELabel = QtWidgets.QLabel(self.uiGeneralPageWidget) - self.uiNPELabel.setObjectName("uiNPELabel") - self.gridLayout_2.addWidget(self.uiNPELabel, 10, 0, 1, 1) - self.uiNPEComboBox = QtWidgets.QComboBox(self.uiGeneralPageWidget) - self.uiNPEComboBox.setEnabled(True) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.uiNPEComboBox.sizePolicy().hasHeightForWidth()) - self.uiNPEComboBox.setSizePolicy(sizePolicy) - self.uiNPEComboBox.setObjectName("uiNPEComboBox") - self.gridLayout_2.addWidget(self.uiNPEComboBox, 10, 2, 1, 1) - self.uiConsoleTypeLabel = QtWidgets.QLabel(self.uiGeneralPageWidget) - self.uiConsoleTypeLabel.setObjectName("uiConsoleTypeLabel") - self.gridLayout_2.addWidget(self.uiConsoleTypeLabel, 11, 0, 1, 2) + self.horizontalLayout_4 = QtWidgets.QHBoxLayout() + self.horizontalLayout_4.setObjectName("horizontalLayout_4") + self.uiStartupConfigLineEdit = QtWidgets.QLineEdit(self.uiGeneralPageWidget) + self.uiStartupConfigLineEdit.setObjectName("uiStartupConfigLineEdit") + self.horizontalLayout_4.addWidget(self.uiStartupConfigLineEdit) + self.uiStartupConfigToolButton = QtWidgets.QToolButton(self.uiGeneralPageWidget) + self.uiStartupConfigToolButton.setToolButtonStyle(QtCore.Qt.ToolButtonTextOnly) + self.uiStartupConfigToolButton.setObjectName("uiStartupConfigToolButton") + self.horizontalLayout_4.addWidget(self.uiStartupConfigToolButton) + self.gridLayout_2.addLayout(self.horizontalLayout_4, 7, 2, 1, 1) + self.uiDefaultNameFormatLabel = QtWidgets.QLabel(self.uiGeneralPageWidget) + self.uiDefaultNameFormatLabel.setObjectName("uiDefaultNameFormatLabel") + self.gridLayout_2.addWidget(self.uiDefaultNameFormatLabel, 1, 0, 1, 2) + self.uiDefaultNameFormatLineEdit = QtWidgets.QLineEdit(self.uiGeneralPageWidget) + self.uiDefaultNameFormatLineEdit.setObjectName("uiDefaultNameFormatLineEdit") + self.gridLayout_2.addWidget(self.uiDefaultNameFormatLineEdit, 1, 2, 1, 1) self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") self.uiConsoleTypeComboBox = QtWidgets.QComboBox(self.uiGeneralPageWidget) @@ -142,8 +142,19 @@ def setupUi(self, iosRouterConfigPageWidget): self.uiConsoleAutoStartCheckBox.setObjectName("uiConsoleAutoStartCheckBox") self.horizontalLayout.addWidget(self.uiConsoleAutoStartCheckBox) self.gridLayout_2.addLayout(self.horizontalLayout, 11, 2, 1, 1) + self.uiCategoryLabel = QtWidgets.QLabel(self.uiGeneralPageWidget) + self.uiCategoryLabel.setObjectName("uiCategoryLabel") + self.gridLayout_2.addWidget(self.uiCategoryLabel, 5, 0, 1, 1) spacerItem = QtWidgets.QSpacerItem(263, 151, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) - self.gridLayout_2.addItem(spacerItem, 12, 1, 1, 2) + self.gridLayout_2.addItem(spacerItem, 13, 0, 1, 3) + self.uiAuxTypeComboBox = QtWidgets.QComboBox(self.uiGeneralPageWidget) + self.uiAuxTypeComboBox.setObjectName("uiAuxTypeComboBox") + self.uiAuxTypeComboBox.addItem("") + self.uiAuxTypeComboBox.addItem("") + self.gridLayout_2.addWidget(self.uiAuxTypeComboBox, 12, 2, 1, 1) + self.uiAuxTypeLabel = QtWidgets.QLabel(self.uiGeneralPageWidget) + self.uiAuxTypeLabel.setObjectName("uiAuxTypeLabel") + self.gridLayout_2.addWidget(self.uiAuxTypeLabel, 12, 0, 1, 2) self.uiTabWidget.addTab(self.uiGeneralPageWidget, "") self.uiMemoriesPageWidget = QtWidgets.QWidget() self.uiMemoriesPageWidget.setObjectName("uiMemoriesPageWidget") @@ -563,25 +574,28 @@ def setupUi(self, iosRouterConfigPageWidget): def retranslateUi(self, iosRouterConfigPageWidget): _translate = QtCore.QCoreApplication.translate iosRouterConfigPageWidget.setWindowTitle(_translate("iosRouterConfigPageWidget", "Dynamips IOS router template configuration")) - self.uiNameLabel.setText(_translate("iosRouterConfigPageWidget", "Name:")) - self.uiDefaultNameFormatLabel.setText(_translate("iosRouterConfigPageWidget", "Default name format:")) - self.uiPlatformLabel.setText(_translate("iosRouterConfigPageWidget", "Platform:")) - self.uiChassisLabel.setText(_translate("iosRouterConfigPageWidget", "Chassis:")) - self.uiSymbolLabel.setText(_translate("iosRouterConfigPageWidget", "Symbol:")) self.uiSymbolToolButton.setText(_translate("iosRouterConfigPageWidget", "&Browse...")) - self.uiCategoryLabel.setText(_translate("iosRouterConfigPageWidget", "Category:")) self.uiIOSImageLabel.setText(_translate("iosRouterConfigPageWidget", "IOS image path:")) + self.uiPlatformLabel.setText(_translate("iosRouterConfigPageWidget", "Platform:")) + self.uiConsoleTypeLabel.setText(_translate("iosRouterConfigPageWidget", "Console type:")) + self.uiSymbolLabel.setText(_translate("iosRouterConfigPageWidget", "Symbol:")) + self.uiPrivateConfigLabel.setText(_translate("iosRouterConfigPageWidget", "Initial private-config:")) self.uiIOSImageToolButton.setText(_translate("iosRouterConfigPageWidget", "&Browse...")) + self.uiNPELabel.setText(_translate("iosRouterConfigPageWidget", "NPE:")) self.uiStartupConfigLabel.setText(_translate("iosRouterConfigPageWidget", "Initial startup-config:")) - self.uiStartupConfigToolButton.setText(_translate("iosRouterConfigPageWidget", "&Browse...")) - self.uiPrivateConfigLabel.setText(_translate("iosRouterConfigPageWidget", "Initial private-config:")) + self.uiNameLabel.setText(_translate("iosRouterConfigPageWidget", "Name:")) + self.uiChassisLabel.setText(_translate("iosRouterConfigPageWidget", "Chassis:")) self.uiPrivateConfigToolButton.setText(_translate("iosRouterConfigPageWidget", "&Browse...")) self.uiMidplaneLabel.setText(_translate("iosRouterConfigPageWidget", "Midplane:")) - self.uiNPELabel.setText(_translate("iosRouterConfigPageWidget", "NPE:")) - self.uiConsoleTypeLabel.setText(_translate("iosRouterConfigPageWidget", "Console type:")) + self.uiStartupConfigToolButton.setText(_translate("iosRouterConfigPageWidget", "&Browse...")) + self.uiDefaultNameFormatLabel.setText(_translate("iosRouterConfigPageWidget", "Default name format:")) self.uiConsoleTypeComboBox.setItemText(0, _translate("iosRouterConfigPageWidget", "telnet")) self.uiConsoleTypeComboBox.setItemText(1, _translate("iosRouterConfigPageWidget", "none")) self.uiConsoleAutoStartCheckBox.setText(_translate("iosRouterConfigPageWidget", "Auto start console")) + self.uiCategoryLabel.setText(_translate("iosRouterConfigPageWidget", "Category:")) + self.uiAuxTypeComboBox.setItemText(0, _translate("iosRouterConfigPageWidget", "telnet")) + self.uiAuxTypeComboBox.setItemText(1, _translate("iosRouterConfigPageWidget", "none")) + self.uiAuxTypeLabel.setText(_translate("iosRouterConfigPageWidget", "Auxiliary console type:")) self.uiTabWidget.setTabText(self.uiTabWidget.indexOf(self.uiGeneralPageWidget), _translate("iosRouterConfigPageWidget", "General")) self.uiRamLabel.setText(_translate("iosRouterConfigPageWidget", "RAM size:")) self.uiRamSpinBox.setSuffix(_translate("iosRouterConfigPageWidget", " MiB")) @@ -639,4 +653,3 @@ def retranslateUi(self, iosRouterConfigPageWidget): self.uiSensor4SpinBox.setSuffix(_translate("iosRouterConfigPageWidget", " C")) self.uiTabWidget.setTabText(self.uiTabWidget.indexOf(self.uiEnvironmentPageWidget), _translate("iosRouterConfigPageWidget", "Environment")) self.uiTabWidget.setTabText(self.uiTabWidget.indexOf(self.uiUsageTab), _translate("iosRouterConfigPageWidget", "Usage")) - diff --git a/gns3/modules/qemu/pages/qemu_vm_configuration_page.py b/gns3/modules/qemu/pages/qemu_vm_configuration_page.py index 439009d1f..568ec99b8 100644 --- a/gns3/modules/qemu/pages/qemu_vm_configuration_page.py +++ b/gns3/modules/qemu/pages/qemu_vm_configuration_page.py @@ -541,6 +541,10 @@ def loadSettings(self, settings, node=None, group=False): if index != -1: self.uiConsoleTypeComboBox.setCurrentIndex(index) + index = self.uiAuxTypeComboBox.findText(settings["aux_type"]) + if index != -1: + self.uiAuxTypeComboBox.setCurrentIndex(index) + self.uiConsoleAutoStartCheckBox.setChecked(settings["console_auto_start"]) self.uiKernelCommandLineEdit.setText(settings["kernel_command_line"]) self.uiAdaptersSpinBox.setValue(settings["adapters"]) @@ -669,6 +673,7 @@ def saveSettings(self, settings, node=None, group=False): settings["boot_priority"] = self.uiBootPriorityComboBox.itemData(self.uiBootPriorityComboBox.currentIndex()) settings["console_type"] = self.uiConsoleTypeComboBox.currentText().lower() settings["console_auto_start"] = self.uiConsoleAutoStartCheckBox.isChecked() + settings["aux_type"] = self.uiAuxTypeComboBox.currentText().lower() settings["adapter_type"] = self.uiAdapterTypesComboBox.itemData(self.uiAdapterTypesComboBox.currentIndex()) settings["kernel_command_line"] = self.uiKernelCommandLineEdit.text() diff --git a/gns3/modules/qemu/pages/qemu_vm_preferences_page.py b/gns3/modules/qemu/pages/qemu_vm_preferences_page.py index 0e5d717e6..6a84a0a3d 100644 --- a/gns3/modules/qemu/pages/qemu_vm_preferences_page.py +++ b/gns3/modules/qemu/pages/qemu_vm_preferences_page.py @@ -89,6 +89,7 @@ def _refreshInfo(self, qemu_vm): pass QtWidgets.QTreeWidgetItem(section_item, ["Console type:", qemu_vm["console_type"]]) QtWidgets.QTreeWidgetItem(section_item, ["Auto start console:", "{}".format(qemu_vm["console_auto_start"])]) + QtWidgets.QTreeWidgetItem(section_item, ["Auxiliary console type:", qemu_vm["aux_type"]]) QtWidgets.QTreeWidgetItem(section_item, ["CPUs:", str(qemu_vm["cpus"])]) QtWidgets.QTreeWidgetItem(section_item, ["Memory:", "{} MB".format(qemu_vm["ram"])]) QtWidgets.QTreeWidgetItem(section_item, ["Linked base VM:", "{}".format(qemu_vm["linked_clone"])]) diff --git a/gns3/modules/qemu/qemu_vm.py b/gns3/modules/qemu/qemu_vm.py index 37f79582b..e64334f8f 100644 --- a/gns3/modules/qemu/qemu_vm.py +++ b/gns3/modules/qemu/qemu_vm.py @@ -68,6 +68,7 @@ def __init__(self, module, server, project): "cpus": QEMU_VM_SETTINGS["cpus"], "console_type": QEMU_VM_SETTINGS["console_type"], "console_auto_start": QEMU_VM_SETTINGS["console_auto_start"], + "aux_type": QEMU_VM_SETTINGS["aux_type"], "adapters": QEMU_VM_SETTINGS["adapters"], "custom_adapters": QEMU_VM_SETTINGS["custom_adapters"], "adapter_type": QEMU_VM_SETTINGS["adapter_type"], @@ -115,6 +116,7 @@ def info(self): Local ID is {id} and server ID is {node_id} Number of processors is {cpus} and amount of memory is {ram}MB Console is on port {console} and type is {console_type} + Auxiliary console is on port {aux} and type is {aux_type} """.format(name=self.name(), id=self.id(), node_id=self._node_id, @@ -124,7 +126,9 @@ def info(self): cpus=self._settings["cpus"], ram=self._settings["ram"], console=self._settings["console"], - console_type=self._settings["console_type"]) + console_type=self._settings["console_type"], + aux = self._settings["aux"], + aux_type = self._settings["aux_type"]) port_info = "" for port in self._ports: @@ -157,6 +161,14 @@ def configTextFiles(self): return None + def auxConsole(self): + """ + Returns the console port for this Docker VM instance. + :returns: port (integer) + """ + + return self._settings["aux"] + def configPage(self): """ Returns the configuration page widget to be used by the node properties dialog. diff --git a/gns3/modules/qemu/settings.py b/gns3/modules/qemu/settings.py index d2e493d17..216a4832f 100644 --- a/gns3/modules/qemu/settings.py +++ b/gns3/modules/qemu/settings.py @@ -50,6 +50,7 @@ "boot_priority": "c", "console_type": "telnet", "console_auto_start": False, + "aux_type": "none", "ram": 256, "cpus": 1, "adapters": 1, diff --git a/gns3/modules/qemu/ui/qemu_vm_configuration_page.ui b/gns3/modules/qemu/ui/qemu_vm_configuration_page.ui index be20621b4..04082869e 100755 --- a/gns3/modules/qemu/ui/qemu_vm_configuration_page.ui +++ b/gns3/modules/qemu/ui/qemu_vm_configuration_page.ui @@ -6,7 +6,7 @@ 0 0 - 478 + 534 579 @@ -24,60 +24,13 @@ General settings - - - - Name: - - - - - - - - - - Default name format: - - - - - - - - - - Symbol: - - - - - - - - - - - - &Browse... - - - Qt::ToolButtonTextOnly - - - - - - - + + - Category: + On close: - - - @@ -85,22 +38,6 @@ - - - - MB - - - 32 - - - 65535 - - - 256 - - - @@ -108,6 +45,22 @@ + + + + + + + Qt::Vertical + + + + 263 + 94 + + + + @@ -118,13 +71,33 @@ - - + + + + + - Qemu binary: + Default name format: + + + + + + + + + &Browse... + + + Qt::ToolButtonTextOnly + + + + + @@ -135,33 +108,6 @@ - - - - Boot priority: - - - - - - - - - - On close: - - - - - - - - - - Console type: - - - @@ -202,18 +148,108 @@ - - - - Qt::Vertical + + + + Console type: - - - 263 - 94 - + + + + + + + + + + + + + + + Boot priority: - + + + + + + Category: + + + + + + + MB + + + 32 + + + 65535 + + + 256 + + + + + + + Name: + + + + + + + Symbol: + + + + + + + Qemu binary: + + + + + + + Auxiliary console type: + + + + + + + + telnet + + + + + vnc + + + + + spice + + + + + spice+agent + + + + + none + + + diff --git a/gns3/modules/qemu/ui/qemu_vm_configuration_page_ui.py b/gns3/modules/qemu/ui/qemu_vm_configuration_page_ui.py index 59d9de7e7..fa6dbf00e 100644 --- a/gns3/modules/qemu/ui/qemu_vm_configuration_page_ui.py +++ b/gns3/modules/qemu/ui/qemu_vm_configuration_page_ui.py @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file '/home/grossmj/PycharmProjects/gns3-gui/gns3/modules/qemu/ui/qemu_vm_configuration_page.ui' # -# Created by: PyQt5 UI code generator 5.15.9 +# Created by: PyQt5 UI code generator 5.15.6 # # WARNING: Any manual changes made to this file will be lost when pyuic5 is # run again. Do not edit this file unless you know what you are doing. @@ -14,7 +14,7 @@ class Ui_QemuVMConfigPageWidget(object): def setupUi(self, QemuVMConfigPageWidget): QemuVMConfigPageWidget.setObjectName("QemuVMConfigPageWidget") - QemuVMConfigPageWidget.resize(478, 579) + QemuVMConfigPageWidget.resize(534, 579) self.verticalLayout = QtWidgets.QVBoxLayout(QemuVMConfigPageWidget) self.verticalLayout.setObjectName("verticalLayout") self.uiQemutabWidget = QtWidgets.QTabWidget(QemuVMConfigPageWidget) @@ -23,21 +23,31 @@ def setupUi(self, QemuVMConfigPageWidget): self.uiGeneralSettingsTab.setObjectName("uiGeneralSettingsTab") self.gridLayout_4 = QtWidgets.QGridLayout(self.uiGeneralSettingsTab) self.gridLayout_4.setObjectName("gridLayout_4") - self.uiNameLabel = QtWidgets.QLabel(self.uiGeneralSettingsTab) - self.uiNameLabel.setObjectName("uiNameLabel") - self.gridLayout_4.addWidget(self.uiNameLabel, 0, 0, 1, 1) + self.uiOnCloseLabel = QtWidgets.QLabel(self.uiGeneralSettingsTab) + self.uiOnCloseLabel.setObjectName("uiOnCloseLabel") + self.gridLayout_4.addWidget(self.uiOnCloseLabel, 8, 0, 1, 1) + self.uiRamLabel = QtWidgets.QLabel(self.uiGeneralSettingsTab) + self.uiRamLabel.setObjectName("uiRamLabel") + self.gridLayout_4.addWidget(self.uiRamLabel, 4, 0, 1, 1) + self.uiCPULabel = QtWidgets.QLabel(self.uiGeneralSettingsTab) + self.uiCPULabel.setObjectName("uiCPULabel") + self.gridLayout_4.addWidget(self.uiCPULabel, 5, 0, 1, 1) + self.uiCategoryComboBox = QtWidgets.QComboBox(self.uiGeneralSettingsTab) + self.uiCategoryComboBox.setObjectName("uiCategoryComboBox") + self.gridLayout_4.addWidget(self.uiCategoryComboBox, 3, 1, 1, 1) + spacerItem = QtWidgets.QSpacerItem(263, 94, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + self.gridLayout_4.addItem(spacerItem, 11, 1, 1, 1) + self.uiCPUSpinBox = QtWidgets.QSpinBox(self.uiGeneralSettingsTab) + self.uiCPUSpinBox.setMinimum(1) + self.uiCPUSpinBox.setMaximum(255) + self.uiCPUSpinBox.setObjectName("uiCPUSpinBox") + self.gridLayout_4.addWidget(self.uiCPUSpinBox, 5, 1, 1, 1) self.uiNameLineEdit = QtWidgets.QLineEdit(self.uiGeneralSettingsTab) self.uiNameLineEdit.setObjectName("uiNameLineEdit") self.gridLayout_4.addWidget(self.uiNameLineEdit, 0, 1, 1, 1) self.uiDefaultNameFormatLabel = QtWidgets.QLabel(self.uiGeneralSettingsTab) self.uiDefaultNameFormatLabel.setObjectName("uiDefaultNameFormatLabel") self.gridLayout_4.addWidget(self.uiDefaultNameFormatLabel, 1, 0, 1, 1) - self.uiDefaultNameFormatLineEdit = QtWidgets.QLineEdit(self.uiGeneralSettingsTab) - self.uiDefaultNameFormatLineEdit.setObjectName("uiDefaultNameFormatLineEdit") - self.gridLayout_4.addWidget(self.uiDefaultNameFormatLineEdit, 1, 1, 1, 1) - self.uiSymbolLabel = QtWidgets.QLabel(self.uiGeneralSettingsTab) - self.uiSymbolLabel.setObjectName("uiSymbolLabel") - self.gridLayout_4.addWidget(self.uiSymbolLabel, 2, 0, 1, 1) self.horizontalLayout_7 = QtWidgets.QHBoxLayout() self.horizontalLayout_7.setObjectName("horizontalLayout_7") self.uiSymbolLineEdit = QtWidgets.QLineEdit(self.uiGeneralSettingsTab) @@ -48,32 +58,6 @@ def setupUi(self, QemuVMConfigPageWidget): self.uiSymbolToolButton.setObjectName("uiSymbolToolButton") self.horizontalLayout_7.addWidget(self.uiSymbolToolButton) self.gridLayout_4.addLayout(self.horizontalLayout_7, 2, 1, 1, 1) - self.uiCategoryLabel = QtWidgets.QLabel(self.uiGeneralSettingsTab) - self.uiCategoryLabel.setObjectName("uiCategoryLabel") - self.gridLayout_4.addWidget(self.uiCategoryLabel, 3, 0, 1, 1) - self.uiCategoryComboBox = QtWidgets.QComboBox(self.uiGeneralSettingsTab) - self.uiCategoryComboBox.setObjectName("uiCategoryComboBox") - self.gridLayout_4.addWidget(self.uiCategoryComboBox, 3, 1, 1, 1) - self.uiRamLabel = QtWidgets.QLabel(self.uiGeneralSettingsTab) - self.uiRamLabel.setObjectName("uiRamLabel") - self.gridLayout_4.addWidget(self.uiRamLabel, 4, 0, 1, 1) - self.uiRamSpinBox = QtWidgets.QSpinBox(self.uiGeneralSettingsTab) - self.uiRamSpinBox.setMinimum(32) - self.uiRamSpinBox.setMaximum(65535) - self.uiRamSpinBox.setProperty("value", 256) - self.uiRamSpinBox.setObjectName("uiRamSpinBox") - self.gridLayout_4.addWidget(self.uiRamSpinBox, 4, 1, 1, 1) - self.uiCPULabel = QtWidgets.QLabel(self.uiGeneralSettingsTab) - self.uiCPULabel.setObjectName("uiCPULabel") - self.gridLayout_4.addWidget(self.uiCPULabel, 5, 0, 1, 1) - self.uiCPUSpinBox = QtWidgets.QSpinBox(self.uiGeneralSettingsTab) - self.uiCPUSpinBox.setMinimum(1) - self.uiCPUSpinBox.setMaximum(255) - self.uiCPUSpinBox.setObjectName("uiCPUSpinBox") - self.gridLayout_4.addWidget(self.uiCPUSpinBox, 5, 1, 1, 1) - self.uiQemuListLabel = QtWidgets.QLabel(self.uiGeneralSettingsTab) - self.uiQemuListLabel.setObjectName("uiQemuListLabel") - self.gridLayout_4.addWidget(self.uiQemuListLabel, 6, 0, 1, 1) self.uiQemuListComboBox = QtWidgets.QComboBox(self.uiGeneralSettingsTab) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) @@ -82,21 +66,6 @@ def setupUi(self, QemuVMConfigPageWidget): self.uiQemuListComboBox.setSizePolicy(sizePolicy) self.uiQemuListComboBox.setObjectName("uiQemuListComboBox") self.gridLayout_4.addWidget(self.uiQemuListComboBox, 6, 1, 1, 1) - self.uiBootPriorityLabel = QtWidgets.QLabel(self.uiGeneralSettingsTab) - self.uiBootPriorityLabel.setObjectName("uiBootPriorityLabel") - self.gridLayout_4.addWidget(self.uiBootPriorityLabel, 7, 0, 1, 1) - self.uiBootPriorityComboBox = QtWidgets.QComboBox(self.uiGeneralSettingsTab) - self.uiBootPriorityComboBox.setObjectName("uiBootPriorityComboBox") - self.gridLayout_4.addWidget(self.uiBootPriorityComboBox, 7, 1, 1, 1) - self.uiOnCloseLabel = QtWidgets.QLabel(self.uiGeneralSettingsTab) - self.uiOnCloseLabel.setObjectName("uiOnCloseLabel") - self.gridLayout_4.addWidget(self.uiOnCloseLabel, 8, 0, 1, 1) - self.uiOnCloseComboBox = QtWidgets.QComboBox(self.uiGeneralSettingsTab) - self.uiOnCloseComboBox.setObjectName("uiOnCloseComboBox") - self.gridLayout_4.addWidget(self.uiOnCloseComboBox, 8, 1, 1, 1) - self.uiConsoleTypeLabel = QtWidgets.QLabel(self.uiGeneralSettingsTab) - self.uiConsoleTypeLabel.setObjectName("uiConsoleTypeLabel") - self.gridLayout_4.addWidget(self.uiConsoleTypeLabel, 9, 0, 1, 1) self.horizontalLayout_2 = QtWidgets.QHBoxLayout() self.horizontalLayout_2.setObjectName("horizontalLayout_2") self.uiConsoleTypeComboBox = QtWidgets.QComboBox(self.uiGeneralSettingsTab) @@ -111,8 +80,50 @@ def setupUi(self, QemuVMConfigPageWidget): self.uiConsoleAutoStartCheckBox.setObjectName("uiConsoleAutoStartCheckBox") self.horizontalLayout_2.addWidget(self.uiConsoleAutoStartCheckBox) self.gridLayout_4.addLayout(self.horizontalLayout_2, 9, 1, 1, 1) - spacerItem = QtWidgets.QSpacerItem(263, 94, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) - self.gridLayout_4.addItem(spacerItem, 10, 1, 1, 1) + self.uiConsoleTypeLabel = QtWidgets.QLabel(self.uiGeneralSettingsTab) + self.uiConsoleTypeLabel.setObjectName("uiConsoleTypeLabel") + self.gridLayout_4.addWidget(self.uiConsoleTypeLabel, 9, 0, 1, 1) + self.uiDefaultNameFormatLineEdit = QtWidgets.QLineEdit(self.uiGeneralSettingsTab) + self.uiDefaultNameFormatLineEdit.setObjectName("uiDefaultNameFormatLineEdit") + self.gridLayout_4.addWidget(self.uiDefaultNameFormatLineEdit, 1, 1, 1, 1) + self.uiOnCloseComboBox = QtWidgets.QComboBox(self.uiGeneralSettingsTab) + self.uiOnCloseComboBox.setObjectName("uiOnCloseComboBox") + self.gridLayout_4.addWidget(self.uiOnCloseComboBox, 8, 1, 1, 1) + self.uiBootPriorityComboBox = QtWidgets.QComboBox(self.uiGeneralSettingsTab) + self.uiBootPriorityComboBox.setObjectName("uiBootPriorityComboBox") + self.gridLayout_4.addWidget(self.uiBootPriorityComboBox, 7, 1, 1, 1) + self.uiBootPriorityLabel = QtWidgets.QLabel(self.uiGeneralSettingsTab) + self.uiBootPriorityLabel.setObjectName("uiBootPriorityLabel") + self.gridLayout_4.addWidget(self.uiBootPriorityLabel, 7, 0, 1, 1) + self.uiCategoryLabel = QtWidgets.QLabel(self.uiGeneralSettingsTab) + self.uiCategoryLabel.setObjectName("uiCategoryLabel") + self.gridLayout_4.addWidget(self.uiCategoryLabel, 3, 0, 1, 1) + self.uiRamSpinBox = QtWidgets.QSpinBox(self.uiGeneralSettingsTab) + self.uiRamSpinBox.setMinimum(32) + self.uiRamSpinBox.setMaximum(65535) + self.uiRamSpinBox.setProperty("value", 256) + self.uiRamSpinBox.setObjectName("uiRamSpinBox") + self.gridLayout_4.addWidget(self.uiRamSpinBox, 4, 1, 1, 1) + self.uiNameLabel = QtWidgets.QLabel(self.uiGeneralSettingsTab) + self.uiNameLabel.setObjectName("uiNameLabel") + self.gridLayout_4.addWidget(self.uiNameLabel, 0, 0, 1, 1) + self.uiSymbolLabel = QtWidgets.QLabel(self.uiGeneralSettingsTab) + self.uiSymbolLabel.setObjectName("uiSymbolLabel") + self.gridLayout_4.addWidget(self.uiSymbolLabel, 2, 0, 1, 1) + self.uiQemuListLabel = QtWidgets.QLabel(self.uiGeneralSettingsTab) + self.uiQemuListLabel.setObjectName("uiQemuListLabel") + self.gridLayout_4.addWidget(self.uiQemuListLabel, 6, 0, 1, 1) + self.uiAuxTypeLabel = QtWidgets.QLabel(self.uiGeneralSettingsTab) + self.uiAuxTypeLabel.setObjectName("uiAuxTypeLabel") + self.gridLayout_4.addWidget(self.uiAuxTypeLabel, 10, 0, 1, 1) + self.uiAuxTypeComboBox = QtWidgets.QComboBox(self.uiGeneralSettingsTab) + self.uiAuxTypeComboBox.setObjectName("uiAuxTypeComboBox") + self.uiAuxTypeComboBox.addItem("") + self.uiAuxTypeComboBox.addItem("") + self.uiAuxTypeComboBox.addItem("") + self.uiAuxTypeComboBox.addItem("") + self.uiAuxTypeComboBox.addItem("") + self.gridLayout_4.addWidget(self.uiAuxTypeComboBox, 10, 1, 1, 1) self.uiQemutabWidget.addTab(self.uiGeneralSettingsTab, "") self.uiHddTab = QtWidgets.QWidget() self.uiHddTab.setObjectName("uiHddTab") @@ -471,24 +482,30 @@ def setupUi(self, QemuVMConfigPageWidget): def retranslateUi(self, QemuVMConfigPageWidget): _translate = QtCore.QCoreApplication.translate QemuVMConfigPageWidget.setWindowTitle(_translate("QemuVMConfigPageWidget", "QEMU VM template configuration")) - self.uiNameLabel.setText(_translate("QemuVMConfigPageWidget", "Name:")) - self.uiDefaultNameFormatLabel.setText(_translate("QemuVMConfigPageWidget", "Default name format:")) - self.uiSymbolLabel.setText(_translate("QemuVMConfigPageWidget", "Symbol:")) - self.uiSymbolToolButton.setText(_translate("QemuVMConfigPageWidget", "&Browse...")) - self.uiCategoryLabel.setText(_translate("QemuVMConfigPageWidget", "Category:")) + self.uiOnCloseLabel.setText(_translate("QemuVMConfigPageWidget", "On close:")) self.uiRamLabel.setText(_translate("QemuVMConfigPageWidget", "RAM:")) - self.uiRamSpinBox.setSuffix(_translate("QemuVMConfigPageWidget", " MB")) self.uiCPULabel.setText(_translate("QemuVMConfigPageWidget", "vCPUs:")) - self.uiQemuListLabel.setText(_translate("QemuVMConfigPageWidget", "Qemu binary:")) - self.uiBootPriorityLabel.setText(_translate("QemuVMConfigPageWidget", "Boot priority:")) - self.uiOnCloseLabel.setText(_translate("QemuVMConfigPageWidget", "On close:")) - self.uiConsoleTypeLabel.setText(_translate("QemuVMConfigPageWidget", "Console type:")) + self.uiDefaultNameFormatLabel.setText(_translate("QemuVMConfigPageWidget", "Default name format:")) + self.uiSymbolToolButton.setText(_translate("QemuVMConfigPageWidget", "&Browse...")) self.uiConsoleTypeComboBox.setItemText(0, _translate("QemuVMConfigPageWidget", "telnet")) self.uiConsoleTypeComboBox.setItemText(1, _translate("QemuVMConfigPageWidget", "vnc")) self.uiConsoleTypeComboBox.setItemText(2, _translate("QemuVMConfigPageWidget", "spice")) self.uiConsoleTypeComboBox.setItemText(3, _translate("QemuVMConfigPageWidget", "spice+agent")) self.uiConsoleTypeComboBox.setItemText(4, _translate("QemuVMConfigPageWidget", "none")) self.uiConsoleAutoStartCheckBox.setText(_translate("QemuVMConfigPageWidget", "Auto start console")) + self.uiConsoleTypeLabel.setText(_translate("QemuVMConfigPageWidget", "Console type:")) + self.uiBootPriorityLabel.setText(_translate("QemuVMConfigPageWidget", "Boot priority:")) + self.uiCategoryLabel.setText(_translate("QemuVMConfigPageWidget", "Category:")) + self.uiRamSpinBox.setSuffix(_translate("QemuVMConfigPageWidget", " MB")) + self.uiNameLabel.setText(_translate("QemuVMConfigPageWidget", "Name:")) + self.uiSymbolLabel.setText(_translate("QemuVMConfigPageWidget", "Symbol:")) + self.uiQemuListLabel.setText(_translate("QemuVMConfigPageWidget", "Qemu binary:")) + self.uiAuxTypeLabel.setText(_translate("QemuVMConfigPageWidget", "Auxiliary console type:")) + self.uiAuxTypeComboBox.setItemText(0, _translate("QemuVMConfigPageWidget", "telnet")) + self.uiAuxTypeComboBox.setItemText(1, _translate("QemuVMConfigPageWidget", "vnc")) + self.uiAuxTypeComboBox.setItemText(2, _translate("QemuVMConfigPageWidget", "spice")) + self.uiAuxTypeComboBox.setItemText(3, _translate("QemuVMConfigPageWidget", "spice+agent")) + self.uiAuxTypeComboBox.setItemText(4, _translate("QemuVMConfigPageWidget", "none")) self.uiQemutabWidget.setTabText(self.uiQemutabWidget.indexOf(self.uiGeneralSettingsTab), _translate("QemuVMConfigPageWidget", "General settings")) self.uiHdaGroupBox.setTitle(_translate("QemuVMConfigPageWidget", "HDA (Primary Master)")) self.uiHdaDiskImageLabel.setText(_translate("QemuVMConfigPageWidget", "Disk image:")) diff --git a/gns3/node.py b/gns3/node.py index ab6530aeb..2a8f97f0c 100644 --- a/gns3/node.py +++ b/gns3/node.py @@ -399,6 +399,8 @@ def _prepareBodyForUpdate(self, params): general_node_properties = ("name", "console", "console_type", + "aux", + "aux_type", "x", "y", "z", @@ -559,7 +561,7 @@ def _parseControllerResponse(self, result): del result["properties"] # Update common element of all nodes - for key in ["x", "y", "z", "locked", "symbol", "label", "console_host", "console", "console_type", "console_auto_start", "custom_adapters", "first_port_name", "port_name_format", "port_segment_size"]: + for key in ["x", "y", "z", "locked", "symbol", "label", "console_host", "console", "console_type", "console_auto_start", "aux", "aux_type", "custom_adapters", "first_port_name", "port_name_format", "port_segment_size"]: if key in result: self._settings[key] = result[key] @@ -680,6 +682,16 @@ def consoleHost(self): host = Controller.instance().host() return host + def auxType(self): + """ + Get the auxiliary console type (serial, telnet or VNC) + """ + + aux_type = "none" + if "aux_type" in self.settings(): + return self.settings()["aux_type"] + return aux_type + def setStatus(self, status): """ Overloaded setStatus() method for console auto start. @@ -702,7 +714,7 @@ def openConsole(self, command=None, aux=False): if command is None: if aux: - command = self.consoleCommand(console_type="telnet") + command = self.consoleCommand(console_type=self.auxType()) else: command = self.consoleCommand() @@ -712,8 +724,8 @@ def openConsole(self, command=None, aux=False): console_port = self.auxConsole() if console_port is None: raise ValueError("AUX console port not allocated for {}".format(self.name())) - # AUX console is always telnet - console_type = "telnet" + if "aux_type" in self.settings(): + console_type = self.auxType() else: console_port = self.console() if console_port is None: From c152de84de9b549da01b8a9a4bf4dfa2661091ba Mon Sep 17 00:00:00 2001 From: Jeremy Grossmann Date: Mon, 23 Sep 2024 13:11:23 +0700 Subject: [PATCH 05/12] Revert "Backport auxiliary console support for Qemu, Docker and Dynamips nodes" --- gns3/modules/docker/docker_vm.py | 5 +- .../pages/docker_vm_configuration_page.py | 2 - .../pages/docker_vm_preferences_page.py | 1 - gns3/modules/docker/settings.py | 1 - .../docker/ui/docker_vm_configuration_page.ui | 307 ++++++++---------- .../ui/docker_vm_configuration_page_ui.py | 209 ++++++------ gns3/modules/dynamips/nodes/router.py | 5 +- .../pages/ios_router_configuration_page.py | 8 - .../pages/ios_router_preferences_page.py | 1 - gns3/modules/dynamips/settings.py | 1 - .../ui/ios_router_configuration_page.ui | 283 +++++++--------- .../ui/ios_router_configuration_page_ui.py | 187 +++++------ .../qemu/pages/qemu_vm_configuration_page.py | 5 - .../qemu/pages/qemu_vm_preferences_page.py | 1 - gns3/modules/qemu/qemu_vm.py | 14 +- gns3/modules/qemu/settings.py | 1 - .../qemu/ui/qemu_vm_configuration_page.ui | 250 ++++++-------- .../qemu/ui/qemu_vm_configuration_page_ui.py | 145 ++++----- gns3/node.py | 20 +- 19 files changed, 620 insertions(+), 826 deletions(-) diff --git a/gns3/modules/docker/docker_vm.py b/gns3/modules/docker/docker_vm.py index 0eaeeeec7..8b31b9e55 100644 --- a/gns3/modules/docker/docker_vm.py +++ b/gns3/modules/docker/docker_vm.py @@ -46,7 +46,7 @@ def __init__(self, module, server, project): "custom_adapters": DOCKER_CONTAINER_SETTINGS["custom_adapters"], "start_command": DOCKER_CONTAINER_SETTINGS["start_command"], "environment": DOCKER_CONTAINER_SETTINGS["environment"], - "aux_type": DOCKER_CONTAINER_SETTINGS["aux_type"], + "aux": None, "console_type": DOCKER_CONTAINER_SETTINGS["console_type"], "console_auto_start": DOCKER_CONTAINER_SETTINGS["console_auto_start"], "console_resolution": DOCKER_CONTAINER_SETTINGS["console_resolution"], @@ -69,7 +69,6 @@ def info(self): Local ID is {id} and server ID is {node_id} Docker image is "{image}" Console is on port {console} and type is {console_type} - Aux console is on port {aux} and type is {aux_type} """.format(name=self.name(), id=self.id(), node_id=self._node_id, @@ -78,8 +77,6 @@ def info(self): port=self.compute().port(), console=self._settings["console"], console_type=self._settings["console_type"], - aux=self._settings["aux"], - aux_type=self._settings["aux_type"], image=self._settings["image"]) port_info = "" diff --git a/gns3/modules/docker/pages/docker_vm_configuration_page.py b/gns3/modules/docker/pages/docker_vm_configuration_page.py index 13913572d..9de063d3c 100644 --- a/gns3/modules/docker/pages/docker_vm_configuration_page.py +++ b/gns3/modules/docker/pages/docker_vm_configuration_page.py @@ -112,7 +112,6 @@ def loadSettings(self, settings, node=None, group=False): self.uiEnvironmentTextEdit.setText(settings["environment"]) self.uiConsoleTypeComboBox.setCurrentIndex(self.uiConsoleTypeComboBox.findText(settings["console_type"])) self.uiConsoleAutoStartCheckBox.setChecked(settings["console_auto_start"]) - self.uiAuxTypeComboBox.setCurrentIndex(self.uiAuxTypeComboBox.findText(settings["aux_type"])) self.uiConsoleResolutionComboBox.setCurrentIndex(self.uiConsoleResolutionComboBox.findText(settings["console_resolution"])) self.uiConsoleHttpPortSpinBox.setValue(settings["console_http_port"]) self.uiHttpConsolePathLineEdit.setText(settings["console_http_path"]) @@ -192,7 +191,6 @@ def saveSettings(self, settings, node=None, group=False): settings["environment"] = self.uiEnvironmentTextEdit.toPlainText() settings["console_type"] = self.uiConsoleTypeComboBox.currentText() settings["console_auto_start"] = self.uiConsoleAutoStartCheckBox.isChecked() - settings["aux_type"] = self.uiAuxTypeComboBox.currentText() settings["console_resolution"] = self.uiConsoleResolutionComboBox.currentText() settings["console_http_port"] = self.uiConsoleHttpPortSpinBox.value() settings["console_http_path"] = self.uiHttpConsolePathLineEdit.text() diff --git a/gns3/modules/docker/pages/docker_vm_preferences_page.py b/gns3/modules/docker/pages/docker_vm_preferences_page.py index b088ef5bf..4b69b033b 100644 --- a/gns3/modules/docker/pages/docker_vm_preferences_page.py +++ b/gns3/modules/docker/pages/docker_vm_preferences_page.py @@ -86,7 +86,6 @@ def _refreshInfo(self, docker_container): pass QtWidgets.QTreeWidgetItem(section_item, ["Console type:", str(docker_container["console_type"])]) QtWidgets.QTreeWidgetItem(section_item, ["Auto start console:", "{}".format(docker_container["console_auto_start"])]) - QtWidgets.QTreeWidgetItem(section_item, ["Auxiliary console type:", str(docker_container["aux_type"])]) QtWidgets.QTreeWidgetItem(section_item, ["Default name format:", docker_container["default_name_format"]]) QtWidgets.QTreeWidgetItem(section_item, ["Adapters:", str(docker_container["adapters"])]) if docker_container["start_command"]: diff --git a/gns3/modules/docker/settings.py b/gns3/modules/docker/settings.py index 88d22682c..255b5031f 100644 --- a/gns3/modules/docker/settings.py +++ b/gns3/modules/docker/settings.py @@ -40,7 +40,6 @@ "environment": "", "console_type": "telnet", "console_auto_start": False, - "aux_type": "none", "console_resolution": "1024x768", "console_http_port": 80, "console_http_path": "/", diff --git a/gns3/modules/docker/ui/docker_vm_configuration_page.ui b/gns3/modules/docker/ui/docker_vm_configuration_page.ui index 6a6764932..251c4e530 100644 --- a/gns3/modules/docker/ui/docker_vm_configuration_page.ui +++ b/gns3/modules/docker/ui/docker_vm_configuration_page.ui @@ -24,121 +24,35 @@ General settings - - - - Custom adapters: - - - - - - - 1 - - - - - + + - HTTP port in the container: + Name: - - - - &Configure custom adapters - - + + - - + + - Network configuration - - - - - - - - 2560x1440 - - - - - 1920x1080 - - - - - 1680x1050 - - - - - 1440x900 - - - - - 1366x768 - - - - - 1280x1024 - - - - - 1280x800 - - - - - 1024x768 - - - - - 800x600 - - - - - 640x480 - - - - - - - - 1 - - - 65535 + Default name format - - - - Start command: - - + + - - + + - Console type: + Category - - + + @@ -164,27 +78,27 @@ - - + + - Environment variables: -(KEY=VALUE, one per line) - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - false + Start command: - - + + - - + + - Default name format + Adapters: + + + + + + + 1 @@ -195,6 +109,30 @@ + + + + + + + Custom adapters: + + + + + + + &Configure custom adapters + + + + + + + Console type: + + + @@ -238,81 +176,122 @@ - - - - - + + - HTTP path: + VNC console resolution: - - + + + + + 2560x1440 + + + + + 1920x1080 + + + + + 1680x1050 + + + + + 1440x900 + + + + + 1366x768 + + + + + 1280x1024 + + + + + 1280x800 + + + + + 1024x768 + + + + + 800x600 + + + + + 640x480 + + + - - + + - Adapters: + HTTP port in the container: - - - - Edit + + + + 1 + + + 65535 - - + + - VNC console resolution: + HTTP path: - - - - - + + - - + + - Name: + Environment variables: +(KEY=VALUE, one per line) - - - - - - Category + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + false - + - - - - - telnet - - - - - none - - + + + + Network configuration + - - + + - Auxiliary console type: + Edit diff --git a/gns3/modules/docker/ui/docker_vm_configuration_page_ui.py b/gns3/modules/docker/ui/docker_vm_configuration_page_ui.py index 07c44f8e0..55ab108b1 100644 --- a/gns3/modules/docker/ui/docker_vm_configuration_page_ui.py +++ b/gns3/modules/docker/ui/docker_vm_configuration_page_ui.py @@ -23,49 +23,24 @@ def setupUi(self, dockerVMConfigPageWidget): self.tab.setObjectName("tab") self.gridLayout = QtWidgets.QGridLayout(self.tab) self.gridLayout.setObjectName("gridLayout") - self.uiCustomAdaptersLabel = QtWidgets.QLabel(self.tab) - self.uiCustomAdaptersLabel.setObjectName("uiCustomAdaptersLabel") - self.gridLayout.addWidget(self.uiCustomAdaptersLabel, 7, 0, 1, 1) - self.uiAdapterSpinBox = QtWidgets.QSpinBox(self.tab) - self.uiAdapterSpinBox.setMinimum(1) - self.uiAdapterSpinBox.setObjectName("uiAdapterSpinBox") - self.gridLayout.addWidget(self.uiAdapterSpinBox, 5, 1, 1, 1) - self.label = QtWidgets.QLabel(self.tab) - self.label.setObjectName("label") - self.gridLayout.addWidget(self.label, 11, 0, 1, 1) - self.uiCustomAdaptersConfigurationPushButton = QtWidgets.QPushButton(self.tab) - self.uiCustomAdaptersConfigurationPushButton.setObjectName("uiCustomAdaptersConfigurationPushButton") - self.gridLayout.addWidget(self.uiCustomAdaptersConfigurationPushButton, 7, 1, 1, 1) - self.uiNetworkConfigLabel = QtWidgets.QLabel(self.tab) - self.uiNetworkConfigLabel.setObjectName("uiNetworkConfigLabel") - self.gridLayout.addWidget(self.uiNetworkConfigLabel, 14, 0, 1, 1) - self.uiConsoleResolutionComboBox = QtWidgets.QComboBox(self.tab) - self.uiConsoleResolutionComboBox.setObjectName("uiConsoleResolutionComboBox") - self.uiConsoleResolutionComboBox.addItem("") - self.uiConsoleResolutionComboBox.addItem("") - self.uiConsoleResolutionComboBox.addItem("") - self.uiConsoleResolutionComboBox.addItem("") - self.uiConsoleResolutionComboBox.addItem("") - self.uiConsoleResolutionComboBox.addItem("") - self.uiConsoleResolutionComboBox.addItem("") - self.uiConsoleResolutionComboBox.addItem("") - self.uiConsoleResolutionComboBox.addItem("") - self.uiConsoleResolutionComboBox.addItem("") - self.gridLayout.addWidget(self.uiConsoleResolutionComboBox, 10, 1, 1, 1) - self.uiConsoleHttpPortSpinBox = QtWidgets.QSpinBox(self.tab) - self.uiConsoleHttpPortSpinBox.setMinimum(1) - self.uiConsoleHttpPortSpinBox.setMaximum(65535) - self.uiConsoleHttpPortSpinBox.setObjectName("uiConsoleHttpPortSpinBox") - self.gridLayout.addWidget(self.uiConsoleHttpPortSpinBox, 11, 1, 1, 1) - self.uiCMDLabel = QtWidgets.QLabel(self.tab) - self.uiCMDLabel.setObjectName("uiCMDLabel") - self.gridLayout.addWidget(self.uiCMDLabel, 4, 0, 1, 1) - self.uiConsoleTypeLabel = QtWidgets.QLabel(self.tab) - self.uiConsoleTypeLabel.setObjectName("uiConsoleTypeLabel") - self.gridLayout.addWidget(self.uiConsoleTypeLabel, 8, 0, 1, 1) + self.uiNameLabel = QtWidgets.QLabel(self.tab) + self.uiNameLabel.setObjectName("uiNameLabel") + self.gridLayout.addWidget(self.uiNameLabel, 0, 0, 1, 1) + self.uiNameLineEdit = QtWidgets.QLineEdit(self.tab) + self.uiNameLineEdit.setObjectName("uiNameLineEdit") + self.gridLayout.addWidget(self.uiNameLineEdit, 0, 1, 1, 1) + self.uiDefaultNameFormatLabel = QtWidgets.QLabel(self.tab) + self.uiDefaultNameFormatLabel.setObjectName("uiDefaultNameFormatLabel") + self.gridLayout.addWidget(self.uiDefaultNameFormatLabel, 1, 0, 1, 1) self.uiDefaultNameFormatLineEdit = QtWidgets.QLineEdit(self.tab) self.uiDefaultNameFormatLineEdit.setObjectName("uiDefaultNameFormatLineEdit") self.gridLayout.addWidget(self.uiDefaultNameFormatLineEdit, 1, 1, 1, 1) + self.uiCategoryLabel = QtWidgets.QLabel(self.tab) + self.uiCategoryLabel.setObjectName("uiCategoryLabel") + self.gridLayout.addWidget(self.uiCategoryLabel, 2, 0, 1, 1) + self.uiCategoryComboBox = QtWidgets.QComboBox(self.tab) + self.uiCategoryComboBox.setObjectName("uiCategoryComboBox") + self.gridLayout.addWidget(self.uiCategoryComboBox, 2, 1, 1, 1) self.uiSymbolLabel = QtWidgets.QLabel(self.tab) self.uiSymbolLabel.setObjectName("uiSymbolLabel") self.gridLayout.addWidget(self.uiSymbolLabel, 3, 0, 1, 1) @@ -79,20 +54,34 @@ def setupUi(self, dockerVMConfigPageWidget): self.uiSymbolToolButton.setObjectName("uiSymbolToolButton") self.horizontalLayout_7.addWidget(self.uiSymbolToolButton) self.gridLayout.addLayout(self.horizontalLayout_7, 3, 1, 1, 1) - self.uiEnvironmentLabel = QtWidgets.QLabel(self.tab) - self.uiEnvironmentLabel.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter) - self.uiEnvironmentLabel.setWordWrap(False) - self.uiEnvironmentLabel.setObjectName("uiEnvironmentLabel") - self.gridLayout.addWidget(self.uiEnvironmentLabel, 13, 0, 1, 1) - self.uiEnvironmentTextEdit = QtWidgets.QTextEdit(self.tab) - self.uiEnvironmentTextEdit.setObjectName("uiEnvironmentTextEdit") - self.gridLayout.addWidget(self.uiEnvironmentTextEdit, 13, 1, 1, 1) - self.uiDefaultNameFormatLabel = QtWidgets.QLabel(self.tab) - self.uiDefaultNameFormatLabel.setObjectName("uiDefaultNameFormatLabel") - self.gridLayout.addWidget(self.uiDefaultNameFormatLabel, 1, 0, 1, 1) + self.uiCMDLabel = QtWidgets.QLabel(self.tab) + self.uiCMDLabel.setObjectName("uiCMDLabel") + self.gridLayout.addWidget(self.uiCMDLabel, 4, 0, 1, 1) + self.uiCMDLineEdit = QtWidgets.QLineEdit(self.tab) + self.uiCMDLineEdit.setObjectName("uiCMDLineEdit") + self.gridLayout.addWidget(self.uiCMDLineEdit, 4, 1, 1, 1) + self.uiAdapterLabel = QtWidgets.QLabel(self.tab) + self.uiAdapterLabel.setObjectName("uiAdapterLabel") + self.gridLayout.addWidget(self.uiAdapterLabel, 5, 0, 1, 1) + self.uiAdapterSpinBox = QtWidgets.QSpinBox(self.tab) + self.uiAdapterSpinBox.setMinimum(1) + self.uiAdapterSpinBox.setObjectName("uiAdapterSpinBox") + self.gridLayout.addWidget(self.uiAdapterSpinBox, 5, 1, 1, 1) self.uiMacAddrLabel = QtWidgets.QLabel(self.tab) self.uiMacAddrLabel.setObjectName("uiMacAddrLabel") self.gridLayout.addWidget(self.uiMacAddrLabel, 6, 0, 1, 1) + self.uiMacAddrLineEdit = QtWidgets.QLineEdit(self.tab) + self.uiMacAddrLineEdit.setObjectName("uiMacAddrLineEdit") + self.gridLayout.addWidget(self.uiMacAddrLineEdit, 6, 1, 1, 1) + self.uiCustomAdaptersLabel = QtWidgets.QLabel(self.tab) + self.uiCustomAdaptersLabel.setObjectName("uiCustomAdaptersLabel") + self.gridLayout.addWidget(self.uiCustomAdaptersLabel, 7, 0, 1, 1) + self.uiCustomAdaptersConfigurationPushButton = QtWidgets.QPushButton(self.tab) + self.uiCustomAdaptersConfigurationPushButton.setObjectName("uiCustomAdaptersConfigurationPushButton") + self.gridLayout.addWidget(self.uiCustomAdaptersConfigurationPushButton, 7, 1, 1, 1) + self.uiConsoleTypeLabel = QtWidgets.QLabel(self.tab) + self.uiConsoleTypeLabel.setObjectName("uiConsoleTypeLabel") + self.gridLayout.addWidget(self.uiConsoleTypeLabel, 8, 0, 1, 1) self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setSizeConstraint(QtWidgets.QLayout.SetNoConstraint) self.horizontalLayout.setObjectName("horizontalLayout") @@ -108,47 +97,50 @@ def setupUi(self, dockerVMConfigPageWidget): self.uiConsoleAutoStartCheckBox.setObjectName("uiConsoleAutoStartCheckBox") self.horizontalLayout.addWidget(self.uiConsoleAutoStartCheckBox) self.gridLayout.addLayout(self.horizontalLayout, 8, 1, 1, 1) - self.uiNameLineEdit = QtWidgets.QLineEdit(self.tab) - self.uiNameLineEdit.setObjectName("uiNameLineEdit") - self.gridLayout.addWidget(self.uiNameLineEdit, 0, 1, 1, 1) - self.label_2 = QtWidgets.QLabel(self.tab) - self.label_2.setObjectName("label_2") - self.gridLayout.addWidget(self.label_2, 12, 0, 1, 1) - self.uiCMDLineEdit = QtWidgets.QLineEdit(self.tab) - self.uiCMDLineEdit.setObjectName("uiCMDLineEdit") - self.gridLayout.addWidget(self.uiCMDLineEdit, 4, 1, 1, 1) - self.uiAdapterLabel = QtWidgets.QLabel(self.tab) - self.uiAdapterLabel.setObjectName("uiAdapterLabel") - self.gridLayout.addWidget(self.uiAdapterLabel, 5, 0, 1, 1) - self.uiNetworkConfigEditButton = QtWidgets.QPushButton(self.tab) - self.uiNetworkConfigEditButton.setObjectName("uiNetworkConfigEditButton") - self.gridLayout.addWidget(self.uiNetworkConfigEditButton, 14, 1, 1, 1) self.uiConsoleResolutionLabel = QtWidgets.QLabel(self.tab) self.uiConsoleResolutionLabel.setObjectName("uiConsoleResolutionLabel") - self.gridLayout.addWidget(self.uiConsoleResolutionLabel, 10, 0, 1, 1) - self.uiCategoryComboBox = QtWidgets.QComboBox(self.tab) - self.uiCategoryComboBox.setObjectName("uiCategoryComboBox") - self.gridLayout.addWidget(self.uiCategoryComboBox, 2, 1, 1, 1) - self.uiMacAddrLineEdit = QtWidgets.QLineEdit(self.tab) - self.uiMacAddrLineEdit.setObjectName("uiMacAddrLineEdit") - self.gridLayout.addWidget(self.uiMacAddrLineEdit, 6, 1, 1, 1) - self.uiNameLabel = QtWidgets.QLabel(self.tab) - self.uiNameLabel.setObjectName("uiNameLabel") - self.gridLayout.addWidget(self.uiNameLabel, 0, 0, 1, 1) - self.uiCategoryLabel = QtWidgets.QLabel(self.tab) - self.uiCategoryLabel.setObjectName("uiCategoryLabel") - self.gridLayout.addWidget(self.uiCategoryLabel, 2, 0, 1, 1) + self.gridLayout.addWidget(self.uiConsoleResolutionLabel, 9, 0, 1, 1) + self.uiConsoleResolutionComboBox = QtWidgets.QComboBox(self.tab) + self.uiConsoleResolutionComboBox.setObjectName("uiConsoleResolutionComboBox") + self.uiConsoleResolutionComboBox.addItem("") + self.uiConsoleResolutionComboBox.addItem("") + self.uiConsoleResolutionComboBox.addItem("") + self.uiConsoleResolutionComboBox.addItem("") + self.uiConsoleResolutionComboBox.addItem("") + self.uiConsoleResolutionComboBox.addItem("") + self.uiConsoleResolutionComboBox.addItem("") + self.uiConsoleResolutionComboBox.addItem("") + self.uiConsoleResolutionComboBox.addItem("") + self.uiConsoleResolutionComboBox.addItem("") + self.gridLayout.addWidget(self.uiConsoleResolutionComboBox, 9, 1, 1, 1) + self.label = QtWidgets.QLabel(self.tab) + self.label.setObjectName("label") + self.gridLayout.addWidget(self.label, 10, 0, 1, 1) + self.uiConsoleHttpPortSpinBox = QtWidgets.QSpinBox(self.tab) + self.uiConsoleHttpPortSpinBox.setMinimum(1) + self.uiConsoleHttpPortSpinBox.setMaximum(65535) + self.uiConsoleHttpPortSpinBox.setObjectName("uiConsoleHttpPortSpinBox") + self.gridLayout.addWidget(self.uiConsoleHttpPortSpinBox, 10, 1, 1, 1) + self.label_2 = QtWidgets.QLabel(self.tab) + self.label_2.setObjectName("label_2") + self.gridLayout.addWidget(self.label_2, 11, 0, 1, 1) self.uiHttpConsolePathLineEdit = QtWidgets.QLineEdit(self.tab) self.uiHttpConsolePathLineEdit.setObjectName("uiHttpConsolePathLineEdit") - self.gridLayout.addWidget(self.uiHttpConsolePathLineEdit, 12, 1, 1, 1) - self.uiAuxTypeComboBox = QtWidgets.QComboBox(self.tab) - self.uiAuxTypeComboBox.setObjectName("uiAuxTypeComboBox") - self.uiAuxTypeComboBox.addItem("") - self.uiAuxTypeComboBox.addItem("") - self.gridLayout.addWidget(self.uiAuxTypeComboBox, 9, 1, 1, 1) - self.uiAuxTypeLabel = QtWidgets.QLabel(self.tab) - self.uiAuxTypeLabel.setObjectName("uiAuxTypeLabel") - self.gridLayout.addWidget(self.uiAuxTypeLabel, 9, 0, 1, 1) + self.gridLayout.addWidget(self.uiHttpConsolePathLineEdit, 11, 1, 1, 1) + self.uiEnvironmentLabel = QtWidgets.QLabel(self.tab) + self.uiEnvironmentLabel.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter) + self.uiEnvironmentLabel.setWordWrap(False) + self.uiEnvironmentLabel.setObjectName("uiEnvironmentLabel") + self.gridLayout.addWidget(self.uiEnvironmentLabel, 12, 0, 1, 1) + self.uiEnvironmentTextEdit = QtWidgets.QTextEdit(self.tab) + self.uiEnvironmentTextEdit.setObjectName("uiEnvironmentTextEdit") + self.gridLayout.addWidget(self.uiEnvironmentTextEdit, 12, 1, 1, 1) + self.uiNetworkConfigLabel = QtWidgets.QLabel(self.tab) + self.uiNetworkConfigLabel.setObjectName("uiNetworkConfigLabel") + self.gridLayout.addWidget(self.uiNetworkConfigLabel, 13, 0, 1, 1) + self.uiNetworkConfigEditButton = QtWidgets.QPushButton(self.tab) + self.uiNetworkConfigEditButton.setObjectName("uiNetworkConfigEditButton") + self.gridLayout.addWidget(self.uiNetworkConfigEditButton, 13, 1, 1, 1) self.uiTabWidget.addTab(self.tab, "") self.tab_2 = QtWidgets.QWidget() self.tab_2.setObjectName("tab_2") @@ -193,10 +185,24 @@ def setupUi(self, dockerVMConfigPageWidget): def retranslateUi(self, dockerVMConfigPageWidget): _translate = QtCore.QCoreApplication.translate dockerVMConfigPageWidget.setWindowTitle(_translate("dockerVMConfigPageWidget", "Docker container template configuration")) + self.uiNameLabel.setText(_translate("dockerVMConfigPageWidget", "Name:")) + self.uiDefaultNameFormatLabel.setText(_translate("dockerVMConfigPageWidget", "Default name format")) + self.uiCategoryLabel.setText(_translate("dockerVMConfigPageWidget", "Category")) + self.uiSymbolLabel.setText(_translate("dockerVMConfigPageWidget", "Symbol:")) + self.uiSymbolToolButton.setText(_translate("dockerVMConfigPageWidget", "&Browse...")) + self.uiCMDLabel.setText(_translate("dockerVMConfigPageWidget", "Start command:")) + self.uiAdapterLabel.setText(_translate("dockerVMConfigPageWidget", "Adapters:")) + self.uiMacAddrLabel.setText(_translate("dockerVMConfigPageWidget", "Base MAC:")) self.uiCustomAdaptersLabel.setText(_translate("dockerVMConfigPageWidget", "Custom adapters:")) - self.label.setText(_translate("dockerVMConfigPageWidget", "HTTP port in the container:")) self.uiCustomAdaptersConfigurationPushButton.setText(_translate("dockerVMConfigPageWidget", "&Configure custom adapters")) - self.uiNetworkConfigLabel.setText(_translate("dockerVMConfigPageWidget", "Network configuration")) + self.uiConsoleTypeLabel.setText(_translate("dockerVMConfigPageWidget", "Console type:")) + self.uiConsoleTypeComboBox.setItemText(0, _translate("dockerVMConfigPageWidget", "telnet")) + self.uiConsoleTypeComboBox.setItemText(1, _translate("dockerVMConfigPageWidget", "vnc")) + self.uiConsoleTypeComboBox.setItemText(2, _translate("dockerVMConfigPageWidget", "http")) + self.uiConsoleTypeComboBox.setItemText(3, _translate("dockerVMConfigPageWidget", "https")) + self.uiConsoleTypeComboBox.setItemText(4, _translate("dockerVMConfigPageWidget", "none")) + self.uiConsoleAutoStartCheckBox.setText(_translate("dockerVMConfigPageWidget", "Auto start console")) + self.uiConsoleResolutionLabel.setText(_translate("dockerVMConfigPageWidget", "VNC console resolution:")) self.uiConsoleResolutionComboBox.setItemText(0, _translate("dockerVMConfigPageWidget", "2560x1440")) self.uiConsoleResolutionComboBox.setItemText(1, _translate("dockerVMConfigPageWidget", "1920x1080")) self.uiConsoleResolutionComboBox.setItemText(2, _translate("dockerVMConfigPageWidget", "1680x1050")) @@ -207,29 +213,12 @@ def retranslateUi(self, dockerVMConfigPageWidget): self.uiConsoleResolutionComboBox.setItemText(7, _translate("dockerVMConfigPageWidget", "1024x768")) self.uiConsoleResolutionComboBox.setItemText(8, _translate("dockerVMConfigPageWidget", "800x600")) self.uiConsoleResolutionComboBox.setItemText(9, _translate("dockerVMConfigPageWidget", "640x480")) - self.uiCMDLabel.setText(_translate("dockerVMConfigPageWidget", "Start command:")) - self.uiConsoleTypeLabel.setText(_translate("dockerVMConfigPageWidget", "Console type:")) - self.uiSymbolLabel.setText(_translate("dockerVMConfigPageWidget", "Symbol:")) - self.uiSymbolToolButton.setText(_translate("dockerVMConfigPageWidget", "&Browse...")) + self.label.setText(_translate("dockerVMConfigPageWidget", "HTTP port in the container:")) + self.label_2.setText(_translate("dockerVMConfigPageWidget", "HTTP path:")) self.uiEnvironmentLabel.setText(_translate("dockerVMConfigPageWidget", "Environment variables:\n" "(KEY=VALUE, one per line)")) - self.uiDefaultNameFormatLabel.setText(_translate("dockerVMConfigPageWidget", "Default name format")) - self.uiMacAddrLabel.setText(_translate("dockerVMConfigPageWidget", "Base MAC:")) - self.uiConsoleTypeComboBox.setItemText(0, _translate("dockerVMConfigPageWidget", "telnet")) - self.uiConsoleTypeComboBox.setItemText(1, _translate("dockerVMConfigPageWidget", "vnc")) - self.uiConsoleTypeComboBox.setItemText(2, _translate("dockerVMConfigPageWidget", "http")) - self.uiConsoleTypeComboBox.setItemText(3, _translate("dockerVMConfigPageWidget", "https")) - self.uiConsoleTypeComboBox.setItemText(4, _translate("dockerVMConfigPageWidget", "none")) - self.uiConsoleAutoStartCheckBox.setText(_translate("dockerVMConfigPageWidget", "Auto start console")) - self.label_2.setText(_translate("dockerVMConfigPageWidget", "HTTP path:")) - self.uiAdapterLabel.setText(_translate("dockerVMConfigPageWidget", "Adapters:")) + self.uiNetworkConfigLabel.setText(_translate("dockerVMConfigPageWidget", "Network configuration")) self.uiNetworkConfigEditButton.setText(_translate("dockerVMConfigPageWidget", "Edit")) - self.uiConsoleResolutionLabel.setText(_translate("dockerVMConfigPageWidget", "VNC console resolution:")) - self.uiNameLabel.setText(_translate("dockerVMConfigPageWidget", "Name:")) - self.uiCategoryLabel.setText(_translate("dockerVMConfigPageWidget", "Category")) - self.uiAuxTypeComboBox.setItemText(0, _translate("dockerVMConfigPageWidget", "telnet")) - self.uiAuxTypeComboBox.setItemText(1, _translate("dockerVMConfigPageWidget", "none")) - self.uiAuxTypeLabel.setText(_translate("dockerVMConfigPageWidget", "Auxiliary console type:")) self.uiTabWidget.setTabText(self.uiTabWidget.indexOf(self.tab), _translate("dockerVMConfigPageWidget", "General settings")) self.uiExtraHostsLabel.setText(_translate("dockerVMConfigPageWidget", "Extra hosts added\n" "to the /etc/hosts file.\n" diff --git a/gns3/modules/dynamips/nodes/router.py b/gns3/modules/dynamips/nodes/router.py index 35c1b71b9..21741792c 100644 --- a/gns3/modules/dynamips/nodes/router.py +++ b/gns3/modules/dynamips/nodes/router.py @@ -71,7 +71,6 @@ def __init__(self, module, server, project, platform="c7200"): "console_type": "telnet", "console_auto_start": False, "aux": None, - "aux_type": "none", "mac_addr": None, "system_id": "FTX0945W0MY", "slot0": None, @@ -243,8 +242,7 @@ def info(self): Local ID is {id} and server ID is {node_id} Dynamips ID is {dynamips_id} Hardware is Dynamips emulated Cisco {platform} {specific_info} with {ram}MB RAM and {nvram}KB NVRAM - Console is on port {console} and type is {console_type} - Auxiliary console is on port {aux} and type is {aux_type} + Console is on port {console} and type is {console_type}, AUX console is on port {aux} IOS image is "{image_name}" {idlepc_info} PCMCIA disks: disk0 is {disk0}MB and disk1 is {disk1}MB @@ -262,7 +260,6 @@ def info(self): console=self._settings["console"], console_type=self._settings["console_type"], aux=self._settings["aux"], - aux_type=self._settings["aux_type"], image_name=os.path.basename(self._settings["image"]), idlepc_info=idlepc_info, disk0=self._settings["disk0"], diff --git a/gns3/modules/dynamips/pages/ios_router_configuration_page.py b/gns3/modules/dynamips/pages/ios_router_configuration_page.py index b2afdfdfe..12fccab6f 100644 --- a/gns3/modules/dynamips/pages/ios_router_configuration_page.py +++ b/gns3/modules/dynamips/pages/ios_router_configuration_page.py @@ -375,11 +375,6 @@ def loadSettings(self, settings, node=None, group=False): self.uiConsoleAutoStartCheckBox.setChecked(settings["console_auto_start"]) - # load the auxiliary console type - index = self.uiAuxTypeComboBox.findText(settings["aux_type"]) - if index != -1: - self.uiAuxTypeComboBox.setCurrentIndex(index) - # load the memories and disks settings self.uiRamSpinBox.setValue(settings["ram"]) self.uiNvramSpinBox.setValue(settings["nvram"]) @@ -585,9 +580,6 @@ def saveSettings(self, settings, node=None, group=False): settings["console_type"] = self.uiConsoleTypeComboBox.currentText().lower() settings["console_auto_start"] = self.uiConsoleAutoStartCheckBox.isChecked() - # save auxiliary console type - settings["aux_type"] = self.uiAuxTypeComboBox.currentText().lower() - # save the memories and disks settings settings["ram"] = self.uiRamSpinBox.value() settings["nvram"] = self.uiNvramSpinBox.value() diff --git a/gns3/modules/dynamips/pages/ios_router_preferences_page.py b/gns3/modules/dynamips/pages/ios_router_preferences_page.py index 45140c0a7..58c36d0d1 100644 --- a/gns3/modules/dynamips/pages/ios_router_preferences_page.py +++ b/gns3/modules/dynamips/pages/ios_router_preferences_page.py @@ -395,7 +395,6 @@ def _refreshInfo(self, ios_router): QtWidgets.QTreeWidgetItem(section_item, ["Image:", ios_router["image"]]) QtWidgets.QTreeWidgetItem(section_item, ["Console type:", ios_router["console_type"]]) QtWidgets.QTreeWidgetItem(section_item, ["Auto start console:", "{}".format(ios_router["console_auto_start"])]) - QtWidgets.QTreeWidgetItem(section_item, ["Auxiliary console type:", ios_router["aux_type"]]) if ios_router["idlepc"]: QtWidgets.QTreeWidgetItem(section_item, ["Idle-PC:", ios_router["idlepc"]]) if ios_router["startup_config"]: diff --git a/gns3/modules/dynamips/settings.py b/gns3/modules/dynamips/settings.py index 021faa972..27ab13de8 100644 --- a/gns3/modules/dynamips/settings.py +++ b/gns3/modules/dynamips/settings.py @@ -40,7 +40,6 @@ "private_config": "", "console_type": "telnet", "console_auto_start": False, - "aux_type": "none", "platform": "", "idlepc": "", "idlemax": 500, diff --git a/gns3/modules/dynamips/ui/ios_router_configuration_page.ui b/gns3/modules/dynamips/ui/ios_router_configuration_page.ui index 764c1923a..d9a285249 100755 --- a/gns3/modules/dynamips/ui/ios_router_configuration_page.ui +++ b/gns3/modules/dynamips/ui/ios_router_configuration_page.ui @@ -6,8 +6,8 @@ 0 0 - 600 - 601 + 980 + 734 @@ -24,37 +24,26 @@ General - - - - - - - - - &Browse... - - - Qt::ToolButtonTextOnly - - - - - - - + + - + Name: - - + + + + + - IOS image path: + Default name format: + + + @@ -62,13 +51,24 @@ - - + + + + + + - - + + - Console type: + Chassis: + + + + + + + @@ -79,36 +79,37 @@ - - + + + + + + + + + &Browse... + + + Qt::ToolButtonTextOnly + + + + + + + - Initial private-config: + Category: - - - - true - - - - 0 - 0 - - - + + - - - - true - - - - 0 - 0 - + + + + IOS image path: @@ -129,13 +130,6 @@ - - - - NPE: - - - @@ -143,17 +137,27 @@ - - - - Name: - - + + + + + + + + + &Browse... + + + Qt::ToolButtonTextOnly + + + + - - + + - Chassis: + Initial private-config: @@ -174,50 +178,53 @@ - - + + - + Midplane: - - + + + + true + + + + 0 + 0 + + + - - + + - Midplane: + NPE: - - - - - - - - - &Browse... - - - Qt::ToolButtonTextOnly - - - - + + + + true + + + + 0 + 0 + + + - - + + - Default name format: + Console type: - - - @@ -243,14 +250,7 @@ - - - - Category: - - - - + Qt::Vertical @@ -263,27 +263,6 @@ - - - - - telnet - - - - - none - - - - - - - - Auxiliary console type: - - - @@ -291,16 +270,7 @@ Memories and disks - - 10 - - - 10 - - - 10 - - + 10 @@ -478,16 +448,7 @@ Slots - - 10 - - - 10 - - - 10 - - + 10 @@ -688,16 +649,7 @@ Advanced - - 10 - - - 10 - - - 10 - - + 10 @@ -876,16 +828,7 @@ Environment - - 10 - - - 10 - - - 10 - - + 10 diff --git a/gns3/modules/dynamips/ui/ios_router_configuration_page_ui.py b/gns3/modules/dynamips/ui/ios_router_configuration_page_ui.py index afa78f474..4042eeeef 100644 --- a/gns3/modules/dynamips/ui/ios_router_configuration_page_ui.py +++ b/gns3/modules/dynamips/ui/ios_router_configuration_page_ui.py @@ -2,19 +2,16 @@ # Form implementation generated from reading ui file '/home/grossmj/PycharmProjects/gns3-gui/gns3/modules/dynamips/ui/ios_router_configuration_page.ui' # -# Created by: PyQt5 UI code generator 5.15.6 +# Created by: PyQt5 UI code generator 5.11.3 # -# WARNING: Any manual changes made to this file will be lost when pyuic5 is -# run again. Do not edit this file unless you know what you are doing. - +# WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets - class Ui_iosRouterConfigPageWidget(object): def setupUi(self, iosRouterConfigPageWidget): iosRouterConfigPageWidget.setObjectName("iosRouterConfigPageWidget") - iosRouterConfigPageWidget.resize(600, 601) + iosRouterConfigPageWidget.resize(980, 734) self.vboxlayout = QtWidgets.QVBoxLayout(iosRouterConfigPageWidget) self.vboxlayout.setObjectName("vboxlayout") self.uiTabWidget = QtWidgets.QTabWidget(iosRouterConfigPageWidget) @@ -23,6 +20,35 @@ def setupUi(self, iosRouterConfigPageWidget): self.uiGeneralPageWidget.setObjectName("uiGeneralPageWidget") self.gridLayout_2 = QtWidgets.QGridLayout(self.uiGeneralPageWidget) self.gridLayout_2.setObjectName("gridLayout_2") + self.uiNameLabel = QtWidgets.QLabel(self.uiGeneralPageWidget) + self.uiNameLabel.setObjectName("uiNameLabel") + self.gridLayout_2.addWidget(self.uiNameLabel, 0, 0, 1, 1) + self.uiNameLineEdit = QtWidgets.QLineEdit(self.uiGeneralPageWidget) + self.uiNameLineEdit.setObjectName("uiNameLineEdit") + self.gridLayout_2.addWidget(self.uiNameLineEdit, 0, 2, 1, 1) + self.uiDefaultNameFormatLabel = QtWidgets.QLabel(self.uiGeneralPageWidget) + self.uiDefaultNameFormatLabel.setObjectName("uiDefaultNameFormatLabel") + self.gridLayout_2.addWidget(self.uiDefaultNameFormatLabel, 1, 0, 1, 2) + self.uiDefaultNameFormatLineEdit = QtWidgets.QLineEdit(self.uiGeneralPageWidget) + self.uiDefaultNameFormatLineEdit.setObjectName("uiDefaultNameFormatLineEdit") + self.gridLayout_2.addWidget(self.uiDefaultNameFormatLineEdit, 1, 2, 1, 1) + self.uiPlatformLabel = QtWidgets.QLabel(self.uiGeneralPageWidget) + self.uiPlatformLabel.setObjectName("uiPlatformLabel") + self.gridLayout_2.addWidget(self.uiPlatformLabel, 2, 0, 1, 1) + self.uiPlatformTextLabel = QtWidgets.QLabel(self.uiGeneralPageWidget) + self.uiPlatformTextLabel.setText("") + self.uiPlatformTextLabel.setObjectName("uiPlatformTextLabel") + self.gridLayout_2.addWidget(self.uiPlatformTextLabel, 2, 2, 1, 1) + self.uiChassisLabel = QtWidgets.QLabel(self.uiGeneralPageWidget) + self.uiChassisLabel.setObjectName("uiChassisLabel") + self.gridLayout_2.addWidget(self.uiChassisLabel, 3, 0, 1, 1) + self.uiChassisTextLabel = QtWidgets.QLabel(self.uiGeneralPageWidget) + self.uiChassisTextLabel.setText("") + self.uiChassisTextLabel.setObjectName("uiChassisTextLabel") + self.gridLayout_2.addWidget(self.uiChassisTextLabel, 3, 2, 1, 1) + self.uiSymbolLabel = QtWidgets.QLabel(self.uiGeneralPageWidget) + self.uiSymbolLabel.setObjectName("uiSymbolLabel") + self.gridLayout_2.addWidget(self.uiSymbolLabel, 4, 0, 1, 1) self.horizontalLayout_7 = QtWidgets.QHBoxLayout() self.horizontalLayout_7.setObjectName("horizontalLayout_7") self.uiSymbolLineEdit = QtWidgets.QLineEdit(self.uiGeneralPageWidget) @@ -33,46 +59,15 @@ def setupUi(self, iosRouterConfigPageWidget): self.uiSymbolToolButton.setObjectName("uiSymbolToolButton") self.horizontalLayout_7.addWidget(self.uiSymbolToolButton) self.gridLayout_2.addLayout(self.horizontalLayout_7, 4, 2, 1, 1) - self.uiPlatformTextLabel = QtWidgets.QLabel(self.uiGeneralPageWidget) - self.uiPlatformTextLabel.setText("") - self.uiPlatformTextLabel.setObjectName("uiPlatformTextLabel") - self.gridLayout_2.addWidget(self.uiPlatformTextLabel, 2, 2, 1, 1) + self.uiCategoryLabel = QtWidgets.QLabel(self.uiGeneralPageWidget) + self.uiCategoryLabel.setObjectName("uiCategoryLabel") + self.gridLayout_2.addWidget(self.uiCategoryLabel, 5, 0, 1, 1) + self.uiCategoryComboBox = QtWidgets.QComboBox(self.uiGeneralPageWidget) + self.uiCategoryComboBox.setObjectName("uiCategoryComboBox") + self.gridLayout_2.addWidget(self.uiCategoryComboBox, 5, 2, 1, 1) self.uiIOSImageLabel = QtWidgets.QLabel(self.uiGeneralPageWidget) self.uiIOSImageLabel.setObjectName("uiIOSImageLabel") self.gridLayout_2.addWidget(self.uiIOSImageLabel, 6, 0, 1, 2) - self.uiPlatformLabel = QtWidgets.QLabel(self.uiGeneralPageWidget) - self.uiPlatformLabel.setObjectName("uiPlatformLabel") - self.gridLayout_2.addWidget(self.uiPlatformLabel, 2, 0, 1, 1) - self.uiNameLineEdit = QtWidgets.QLineEdit(self.uiGeneralPageWidget) - self.uiNameLineEdit.setObjectName("uiNameLineEdit") - self.gridLayout_2.addWidget(self.uiNameLineEdit, 0, 2, 1, 1) - self.uiConsoleTypeLabel = QtWidgets.QLabel(self.uiGeneralPageWidget) - self.uiConsoleTypeLabel.setObjectName("uiConsoleTypeLabel") - self.gridLayout_2.addWidget(self.uiConsoleTypeLabel, 11, 0, 1, 2) - self.uiSymbolLabel = QtWidgets.QLabel(self.uiGeneralPageWidget) - self.uiSymbolLabel.setObjectName("uiSymbolLabel") - self.gridLayout_2.addWidget(self.uiSymbolLabel, 4, 0, 1, 1) - self.uiPrivateConfigLabel = QtWidgets.QLabel(self.uiGeneralPageWidget) - self.uiPrivateConfigLabel.setObjectName("uiPrivateConfigLabel") - self.gridLayout_2.addWidget(self.uiPrivateConfigLabel, 8, 0, 1, 2) - self.uiMidplaneComboBox = QtWidgets.QComboBox(self.uiGeneralPageWidget) - self.uiMidplaneComboBox.setEnabled(True) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.uiMidplaneComboBox.sizePolicy().hasHeightForWidth()) - self.uiMidplaneComboBox.setSizePolicy(sizePolicy) - self.uiMidplaneComboBox.setObjectName("uiMidplaneComboBox") - self.gridLayout_2.addWidget(self.uiMidplaneComboBox, 9, 2, 1, 1) - self.uiNPEComboBox = QtWidgets.QComboBox(self.uiGeneralPageWidget) - self.uiNPEComboBox.setEnabled(True) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.uiNPEComboBox.sizePolicy().hasHeightForWidth()) - self.uiNPEComboBox.setSizePolicy(sizePolicy) - self.uiNPEComboBox.setObjectName("uiNPEComboBox") - self.gridLayout_2.addWidget(self.uiNPEComboBox, 10, 2, 1, 1) self.horizontalLayout_5 = QtWidgets.QHBoxLayout() self.horizontalLayout_5.setObjectName("horizontalLayout_5") self.uiIOSImageLineEdit = QtWidgets.QLineEdit(self.uiGeneralPageWidget) @@ -83,18 +78,22 @@ def setupUi(self, iosRouterConfigPageWidget): self.uiIOSImageToolButton.setObjectName("uiIOSImageToolButton") self.horizontalLayout_5.addWidget(self.uiIOSImageToolButton) self.gridLayout_2.addLayout(self.horizontalLayout_5, 6, 2, 1, 1) - self.uiNPELabel = QtWidgets.QLabel(self.uiGeneralPageWidget) - self.uiNPELabel.setObjectName("uiNPELabel") - self.gridLayout_2.addWidget(self.uiNPELabel, 10, 0, 1, 1) self.uiStartupConfigLabel = QtWidgets.QLabel(self.uiGeneralPageWidget) self.uiStartupConfigLabel.setObjectName("uiStartupConfigLabel") self.gridLayout_2.addWidget(self.uiStartupConfigLabel, 7, 0, 1, 2) - self.uiNameLabel = QtWidgets.QLabel(self.uiGeneralPageWidget) - self.uiNameLabel.setObjectName("uiNameLabel") - self.gridLayout_2.addWidget(self.uiNameLabel, 0, 0, 1, 1) - self.uiChassisLabel = QtWidgets.QLabel(self.uiGeneralPageWidget) - self.uiChassisLabel.setObjectName("uiChassisLabel") - self.gridLayout_2.addWidget(self.uiChassisLabel, 3, 0, 1, 1) + self.horizontalLayout_4 = QtWidgets.QHBoxLayout() + self.horizontalLayout_4.setObjectName("horizontalLayout_4") + self.uiStartupConfigLineEdit = QtWidgets.QLineEdit(self.uiGeneralPageWidget) + self.uiStartupConfigLineEdit.setObjectName("uiStartupConfigLineEdit") + self.horizontalLayout_4.addWidget(self.uiStartupConfigLineEdit) + self.uiStartupConfigToolButton = QtWidgets.QToolButton(self.uiGeneralPageWidget) + self.uiStartupConfigToolButton.setToolButtonStyle(QtCore.Qt.ToolButtonTextOnly) + self.uiStartupConfigToolButton.setObjectName("uiStartupConfigToolButton") + self.horizontalLayout_4.addWidget(self.uiStartupConfigToolButton) + self.gridLayout_2.addLayout(self.horizontalLayout_4, 7, 2, 1, 1) + self.uiPrivateConfigLabel = QtWidgets.QLabel(self.uiGeneralPageWidget) + self.uiPrivateConfigLabel.setObjectName("uiPrivateConfigLabel") + self.gridLayout_2.addWidget(self.uiPrivateConfigLabel, 8, 0, 1, 2) self.horizontalLayout_6 = QtWidgets.QHBoxLayout() self.horizontalLayout_6.setObjectName("horizontalLayout_6") self.uiPrivateConfigLineEdit = QtWidgets.QLineEdit(self.uiGeneralPageWidget) @@ -105,32 +104,33 @@ def setupUi(self, iosRouterConfigPageWidget): self.uiPrivateConfigToolButton.setObjectName("uiPrivateConfigToolButton") self.horizontalLayout_6.addWidget(self.uiPrivateConfigToolButton) self.gridLayout_2.addLayout(self.horizontalLayout_6, 8, 2, 1, 1) - self.uiChassisTextLabel = QtWidgets.QLabel(self.uiGeneralPageWidget) - self.uiChassisTextLabel.setText("") - self.uiChassisTextLabel.setObjectName("uiChassisTextLabel") - self.gridLayout_2.addWidget(self.uiChassisTextLabel, 3, 2, 1, 1) - self.uiCategoryComboBox = QtWidgets.QComboBox(self.uiGeneralPageWidget) - self.uiCategoryComboBox.setObjectName("uiCategoryComboBox") - self.gridLayout_2.addWidget(self.uiCategoryComboBox, 5, 2, 1, 1) self.uiMidplaneLabel = QtWidgets.QLabel(self.uiGeneralPageWidget) self.uiMidplaneLabel.setObjectName("uiMidplaneLabel") self.gridLayout_2.addWidget(self.uiMidplaneLabel, 9, 0, 1, 1) - self.horizontalLayout_4 = QtWidgets.QHBoxLayout() - self.horizontalLayout_4.setObjectName("horizontalLayout_4") - self.uiStartupConfigLineEdit = QtWidgets.QLineEdit(self.uiGeneralPageWidget) - self.uiStartupConfigLineEdit.setObjectName("uiStartupConfigLineEdit") - self.horizontalLayout_4.addWidget(self.uiStartupConfigLineEdit) - self.uiStartupConfigToolButton = QtWidgets.QToolButton(self.uiGeneralPageWidget) - self.uiStartupConfigToolButton.setToolButtonStyle(QtCore.Qt.ToolButtonTextOnly) - self.uiStartupConfigToolButton.setObjectName("uiStartupConfigToolButton") - self.horizontalLayout_4.addWidget(self.uiStartupConfigToolButton) - self.gridLayout_2.addLayout(self.horizontalLayout_4, 7, 2, 1, 1) - self.uiDefaultNameFormatLabel = QtWidgets.QLabel(self.uiGeneralPageWidget) - self.uiDefaultNameFormatLabel.setObjectName("uiDefaultNameFormatLabel") - self.gridLayout_2.addWidget(self.uiDefaultNameFormatLabel, 1, 0, 1, 2) - self.uiDefaultNameFormatLineEdit = QtWidgets.QLineEdit(self.uiGeneralPageWidget) - self.uiDefaultNameFormatLineEdit.setObjectName("uiDefaultNameFormatLineEdit") - self.gridLayout_2.addWidget(self.uiDefaultNameFormatLineEdit, 1, 2, 1, 1) + self.uiMidplaneComboBox = QtWidgets.QComboBox(self.uiGeneralPageWidget) + self.uiMidplaneComboBox.setEnabled(True) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.uiMidplaneComboBox.sizePolicy().hasHeightForWidth()) + self.uiMidplaneComboBox.setSizePolicy(sizePolicy) + self.uiMidplaneComboBox.setObjectName("uiMidplaneComboBox") + self.gridLayout_2.addWidget(self.uiMidplaneComboBox, 9, 2, 1, 1) + self.uiNPELabel = QtWidgets.QLabel(self.uiGeneralPageWidget) + self.uiNPELabel.setObjectName("uiNPELabel") + self.gridLayout_2.addWidget(self.uiNPELabel, 10, 0, 1, 1) + self.uiNPEComboBox = QtWidgets.QComboBox(self.uiGeneralPageWidget) + self.uiNPEComboBox.setEnabled(True) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.uiNPEComboBox.sizePolicy().hasHeightForWidth()) + self.uiNPEComboBox.setSizePolicy(sizePolicy) + self.uiNPEComboBox.setObjectName("uiNPEComboBox") + self.gridLayout_2.addWidget(self.uiNPEComboBox, 10, 2, 1, 1) + self.uiConsoleTypeLabel = QtWidgets.QLabel(self.uiGeneralPageWidget) + self.uiConsoleTypeLabel.setObjectName("uiConsoleTypeLabel") + self.gridLayout_2.addWidget(self.uiConsoleTypeLabel, 11, 0, 1, 2) self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") self.uiConsoleTypeComboBox = QtWidgets.QComboBox(self.uiGeneralPageWidget) @@ -142,19 +142,8 @@ def setupUi(self, iosRouterConfigPageWidget): self.uiConsoleAutoStartCheckBox.setObjectName("uiConsoleAutoStartCheckBox") self.horizontalLayout.addWidget(self.uiConsoleAutoStartCheckBox) self.gridLayout_2.addLayout(self.horizontalLayout, 11, 2, 1, 1) - self.uiCategoryLabel = QtWidgets.QLabel(self.uiGeneralPageWidget) - self.uiCategoryLabel.setObjectName("uiCategoryLabel") - self.gridLayout_2.addWidget(self.uiCategoryLabel, 5, 0, 1, 1) spacerItem = QtWidgets.QSpacerItem(263, 151, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) - self.gridLayout_2.addItem(spacerItem, 13, 0, 1, 3) - self.uiAuxTypeComboBox = QtWidgets.QComboBox(self.uiGeneralPageWidget) - self.uiAuxTypeComboBox.setObjectName("uiAuxTypeComboBox") - self.uiAuxTypeComboBox.addItem("") - self.uiAuxTypeComboBox.addItem("") - self.gridLayout_2.addWidget(self.uiAuxTypeComboBox, 12, 2, 1, 1) - self.uiAuxTypeLabel = QtWidgets.QLabel(self.uiGeneralPageWidget) - self.uiAuxTypeLabel.setObjectName("uiAuxTypeLabel") - self.gridLayout_2.addWidget(self.uiAuxTypeLabel, 12, 0, 1, 2) + self.gridLayout_2.addItem(spacerItem, 12, 1, 1, 2) self.uiTabWidget.addTab(self.uiGeneralPageWidget, "") self.uiMemoriesPageWidget = QtWidgets.QWidget() self.uiMemoriesPageWidget.setObjectName("uiMemoriesPageWidget") @@ -574,28 +563,25 @@ def setupUi(self, iosRouterConfigPageWidget): def retranslateUi(self, iosRouterConfigPageWidget): _translate = QtCore.QCoreApplication.translate iosRouterConfigPageWidget.setWindowTitle(_translate("iosRouterConfigPageWidget", "Dynamips IOS router template configuration")) - self.uiSymbolToolButton.setText(_translate("iosRouterConfigPageWidget", "&Browse...")) - self.uiIOSImageLabel.setText(_translate("iosRouterConfigPageWidget", "IOS image path:")) + self.uiNameLabel.setText(_translate("iosRouterConfigPageWidget", "Name:")) + self.uiDefaultNameFormatLabel.setText(_translate("iosRouterConfigPageWidget", "Default name format:")) self.uiPlatformLabel.setText(_translate("iosRouterConfigPageWidget", "Platform:")) - self.uiConsoleTypeLabel.setText(_translate("iosRouterConfigPageWidget", "Console type:")) + self.uiChassisLabel.setText(_translate("iosRouterConfigPageWidget", "Chassis:")) self.uiSymbolLabel.setText(_translate("iosRouterConfigPageWidget", "Symbol:")) - self.uiPrivateConfigLabel.setText(_translate("iosRouterConfigPageWidget", "Initial private-config:")) + self.uiSymbolToolButton.setText(_translate("iosRouterConfigPageWidget", "&Browse...")) + self.uiCategoryLabel.setText(_translate("iosRouterConfigPageWidget", "Category:")) + self.uiIOSImageLabel.setText(_translate("iosRouterConfigPageWidget", "IOS image path:")) self.uiIOSImageToolButton.setText(_translate("iosRouterConfigPageWidget", "&Browse...")) - self.uiNPELabel.setText(_translate("iosRouterConfigPageWidget", "NPE:")) self.uiStartupConfigLabel.setText(_translate("iosRouterConfigPageWidget", "Initial startup-config:")) - self.uiNameLabel.setText(_translate("iosRouterConfigPageWidget", "Name:")) - self.uiChassisLabel.setText(_translate("iosRouterConfigPageWidget", "Chassis:")) + self.uiStartupConfigToolButton.setText(_translate("iosRouterConfigPageWidget", "&Browse...")) + self.uiPrivateConfigLabel.setText(_translate("iosRouterConfigPageWidget", "Initial private-config:")) self.uiPrivateConfigToolButton.setText(_translate("iosRouterConfigPageWidget", "&Browse...")) self.uiMidplaneLabel.setText(_translate("iosRouterConfigPageWidget", "Midplane:")) - self.uiStartupConfigToolButton.setText(_translate("iosRouterConfigPageWidget", "&Browse...")) - self.uiDefaultNameFormatLabel.setText(_translate("iosRouterConfigPageWidget", "Default name format:")) + self.uiNPELabel.setText(_translate("iosRouterConfigPageWidget", "NPE:")) + self.uiConsoleTypeLabel.setText(_translate("iosRouterConfigPageWidget", "Console type:")) self.uiConsoleTypeComboBox.setItemText(0, _translate("iosRouterConfigPageWidget", "telnet")) self.uiConsoleTypeComboBox.setItemText(1, _translate("iosRouterConfigPageWidget", "none")) self.uiConsoleAutoStartCheckBox.setText(_translate("iosRouterConfigPageWidget", "Auto start console")) - self.uiCategoryLabel.setText(_translate("iosRouterConfigPageWidget", "Category:")) - self.uiAuxTypeComboBox.setItemText(0, _translate("iosRouterConfigPageWidget", "telnet")) - self.uiAuxTypeComboBox.setItemText(1, _translate("iosRouterConfigPageWidget", "none")) - self.uiAuxTypeLabel.setText(_translate("iosRouterConfigPageWidget", "Auxiliary console type:")) self.uiTabWidget.setTabText(self.uiTabWidget.indexOf(self.uiGeneralPageWidget), _translate("iosRouterConfigPageWidget", "General")) self.uiRamLabel.setText(_translate("iosRouterConfigPageWidget", "RAM size:")) self.uiRamSpinBox.setSuffix(_translate("iosRouterConfigPageWidget", " MiB")) @@ -653,3 +639,4 @@ def retranslateUi(self, iosRouterConfigPageWidget): self.uiSensor4SpinBox.setSuffix(_translate("iosRouterConfigPageWidget", " C")) self.uiTabWidget.setTabText(self.uiTabWidget.indexOf(self.uiEnvironmentPageWidget), _translate("iosRouterConfigPageWidget", "Environment")) self.uiTabWidget.setTabText(self.uiTabWidget.indexOf(self.uiUsageTab), _translate("iosRouterConfigPageWidget", "Usage")) + diff --git a/gns3/modules/qemu/pages/qemu_vm_configuration_page.py b/gns3/modules/qemu/pages/qemu_vm_configuration_page.py index 568ec99b8..439009d1f 100644 --- a/gns3/modules/qemu/pages/qemu_vm_configuration_page.py +++ b/gns3/modules/qemu/pages/qemu_vm_configuration_page.py @@ -541,10 +541,6 @@ def loadSettings(self, settings, node=None, group=False): if index != -1: self.uiConsoleTypeComboBox.setCurrentIndex(index) - index = self.uiAuxTypeComboBox.findText(settings["aux_type"]) - if index != -1: - self.uiAuxTypeComboBox.setCurrentIndex(index) - self.uiConsoleAutoStartCheckBox.setChecked(settings["console_auto_start"]) self.uiKernelCommandLineEdit.setText(settings["kernel_command_line"]) self.uiAdaptersSpinBox.setValue(settings["adapters"]) @@ -673,7 +669,6 @@ def saveSettings(self, settings, node=None, group=False): settings["boot_priority"] = self.uiBootPriorityComboBox.itemData(self.uiBootPriorityComboBox.currentIndex()) settings["console_type"] = self.uiConsoleTypeComboBox.currentText().lower() settings["console_auto_start"] = self.uiConsoleAutoStartCheckBox.isChecked() - settings["aux_type"] = self.uiAuxTypeComboBox.currentText().lower() settings["adapter_type"] = self.uiAdapterTypesComboBox.itemData(self.uiAdapterTypesComboBox.currentIndex()) settings["kernel_command_line"] = self.uiKernelCommandLineEdit.text() diff --git a/gns3/modules/qemu/pages/qemu_vm_preferences_page.py b/gns3/modules/qemu/pages/qemu_vm_preferences_page.py index 6a84a0a3d..0e5d717e6 100644 --- a/gns3/modules/qemu/pages/qemu_vm_preferences_page.py +++ b/gns3/modules/qemu/pages/qemu_vm_preferences_page.py @@ -89,7 +89,6 @@ def _refreshInfo(self, qemu_vm): pass QtWidgets.QTreeWidgetItem(section_item, ["Console type:", qemu_vm["console_type"]]) QtWidgets.QTreeWidgetItem(section_item, ["Auto start console:", "{}".format(qemu_vm["console_auto_start"])]) - QtWidgets.QTreeWidgetItem(section_item, ["Auxiliary console type:", qemu_vm["aux_type"]]) QtWidgets.QTreeWidgetItem(section_item, ["CPUs:", str(qemu_vm["cpus"])]) QtWidgets.QTreeWidgetItem(section_item, ["Memory:", "{} MB".format(qemu_vm["ram"])]) QtWidgets.QTreeWidgetItem(section_item, ["Linked base VM:", "{}".format(qemu_vm["linked_clone"])]) diff --git a/gns3/modules/qemu/qemu_vm.py b/gns3/modules/qemu/qemu_vm.py index e64334f8f..37f79582b 100644 --- a/gns3/modules/qemu/qemu_vm.py +++ b/gns3/modules/qemu/qemu_vm.py @@ -68,7 +68,6 @@ def __init__(self, module, server, project): "cpus": QEMU_VM_SETTINGS["cpus"], "console_type": QEMU_VM_SETTINGS["console_type"], "console_auto_start": QEMU_VM_SETTINGS["console_auto_start"], - "aux_type": QEMU_VM_SETTINGS["aux_type"], "adapters": QEMU_VM_SETTINGS["adapters"], "custom_adapters": QEMU_VM_SETTINGS["custom_adapters"], "adapter_type": QEMU_VM_SETTINGS["adapter_type"], @@ -116,7 +115,6 @@ def info(self): Local ID is {id} and server ID is {node_id} Number of processors is {cpus} and amount of memory is {ram}MB Console is on port {console} and type is {console_type} - Auxiliary console is on port {aux} and type is {aux_type} """.format(name=self.name(), id=self.id(), node_id=self._node_id, @@ -126,9 +124,7 @@ def info(self): cpus=self._settings["cpus"], ram=self._settings["ram"], console=self._settings["console"], - console_type=self._settings["console_type"], - aux = self._settings["aux"], - aux_type = self._settings["aux_type"]) + console_type=self._settings["console_type"]) port_info = "" for port in self._ports: @@ -161,14 +157,6 @@ def configTextFiles(self): return None - def auxConsole(self): - """ - Returns the console port for this Docker VM instance. - :returns: port (integer) - """ - - return self._settings["aux"] - def configPage(self): """ Returns the configuration page widget to be used by the node properties dialog. diff --git a/gns3/modules/qemu/settings.py b/gns3/modules/qemu/settings.py index 216a4832f..d2e493d17 100644 --- a/gns3/modules/qemu/settings.py +++ b/gns3/modules/qemu/settings.py @@ -50,7 +50,6 @@ "boot_priority": "c", "console_type": "telnet", "console_auto_start": False, - "aux_type": "none", "ram": 256, "cpus": 1, "adapters": 1, diff --git a/gns3/modules/qemu/ui/qemu_vm_configuration_page.ui b/gns3/modules/qemu/ui/qemu_vm_configuration_page.ui index 04082869e..be20621b4 100755 --- a/gns3/modules/qemu/ui/qemu_vm_configuration_page.ui +++ b/gns3/modules/qemu/ui/qemu_vm_configuration_page.ui @@ -6,7 +6,7 @@ 0 0 - 534 + 478 579 @@ -24,42 +24,89 @@ General settings - - + + - On close: + Name: - - + + + + + - RAM: + Default name format: - - + + + + + - vCPUs: + Symbol: + + + + + + + + + + + + &Browse... + + + Qt::ToolButtonTextOnly + + + + + + + + + Category: - - - - Qt::Vertical + + + + RAM: - - - 263 - 94 - + + + + + + MB - + + 32 + + + 65535 + + + 256 + + + + + + + vCPUs: + + @@ -71,33 +118,13 @@ - - - - - + + - Default name format: + Qemu binary: - - - - - - - - - &Browse... - - - Qt::ToolButtonTextOnly - - - - - @@ -108,6 +135,33 @@ + + + + Boot priority: + + + + + + + + + + On close: + + + + + + + + + + Console type: + + + @@ -148,108 +202,18 @@ - - - - Console type: - - - - - - - - - - - - - - - - Boot priority: - - - - - - - Category: - - - - - - - MB - - - 32 - - - 65535 - - - 256 - - - - - - - Name: - - - - - - - Symbol: - - - - - - - Qemu binary: + + + + Qt::Vertical - - - - - - Auxiliary console type: + + + 263 + 94 + - - - - - - - telnet - - - - - vnc - - - - - spice - - - - - spice+agent - - - - - none - - - + diff --git a/gns3/modules/qemu/ui/qemu_vm_configuration_page_ui.py b/gns3/modules/qemu/ui/qemu_vm_configuration_page_ui.py index fa6dbf00e..59d9de7e7 100644 --- a/gns3/modules/qemu/ui/qemu_vm_configuration_page_ui.py +++ b/gns3/modules/qemu/ui/qemu_vm_configuration_page_ui.py @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file '/home/grossmj/PycharmProjects/gns3-gui/gns3/modules/qemu/ui/qemu_vm_configuration_page.ui' # -# Created by: PyQt5 UI code generator 5.15.6 +# Created by: PyQt5 UI code generator 5.15.9 # # WARNING: Any manual changes made to this file will be lost when pyuic5 is # run again. Do not edit this file unless you know what you are doing. @@ -14,7 +14,7 @@ class Ui_QemuVMConfigPageWidget(object): def setupUi(self, QemuVMConfigPageWidget): QemuVMConfigPageWidget.setObjectName("QemuVMConfigPageWidget") - QemuVMConfigPageWidget.resize(534, 579) + QemuVMConfigPageWidget.resize(478, 579) self.verticalLayout = QtWidgets.QVBoxLayout(QemuVMConfigPageWidget) self.verticalLayout.setObjectName("verticalLayout") self.uiQemutabWidget = QtWidgets.QTabWidget(QemuVMConfigPageWidget) @@ -23,31 +23,21 @@ def setupUi(self, QemuVMConfigPageWidget): self.uiGeneralSettingsTab.setObjectName("uiGeneralSettingsTab") self.gridLayout_4 = QtWidgets.QGridLayout(self.uiGeneralSettingsTab) self.gridLayout_4.setObjectName("gridLayout_4") - self.uiOnCloseLabel = QtWidgets.QLabel(self.uiGeneralSettingsTab) - self.uiOnCloseLabel.setObjectName("uiOnCloseLabel") - self.gridLayout_4.addWidget(self.uiOnCloseLabel, 8, 0, 1, 1) - self.uiRamLabel = QtWidgets.QLabel(self.uiGeneralSettingsTab) - self.uiRamLabel.setObjectName("uiRamLabel") - self.gridLayout_4.addWidget(self.uiRamLabel, 4, 0, 1, 1) - self.uiCPULabel = QtWidgets.QLabel(self.uiGeneralSettingsTab) - self.uiCPULabel.setObjectName("uiCPULabel") - self.gridLayout_4.addWidget(self.uiCPULabel, 5, 0, 1, 1) - self.uiCategoryComboBox = QtWidgets.QComboBox(self.uiGeneralSettingsTab) - self.uiCategoryComboBox.setObjectName("uiCategoryComboBox") - self.gridLayout_4.addWidget(self.uiCategoryComboBox, 3, 1, 1, 1) - spacerItem = QtWidgets.QSpacerItem(263, 94, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) - self.gridLayout_4.addItem(spacerItem, 11, 1, 1, 1) - self.uiCPUSpinBox = QtWidgets.QSpinBox(self.uiGeneralSettingsTab) - self.uiCPUSpinBox.setMinimum(1) - self.uiCPUSpinBox.setMaximum(255) - self.uiCPUSpinBox.setObjectName("uiCPUSpinBox") - self.gridLayout_4.addWidget(self.uiCPUSpinBox, 5, 1, 1, 1) + self.uiNameLabel = QtWidgets.QLabel(self.uiGeneralSettingsTab) + self.uiNameLabel.setObjectName("uiNameLabel") + self.gridLayout_4.addWidget(self.uiNameLabel, 0, 0, 1, 1) self.uiNameLineEdit = QtWidgets.QLineEdit(self.uiGeneralSettingsTab) self.uiNameLineEdit.setObjectName("uiNameLineEdit") self.gridLayout_4.addWidget(self.uiNameLineEdit, 0, 1, 1, 1) self.uiDefaultNameFormatLabel = QtWidgets.QLabel(self.uiGeneralSettingsTab) self.uiDefaultNameFormatLabel.setObjectName("uiDefaultNameFormatLabel") self.gridLayout_4.addWidget(self.uiDefaultNameFormatLabel, 1, 0, 1, 1) + self.uiDefaultNameFormatLineEdit = QtWidgets.QLineEdit(self.uiGeneralSettingsTab) + self.uiDefaultNameFormatLineEdit.setObjectName("uiDefaultNameFormatLineEdit") + self.gridLayout_4.addWidget(self.uiDefaultNameFormatLineEdit, 1, 1, 1, 1) + self.uiSymbolLabel = QtWidgets.QLabel(self.uiGeneralSettingsTab) + self.uiSymbolLabel.setObjectName("uiSymbolLabel") + self.gridLayout_4.addWidget(self.uiSymbolLabel, 2, 0, 1, 1) self.horizontalLayout_7 = QtWidgets.QHBoxLayout() self.horizontalLayout_7.setObjectName("horizontalLayout_7") self.uiSymbolLineEdit = QtWidgets.QLineEdit(self.uiGeneralSettingsTab) @@ -58,6 +48,32 @@ def setupUi(self, QemuVMConfigPageWidget): self.uiSymbolToolButton.setObjectName("uiSymbolToolButton") self.horizontalLayout_7.addWidget(self.uiSymbolToolButton) self.gridLayout_4.addLayout(self.horizontalLayout_7, 2, 1, 1, 1) + self.uiCategoryLabel = QtWidgets.QLabel(self.uiGeneralSettingsTab) + self.uiCategoryLabel.setObjectName("uiCategoryLabel") + self.gridLayout_4.addWidget(self.uiCategoryLabel, 3, 0, 1, 1) + self.uiCategoryComboBox = QtWidgets.QComboBox(self.uiGeneralSettingsTab) + self.uiCategoryComboBox.setObjectName("uiCategoryComboBox") + self.gridLayout_4.addWidget(self.uiCategoryComboBox, 3, 1, 1, 1) + self.uiRamLabel = QtWidgets.QLabel(self.uiGeneralSettingsTab) + self.uiRamLabel.setObjectName("uiRamLabel") + self.gridLayout_4.addWidget(self.uiRamLabel, 4, 0, 1, 1) + self.uiRamSpinBox = QtWidgets.QSpinBox(self.uiGeneralSettingsTab) + self.uiRamSpinBox.setMinimum(32) + self.uiRamSpinBox.setMaximum(65535) + self.uiRamSpinBox.setProperty("value", 256) + self.uiRamSpinBox.setObjectName("uiRamSpinBox") + self.gridLayout_4.addWidget(self.uiRamSpinBox, 4, 1, 1, 1) + self.uiCPULabel = QtWidgets.QLabel(self.uiGeneralSettingsTab) + self.uiCPULabel.setObjectName("uiCPULabel") + self.gridLayout_4.addWidget(self.uiCPULabel, 5, 0, 1, 1) + self.uiCPUSpinBox = QtWidgets.QSpinBox(self.uiGeneralSettingsTab) + self.uiCPUSpinBox.setMinimum(1) + self.uiCPUSpinBox.setMaximum(255) + self.uiCPUSpinBox.setObjectName("uiCPUSpinBox") + self.gridLayout_4.addWidget(self.uiCPUSpinBox, 5, 1, 1, 1) + self.uiQemuListLabel = QtWidgets.QLabel(self.uiGeneralSettingsTab) + self.uiQemuListLabel.setObjectName("uiQemuListLabel") + self.gridLayout_4.addWidget(self.uiQemuListLabel, 6, 0, 1, 1) self.uiQemuListComboBox = QtWidgets.QComboBox(self.uiGeneralSettingsTab) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) @@ -66,6 +82,21 @@ def setupUi(self, QemuVMConfigPageWidget): self.uiQemuListComboBox.setSizePolicy(sizePolicy) self.uiQemuListComboBox.setObjectName("uiQemuListComboBox") self.gridLayout_4.addWidget(self.uiQemuListComboBox, 6, 1, 1, 1) + self.uiBootPriorityLabel = QtWidgets.QLabel(self.uiGeneralSettingsTab) + self.uiBootPriorityLabel.setObjectName("uiBootPriorityLabel") + self.gridLayout_4.addWidget(self.uiBootPriorityLabel, 7, 0, 1, 1) + self.uiBootPriorityComboBox = QtWidgets.QComboBox(self.uiGeneralSettingsTab) + self.uiBootPriorityComboBox.setObjectName("uiBootPriorityComboBox") + self.gridLayout_4.addWidget(self.uiBootPriorityComboBox, 7, 1, 1, 1) + self.uiOnCloseLabel = QtWidgets.QLabel(self.uiGeneralSettingsTab) + self.uiOnCloseLabel.setObjectName("uiOnCloseLabel") + self.gridLayout_4.addWidget(self.uiOnCloseLabel, 8, 0, 1, 1) + self.uiOnCloseComboBox = QtWidgets.QComboBox(self.uiGeneralSettingsTab) + self.uiOnCloseComboBox.setObjectName("uiOnCloseComboBox") + self.gridLayout_4.addWidget(self.uiOnCloseComboBox, 8, 1, 1, 1) + self.uiConsoleTypeLabel = QtWidgets.QLabel(self.uiGeneralSettingsTab) + self.uiConsoleTypeLabel.setObjectName("uiConsoleTypeLabel") + self.gridLayout_4.addWidget(self.uiConsoleTypeLabel, 9, 0, 1, 1) self.horizontalLayout_2 = QtWidgets.QHBoxLayout() self.horizontalLayout_2.setObjectName("horizontalLayout_2") self.uiConsoleTypeComboBox = QtWidgets.QComboBox(self.uiGeneralSettingsTab) @@ -80,50 +111,8 @@ def setupUi(self, QemuVMConfigPageWidget): self.uiConsoleAutoStartCheckBox.setObjectName("uiConsoleAutoStartCheckBox") self.horizontalLayout_2.addWidget(self.uiConsoleAutoStartCheckBox) self.gridLayout_4.addLayout(self.horizontalLayout_2, 9, 1, 1, 1) - self.uiConsoleTypeLabel = QtWidgets.QLabel(self.uiGeneralSettingsTab) - self.uiConsoleTypeLabel.setObjectName("uiConsoleTypeLabel") - self.gridLayout_4.addWidget(self.uiConsoleTypeLabel, 9, 0, 1, 1) - self.uiDefaultNameFormatLineEdit = QtWidgets.QLineEdit(self.uiGeneralSettingsTab) - self.uiDefaultNameFormatLineEdit.setObjectName("uiDefaultNameFormatLineEdit") - self.gridLayout_4.addWidget(self.uiDefaultNameFormatLineEdit, 1, 1, 1, 1) - self.uiOnCloseComboBox = QtWidgets.QComboBox(self.uiGeneralSettingsTab) - self.uiOnCloseComboBox.setObjectName("uiOnCloseComboBox") - self.gridLayout_4.addWidget(self.uiOnCloseComboBox, 8, 1, 1, 1) - self.uiBootPriorityComboBox = QtWidgets.QComboBox(self.uiGeneralSettingsTab) - self.uiBootPriorityComboBox.setObjectName("uiBootPriorityComboBox") - self.gridLayout_4.addWidget(self.uiBootPriorityComboBox, 7, 1, 1, 1) - self.uiBootPriorityLabel = QtWidgets.QLabel(self.uiGeneralSettingsTab) - self.uiBootPriorityLabel.setObjectName("uiBootPriorityLabel") - self.gridLayout_4.addWidget(self.uiBootPriorityLabel, 7, 0, 1, 1) - self.uiCategoryLabel = QtWidgets.QLabel(self.uiGeneralSettingsTab) - self.uiCategoryLabel.setObjectName("uiCategoryLabel") - self.gridLayout_4.addWidget(self.uiCategoryLabel, 3, 0, 1, 1) - self.uiRamSpinBox = QtWidgets.QSpinBox(self.uiGeneralSettingsTab) - self.uiRamSpinBox.setMinimum(32) - self.uiRamSpinBox.setMaximum(65535) - self.uiRamSpinBox.setProperty("value", 256) - self.uiRamSpinBox.setObjectName("uiRamSpinBox") - self.gridLayout_4.addWidget(self.uiRamSpinBox, 4, 1, 1, 1) - self.uiNameLabel = QtWidgets.QLabel(self.uiGeneralSettingsTab) - self.uiNameLabel.setObjectName("uiNameLabel") - self.gridLayout_4.addWidget(self.uiNameLabel, 0, 0, 1, 1) - self.uiSymbolLabel = QtWidgets.QLabel(self.uiGeneralSettingsTab) - self.uiSymbolLabel.setObjectName("uiSymbolLabel") - self.gridLayout_4.addWidget(self.uiSymbolLabel, 2, 0, 1, 1) - self.uiQemuListLabel = QtWidgets.QLabel(self.uiGeneralSettingsTab) - self.uiQemuListLabel.setObjectName("uiQemuListLabel") - self.gridLayout_4.addWidget(self.uiQemuListLabel, 6, 0, 1, 1) - self.uiAuxTypeLabel = QtWidgets.QLabel(self.uiGeneralSettingsTab) - self.uiAuxTypeLabel.setObjectName("uiAuxTypeLabel") - self.gridLayout_4.addWidget(self.uiAuxTypeLabel, 10, 0, 1, 1) - self.uiAuxTypeComboBox = QtWidgets.QComboBox(self.uiGeneralSettingsTab) - self.uiAuxTypeComboBox.setObjectName("uiAuxTypeComboBox") - self.uiAuxTypeComboBox.addItem("") - self.uiAuxTypeComboBox.addItem("") - self.uiAuxTypeComboBox.addItem("") - self.uiAuxTypeComboBox.addItem("") - self.uiAuxTypeComboBox.addItem("") - self.gridLayout_4.addWidget(self.uiAuxTypeComboBox, 10, 1, 1, 1) + spacerItem = QtWidgets.QSpacerItem(263, 94, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + self.gridLayout_4.addItem(spacerItem, 10, 1, 1, 1) self.uiQemutabWidget.addTab(self.uiGeneralSettingsTab, "") self.uiHddTab = QtWidgets.QWidget() self.uiHddTab.setObjectName("uiHddTab") @@ -482,30 +471,24 @@ def setupUi(self, QemuVMConfigPageWidget): def retranslateUi(self, QemuVMConfigPageWidget): _translate = QtCore.QCoreApplication.translate QemuVMConfigPageWidget.setWindowTitle(_translate("QemuVMConfigPageWidget", "QEMU VM template configuration")) - self.uiOnCloseLabel.setText(_translate("QemuVMConfigPageWidget", "On close:")) - self.uiRamLabel.setText(_translate("QemuVMConfigPageWidget", "RAM:")) - self.uiCPULabel.setText(_translate("QemuVMConfigPageWidget", "vCPUs:")) + self.uiNameLabel.setText(_translate("QemuVMConfigPageWidget", "Name:")) self.uiDefaultNameFormatLabel.setText(_translate("QemuVMConfigPageWidget", "Default name format:")) + self.uiSymbolLabel.setText(_translate("QemuVMConfigPageWidget", "Symbol:")) self.uiSymbolToolButton.setText(_translate("QemuVMConfigPageWidget", "&Browse...")) + self.uiCategoryLabel.setText(_translate("QemuVMConfigPageWidget", "Category:")) + self.uiRamLabel.setText(_translate("QemuVMConfigPageWidget", "RAM:")) + self.uiRamSpinBox.setSuffix(_translate("QemuVMConfigPageWidget", " MB")) + self.uiCPULabel.setText(_translate("QemuVMConfigPageWidget", "vCPUs:")) + self.uiQemuListLabel.setText(_translate("QemuVMConfigPageWidget", "Qemu binary:")) + self.uiBootPriorityLabel.setText(_translate("QemuVMConfigPageWidget", "Boot priority:")) + self.uiOnCloseLabel.setText(_translate("QemuVMConfigPageWidget", "On close:")) + self.uiConsoleTypeLabel.setText(_translate("QemuVMConfigPageWidget", "Console type:")) self.uiConsoleTypeComboBox.setItemText(0, _translate("QemuVMConfigPageWidget", "telnet")) self.uiConsoleTypeComboBox.setItemText(1, _translate("QemuVMConfigPageWidget", "vnc")) self.uiConsoleTypeComboBox.setItemText(2, _translate("QemuVMConfigPageWidget", "spice")) self.uiConsoleTypeComboBox.setItemText(3, _translate("QemuVMConfigPageWidget", "spice+agent")) self.uiConsoleTypeComboBox.setItemText(4, _translate("QemuVMConfigPageWidget", "none")) self.uiConsoleAutoStartCheckBox.setText(_translate("QemuVMConfigPageWidget", "Auto start console")) - self.uiConsoleTypeLabel.setText(_translate("QemuVMConfigPageWidget", "Console type:")) - self.uiBootPriorityLabel.setText(_translate("QemuVMConfigPageWidget", "Boot priority:")) - self.uiCategoryLabel.setText(_translate("QemuVMConfigPageWidget", "Category:")) - self.uiRamSpinBox.setSuffix(_translate("QemuVMConfigPageWidget", " MB")) - self.uiNameLabel.setText(_translate("QemuVMConfigPageWidget", "Name:")) - self.uiSymbolLabel.setText(_translate("QemuVMConfigPageWidget", "Symbol:")) - self.uiQemuListLabel.setText(_translate("QemuVMConfigPageWidget", "Qemu binary:")) - self.uiAuxTypeLabel.setText(_translate("QemuVMConfigPageWidget", "Auxiliary console type:")) - self.uiAuxTypeComboBox.setItemText(0, _translate("QemuVMConfigPageWidget", "telnet")) - self.uiAuxTypeComboBox.setItemText(1, _translate("QemuVMConfigPageWidget", "vnc")) - self.uiAuxTypeComboBox.setItemText(2, _translate("QemuVMConfigPageWidget", "spice")) - self.uiAuxTypeComboBox.setItemText(3, _translate("QemuVMConfigPageWidget", "spice+agent")) - self.uiAuxTypeComboBox.setItemText(4, _translate("QemuVMConfigPageWidget", "none")) self.uiQemutabWidget.setTabText(self.uiQemutabWidget.indexOf(self.uiGeneralSettingsTab), _translate("QemuVMConfigPageWidget", "General settings")) self.uiHdaGroupBox.setTitle(_translate("QemuVMConfigPageWidget", "HDA (Primary Master)")) self.uiHdaDiskImageLabel.setText(_translate("QemuVMConfigPageWidget", "Disk image:")) diff --git a/gns3/node.py b/gns3/node.py index 2a8f97f0c..ab6530aeb 100644 --- a/gns3/node.py +++ b/gns3/node.py @@ -399,8 +399,6 @@ def _prepareBodyForUpdate(self, params): general_node_properties = ("name", "console", "console_type", - "aux", - "aux_type", "x", "y", "z", @@ -561,7 +559,7 @@ def _parseControllerResponse(self, result): del result["properties"] # Update common element of all nodes - for key in ["x", "y", "z", "locked", "symbol", "label", "console_host", "console", "console_type", "console_auto_start", "aux", "aux_type", "custom_adapters", "first_port_name", "port_name_format", "port_segment_size"]: + for key in ["x", "y", "z", "locked", "symbol", "label", "console_host", "console", "console_type", "console_auto_start", "custom_adapters", "first_port_name", "port_name_format", "port_segment_size"]: if key in result: self._settings[key] = result[key] @@ -682,16 +680,6 @@ def consoleHost(self): host = Controller.instance().host() return host - def auxType(self): - """ - Get the auxiliary console type (serial, telnet or VNC) - """ - - aux_type = "none" - if "aux_type" in self.settings(): - return self.settings()["aux_type"] - return aux_type - def setStatus(self, status): """ Overloaded setStatus() method for console auto start. @@ -714,7 +702,7 @@ def openConsole(self, command=None, aux=False): if command is None: if aux: - command = self.consoleCommand(console_type=self.auxType()) + command = self.consoleCommand(console_type="telnet") else: command = self.consoleCommand() @@ -724,8 +712,8 @@ def openConsole(self, command=None, aux=False): console_port = self.auxConsole() if console_port is None: raise ValueError("AUX console port not allocated for {}".format(self.name())) - if "aux_type" in self.settings(): - console_type = self.auxType() + # AUX console is always telnet + console_type = "telnet" else: console_port = self.console() if console_port is None: From be2b5eecf6c732de25cb79711b2c36e70c57617f Mon Sep 17 00:00:00 2001 From: grossmj Date: Tue, 24 Sep 2024 12:25:26 +0700 Subject: [PATCH 06/12] Use "experimental features" option to force listening for HTTP notification streams. Ref #3579 --- gns3/controller.py | 8 +++++++- gns3/project.py | 25 ++++++++++++++----------- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/gns3/controller.py b/gns3/controller.py index 5ea402ce3..a659488d1 100644 --- a/gns3/controller.py +++ b/gns3/controller.py @@ -25,6 +25,8 @@ from .symbol import Symbol from .local_server_config import LocalServerConfig from .settings import LOCAL_SERVER_SETTINGS + +from gns3.local_config import LocalConfig from gns3.utils import parse_version import logging @@ -416,19 +418,23 @@ def _startListenNotifications(self): self._notification_stream = None # Qt websocket before Qt 5.6 doesn't support auth - if parse_version(QtCore.QT_VERSION_STR) < parse_version("5.6.0") or parse_version(QtCore.PYQT_VERSION_STR) < parse_version("5.6.0"): + if parse_version(QtCore.QT_VERSION_STR) < parse_version("5.6.0") or parse_version(QtCore.PYQT_VERSION_STR) < parse_version("5.6.0") or LocalConfig.instance().experimental(): + self._notification_stream = Controller.instance().createHTTPQuery("GET", "/notifications", self._endListenNotificationCallback, downloadProgressCallback=self._event_received, networkManager=self._notification_network_manager, timeout=None, showProgress=False, ignoreErrors=True) + url = self._http_client.url() + '/notifications' + log.info("Listening for controller notifications on '{}'".format(url)) else: self._notification_stream = self._http_client.connectWebSocket(self._websocket, "/notifications/ws") self._notification_stream.textMessageReceived.connect(self._websocket_event_received) self._notification_stream.error.connect(self._websocket_error) self._notification_stream.sslErrors.connect(self._sslErrorsSlot) + log.info("Listening for controller notifications on '{}'".format(self._notification_stream.requestUrl().toString())) def stopListenNotifications(self): if self._notification_stream: diff --git a/gns3/project.py b/gns3/project.py index aa3f602e0..25030836c 100644 --- a/gns3/project.py +++ b/gns3/project.py @@ -627,21 +627,24 @@ def _startListenNotifications(self): return # Qt websocket before Qt 5.6 doesn't support auth - if parse_version(QtCore.QT_VERSION_STR) < parse_version("5.6.0") or parse_version(QtCore.PYQT_VERSION_STR) < parse_version("5.6.0"): + if parse_version(QtCore.QT_VERSION_STR) < parse_version("5.6.0") or parse_version(QtCore.PYQT_VERSION_STR) < parse_version("5.6.0") or LocalConfig.instance().experimental(): path = "/projects/{project_id}/notifications".format(project_id=self._id) self._notification_stream = Controller.instance().createHTTPQuery("GET", path, self._endListenNotificationCallback, - downloadProgressCallback=self._event_received, - networkManager=self._notification_network_manager, - timeout=None, - showProgress=False, - ignoreErrors=True) + downloadProgressCallback=self._event_received, + networkManager=self._notification_network_manager, + timeout=None, + showProgress=False, + ignoreErrors=True) + url = Controller.instance().getHttpClient().url() + path + log.info("Listening for project notifications on '{}'".format(url)) else: - path = "/projects/{project_id}/notifications/ws".format(project_id=self._id) - self._notification_stream = Controller.instance().httpClient().connectWebSocket(self._websocket, path) - self._notification_stream.textMessageReceived.connect(self._websocket_event_received) - self._notification_stream.error.connect(self._websocket_error) - self._notification_stream.sslErrors.connect(self._sslErrorsSlot) + path = "/projects/{project_id}/notifications/ws".format(project_id=self._id) + self._notification_stream = Controller.instance().httpClient().connectWebSocket(self._websocket, path) + self._notification_stream.textMessageReceived.connect(self._websocket_event_received) + self._notification_stream.error.connect(self._websocket_error) + self._notification_stream.sslErrors.connect(self._sslErrorsSlot) + log.info("Listening for project notifications on '{}'".format(self._notification_stream.requestUrl().toString())) def _endListenNotificationCallback(self, result, error=False, **kwargs): """ From f21a53072980b027b256510d164f638943201791 Mon Sep 17 00:00:00 2001 From: grossmj Date: Thu, 26 Sep 2024 16:14:02 +0700 Subject: [PATCH 07/12] Improve information provided when uploading invalid appliance image. Fixes #3637 --- gns3/dialogs/appliance_wizard.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/gns3/dialogs/appliance_wizard.py b/gns3/dialogs/appliance_wizard.py index 8835887fb..8f6ab6753 100644 --- a/gns3/dialogs/appliance_wizard.py +++ b/gns3/dialogs/appliance_wizard.py @@ -543,9 +543,19 @@ def _importPushButtonClickedSlot(self, *args): image = Image(self._appliance.template_type(), path, filename=disk["filename"]) try: if "md5sum" in disk and image.md5sum != disk["md5sum"]: - reply = QtWidgets.QMessageBox.question(self, "Add appliance", - "This is not the correct file. The MD5 sum is {} and should be {}.\nDo you want to accept it at your own risks?".format(image.md5sum, disk["md5sum"]), - QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No) + reply = QtWidgets.QMessageBox.question( + self, + "Add appliance", + "This is not the correct file.\n\n" + "MD5 checksum\n" + f"actual:\t{image.md5sum}\n" + f"expected:\t{disk["md5sum"]}\n\n" + "File size\n" + f"actual:\t{image.filesize} bytes\n" + f"expected:\t{disk["filesize"]} bytes\n\n" + "Do you want to accept it at your own risks?", + QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No + ) if reply == QtWidgets.QMessageBox.No: return except OSError as e: From de8b9bc8f13377a124e134e05c1e56f5c1f67497 Mon Sep 17 00:00:00 2001 From: grossmj Date: Sat, 28 Sep 2024 11:20:39 +0700 Subject: [PATCH 08/12] Fix f-string syntax error. Fixes #3639 --- gns3/dialogs/appliance_wizard.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gns3/dialogs/appliance_wizard.py b/gns3/dialogs/appliance_wizard.py index 8f6ab6753..aed9c61af 100644 --- a/gns3/dialogs/appliance_wizard.py +++ b/gns3/dialogs/appliance_wizard.py @@ -549,10 +549,10 @@ def _importPushButtonClickedSlot(self, *args): "This is not the correct file.\n\n" "MD5 checksum\n" f"actual:\t{image.md5sum}\n" - f"expected:\t{disk["md5sum"]}\n\n" + f"expected:\t{disk['md5sum']}\n\n" "File size\n" f"actual:\t{image.filesize} bytes\n" - f"expected:\t{disk["filesize"]} bytes\n\n" + f"expected:\t{disk['filesize']} bytes\n\n" "Do you want to accept it at your own risks?", QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No ) From f7703e3fa27c598f64d52c6a07b502018ac5e821 Mon Sep 17 00:00:00 2001 From: grossmj Date: Mon, 14 Oct 2024 17:46:53 +1000 Subject: [PATCH 09/12] Add comment to indicate sentry-sdk is optional. Ref https://github.com/GNS3/gns3-server/issues/2423 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 4ef10c35a..71dd3a53e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ jsonschema>=4.23,<4.24 -sentry-sdk==2.12,<2.13 +sentry-sdk==2.12,<2.13 # optional dependency psutil==6.0.0 distro>=1.9.0 truststore>=0.9.1; python_version >= '3.10' From e84ef8bf13bccdcb9a974bc284cbc62d77573c26 Mon Sep 17 00:00:00 2001 From: grossmj Date: Wed, 16 Oct 2024 16:28:46 +1000 Subject: [PATCH 10/12] Fix issue when pid file contains invalid data --- gns3/local_config.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/gns3/local_config.py b/gns3/local_config.py index 8b9da10c5..9c5102013 100644 --- a/gns3/local_config.py +++ b/gns3/local_config.py @@ -483,7 +483,7 @@ def isMainGui(): if os.path.exists(pid_path): try: - with open(pid_path) as f: + with open(pid_path, encoding="utf-8") as f: pid = int(f.read()) if pid != my_pid: try: @@ -498,9 +498,17 @@ def isMainGui(): return False else: return True - except (OSError, ValueError) as e: + except OSError as e: log.critical("Can't read pid file %s: %s", pid_path, str(e)) return False + except ValueError as e: + log.warning("Invalid data in pid file %s: %s", pid_path, str(e)) + try: + # try removing the file since it contains invalid data + os.remove(pid_path) + except OSError: + log.critical("Can't remove pid file %s", pid_path) + return False try: with open(pid_path, 'w+') as f: From 6df7dc4730e9fcf7a1de206b79ae3673f616d9aa Mon Sep 17 00:00:00 2001 From: grossmj Date: Sat, 19 Oct 2024 16:07:54 +1000 Subject: [PATCH 11/12] Replace AppVeyor testing with GH Actions --- appveyor.yml | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 appveyor.yml diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 61e9697fb..000000000 --- a/appveyor.yml +++ /dev/null @@ -1,20 +0,0 @@ -version: '{build}-{branch}' - -image: Visual Studio 2022 - -platform: x64 - -environment: - PYTHON: "C:\\Python38-x64" - DISTUTILS_USE_SDK: "1" - -install: - - cinst nmap - - "%PYTHON%\\python.exe -m pip install -U pip setuptools" # upgrade pip & setuptools first - - "%PYTHON%\\python.exe -m pip install -r dev-requirements.txt" - - "%PYTHON%\\python.exe -m pip install -r win-requirements.txt" - -build: off - -test_script: - - "%PYTHON%\\python.exe -m pytest -v" From 9b5713df03015bf06ef31e9d1e9c881685c52477 Mon Sep 17 00:00:00 2001 From: grossmj Date: Mon, 21 Oct 2024 12:14:18 +1000 Subject: [PATCH 12/12] Release v2.2.50 --- CHANGELOG | 10 ++++++++++ gns3/crash_report.py | 2 +- gns3/version.py | 4 ++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 625b63f65..e5a55abd0 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,15 @@ # Change Log +## 2.2.50 21/10/2024 + +* Fix issue when pid file contains invalid data +* Add comment to indicate sentry-sdk is optional. Ref https://github.com/GNS3/gns3-server/issues/2423 +* Improve information provided when uploading invalid appliance image. Fixes #3637 +* Use "experimental features" option to force listening for HTTP notification streams. Ref #3579 +* Fix to allow packet capture on more than 6 links. Fixes #3594 +* Support for configuring MAC address in Docker containers +* Add KRDC to pre-configured VNC console commands + ## 2.2.49 06/08/2024 * Upgrade jsonschema and sentry-sdk packages diff --git a/gns3/crash_report.py b/gns3/crash_report.py index 49fac2206..f3bac1cd2 100644 --- a/gns3/crash_report.py +++ b/gns3/crash_report.py @@ -50,7 +50,7 @@ class CrashReport: Report crash to a third party service """ - DSN = "https://4cbe2abf0323ef3136a900d624b12567@o19455.ingest.us.sentry.io/38506" + DSN = "https://2f7ebda845810e764bfd049a40cc09e3@o19455.ingest.us.sentry.io/38506" _instance = None def __init__(self): diff --git a/gns3/version.py b/gns3/version.py index 058e61c40..4272b47c0 100644 --- a/gns3/version.py +++ b/gns3/version.py @@ -23,8 +23,8 @@ # or negative for a release candidate or beta (after the base version # number has been incremented) -__version__ = "2.2.50.dev1" -__version_info__ = (2, 2, 50, 99) +__version__ = "2.2.50" +__version_info__ = (2, 2, 50, 0) if "dev" in __version__: try: