feat(dashboard): add rules management panel#344
Open
evagundan wants to merge 1 commit into
Open
Conversation
Add a new Rules tab to the sidebar that displays configured automation rules with enable/disable toggles and manual trigger buttons. Changes: - Add Rule type definitions to types.ts - Add rule API functions (list, toggle, trigger) to real.ts and index.ts - Create RuleListPanel component with rule cards showing: - Rule name with tag badge - Mode badge (event/state) - Condition query text - Duration/ratio info - Toggle switch and trigger button - Add rules tab to Sidebar navigation - Add i18n translations for zh and en - Wire rules panel into App.tsx
|
|
|
👋 感谢提交 PR @evagundan!维护者会尽快 review。 提交前请确认:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a new "Rules" tab to the home dashboard sidebar, allowing users to view and manage their automation rules.
Motivation
Currently, rules can only be managed through the CLI (
miloco-cli) or the Agent. Adding a visual rules panel to the dashboard gives users a quick overview of their configured rules and the ability to enable/disable them or trigger them manually — without needing to open a terminal.Changes
New Files
web/src/components/RuleListPanel.tsx— Main component displaying rule cardsweb/src/i18n/locales/zh/rules.json— Chinese translationsweb/src/i18n/locales/en/rules.json— English translationsModified Files
web/src/lib/types.ts— AddRule,RuleMode,RuleLifecycle,RuleAction,RuleConditiontype definitionsweb/src/api/real.ts— AddrealListRules,realToggleRule,realTriggerRuleAPI functionsweb/src/api/index.ts— ExportlistRules,toggleRule,triggerRulefunctionsweb/src/components/Sidebar.tsx— Add "rules" tab to navigation, addIconRulesSVG iconweb/src/App.tsx— Wire up rules data fetching and renderRuleListPanelfor the rules tabweb/src/i18n/locales/zh/nav.json— Addnav.rules/nav.rulesHintkeysweb/src/i18n/locales/en/nav.json— Addnav.rules/nav.rulesHintkeysFeatures
The rules panel shows each configured rule as a card with:
[study_focus])Loading skeleton and empty state are also handled.
Testing