We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am trying to write a module about firewalld toggle in quicktoggles.js when I import it in sideright.js it makes ags error. I need help.
// cCustom moduel for firewalld export const ModuleFirewall = (props = {}) => Widget.Button({ className: "txt-small sidebar-iconbutton", tooltipText: "FirewallD | Right-click to configure", onClicked: () => { execAsync("systemctl is-active firewalld") .then((status) => { if (status.trim() === "active") { exec("sudo systemctl stop firewalld").catch(print); } else { exec("sudo systemctl start firewalld").catch(print); } }) .catch((error) => { print(`Error checking firewalld status: ${error}`); }); }, onSecondaryClickRelease: () => { execAsync(["bash", "-c", "firewalld-config-tool"]).catch(print); closeEverything(); }, child: FirewallIndicator(), setup: (self) => { setupCursorHover(self); // Cập nhật trạng thái của firewalld const updateFirewallStatus = () => { execAsync("systemctl is-active firewalld") .then((status) => { const isActive = status.trim() === "active"; self.toggleClassName("sidebar-button-active", isActive); self.tooltipText = isActive ? "FirewallD Active" : "FirewallD Inactive"; }) .catch((error) => { print(`Error updating firewalld status: ${error}`); }); }; updateFirewallStatus(); setInterval(updateFirewallStatus, 5000); }, ...props, });
The text was updated successfully, but these errors were encountered:
I just tweaked the source code a bit and it works. But only when the firewall is turned off. If you want to turn it on, you can't
// cCustom moduel for firewalld export const ModuleFirewall = (props = {}) => Widget.Button({ className: "txt-small sidebar-iconbutton", tooltipText: "Firewalld", onClicked: (self) => { execAsync("systemctl is-active firewalld") .then((status) => { const isActive = status.trim() === "active"; const command = isActive ? "pkexec systemctl stop firewalld" : "sudo systemctl start firewalld"; execAsync(command) .then(() => { self.toggleClassName("sidebar-button-active", !isActive); }) .catch(print); }) .catch(print); }, child: MaterialIcon("security", "norm"), setup: (self) => { execAsync("systemctl is-active firewalld") .then((status) => { const isActive = status.trim() === "active"; self.toggleClassName("sidebar-button-active", isActive); }) .catch(print); }, ...props, }); // End
Sorry, something went wrong.
No branches or pull requests
I am trying to write a module about firewalld toggle in quicktoggles.js
when I import it in sideright.js it makes ags error. I need help.
The text was updated successfully, but these errors were encountered: