hawtio / hawtio-kubernetes

hawtio plugin for working with kubernetes
Apache License 2.0
24 stars 14 forks source link

can you tell me the structure of this code ? #101

Closed ladventure closed 8 years ago

ladventure commented 8 years ago

I want to change the page and add some new functions for me .But I don't know the structure of code ,can you tell me ?

Thanks!

gashcrumb commented 8 years ago

I would recommend creating a fresh hawtio project following the 'getting started' guide on this page:

http://hawt.io/overview/index.html

I'd maybe suggest typescript, but javascript would work as well. You can then bring in hawtio-kubernetes as a bower dependency via:

bower install --save hawtio-kubernetes

If you use typescript you can add a line to plugins/includes.ts to include all the hawtio-kubernetes definitions in your own plugin if you need to re-use some of the API. Also the slush generator gives you a simple example plugin to start from with a couple pages.

In terms of the code structure we organize hawtio project code by plugin. So all the typescript goes in plugins//ts for all the controllers, directives etc. for a plugin. Same goes for the HTML templates, and we put .less files into the 'less' directory.

The generated slush project compiles all the code for your plugin into 'dist'. If you want to say create a full site say to put in a .war file I can point you to an example, I tend to copy functions over as needed between projects:

https://github.com/hawtio/hawtio-java/blob/master/hawtio-console-assembly/gulpfile.js#L286-348

Also if it's something you think would be useful for other folks, feel free to open a PR, we love contributions!

ladventure commented 8 years ago

Thank you very much!

gashcrumb commented 8 years ago

@ladventure hope this is all set, closing for now, re-open or create another issue if you've more questions.