Some minor changes to Hawkeye:
* Colors are a bit more vibrant (less gray, more blue). * Generic notification message implemented (might need some more work). * Neater agent-selection page. * Few other tiny fixups/enchancements.
This commit is contained in:
+2
-2
@@ -185,6 +185,7 @@ dist_img_DATA := \
|
||||
src/www/img/bg.png \
|
||||
src/www/img/Bongo-logo.png \
|
||||
src/www/img/cbg.png \
|
||||
src/www/img/desktop-big.png \
|
||||
src/www/img/dialog-warning.png \
|
||||
src/www/img/help-browser.png \
|
||||
src/www/img/locked.png \
|
||||
@@ -194,8 +195,7 @@ dist_img_DATA := \
|
||||
src/www/img/system-installer.png \
|
||||
src/www/img/system-users.png \
|
||||
src/www/img/user.png \
|
||||
src/www/img/user-desktop.png \
|
||||
src/www/img/welcome-box.png
|
||||
src/www/img/user-desktop.png
|
||||
|
||||
|
||||
jsdir = $(htdocsdir)/js
|
||||
|
||||
@@ -6,4 +6,5 @@ class AgentHandler(HawkeyeHandler):
|
||||
def index_GET(self, req, rp):
|
||||
self.SetVariable("breadcrumb", "Agents")
|
||||
self.SetVariable("agntab", "selecteditem")
|
||||
self.SetVariable("title", "Agents")
|
||||
return self.SendTemplate(req, rp, "index.tpl")
|
||||
|
||||
@@ -13,8 +13,9 @@ class BackupHandler(HawkeyeHandler):
|
||||
def index_GET(self, req, rp):
|
||||
today = datetime.date.today()
|
||||
self.SetVariable("set", today.strftime("%y%m%d"))
|
||||
self.SetVariable("breadcrumb", "System » Backup and Restore");
|
||||
self.SetVariable("systab", "selecteditem");
|
||||
self.SetVariable("breadcrumb", "System » Backup and Restore")
|
||||
self.SetVariable("systab", "selecteditem")
|
||||
self.SetVariable("title", "Backup and Restore")
|
||||
return self.SendTemplate(req, rp, "index.tpl")
|
||||
|
||||
def download_GET(self, req, rp):
|
||||
@@ -46,7 +47,7 @@ class BackupHandler(HawkeyeHandler):
|
||||
else:
|
||||
agent["enabled"] = False
|
||||
else:
|
||||
self.SetVariable("message", "Unable to read config")
|
||||
self.SetVariable("error", "Unable to read config from store.")
|
||||
|
||||
self._setManagerFile(req, config)
|
||||
return self.index_GET(req, rp)
|
||||
|
||||
@@ -29,12 +29,14 @@ class RootHandler(HawkeyeHandler):
|
||||
if len(t) == 3: ## and t[0] == VmKey:
|
||||
return float(t[1]) * _scale.get(t[2], 0.0)
|
||||
except:
|
||||
self.SetVariable("error", "Unable to get memory statistics for your system.")
|
||||
pass
|
||||
return 0.0
|
||||
|
||||
def index_GET(self, req, rp):
|
||||
# template ui
|
||||
self.SetVariable("breadcrumb", "Desktop")
|
||||
self.SetVariable("title", "Welcome!")
|
||||
self.SetVariable("dsktab", "selecteditem")
|
||||
# check ram free
|
||||
cm = self.memory("MemTotal:")
|
||||
|
||||
@@ -4,13 +4,22 @@ from bongo.store.StoreClient import StoreClient, DocTypes
|
||||
import bongo.external.simplejson as simplejson
|
||||
from HawkeyeHandler import HawkeyeHandler
|
||||
|
||||
doneop = 0
|
||||
|
||||
class ServerHandler(HawkeyeHandler):
|
||||
def NeedsAuth(self, rp):
|
||||
return True
|
||||
|
||||
def index_GET(self, req, rp):
|
||||
global doneop
|
||||
agentlist = []
|
||||
config = self._getManagerFile(req)
|
||||
|
||||
if doneop:
|
||||
self.SetVariable("opsuccess", 1)
|
||||
doneop = 0
|
||||
else:
|
||||
self.SetVariable("opsuccess", 0)
|
||||
|
||||
# change things which eval. to False to empty elements
|
||||
if config != None and config.has_key("agents"):
|
||||
@@ -21,13 +30,17 @@ class ServerHandler(HawkeyeHandler):
|
||||
self.SetVariable("success", 1)
|
||||
else:
|
||||
self.SetVariable("success", 0)
|
||||
self.SetVariable("error", "Unable to read configuration information from the Bongo store. Are you logged in as a user with administrative permissions?")
|
||||
|
||||
self.SetVariable("breadcrumb", "Agents » Enable/Disable Agents");
|
||||
self.SetVariable("agntab", "selecteditem");
|
||||
self.SetVariable("breadcrumb", "Agents » Enable/Disable Agents")
|
||||
self.SetVariable("title", "Enable/Disable Agents")
|
||||
self.SetVariable("agntab", "selecteditem")
|
||||
|
||||
return self.SendTemplate(req, rp, "index.tpl")
|
||||
|
||||
def index_POST(self, req, rp):
|
||||
global doneop
|
||||
|
||||
if not req.form:
|
||||
return bongo.dragonfly.HTTP_UNAUTHORIZED
|
||||
|
||||
@@ -42,9 +55,11 @@ class ServerHandler(HawkeyeHandler):
|
||||
else:
|
||||
agent["enabled"] = False
|
||||
else:
|
||||
self.SetVariable("message", "Unable to read config")
|
||||
self.SetVariable("error", "Unable to read config")
|
||||
|
||||
self._setManagerFile(req, config)
|
||||
# Operation completed OK.
|
||||
doneop = 1
|
||||
return self.index_GET(req, rp)
|
||||
|
||||
def login_POST(self, req, rp):
|
||||
|
||||
@@ -7,4 +7,5 @@ class SystemHandler(HawkeyeHandler):
|
||||
def index_GET(self, req, rp):
|
||||
self.SetVariable("breadcrumb", "System")
|
||||
self.SetVariable("systab", "selecteditem")
|
||||
self.SetVariable("title", "System")
|
||||
return self.SendTemplate(req, rp, "index.tpl")
|
||||
|
||||
+61
-10
@@ -55,17 +55,27 @@ min-height: 500px;
|
||||
|
||||
#sidebar {
|
||||
color: #eeeeec; /* Tango WHITE */
|
||||
/* background: url('/img/sbg.png');
|
||||
background-repeat: repeat-x;*/
|
||||
background: url('/img/sbg.png');
|
||||
background-repeat: repeat-x;
|
||||
background-color: #2e3436; /* Tango DARK-GREY */
|
||||
float: left;
|
||||
height: 500px;
|
||||
min-height: 500px;
|
||||
width: 175px;
|
||||
|
||||
text-align: right;
|
||||
margin-right: 0px;
|
||||
padding-right: 0px;
|
||||
-moz-border-radius: 15px;
|
||||
padding-bottom: 6px;
|
||||
|
||||
-moz-border-radius-bottomleft: 20px;
|
||||
-khtml-border-radius-bottomleft: 20px;
|
||||
border-radius-bottomleft: 20px;
|
||||
|
||||
-moz-border-radius-bottomright: 20px;
|
||||
-khtml-border-radius-bottomright: 20px;
|
||||
border-radius-bottomright: 20px;
|
||||
|
||||
/*-moz-border-radius: 15px;*/
|
||||
}
|
||||
.helpitem {
|
||||
/* FIXME! */
|
||||
@@ -134,18 +144,59 @@ ul.nav{
|
||||
width: 100%;
|
||||
}
|
||||
.htable {
|
||||
border: 2px solid #2e3436;
|
||||
font-size: 110%;
|
||||
border: 3px solid #729fcf;
|
||||
/*font-size: 110%;*/
|
||||
-moz-border-radius: 10px;
|
||||
}
|
||||
|
||||
|
||||
.hrow {
|
||||
background-color: #2e3436;
|
||||
color: #eeeeec;
|
||||
color: #d3d7cf;
|
||||
font-weight: bold;
|
||||
padding-left: 4px;
|
||||
}
|
||||
.drow {
|
||||
border-bottom: 1px dotted #2e3436;
|
||||
|
||||
.highlight, .highlight0 {
|
||||
color: #d3d7cf;
|
||||
background-color: #204a87;
|
||||
}
|
||||
|
||||
.highlight1 {
|
||||
color: #d3d7cf;
|
||||
background-color: #3465a4;
|
||||
}
|
||||
|
||||
.drow {
|
||||
color: #d3d7cf;
|
||||
}
|
||||
|
||||
.error, .info {
|
||||
-moz-border-radius: 5px;
|
||||
|
||||
margin-right: 12px;
|
||||
min-height:18px; /* Icon size - total padding (top & bottom) */
|
||||
padding-top: 8px;
|
||||
padding-bottom: 8px;
|
||||
|
||||
|
||||
padding-left: 36px;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.error {
|
||||
background-image: url('/img/dialog-error-32.png');
|
||||
background-color: #a40000;
|
||||
color: #eeeeec;
|
||||
border: 3px solid #cc0000;
|
||||
}
|
||||
|
||||
.info {
|
||||
background-image: url('/img/dialog-information-32.png');
|
||||
background-color: #3465a4;
|
||||
color: #eeeeec;
|
||||
border: 3px solid #204a85;
|
||||
}
|
||||
|
||||
.tlist {
|
||||
padding-bottom: 3px;
|
||||
padding-top: 3px;
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
%(include|header.tpl)s
|
||||
|
||||
<h1>Agents</h1>
|
||||
|
||||
<ul>
|
||||
<li>TODO: List different agent pages here.</li>
|
||||
<li><a href="%(url|/)sserver/">Enable/Disable Agents</a></li>
|
||||
<li><a href="%(url|/)santispam/">Antispam</a></li>
|
||||
</ul>
|
||||
|
||||
%(include|footer.tpl)s
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
%(include|header.tpl)s
|
||||
|
||||
<h1>Backup and Restore</h1>
|
||||
|
||||
<p>This allows you to save and restore copies of the Bongo server configuration.
|
||||
It <em>does not</em> look at user data such as contacts or e-mail: use the
|
||||
specialist <tt>bongo-backup</tt> tool to handle those (potentially very large)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<!-- END HAWKYE CONTENT -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -27,3 +27,10 @@
|
||||
<div id="content">
|
||||
<div class="breadcrumb"><p>%(breadcrumb)s</p></div>
|
||||
|
||||
<h1 tal:content="title">Untitled page</h1>
|
||||
|
||||
<div class="info" tal:condition="message" tal:content="message">Something happened, but I'm not sure.</div>
|
||||
<div class="error" tal:condition="error" tal:content="error">An error occured while processing your request. No more information is available.</div>
|
||||
<div class="info" tal:condition="opsuccess">Operation completed sucessfully.</div>
|
||||
|
||||
<!-- BEGIN HAWKYE CONTENT -->
|
||||
|
||||
@@ -1,38 +1,39 @@
|
||||
%(include|header.tpl)s
|
||||
|
||||
<img src="/img/welcome-box.png" class="floaty" alt="Welcome to Bongo" />
|
||||
<img src="/img/desktop-big.png" class="floaty" alt="Welcome to Bongo" />
|
||||
|
||||
<h1>Welcome</h1>
|
||||
<p>Thank you for choosing Bongo as your calendaring and mail solution.</p>
|
||||
<p>This screen enables you to briefly overview your system status, and to access commonly and recently used tasks.</p>
|
||||
<p>Help can be accessed by clicking on the help menu at any time.<br />To get started, either click on one of the menus to the left, or click on one of the common tasks listed below.</p>
|
||||
<p>This screen enables you to briefly overview your system status, and as a starting point to the different administration tasks available.</p>
|
||||
<p>Help can be accessed by clicking on the help menu at any time.<br />To get started, click on one of the menu items to your left.</p>
|
||||
|
||||
<br />
|
||||
|
||||
<table class="htable" width="100%%" cellspacing="0" >
|
||||
<tr style="height: 28px;">
|
||||
<tr style="height: 28px;" class="highlight">
|
||||
<td class="hrow">Agent Status</td>
|
||||
<td class="drow" style="text-align: center;">Operation normal.</td>
|
||||
<td style="text-align: center;">Operation normal.</td>
|
||||
<td class="hrow" width="16"></td>
|
||||
</tr>
|
||||
<tr style="height: 28px;">
|
||||
<tr class="highlight1">
|
||||
<td class="hrow">Bongo Updates</td>
|
||||
<td class="drow" style="text-align: center;">
|
||||
<p>Running version: <span tal:content="sw_current">unknown</span> <br />
|
||||
Latest available: <span tal:content="sw_available">unknown</span></p>
|
||||
<p tal:condition="sw_upgrade">Upgrade to new version recommended.</p>
|
||||
<td style="text-align: center;">
|
||||
Running version: <span tal:content="sw_current">unknown</span> <br />
|
||||
Latest available: <span tal:content="sw_available">unknown</span>
|
||||
<div tal:condition="sw_upgrade">Upgrade to new version recommended.</div>
|
||||
</td>
|
||||
<td class="hrow" width="16"><img src="/img/dialog-warning.png" alt="Warning" tal:condition="sw_upgrade" /></td>
|
||||
</tr>
|
||||
<tr style="height: 28px;">
|
||||
<tr style="height: 28px;" class="highlight">
|
||||
<td class="hrow">System Status</td>
|
||||
<td style="text-align: center;">Current processing load: <span tal:content="load">unknown</span></td>
|
||||
<td class="hrow" width="16"></td>
|
||||
</tr>
|
||||
<tr style="height: 28px;">
|
||||
<tr style="height: 28px;" class="highlight1">
|
||||
<td class="hrow">Memory Usage</td>
|
||||
<td style="text-align: center;" tal:content="mem">RAM</td>
|
||||
<td class="hrow" width="16"></td>
|
||||
</tr>
|
||||
<tr style="height: 28px;">
|
||||
<tr style="height: 28px;" class="highlight">
|
||||
<td class="hrow">Load</td>
|
||||
<td style="text-align: center;">Unknown</td>
|
||||
<td class="hrow" width="16"></td>
|
||||
|
||||
@@ -1,31 +1,27 @@
|
||||
%(include|header.tpl)s
|
||||
|
||||
<h1>Enable/Disable Agents</h1>
|
||||
<p>
|
||||
|
||||
<p tal:condition="message" tal:content="message">No message.</p>
|
||||
|
||||
<p tal:condition="not:success">
|
||||
Unable to read configuration information from the Bongo store.
|
||||
Are you logged in as a user with administrative permissions?
|
||||
</p>
|
||||
|
||||
<div tal:condition="success">
|
||||
<div tal:condition="success" style="text-align: center;">
|
||||
<form method="post">
|
||||
<input type="hidden" name="command" value="agentstatus" />
|
||||
<table class="htable">
|
||||
<tr>
|
||||
<th>Enabled?</th>
|
||||
<th>Agent Name</th>
|
||||
<table class="htable" cellspacing="0">
|
||||
<tr class="highlight hrow">
|
||||
<th style="padding: 10px;">Enabled</th>
|
||||
<th style="padding: 10px;">Agent Name</th>
|
||||
</tr>
|
||||
<tr tal:repeat="agent agentlist">
|
||||
<td>
|
||||
<tr tal:repeat="agent agentlist" tal:attributes="class string:highlight${repeat/agent/odd}">
|
||||
<td style="height: 24px">
|
||||
<input type="checkbox" tal:attributes="checked agent/enabled;name agent/name" />
|
||||
</td>
|
||||
<td tal:content="agent/name">unknown agent</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br />
|
||||
<input type="submit" value="Save" />
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</p>
|
||||
|
||||
%(include|footer.tpl)s
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
%(include|header.tpl)s
|
||||
|
||||
<h1>System</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="%(url|/)sbackup/">Backup and Restore</a></li>
|
||||
</ul>
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 5.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.9 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 7.6 KiB |
Reference in New Issue
Block a user