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; 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' ); 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): def getAllConf(self, srvid):
return MumbleCtlDbus.converDbusTypeToNative(self.meta.getAllConf(dbus.Int32(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()) ret.append(x.id())
return ret return ret
def getVersion( self ):
return self.meta.getVersion();
def getAllServers(self): def getAllServers(self):
ret = [] ret = []
for x in self.meta.getAllServers(): for x in self.meta.getAllServers():
@ -263,7 +266,7 @@ class MumbleCtlIce_120(MumbleCtlIce_118):
for x in chans: for x in chans:
chan = chans[x] 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 return ret

3
pyweb/mumble/mctl.py

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

10
pyweb/mumble/mmobjects.py

@ -42,7 +42,15 @@ class mmChannel( object ):
self.subchans = list(); self.subchans = list();
self.linked = 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; self.parent = parentChan;
if self.parent is not None: if self.parent is not None:

2
pyweb/mumble/models.py

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

32
template/mumble/mumble.htm

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

Loading…
Cancel
Save