Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Displaying detailed connection information in Admin app.

  • Loading branch information...
commit 755cba182831b94b7bfe2f252a5e11802919bbbd 1 parent 7d0a55f
@cederberg authored
View
42 src/plugin/system/files/app/admin/app.js
@@ -31,6 +31,13 @@ AdminApp.prototype.start = function () {
// Connection view
RapidContext.UI.connectProc(this.proc.cxnList, this.ui.cxnLoading, this.ui.cxnReload);
MochiKit.Signal.connect(this.proc.cxnList, "onsuccess", this.ui.cxnTable, "setData");
+ MochiKit.Signal.connect(this.ui.cxnTable, "onselect", this, "_showConnection");
+ var func = function (td, data) {
+ if (/^connection\//.test(data)) {
+ td.appendChild(RapidContext.Util.createTextNode(data.substr(11)));
+ }
+ };
+ this.ui.cxnTable.getChildNodes()[1].setAttrs({ renderer: func });
// App view
MochiKit.Signal.connectOnce(this.ui.appTab, "onenter", this, "loadApps");
@@ -154,6 +161,41 @@ AdminApp.prototype.stop = function () {
}
/**
+ * Shows detailed connection information.
+ */
+AdminApp.prototype._showConnection = function () {
+ var data = this.ui.cxnTable.getSelectedData();
+ data = MochiKit.Base.update({}, data);
+ if (/^@\d+$/.test(data._lastUsedTime)) {
+ var dttm = new Date(+data._lastUsedTime.substr(1));
+ data.lastAccess = MochiKit.DateTime.toISOTimestamp(dttm);
+ }
+ this.ui.cxnForm.reset();
+ this.ui.cxnForm.update(data);
+ while (this.ui.cxnTemplate.previousSibling.className == "template") {
+ RapidContext.Widget.destroyWidget(this.ui.cxnTemplate.previousSibling);
+ }
+ var hidden = ["id", "type", "maxOpen", "_maxOpen", "_usedChannels",
+ "_openChannels", "_lastUsedTime", "lastAccess"];
+ RapidContext.Util.mask(data, hidden);
+ for (var k in data) {
+ var title = RapidContext.Util.toTitleCase(k);
+ var value = data[k];
+ if (value == null) {
+ value = "";
+ }
+ if (k == "password") {
+ value = "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022";
+ }
+ var tr = this.ui.cxnTemplate.cloneNode(true);
+ tr.className = "template";
+ MochiKit.DOM.appendChildNodes(tr.firstChild, title + ":");
+ MochiKit.DOM.appendChildNodes(tr.lastChild, value);
+ MochiKit.DOM.insertSiblingNodesBefore(this.ui.cxnTemplate, tr);
+ }
+}
+
+/**
* Loads the app list.
*/
AdminApp.prototype.loadApps = function () {
View
62 src/plugin/system/files/app/admin/ui.xml
@@ -3,9 +3,9 @@
<ui>
<TabContainer id="tabContainer" w="100%" h="100%">
<Pane pageTitle="Connections">
- <div w="55%" h="100%" style="float: left; padding-right: 20px;">
+ <div w="45%" h="100%" style="float: left; padding-right: 20px;">
<h3>
- Configured Connections:
+ Connection List:
<Icon id="cxnReload" ref="RELOAD" style="margin-left: 3px;" />
<Icon id="cxnLoading" ref="LOADING" style="margin-left: 3px;" />
</h3>
@@ -14,15 +14,65 @@
<TableColumn title="Type" field="type" />
<TableColumn title="In Use" field="_usedChannels" type="number" />
<TableColumn title="Open" field="_openChannels" type="number" />
- <TableColumn title="Limit" field="_maxOpen" type="number" />
- <TableColumn title="Last Accessed" field="_lastUsedTime" type="datetime" />
+ <TableColumn title="Last Access" field="_lastUsedTime" type="datetime" />
</Table>
</div>
+ <Form id="cxnForm" w="55%-30" h="100%" style="float: left; overflow-y: auto;">
+ <h3>
+ Connection Details:
+<!--
+ <Icon ref="ADD" style="margin-left: 3px;" />
+ <Icon ref="REMOVE" style="margin-left: 3px;" />
+ <Icon ref="EDIT" style="margin-left: 3px;" />
+ <Icon ref="AUTOMATIC" style="margin-left: 3px;" />
+-->
+ </h3>
+ <table>
+ <tbody>
+ <tr>
+ <th class="label" style="padding-right: 4px; width: 90px;">Identifier:</th>
+ <td>
+ <Field name="id" />
+ </td>
+ </tr>
+ <tr>
+ <th class="label" style="padding-right: 4px;">Type:</th>
+ <td>
+ <Field name="type" />
+ </td>
+ </tr>
+ <tr>
+ <th class="label" style="padding-right: 4px;">Description:</th>
+ <td>
+ <Field name="description" />
+ </td>
+ </tr>
+ <tr id="cxnTemplate" class="hidden">
+ <th class="label" style="padding-right: 4px;"></th>
+ <td style="white-space: pre-wrap;"></td>
+ </tr>
+ <tr>
+ <th class="label" style="padding-right: 4px;">Last Access:</th>
+ <td>
+ <Field name="lastAccess" />
+ </td>
+ </tr>
+ <tr>
+ <th class="label" style="padding-right: 4px;">Channels:</th>
+ <td>
+ <Field name="_usedChannels" format="{} in use" /><br/>
+ <Field name="_openChannels" format="{} open" /><br/>
+ <Field name="_maxOpen" format="{} maximum open" />
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </Form>
</Pane>
<Pane id="appTab" pageTitle="Apps">
<div w="35%" h="100%" style="float: left; padding-right: 20px;">
<h3>
- Installed Apps:
+ App List:
<Icon id="appReload" ref="RELOAD" style="margin-left: 3px;" />
<Icon id="appLoading" ref="LOADING" style="margin-left: 3px;" />
</h3>
@@ -125,7 +175,7 @@
</Form>
<div w="45%" h="100%-100" style="float: left; padding-right: 20px;">
<h3>
- Installed Plug-Ins:
+ Plug-In List:
<Icon id="pluginReload" ref="RELOAD" style="margin-left: 3px;" />
<Icon id="pluginLoading" ref="LOADING" style="margin-left: 3px;" />
</h3>

0 comments on commit 755cba1

Please sign in to comment.
Something went wrong with that request. Please try again.