Browse Source

server info and channel description

Natenom/support-murmur-13-1446181288462
Michael Ziegler 16 years ago
parent
commit
48b4ca659f
  1. 14
      htdocs/mumble/style.css
  2. 11
      pyweb/mumble/MumbleCtlDbus.py
  3. 7
      pyweb/mumble/MumbleCtlIce.py
  4. 3
      pyweb/mumble/mctl.py
  5. 10
      pyweb/mumble/mmobjects.py
  6. 2
      pyweb/mumble/models.py
  7. 136
      template/index.htm
  8. 36
      template/mumble/mumble.htm

14
htdocs/mumble/style.css

@ -24,3 +24,17 @@ span.mumble {
float:right;
}
div.mumble-ext {
padding: 10px;
}
div.mumble-ext ul {
list-style-type: disc;
padding-left: 20px;
}
div.mumble-ext fieldset {
border: 1px solid darkblue;
margin-top: 20px;
padding: 10px;
}

11
pyweb/mumble/MumbleCtlDbus.py

@ -29,18 +29,21 @@ class MumbleCtlDbus(MumbleCtlBase):
# Prior to saving the model, connect to murmur via dbus and update its settings.
self.dbus_base = connstring;
self.meta = self._getDbusMeta();
def _getDbusMeta( self ):
return dbus.Interface( dbus.SystemBus().get_object( self.dbus_base, '/' ), 'net.sourceforge.mumble.Meta' );
def _getDbusServerObject( self, srvid):
"Connects to DBus and returns an mmServer object representing this Murmur instance."
if srvid not in self.getBootedServers():
raise Exception, 'No murmur process with the given server ID (%d) is running and attached to system dbus under %s.' % ( srvid, self.meta );
return dbus.Interface( dbus.SystemBus().get_object( self.dbus_base, '/%d' % srvid ), 'net.sourceforge.mumble.Murmur' );
def getVersion( self ):
return MumbleCtlDbus.converDbusTypeToNative( self.meta.getVersion() )
def getAllConf(self, srvid):
return MumbleCtlDbus.converDbusTypeToNative(self.meta.getAllConf(dbus.Int32(srvid)))

7
pyweb/mumble/MumbleCtlIce.py

@ -74,7 +74,10 @@ class MumbleCtlIce_118(MumbleCtlBase):
for x in self.meta.getBootedServers():
ret.append(x.id())
return ret
def getVersion( self ):
return self.meta.getVersion();
def getAllServers(self):
ret = []
for x in self.meta.getAllServers():
@ -263,7 +266,7 @@ class MumbleCtlIce_120(MumbleCtlIce_118):
for x in chans:
chan = chans[x]
ret.append([chan.id, self.setUnicodeFlag(chan.name), chan.parent, chan.links])
ret.append([chan.id, self.setUnicodeFlag(chan.name), chan.parent, chan.links, chan.description])
return ret

3
pyweb/mumble/mctl.py

@ -27,6 +27,9 @@ class MumbleCtlBase ():
def getAllConf(self, srvid):
pass
def getVersion( self ):
pass
def setConf(self, srvid, key, value):
pass

10
pyweb/mumble/mmobjects.py

@ -42,7 +42,15 @@ class mmChannel( object ):
self.subchans = list();
self.linked = list();
(self.chanid, self.name, parent, self.linkedIDs ) = channelObj;
self.chanid = channelObj[0];
self.name = channelObj[1];
parent = channelObj[2];
self.linkedIDs = channelObj[3];
if len( channelObj ) == 5:
self.description = channelObj[4];
else:
self.description = "";
self.parent = parentChan;
if self.parent is not None:

2
pyweb/mumble/models.py

@ -217,6 +217,8 @@ class Mumble( models.Model ):
return "mumble://%s%s/" % ( userstr, self.addr );
connecturl = property( getURL, None );
version = property( lambda self: self.ctl.getVersion(), None );

136
template/index.htm

