Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

adding stuff to the services page

  • Loading branch information...
commit 32220f4be6cc24a50420910cda8667ef741748ae 1 parent 2d8496d
@haxwithaxe haxwithaxe authored
View
10 byzantium.conf
@@ -0,0 +1,10 @@
+# INI key=value format
+
+## global
+debug.level=5
+avahi.service_type=__byz__._tcp
+
+## control panel
+
+## captive portal
+
View
3  porteus/home/guest/.bashrc
@@ -0,0 +1,3 @@
+
+## this will set kdesu to use sudo instead of su in the event it needs to be set again
+kwriteconfig --file kdesurc --group super-user-command --key super-user-command sudo
View
2  porteus/home/guest/.kde/share/config/kdesurc
@@ -0,0 +1,2 @@
+[super-user-command]
+super-user-command=sudo
View
3  service_directory/_utils.py
@@ -47,6 +47,9 @@ def __init__(self):
self.services_live_dir = '/etc/avahi/services'
self.servicedb = '/var/db/controlpanel/services.sqlite'
self.no_services_msg = 'No services found in the network. Please try again in a little while.'
+ self.no_internet_msg = '<span class="sad-face">This mesh network is probably not connected to the internet.</span>'
+ self.no_internet_msg = '<span class="winning">This mesh network is probably connected to the internet.</span>'
self.uri_post_port_string_key = 'appendtourl'
self.service_description_key = 'description'
self.service_info = {'chat':'/chat/?channels=byzantium'}
+
View
9 service_directory/services.py
@@ -5,17 +5,22 @@
conf = _utils.Config()
+def has_internet():
+ return False
+
def main():
service_entry = _utils.file2str('tmpl/services_entry.tmpl')
page = _utils.file2str('tmpl/services_page.tmpl')
+ internet_connected_html = config.no_internet_msg
+ if has_intnernet(): internet_connected_html = config.has_internet_msg
services_list = _services.get_services_list()
if len(services_list) < 1:
- page = page % {'service-list':conf.no_services_msg}
+ page = page % {'service-list':conf.no_services_msg,'internet-connected':internet_connected_html}
else:
services_html = ''
for entry in services_list:
services_html += service_entry % entry
- page = page % {'service-list':services_html}
+ page = page % {'service-list':services_html,'internet-connected':internet_connected_html}
return page
if __name__ == '__main__':
View
11 service_directory/tmpl/services_page.tmpl
@@ -1,12 +1,17 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
+<!DOCTYPE html>
+<html>
<head>
<title>Mesh Services</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
</head>
<body>
+<div id="header">
+Services On This Mesh Network
+</div>
<div id="content">
+<div id="internet-connected">
+%(internet-connected)s
+</div>
<div id="service-list">
%(service-list)s
</div>
Please sign in to comment.
Something went wrong with that request. Please try again.