Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1) Added a roster controller in the Web User Interface (wui)
2) Fixed an issue when guessing the external ip
- Loading branch information
1 parent
038572a
commit 094efd6
Showing
10 changed files
with
156 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# -*- coding: utf-8 -*- | ||
import time | ||
|
||
import sys | ||
sys.path.append("..") | ||
|
||
import spade | ||
|
||
host = "127.0.0.1" | ||
|
||
|
||
if __name__ == "__main__": | ||
jida = "a@" + host | ||
jidb = "b@" + host | ||
jidc = "c@" + host | ||
|
||
a = spade.Agent.Agent(jida, "secret") | ||
a.start() | ||
#a.setDebugToScreen() | ||
|
||
b = spade.Agent.Agent(jidb, "secret", "work") | ||
b.start() | ||
b2 = spade.Agent.Agent(jidb, "secret", "home") | ||
b2.start() | ||
#b.setDebugToScreen() | ||
|
||
c = spade.Agent.Agent(jidc, "secret", "travel") | ||
c.start() | ||
#c.setDebugToScreen() | ||
|
||
a.roster.acceptAllSubscriptions() | ||
b.roster.acceptAllSubscriptions() | ||
c.roster.acceptAllSubscriptions() | ||
b2.roster.acceptAllSubscriptions() | ||
b.roster.followbackAllSubscriptions() | ||
b2.roster.followbackAllSubscriptions() | ||
c.roster.followbackAllSubscriptions() | ||
a.roster.subscribe(jidb) | ||
a.roster.subscribe(jidc) | ||
|
||
a.wui.start() | ||
b.wui.start() | ||
b2.wui.start() | ||
c.wui.start() | ||
|
||
|
||
alive = True | ||
while alive: | ||
try: | ||
time.sleep(1) | ||
except: | ||
alive=False | ||
|
||
a.stop() | ||
b.stop() | ||
c.stop() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> | ||
<html xmlns="http://www.w3.org/1999/xhtml"> | ||
|
||
<head> | ||
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/> | ||
<meta name="description" content="description"/> | ||
<meta name="keywords" content="keywords"/> | ||
<meta name="author" content="author"/> | ||
<link rel="stylesheet" type="text/css" href="magwood.css" media="screen"/> | ||
<link rel="stylesheet" type="text/css" href="table.css" media="screen"/> | ||
|
||
<title>@!name!@ - SPADE Web Interface</title> | ||
</head> | ||
|
||
<!--(include)--> | ||
header.pyra | ||
<!--(end)--> | ||
<!--(if "acc" in name)--> | ||
@!header(item="roster",admin="True")!@ | ||
<!--(else)--> | ||
@!header(item="roster",admin="False")!@ | ||
<!--(end)--> | ||
|
||
|
||
<div id="templatemo_background_section_mid"> | ||
|
||
<div class="templatemo_container"> | ||
<div id="templatemo_content_area"> | ||
<div id="templatemo_left_section"> | ||
<div class='main section' id='main'> | ||
|
||
<h1 class="templatemo_left_section_box_top">Roster</h1> | ||
<table class="servicesT" cellspacing="0"> | ||
<!--(for jid, v in roster.items())--> | ||
<!--(if len(v['resources'])>0)--> | ||
<tr> | ||
<td rowspan=@!len(v['resources'])+1!@><img src="statusGreen.png" width="10" height="10"></td> | ||
<td><b>@!str(jid)!@</b></td> | ||
</tr> | ||
<!--(for res, stat in v['resources'].items())--> | ||
<tr><td>@!str(res)!@: @!str(stat)!@</td></tr> | ||
<!--(end)--> | ||
<!--(else)--> | ||
<tr> | ||
<td><img src="statusRed.png" width="10" height="10"></td> | ||
<td><b>@!str(jid)!@</b></td> | ||
</tr> | ||
<!--(end)--> | ||
<!--(end)--> | ||
</table> | ||
|
||
</div> | ||
</div> | ||
|
||
<div class="cleaner_with_height"></div> | ||
|
||
|
||
</div> | ||
@!footer!@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters