The server list no longer renders a bogus server entry in case no

monotone server has been configured yet in the connected usher instance.
Also display a short info text if the server or connection list for
a running monotone server is empty.
This commit is contained in:
Thomas Keller 2011-06-04 23:15:58 +02:00
parent 8693418d39
commit 1b1b00a10c
4 changed files with 17 additions and 2 deletions

View File

@ -17,6 +17,9 @@
- Fix SSH public key parsing issues and improve the check for existing, uploaded keys (issue 679) - Fix SSH public key parsing issues and improve the check for existing, uploaded keys (issue 679)
- Diff views now show empty context lines for git and hg again (issue 688) - Diff views now show empty context lines for git and hg again (issue 688)
- Let the SVN command line client not store the login credentials we give him as arguments - Let the SVN command line client not store the login credentials we give him as arguments
- The usher section in the forge administration no longer displays a bogus
server enty in case no monotone server is configured in the connected
usher instance
## Documentation ## Documentation

View File

@ -48,7 +48,7 @@ class IDF_Scm_Monotone_Usher
if ($conn == 'none') if ($conn == 'none')
return array(); return array();
return preg_split('/[ ]/', $conn); return preg_split('/[ ]/', $conn, -1, PREG_SPLIT_NO_EMPTY);
} }
/** /**
@ -73,7 +73,7 @@ class IDF_Scm_Monotone_Usher
if ($conn == 'none') if ($conn == 'none')
return array(); return array();
$single_conns = preg_split('/[ ]/', $conn); $single_conns = preg_split('/[ ]/', $conn, -1, PREG_SPLIT_NO_EMPTY);
$ret = array(); $ret = array();
foreach ($single_conns as $conn) { foreach ($single_conns as $conn) {
preg_match('/\((\w+)\)([^:]+):(\d+)/', $conn, $matches); preg_match('/\((\w+)\)([^:]+):(\d+)/', $conn, $matches);

View File

@ -8,12 +8,18 @@
<th>{trans "address"}</th> <th>{trans "address"}</th>
<th>{trans "port"}</th> <th>{trans "port"}</th>
</tr> </tr>
{if count($connections) == 0}
<tr>
<td colspan="2" align="center">{trans 'No connections found.'}</td>
</tr>
{else}
{foreach $connections as $connection} {foreach $connections as $connection}
<tr> <tr>
<td>{$connection.address}</td> <td>{$connection.address}</td>
<td>{$connection.port}</td> <td>{$connection.port}</td>
</tr> </tr>
{/foreach} {/foreach}
{/if}
</table> </table>
{/block} {/block}

View File

@ -9,6 +9,11 @@
<th>{trans "status"}</th> <th>{trans "status"}</th>
<th>{trans "action"}</th> <th>{trans "action"}</th>
</tr> </tr>
{if count($servers) == 0}
<tr>
<td colspan="3" align="center">{trans 'No monotone servers configured.'}</td>
</tr>
{else}
{foreach $servers as $server} {foreach $servers as $server}
<tr> <tr>
<td>{$server.name}</td> <td>{$server.name}</td>
@ -31,6 +36,7 @@
{/if} {/if}
</tr> </tr>
{/foreach} {/foreach}
{/if}
</table> </table>
{/block} {/block}