Back to Coding

Add Listener Menu and SSL Proxy

Prompt

You are an expert coder and UI/UX designer, known for perfection and bug-free implementations. Your task is to update the menubar by adding a "Listener" option under the "Settings" menubar item, similar to the existing "Certificate Settings". The Listener should open a popup similar to the existing SettingsModal but with two tabs: "SSL Proxify" and "Proxy & Port". Details for each tab: 1. Proxy & Port Tab: - Contains a single number-input field styled according to the existing theme.ts. - This field is for specifying the proxy port number. 2. SSL Proxify Tab: - Layout is a split screen with two boxes side-by-side: "Include" and "Exclude". - Each box has a title at the top ("Include" on the left, "Exclude" on the right). - Each box contains a table where each row has two columns: * A checkbox (nameless) on the left. * A "Location" column on the right showing host:port. - Below each table, provide "Add" and "Remove" buttons to manage entries. The Add Popup for SSL Proxify entries must contain: - A "Host" input that supports regex and wildcard characters (e.g., '*') to match all hosts. - A "Port" input which also supports wildcards. Backend Implementation Requirements: - The SSL Proxify logic means hosts listed under "Include" are the only ones proxied; hosts not included should be passed through without SSL proxying. - The Proxy & Port change should be persisted in the backend with a method to update the listening port. Rules to Follow: - Follow all given rules meticulously. - Provide full code for all modified files without comments. - Prior to coding, ask for any necessary components, import code, or interface details required to fully understand the existing structure. - Your code must be flawless, bug-free, and polished. # Steps 1. Request any missing component or interface code relevant to the SettingsModal and menubar if needed. 2. Implement adding "Listener" to the Settings menubar. 3. Create the Listener popup with two tabs: SSL Proxify and Proxy & Port. 4. Implement the Proxy & Port tab with a themed number input for port. 5. Implement the SSL Proxify tab as a split-screen layout with Include and Exclude boxes. 6. Each box should have a checkbox and Location columns in a table alongside Add and Remove buttons. 7. Create Add Popup dialogs supporting regex and wildcard inputs for Host and Port. 8. Integrate backend support to save/update SSL Proxy include/exclude rules and the proxy port. # Output Format Provide full updated source code files that have been modified or created during this task, strictly without any inline comments. If you require additional code or interface definitions to proceed, ask clearly before starting the implementation.

Related Coding Prompts

Write Code

As a seasoned programmer, your task is to write code in [programming language] to [perform action]. The code should be efficient, well-structured, and optimized for performance. Make sure to follow best practices and industry standards while implementing the necessary algorithms and logic to achieve the desired functionality. Test the code thoroughly to ensure it functions as intended and meets all requirements. Additionally, document the code properly for future reference and maintenance.

Debug Code

Act as a seasoned programmer with over 20 years of commercial experience. Analyze the provided [piece of code] that is causing a specific [error]. Your task involves diagnosing the root cause of the error, understanding the context and functionality intended by the code, and proposing a solution to fix the issue. Your analysis should include a step-by-step walkthrough of the code, identification of any bugs or logical mistakes, and a detailed explanation of how to resolve them. Additionally, suggest any improvements or optimizations to enhance the performance, readability, or maintainability of the code based on your extensive experience. Ensure that your solution adheres to best practices in software development and is compatible with the current development environment where the code is being executed.

Do Code Review

As a seasoned programmer with over 20 years of commercial experience, your task is to perform a comprehensive code review on the provided [piece of code]. Your review should meticulously evaluate the code's efficiency, readability, and maintainability. You are expected to identify any potential bugs, security vulnerabilities, or performance issues and suggest specific improvements or optimizations. Additionally, assess the code's adherence to industry standards and best practices. Your feedback should be constructive and detailed, offering clear explanations and recommendations for changes. Where applicable, provide examples or references to support your suggestions. Your goal is to ensure that the code not only functions as intended but also meets high standards of quality and can be easily managed and scaled in the future. This review is an opportunity to mentor and guide less experienced developers, so your insights should be both educational and actionable.