Feature: Pool autoscale formula #300
Conversation
2, added custom validator for target dedicated and autoscale formula in different mode. 3, register touch function for validating auto scale formula
|
@johnnyzhang82, |
app/app.component.ts
Outdated
| .combineLatest(accountService.accountLoaded, settingsService.hasSettingsLoaded) | ||
| .subscribe((loadedArray) => { | ||
| this.isAppReady = loadedArray[0] && loadedArray[1]; | ||
| this.autoscaleFormulaService.init(); |
There was a problem hiding this comment.
Can you add a blank line here instead of indenting. The auto formatter will put it back
| } | ||
|
|
||
| public changeScaleModeTab(event) { | ||
| if (event) { |
There was a problem hiding this comment.
Can this really be null?
There was a problem hiding this comment.
Probably not, I am just afraid of null reference exception.
| name: string; | ||
| value: string; | ||
| } | ||
| export class AutoscaleFormula extends AutoscaleFormulaRecord implements AutoscaleFormulaAttributes { |
There was a problem hiding this comment.
missing blank line before
| enableInterNodeCommunication: output.enableInterNodeCommunication, | ||
| }; | ||
|
|
||
| if (output.enableAutoScale) { |
There was a problem hiding this comment.
hhm, I would do it the other way arround. Only add what's needed instead of removing
There was a problem hiding this comment.
I tried to follow convention below this code, anyway it's now updated.
app/utils/autoscale.js
Outdated
| @@ -0,0 +1,51 @@ | |||
| (function(mod) { | |||
There was a problem hiding this comment.
Should be able to do import * as CodeMirror from "codemirror" here instead
| import "hammerjs"; | ||
| import "./utils/extensions"; | ||
|
|
||
| import "codemirror/addon/hint/show-hint.css"; |
There was a problem hiding this comment.
Didn't see an update to package.json and yarn.lock did you added codemirror to the list of dep?
There was a problem hiding this comment.
Installed yarn dependencies.
33f851f to
e90823e
Compare
| import { Injectable } from "@angular/core"; | ||
| import { AutoscaleFormula } from "app/models"; | ||
| import { Constants, log } from "app/utils"; | ||
| import * as storage from "electron-json-storage"; |
There was a problem hiding this comment.
I made a service wrapping around electron-json-storage called LocalFileStorage. Use that instead it makes the testing easier and it is also cleaner.
There was a problem hiding this comment.
I think we also have to update ssh-key service as well. That's code I originally cloned from.
converted autscale.js to ts misc
dd40a6d to
6dd163c
Compare
app/assets/styles/pool/create.scss
Outdated
| @@ -188,7 +185,7 @@ bl-autoscale-formula-picker { | |||
| display:block; | |||
| padding:0 2px; | |||
| transform:matrix(0.75, 0, 0, 0.75, 0, 0); | |||
There was a problem hiding this comment.
This is style of label in code editor section. Are there any class we can reuse in form? Because I only see placeholder attribute as a subtitle when blur, I cloned same style for autoscale editor.
| "brace": "^0.10.0", | ||
| "bunyan": "^1.8.4", | ||
| "chart.js": "^2.5.0", | ||
| "codemirror": "^5.25.0", |
There was a problem hiding this comment.
added the package twice? Should only be in the normal dependencies not dev
There was a problem hiding this comment.
Removed dev-dependencies cm.
| ]; | ||
|
|
||
| // tslint:disable-next-line:max-line-length | ||
| const keywordRegex = /\$CPUPercent|\$WallClockSeconds|\$MemoryBytes|\$DiskBytes|\$DiskReadBytes\$DiskWriteBytes|\$DiskReadOps|\$DiskWriteOps|\$NetworkInBytes|\$NetworkOutBytes|\$SampleNodeCount|\$ActiveTasks|\$RunningTasks|\$PendingTasks|\$SucceededTasks|\$FailedTasks|\$CurrentDedicated|\$TargetDedicated/; |
There was a problem hiding this comment.
I don't know how the codemirror modes works but could you here build the regex from an array here instead. It would look cleaner I think.
There was a problem hiding this comment.
This is the part I don't really like. I will refactor this regex to work better with a customize function.
There was a problem hiding this comment.
I've updated this part to a function that check whether given variables, function and system functions started with current word. If so, we display a list of word in auto complete ddl. Please review.
| } | ||
| } | ||
|
|
||
| bl-autoscale-formula-picker { |
There was a problem hiding this comment.
I just merged a new way to handle styles. So you can use angular2 styleUrls check the tags.component.ts for a sample or the components.md doc. This will make styles cleaner
* Adding tags to jobs and pools using metadata (#286) * Tags v1 * Save on enter * Focus input on edit * job tags * Tags specs * Fix tslint * Fix undefined exception in tests * General package update (#287) * First set of update * More update * more * Refresh account button (#290) * add refresh button and method to account details * Account refresh * ff * fix tslint * OS picker improvement (#291) * V1 * Working * Clean * update menu item style * Cleanu * Icons better * Style nitpick * Add icons license * remove svg and use font-mfizz * update * Better icons * fix tslint * Cleanup icon selection * fix svg to work with md-icons * Forgot config folder * Review PR * Cleanup * Created offer tile component * Move data science * Added bl-icon component * Job pool picker improvement (#288) * Job pool picker v1 * Job pool picker v1 * Added selected pool to the list * Added tags * Pool info return by the pool picker * Added specs * Fix tslint * Fix specs * Fix specs * Use actual os icons * Added sorting to bl-table (#293) * Sortable table v1 * Moved display items logic to abstract list base * Sorting all working * Vm size table wired * Fix specs * Added table specs * Fix max results bug with query cache (#296) * Fix query list bug with max results * Fix bug * Fix bug with query cache loading items too litle at the time (#298) * Fix bug with query cache loading items too litle at the time * cleanup * Rename maxResults to pageSize * Fix pool details freeze after a minute (#301) * Fix pool freeze * cleanup * fix tests * Pricing for VM Sizes (#303) * Pricing * Save harware map locally * Added local file storage service * Added local file storage service * Comment * Disable pricing for now * Change branch to master * Added doc for storage * Fix specs * Fix specs * Fix specs * Clear the list keys when clearing the cache (#307) * persisted task output files (#281) * rename task output tab to be task log, added sub tabs to task outputs for persisted files * storage service * storage service updated * basic ui and tabs working * yarn add storage package * comitting broken * finish off wiring up node storage proxy factory, basic data through to UI, but not mapped to grid * kinda working now and hooked up to the UI * just fixing up CSS and some filter issues * loads task outputs and logs, handles no container errors * Handle linking to files from blob storage as well as the task and node API * call listKeys, parse account name from storage url * changes from review * storage key cache, refresh button on account details page * revert account changes, working on get blob properties * rx entity proxy for storage * sorted out my mistake, getting blob now * file details display * Fix no current account error * for tim * Fix shared * remove console.log * display file contents * show selected file content from storage * fix potential circular dependencies and bad merge * fix contentLength as string issue * review suggestions * Update the batch client code to have custom header to every request and to use the promise (#306) * Pool, Task and nodes * New client proxy * Fix * Node proxy fixes * Updated User-Agent * Internal: Enabled component css with style urls and added docs (#312) * Start make component styles * Fix webpack * Move remaining * Fix css by disabling extract text plugin for now * fix spec * Feature: Pool autoscale formula (#300) * added autoscale formula picker * Update some values to default * 1, changed scalemode to tab. 2, added custom validator for target dedicated and autoscale formula in different mode. 3, register touch function for validating auto scale formula * Fixed a build error for moment type * added package config converted autscale.js to ts misc * Fixed lint build erorrs * set cm auto complete to prefix match instead of '$' trigger * * Autoscale formula service updated to LocalFileStorage * Review update and etc * Completed autoscale validation style * resolve conflict during merge * refactor autoscale formula picker styles * update style of codemirror placeholder * Internal: Travis run prod build in branch builds and PRs against stable (#314) * prod build only stable test * Typo * Permissions * if * should not run prod now * should run prod now * should run NOT prod anymore * renable all scripts * Feature: New form experience with sections and picker (#308) * Form Refactoring * Wip * Start task in other blade * Form picker * new forms * Style * change form layout (#305) * change form layout * rename 'name' to 'title' for stepper * Picker smarter * Picked works cleaner * Cancel reset the form * fix os picker and start task edit * Update job create form * Task new form * app package form * typo * Form doc * Missing images * Missing images * Job and app spec fix * Picker specs * Fix tslint * style nitpick * better picker style * Integrate scale into * Move form picker style separted * Move page form separted * Move page form separted * fix * Move form section * fix tslint * fix * Show error at the bottom sticked to the footer (#319) * Show error at the bottom sticked to the footer * Added specs * Added specs * Pool scale picker (#320) * Pool scale picker v1 * Fix * fix editor submitting form on enter * Editor cleanup * more onpush * Revert "more onpush" This reverts commit 6877d69. * Style imporvement * update validity * Perf: Small performance improvement (#322) * Pool details pool os decorator * Fix decorator * Improve more * fix * Internal: Moved from styleUrls to regular import (#324) * Moved from styleUrls to regular import * Fix tslint * fix prod * Feature: Pool rescale supports autoscale (#325) * Pool rescale support forumla * Pool resize fixes * Fixes * Refactor: action-form and create-form into simple-form and complex-form (#327) * Create form to complex form rename * Fix specs after refactor * Rename action form to simple form * update job dialogs * Updated application and task dialog * node connect * More refactor * Fix tests * Fix tslint * Added changes for version 0.3.0 (#331) * Added changes for version 0.3.0 * Added docs for new release * Update version in package.json
Fix #107 Added scale mode picker in create pool form and integrated with codemirror text editor. Please review.