@ -1,68 +1,68 @@
<html>
<head>
<title>Mumble Administration</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="/static/ext-2.2/resources/css/ext-all.css" />
<link rel="stylesheet" type="text/css" href="/static/style.css" />
<link rel="stylesheet" type="text/css" href="/static/templatestyle.css" />
<link rel="stylesheet" type="text/css" href="/static/mumble/style.css" />
<link rel="shortcut icon" type="image/png" href="/static/mumble/mumble.16x16.png" />
<script type="text/javascript" src="/static/ext-2.2/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="/static/ext-2.2/ext-all.js"></script>
{% block HeadTag %}
{% endblock %}
</head>
<body bgcolor="#3B69AD">
<div id="content">
<!-- header -->
<div id="headpanel">
<div id="headlinks">
{% if user.is_authenticated %}
<a href="/accounts/logout">Logout</a> |
{% else %}
<a href="/accounts/login">Login</a> |
{% endif %}
<a href="/admin" target="_blank">Admin</a> |
<a href="/accounts/imprint">Imprint</a>
</div>
<h2>{% block Headline %}{% endblock %}</h2>
</div>
<!-- navi -->
<div id="navipanel">
<ul id="navilinks">
<li><a href="/">Home</a></li>
{% if MumbleActive %}
<li><b>Mumble</b></li>
{% else %}
<li><a href="/mumble">Mumble</a></li>
{% endif %}
{% if ProfileActive %}
<li><b>Profile</b></li>
{% else %}
<li><a href="/accounts/profile">Profile</a></li>
{% endif %}
</ul>
</div>
<!-- content -->
<div id="contentpanel">
<div id="contentleft">
{% block LeftColumn %}
{% endblock %}
</div>
<div id="contentright">
{% block Content %}
{% endblock %}
</div>
</div>
<!-- footer -->
<div id="footerpanel">
You are using <a href="http://bitbucket.org/Svedrin/mumble-django" target="_blank">Mumble-Django</a> --
interface built using <a href="http://extjs.com/" target="_blank">ExtJS</a>
</div>
</div>
</body>
</html>
<html>
<head>
<title>Mumble Administration</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="/static/ext-2.2/resources/css/ext-all.css" />
<link rel="stylesheet" type="text/css" href="/static/style.css" />
<link rel="stylesheet" type="text/css" href="/static/templatestyle.css" />
<link rel="stylesheet" type="text/css" href="/static/mumble/style.css" />
<link rel="shortcut icon" type="image/png" href="/static/mumble/mumble.16x16.png" />
<script type="text/javascript" src="/static/ext-2.2/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="/static/ext-2.2/ext-all.js"></script>
{% block HeadTag %}
{% endblock %}
</head>
<body bgcolor="#3B69AD">
<div id="content">
<!-- header -->
<div id="headpanel">
<div id="headlinks">
{% if user.is_authenticated %}
<a href="/accounts/logout">Logout</a> |
{% else %}
<a href="/accounts/login">Login</a> |
{% endif %}
<a href="/admin" target="_blank">Admin</a> |
<a href="/accounts/imprint">Imprint</a>
</div>
<h2>{% block Headline %}{% endblock %}</h2>
</div>
<!-- navi -->
<div id="navipanel">
<ul id="navilinks">
<li><a href="/">Home</a></li>
{% if MumbleActive %}
<li><b>Mumble</b></li>
{% else %}
<li><a href="/mumble">Mumble</a></li>
{% endif %}
{% if ProfileActive %}
<li><b>Profile</b></li>
{% else %}
<li><a href="/accounts/profile">Profile</a></li>
{% endif %}
</ul>
</div>
<!-- content -->
<div id="contentpanel">
<div id="contentleft">
{% block LeftColumn %}
{% endblock %}
</div>
<div id="contentright">
{% block Content %}
{% endblock %}
</div>
</div>
<!-- footer -->
<div id="footerpanel">
You are using <a href="http://bitbucket.org/Svedrin/mumble-django" target="_blank">Mumble-Django</a> --
interface built using <a href="http://extjs.com/" target="_blank">ExtJS</a>
</div>
</div>
</body>
</html>

36
template/mumble/mumble.htm

@ -16,7 +16,20 @@
</p>
</noscript>
<div id="mumble_ext_container"></div>
<div id="mumble_registration">
<div id="mumble_motd" class="mumble-ext x-hide-display">
<ul>
<li>Server address: <a href="{{ DBaseObject.connecturl }}">{{ DBaseObject.addr }}:{{ DBaseObject.port }}</a></li>
{% if DBaseObject.url %}
<li>Website: {{ DBaseObject.url|urlize }}</li>
{% endif %}
<li>Server version: {{ DBaseObject.version.0 }}.{{ DBaseObject.version.1 }}.{{ DBaseObject.version.2 }}</li>
</ul>
<fieldset>
<legend>Welcome message</legend>
{{ DBaseObject.motd|safe }}
</fieldset>
</div>
<div id="mumble_registration" class="mumble-ext">
{% if user.is_authenticated %}
<h2>Server registration</h2>
<form action="" method="post">
@ -37,7 +50,7 @@
</div>
{% if Registered %}
<div id="mumble_texture">
<div id="mumble_texture" class="mumble-ext">
<h2>User Texture</h2>
<p>
You can upload an image that you would like to use as your user texture here.<br />
@ -57,7 +70,7 @@
{% endif %}
{% if CurrentUserIsAdmin %}
<div id="mumble_admin">
<div id="mumble_admin" class="mumble-ext">
<h2>Server administration</h2>
<form action="" method="post">
<table>
@ -71,7 +84,7 @@
{% for item in ChannelTable %}
{% if item.is_player %}
<div id="mumble_{{ item.id }}" class="x-hide-display">
<div id="mumble_{{ item.id }}" class="mumble-ext x-hide-display">
<h2>Player {{ item.name }}</h2>
<ul>
<li>Online since {{item.onlinesince|time:"H:i"}}</li>
@ -94,9 +107,15 @@
{% endif %}
</div>
{% else %}
<div id="mumble_{{ item.id }}" class="x-hide-display">
<div id="mumble_{{ item.id }}" class="mumble-ext x-hide-display">
<h2>Channel {{ item.name }}</h2>
<a href="{{ item|chanurl:MumbleAccount }}" class="mumble">Connect</a>
{% if item.description %}
<fieldset>
<legend>Channel description</legend>
{{ item.description|safe }}
</fieldset>
{% endif %}
</div>
{% endif %}
{% endfor %}
@ -117,7 +136,7 @@
renderTo: 'mumble_ext_container',
layout: 'card',
id: 'mumble_container',
height: 550,
height: 570,
activeItem: 0,
border: false,
items: [ {
@ -126,12 +145,13 @@
defaults: { autoheight: true },
activeTab: {{ DisplayTab }},
items: [
{ contentEl: 'mumble_motd', title: 'Server Info', autoScroll: true },
{ contentEl: 'mumble_registration', title: 'Registration', autoScroll: true },
{% if CurrentUserIsAdmin %}
{ contentEl: 'mumble_admin', title: 'Administration', autoScroll: true },
{ contentEl: 'mumble_admin', title: 'Administration', autoScroll: true },
{% endif %}
{% if Registered %}
{ contentEl: 'mumble_texture', title: 'User Texture', autoScroll: true },
{ contentEl: 'mumble_texture', title: 'User Texture', autoScroll: true },
{% endif %}
]
},

Loading…
Cancel
Save