Your comments

How about a way to update the UI when the user clicks away from a plugin? i tried putting the item into init but it doesn't seem to get called beyond the first time the page loads.

or a way to extend the servicebar action such that it calls my python function after it performs a start/stop?

i have information that i would like to provide the user depending on if the service is started or stopped. i was hoping to be able to provide a link the the user initially (through JS), and the link changes depending the state of the service.
hi

(apologies for all these seemingly newbie questions. i'm not too familiar with python and coffee script.. )
as an extension to this question. How do i call my own JS from the text included in in my own control? 

i have a simple coffee script included as part of the DOM build

go_alert: () ->
alert "Test text"

but how do i call it in my own control? and reference my own DOM in the JS within Ajenti?
thanks for the hint.

i think i got it.... i had to also "id" the tag in layout/main.xml to make sure that self.find() is able to locate the attribute in the XML.

thanks
hi

thanks for your reply.
i have looked at it and tried to play with the example given. However, i'm still not very sure where the pieces comes together. perhaps you can enlighten me.

it seems to me that the coffee script creates a DOM that would be inserted into the layout based on the XML tag provided as part of the typeid defined in the respective class.
The example made use of a input type to read a value from the DOM.

but what if i wanted to updated a section of the text? something like manipulating innerHTML from the custom DOM?

i created something like the below.

class window.Controls.textinfo extends window.Control
createDom: () ->
# createDom() must set this.dom and (optional) this.childContainer to jQuery DOM elements
# use this.properties hash to populate control with its current state
@dom = $("""
<div id="textinfo">
Something to see
</div>
""")

and tried to access/change it using the below in main.py
self.find("textinfo").value = "New stuff"

but it doesn't work. is there any advice you can give?

ah... that great. thanks
got it... its working now...
thanks
hi.. thanks

so i now have managed to start the server... but when i try to connect to it via my other machine, it gives an error...

how can i make it allow any host to connect?
i tried looking at config.json but am not seeing anything.

thanks lots for your help

<socket fileno=11 sock=192.168.1.106:8000 peer=192.168.1.144:61811>: Invalid HTTP method: '\x16\x03\x01\x00\xae\x01\x00\x00\xaa\x03\x03R\xae\xec\x12\xabS\xf5{\xb6\x82C\xf8\xf2\xa2\xc7#UZ\xcd\x16\x1a\xbf\x174\xa0\xdf.\x94\x08\xb2\xa8\x14\x00\x00J\x00\xff\xc0$\xc0#\xc0\n'
<socket fileno=11 sock=192.168.1.106:8000 peer=192.168.1.144:61812>: Expected GET method: '\x16\x03\x01\x00\x9e\x01\x00\x00\x9a\x03\x01R\xae\xec\x12\x0c\xa0)\x9f\xba\xd7\xa6\xe1\xcf=\xe5S\x8a\xc7\x93o:\xeb6\x04QV\x91\x1a\xd5\x03\xa8\xf0\x00\x00J\x00\xff\xc0$\xc0#\xc0\n'
<socket fileno=11 sock=192.168.1.106:8000 peer=192.168.1.144:61813>: Invalid HTTP method: '\x16\x03\x00\x00E\x01\x00\x00A\x03\x00R\xae\xec\x12\xc9\\\xe2\xbf%O\xf6AS\x05c\xce\xbez\xdc8Mdx\x99\x87J\xd8\xd2\xfb\xc7\x17\xc5\x00\x00\x1a\x00\xff\x00=\x00<\x00/\x00\x05\x00\x04\x005\x00\n'
hi

so i have tried updating.. and it didn't seem to help. any advice?

dev@dev:~$ sudo pip install --upgrade python-catcher
Requirement already up-to-date: python-catcher in /usr/local/lib/python2.7/dist-packages
Requirement already up-to-date: requests in /usr/local/lib/python2.7/dist-packages (from python-catcher)
Requirement already up-to-date: Mako in /usr/local/lib/python2.7/dist-packages (from python-catcher)
Requirement already up-to-date: MarkupSafe>=0.9.2 in /usr/local/lib/python2.7/dist-packages (from Mako->python-catcher)
Cleaning up...

dev@dev:~/src/ajenti-debug/ajenti$ sudo make run
./ajenti-panel -v -c ./config.json
16.12.2013 19:50 ajenti-panel:71 INFO Using config file ./config.json
16.12.2013 19:50 ajenti-panel:90 INFO Ajenti starting in foreground
16.12.2013 19:50 registry.py:247 INFO registered crypt handler 'sha512_crypt': <class 'passlib.handlers.sha2_crypt.sha512_crypt'>
16.12.2013 19:50 core.py:95 INFO Ajenti 1.2.10-10-g4d3c040 running on platform: debian
Traceback (most recent call last):
File "./ajenti-panel", line 93, in <module>
core.run()
File "/home/cubie/src/ajenti-debug/ajenti/ajenti/core.py", line 117, in run
('_instances_session', 'return all @plugin instances in session #0', cmd_list_instances_session),
TypeError: register() got an unexpected keyword argument 'commands'
make: *** [run] Error 1

hi

attached is the traceback

dev@dev:~/src/node-v0.10.23/ajenti$ make run
./ajenti-panel -v -c ./config.json
16.12.2013 07:19 ajenti-panel:71 INFO Using config file ./config.json
16.12.2013 07:19 ajenti-panel:90 INFO Ajenti starting in foreground
16.12.2013 07:19 registry.py:247 INFO registered crypt handler 'sha512_crypt': <class 'passlib.handlers.sha2_crypt.sha512_crypt'>
16.12.2013 07:19 core.py:95 INFO Ajenti 1.2.10-10-g4d3c040 running on platform: debian
Traceback (most recent call last):
File "./ajenti-panel", line 93, in <module>
core.run()
File "/home/cubie/src/node-v0.10.23/ajenti/ajenti/core.py", line 117, in run
('_instances_session', 'return all @plugin instances in session #0', cmd_list_instances_session),
TypeError: register() got an unexpected keyword argument 'commands'
make: *** [run] Error 1