-
Notifications
You must be signed in to change notification settings - Fork 683
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
inspec demo #989
inspec demo #989
Conversation
13f0744
to
f3c85ba
Compare
|
||
evalInput(value) { | ||
if (value.match(/^inspec exec\s*examples\/profile\/controls\/example.rb\s*/)) { | ||
this.getResponse(value, "inspec_exec"); |
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.
This makes sense for the viability demo, but I think we might want to bundle the response data (or a segment of it) in a single blob that we send to the client to avoid a lot of round tripping.
It is hard to get a screenshot of, but the cursor appears on the line below the |
Like the pattern matching on the errors, very cool, but it seems to have gone wrong a little bit:
|
The instructions don't seem to reposition if I make my browser window smaller. |
@vjeffrey Listed some issues I found, but overall this was very easy to get running and worked immediately, very cool start. |
if (value.match(/^inspec exec\s*examples\/profile\/controls\/example.rb\s*/)) { | ||
this.getResponse(value, "inspec_exec"); | ||
} | ||
else if (value.match(/^inspec exec\s*.*/)) { |
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.
We might want to find a way to parameterize responses so that we could capture the path here and inject it into the response we print.
e8d0e27
to
8b24638
Compare
i'm working on a refactor commit that will pull the terminal view into its own component to make real shell emulation easier-- up arrow thru previous commands, prompt -command-repeat cycle -- and it will also reduce the amount of get requests. |
@Vj you probably want to use https://github.com/drudru/ansi_up, this helps with the colors @stevendanna mentioned |
Maybe https://github.com/sourcelair/xterm.js also helps with the rendering of a terminal |
} | ||
|
||
evalInput(value) { | ||
if (value.match(/^inspec exec\s*examples\/profile\s*/)) { |
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.
During generation of the commands, we probably want to have json file that tracks the commands. We could use https://github.com/chef/inspec/blob/master/tasks/command_simulator.rb#L4 as an external json. This enables us to use it as a reference in this app and as a list of commands for the rake task
This is a really great start @vjeffrey ! I see two points that we can improve:
|
Maybe we should move this to |
735e462
to
38b2829
Compare
just pushed up a commit i had started on friday to cleanup and refactor a bit/reduce get requests. also moved to tutorial folder. now i'm starting to work on getting xterm in, then once that's done i'll focus on command generating (json) and then the ui bits of making it look nice and ansi_up and stuffs |
f0c8c70
to
6b64e0e
Compare
6b64e0e
to
6d37405
Compare
6d37405
to
08b9d7d
Compare
08b9d7d
to
d78740c
Compare
b9027f0
to
eaf6cbf
Compare
eaf6cbf
to
36fafa4
Compare
36fafa4
to
171beb8
Compare
171beb8
to
e44bc7e
Compare
@chris-rock @arlimus updated with the refactor/addressing comments. i still need to figure out the print a block of text and don't make it look crazy thing....working on it... |
holybergeeeeeez it took me forever to figure out everything was broken because xterm.js had some updates in the couple days. thus the pinning to 1.1.2 commit. |
@chris-rock @arlimus try it out I fixed things with @stevendanna's help :) :) :) |
@@ -0,0 +1,20 @@ | |||
Commands: |
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.
A note on this: The problem we found is that the xterm js library expect windows style line endings \r\n
. The rake task now generates files with the correct endings, but we may need to be vigilant to ensure that git doesn't mangle them.
Very nice first iteration @vjeffrey |
129313e
to
a18dc7a
Compare
just pushed up another small commit -- realized i wasn't handling next and prev very well |
1acbb0f
to
9340bc9
Compare
ok, so obviously this is not ready ready, but it's a start, so i'm putting up a PR for it...i think this works for the whole "viability gate" thing. There is much more to do, but i think this is a good spot to commit something. Please list out ANYTHING you can think of that you see needing improvement/want implemented, so i can keep a list as I truck along.
fixes most of #956