-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
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
Add Vanilla JavaScript actions #1438
Add Vanilla JavaScript actions #1438
Conversation
29cd35c
to
38ee5bb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since there is no 'auto save', if the user is typing its code on the dialog and accidentally clicks on the backdrop, the dialog will close and all code will be lost.
Make the v-dialog persistent using a prop with this name, or make the text persistent on the 'JavaScript Code' input field.
import JavascriptActionConfig from '@/components/configuration/JavascriptActionConfig.vue' | ||
import MavlinkMessageActionConfig from '@/components/configuration/MavlinkMessageActionConfig.vue' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you have made the atomization for the JavascriptActionConfig and MavlinkMessageActionConfig components, placing them inside src/components, I think would be nice to also do the same with the 'HTTP Request Actions' part on this template.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely! Will do that now.
This way free JavaScript functions, for example, can take advantage of them.
With this, the user can create vanilla JavaScript methods that can be called from anywhere in the application. This basically allows one to extend Cockpit capabilities to anything.
For the sake of code maintainability.
38ee5bb
to
be48112
Compare
With this, the user can create vanilla JavaScript methods that can be called from anywhere in the application.
This basically allows one to extend Cockpit capabilities to the infinite and beyond.
I also exposed the cockpit-actions and data-lake methods globally, so the user can call those from their functions. They are accessible under
window.cockpit
.Once we merge the DIY widget, I will change the current
v-text-field
with a proper Monaco editor.Fix #569