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. 3
      pyweb/mumble/MumbleCtlDbus.py
  3. 5
      pyweb/mumble/MumbleCtlIce.py
  4. 3
      pyweb/mumble/mctl.py
  5. 10
      pyweb/mumble/mmobjects.py
  6. 2
      pyweb/mumble/models.py
  7. 32
      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;
}

3
pyweb/mumble/MumbleCtlDbus.py

@ -41,6 +41,9 @@ class MumbleCtlDbus(MumbleCtlBase):
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)))

5
pyweb/mumble/MumbleCtlIce.py

@ -75,6 +75,9 @@ class MumbleCtlIce_118(MumbleCtlBase):
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

@ -218,6 +218,8 @@ class Mumble( models.Model ):
connecturl = property( getURL, None );
version = property( lambda self: self.ctl.getVersion(), None );
class MumbleUser( models.Model ):

32
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,6 +145,7 @@
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 },

Loading…
Cancel
Save