WebApp: Abuse Comet to update the status of the connection
This commit is contained in:
parent
cfb10be704
commit
d10427f782
27
WebApp.st
27
WebApp.st
|
@ -1,4 +1,5 @@
|
|||
PackageLoader fileInPackage: 'Iliad-Core'.
|
||||
PackageLoader fileInPackage: 'Iliad-More-Comet'.
|
||||
PackageLoader fileInPackage: 'Iliad-More-Formula'.
|
||||
PackageLoader fileInPackage: 'Iliad-Swazoo'.
|
||||
|
||||
|
@ -11,7 +12,15 @@ FileStream fileIn: 'SCCPHandler.st'.
|
|||
FileStream fileIn: 'GSMDriver.st'.
|
||||
FileStream fileIn: 'TestPhone.st'.
|
||||
|
||||
Iliad.ILCometEvent subclass: PhoneRefresh [
|
||||
]
|
||||
|
||||
Iliad.ILWidget subclass: ServerConfigWidget [
|
||||
initialize [
|
||||
super initialize.
|
||||
self subscribeToCometEvent: PhoneRefresh.
|
||||
]
|
||||
|
||||
contents [
|
||||
^ [:e |
|
||||
self application gsmServer isConnected
|
||||
|
@ -28,15 +37,21 @@ Iliad.ILWidget subclass: ServerConfigWidget [
|
|||
]
|
||||
|
||||
connectServer [
|
||||
| context |
|
||||
(self application gsmServer)
|
||||
connect;
|
||||
serve.
|
||||
|
||||
context := self context.
|
||||
[
|
||||
ILCurrentContext processVariable value: context.
|
||||
|
||||
(Delay forSeconds: 5) wait.
|
||||
self send: #markDirty.
|
||||
self session cometHandler
|
||||
handleEvent: PhoneRefresh new.
|
||||
] fork.
|
||||
]
|
||||
|
||||
]
|
||||
|
||||
Iliad.ILWidget subclass: PhoneConfigWidget [
|
||||
|
@ -142,10 +157,12 @@ Iliad.ILApplication subclass: GSMTestphoneApp [
|
|||
index [
|
||||
<category: 'controllers'>
|
||||
^ [:e |
|
||||
e build: self serverConfig.
|
||||
e build: self phoneConfig.
|
||||
e build: self lu.
|
||||
e build: self call.
|
||||
e
|
||||
build: self cometConnection;
|
||||
build: self serverConfig;
|
||||
build: self phoneConfig;
|
||||
build: self lu;
|
||||
build: self call.
|
||||
].
|
||||
]
|
||||
|
||||
|
|
Reference in New Issue