omadawn / njord Goto Github PK
View Code? Open in Web Editor NEWJava iRule Editor
Java iRule Editor
A couple of the worst offenders like iRule selected have been taken care of but I still have a few places where code should be moved to a subroutine. Check new iRule and go back over all the actionLister options.
Re-validate the connection then rebuild the iRules nav tree.
Technically this is probably an enhancement but not having this feature is so stupid I'm considering it a bug.
So that if we do want to connect automatically we can. For when you're always connecting to the same bigip.
Sub task of Issue #154.
Too many places where we're doing something and it's not reflected in the notices box.
To do this make NjordiRuleDefinition no longer hold the actual iRule but instead it's name. MainGuiWindow isn't going to download the rule and stuff it into a NjordiRule definition any longer but rather just get the list of iRules and take create NjordiRuleDefinitions off those? Either way NjordFileLocation is goiing to be the interface to get and write the iRules. NjordOutputStream will be created and NjordOutputStream.write() will be the method to save the iRule. Does this mean I need to write NjordInputStream as well or can I just have NjordFileLocation pull down the iRule when it's created? I'll start with that.
So instantiate NjordFileLocation with an iControl Interface. and an iRule name. Then it can get the iRule and create an OS of type NjordOutputStream which is instantiated with an iControlInterface? Then when NjordOutputStream.write() is called we save the OS?
We probably shouldn't create write() but rather only use write(String) to save the iRule.
NjordOutputStream isn't going to take a NjordiRule as an argument because NjordiRuleObject is going to have it's own OS as a variable? Actually NjordiRuleObject might go away completely.
This might be worth pushing off until v0.9.
Right now when you expand the tree it creates a little white square which looks a little odd on the grey background.
Related to Issue #42
Like certain actions take a certain amount of time. So that I can catch them when they take longer.
Dunno how to do this but figure it out.
Make sure to exclude the time connecting to the bigip from the timing.
Something that maybe sends an email or at least just opens a form they can fill out and then paste into the body of an email.
Decide how best to do it.
But I need to capture the specific version of Njord and of the BIGIP. Probably should get OS and some other thigns as well.
Might put this off until 0.9 but might not. Figure out how far back I should support. I think iRuler supports as far back as 9.4 something. No reason I should do any different I don't think.
This might get pushed back to 1.0 but I think it's going to be reasonably simple.
At minimum I should be able to highlight Rules based on the fact that they all start with a $. enhancement
I probably shouldn't do the dynamic thing described here at all.
See this forum post here:
http://fifesoft.com/forum/viewtopic.php?f=11&t=693
But the short answer is update the document listener so that we check for variables defined with 'set ' then add all the instances of to a list of variables and update the key words list on our syntax scheme to highlight those.
I will probably need to figure out a good way to do it so we aren't parsing the entire document every time someone adds or deletes a letter. I can start that way but it will probably be pretty slow.
Already have one for the iRule name being different. Maybe email the iRuler dude.
This was originally just so that I have a single issue in here so that I can tell once I have the Mylyn connector configured properly but I modified it to be a real task..
When you click 'New iRule' even if you click cancel it refreshes the nav tree and you loose any edits you've made. Fix that first. Then figure out how to add an iRule to the tree without loosing all your edits.
At this point new iRule is probably broken since I'm pretty sure I'm not creating a TextEditorPane for it and adding that to the list. Once that is fixed this should be resolved at the same time.
This should actually be working fine now but I'm doing it with an if/ifelse block instead of a single if statement with a better match on the name.
Adding to 0.8 milestone so I won't have to update the number of iRules to look for every time I run junit tests.
This is for far future.
Original TODO said to add a document listener but I found the ntexteditorPane (maybe just textEditorPane, not sure) which has clean/dirty status but loading the iRule into it is proving to be slightly more complex than I expected.
Original TODO: Add a document listener (See rSyntaxTextArea notes below on how) So that I can tell when a rule has been edited so I can tell that it has been edited and needs to be saved. Update the tree to show.
Resource: njord/src/com/f5/AaronForster/njord/MainGuiWindow.java
Location: line 775
in actionPerformed(ActionEvent e)
Forum post
http://fifesoft.com/forum/viewtopic.php?f=11&t=700
See if we can get the RSTA source code so we can attach it and debug this to see if RSTA is getting my IOException.
It might only be looking for an IOException from write(Int) instead of from flush(). Unfortunately since I need to convert the input to text and save it via iControl write() is buffering the data and saving it when flush() is called.
This will be resolved if I add other items to the nav tree like the ability to view the config file.
Pointing to a 10.2.2 machine when I hit save it changes the notifierpane to "Saving...." and then nothing. No feedback that it was successfull.
Pointing to an 11.1 instance however it seems to be updating it fine. Odd.
Resource: njord/src/com/f5/AaronForster/njord/MainGuiWindow.java
Location: line 145
We need to store the name differently based on the version of the BIGIP we are connected to and make sure that we are displaying it properly in the tree.
Set isLocal if this is a new iRule otherwise it's false.
Currently borked on Georges' mac. Not sure if it's borked on mac or some other issue. I'm definately not handling errors in building the tree correctly.
192.168.215.251 isn't a default bigip address though the admin password is correct.
rsyntaxtextarea's built in undo/redo function has an odd quirk. If you hit undo enough times it removes all the code in the screen. I think that might be 'undoing' the part where I stick the code into the text area. Make it not do that.
I might be able to fix this by loading the text then disabling undo and re-enabling undo. Ooh, in order to get undo to work properly I need to create a new ntextarea for each iRule. Hrmmm.... Let's add an nTextarea variable to NjordIruleObject and then when a rule is selected check that, if there's no ntexteditor create one and assign if there is then just load that. Then when you click off a rule you save the ntextarea instead of the text contents.
IE V10 doesn't include the full path in the name but V11 does.
Stuff like
This is related to issue #6 about properly displaying iRule status.
#6
Initial problem with this because when we load it with text it's marking it dirty. I need to fill it with text when I open it but the only way to do that is to give it a 'file path' See Issue #2 about using fileLocation properly.
Also related #11
New iRule is completely broken now.
Add a couple of other items in the nav menu like the ability to view the config files or something.
Make it RO for 0.8 open an enhancement to make it editable once this task is completed.
Relies on and elated to issue #19 have an "offline" section
See if that's a feature of TextEditorPane or if I need to do it in some default swing component.
I think I need to create a scrollpane and put the TextEditorPane inside it. I thought I was actually doing that. Anyway it isn't scrolling which makes editing large scripts awkward at best.
I'm reasonably certain this used to work.
Dunno how I would write a test case for this. Maybe There's a function to scroll left and right or up and down...
There's a bug/todo somewhere about the connection strings not being reflected when you save new ones and I just figured out why.
When you open the connection settings dialog it populates it with the defaults instead of the contents of the config file. Actual connecting will use the contents of the config but they aren't reflected to the user.
Things like 'Main User Interface' 'Network connectivity' 'Performance enhancement' 'Code Editor UI Improvement'
It's a required inherited method but I'm only implementing write(String) for now
It looks like most errors that we get back are going to be of type RemoteException but they are very different errors.
Known types so far will be
A few types of connection errors.
Several different types of iRules errors including:
Trying to create an iRule that already exists.
Syntax error extra text after the closing bracket
Syntax error method not applicable for context
Syntax error when a method isn't understood because you haven't used it properly.
Is method not found coming back as a remote Exception? IE when we try and use a method like create_v2 on a version of BIGIP that predates the creation of that method.
Invalid Virtual Server Name
Error is an instance of class org.apache.axis.AxisFault
Processing Remote Exception
Error: 01070088:3: The requested object name (1A-Some FI For ActivityTestsLTM1) is invalid.
01070088:3: The requested object name (1A-Some FI For ActivityTestsLTM1) is invalid.
Error is an instance of class org.apache.axis.AxisFault
Processing Remote Exception
Error: 01020036:3: The requested virtual server (AAA-USP-SL1-PrimaryVirtualServerLTM2) was not found.
01020036:3: The requested virtual server (AAA-USP-SL1-PrimaryVirtualServerLTM2) was not found.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.