blob: 8ca18db45ba3b5397afcfc038c21d6385529de6f [file] [log] [blame]
<!-- Error and Success templates -->
<script type="text/template" id="xos-error-response">
<h5>Error</h5>
<table>
<tr><td>error:</td><td><%= error %></td></tr>
<tr><td>check:</td><td><%= specific_error %></td></tr>
</table>
<h5>Details:</h5>
<table>
<tbody>
<% _.each(reasons, function(element, index) { %>
<tr><td><%= index %></td><td><%= element %></td></tr>
<% }); %>
</tbody>
</table>
</script>
<script type="text/template" id="xos-error-rawresponse">
<h5>Error</h5>
<pre>The server returned:
"<%= responseText %>"</pre>
</script>
<script type="text/template" id="xos-error-template">
<button id="close-error-box">Close Error Message</button>
<h3>An error has occurred.</h3>
<table class="test-error-table">
<tr><td>Code:</td><td><%= status %></td></tr>
<tr><td>Message:</td><td><%= statusText %></td></tr>
</table>
</script>
<script type="text/template" id="xos-success-template">
<button id="close-success-box">Close Success Message</button>
<h3>Success!</h3>
<table class="test-success-table">
<tr><td>Code:</td><td><%= status %></td></tr>
<tr><td>Message:</td><td><%= statusText %></td></tr>
</table>
</script>
<script type="text/template" id="xos-navbutton-old">
<button class="btn btn-default btn-xosnav" onclick="<%= router %>.navigate('<%= routeUrl %>', {trigger: true})"><%= name %></button><br>
</script>
<script type="text/template" id="xos-status-template">
<div class="xos-status xos-<%= statusclass %>"><%= what %>: <%= statusText %> (<%= status %>)</div>
</script>
<script type="text/template" id="xos-tabs-template">
<ul class="xos-nav-list">
<% _.each(tabs, function(tab) { %>
<li class="xos-nav-item" id="xos-nav-<%= tab["region"] %>"><%= tab["name"] %></li>
<% }); %>
</ul>
</script>
<script type="text/template" id="xos-title-list">
<h3><img src="/static/img/brokencircle.gif" height=16 width=16 id="xos-list-title-spinner"> <%= title %></h3>
</script>
<script type="text/template" id="xos-title-detail">
<h3><%= title %></h3>
</script>
<script type="text/template" id="xos-navbutton">
<li>
<a href="<%= routeUrl %>">
<i class="<%= iconClass %>"></i>
<%= name %>
</a>
</li>
</script>
<script type="text/template" id="xos-inline-detail-buttons-template">
<tr>
<td colspan=2><button class="btn js-submit btn-xos-detail btn-xos-save-leave">Save</button>
<button class="btn js-submit btn-xos-detail btn-xos-save-continue">Save and Continue Editing</button>
<button class="btn js-submit btn-xos-detail btn-xos-save-another">Save and Add Another</button>
<button class="btn js-submit btn-xos-detail btn-xos-delete">Delete</button>
</td>
</tr>
</script>
<script type="text/template" id="xos-list-header-template">
<button class="btn js-submit btn-xos-list btn-xos-add">Add</button>
<button class="btn js-submit btn-xos-list btn-xos-refresh">Refresh</button>
</script>
<script type="text/template" id="xos-list-footer-template">
<% console.log(model); %>
<a href="<%= addChildHash %>">Add...</a>
</script>
<script type="text/template" id="xos-delete-button-template">
<a href="#delete<%= firstCharUpper(modelName) %>/<%= id %>">delete</a>
</script>
<script type="text/template" id="xos-detail-link-template">
<a href="#<%= collectionName %>/<%= id %>"><%= text %></a>
</script>
<script type="text/template" id="xos-add-template">
<h3 class="xos-detail-title">Add Object: <%= modelName %></h3>
<form>
<table>
<% _.each(addFields, function(fieldName) { %>
<tr><td><%= fieldNameToHumanReadable(fieldName) %>:</td>
<% if (fieldName in foreignFields) { %>
<td><%= idToSelect(fieldName, window[fieldName], foreignFields[fieldName], "humanReadableName") %></td>
<% } else if (inputType[fieldName] == "checkbox") { %>
<td><input type="checkbox" name="<%= fieldName %>" <% if (model.attributes[fieldName]) print("checked"); %>></td>
<% } else { %>
<td><input type="text" name="<%= fieldName %>" value="<%= model.attributes[fieldName] %>"></td>
<% } %>
</tr>
<% }); %>
<%= xosInlineDetailButtonsTemplate() %>
</table>
</form>
</script>
<script type="text/template" id="xos-detail-template">
<h3 class="xos-detail-title">Add Object: <%= modelName %></h3>
<form>
<table>
<% console.log(model); _.each(detailFields, function(fieldName) { %>
<tr><td><%= fieldNameToHumanReadable(fieldName) %>:</td>
<% if (fieldName in foreignFields) { %>
<td><%= idToSelect(fieldName, window[fieldName], foreignFields[fieldName], "humanReadableName") %></td>
<% } else if (inputType[fieldName] == "checkbox") { %>
<td><input type="checkbox" name="<%= fieldName %>" <% if (model.attributes[fieldName]) print("checked"); %>></td>
<% } else { %>
<td><input type="text" name="<%= fieldName %>" value="<%= model.attributes[fieldName] %>"></td>
<% } %>
</tr>
<% }); %>
<%= xosInlineDetailButtonsTemplate() %>
</table>
</form>
</script>
<!-- Deployment -->
<script type="text/template" id="xosAdmin-deployment-list-template">
<h3 class="xos-list-title"><%= title %></h3>
<%= xosListHeaderTemplate() %>
<table class="test-table">
<thead><tr>
<th>id</th>
<th>name</th>
<th>backend</th>
<th>admin_tenant</th>
<th># sites</th>
<th>delete</th>
</tr></thead>
<tbody></tbody>
</table>
<%= xosListFooterTemplate({addChildHash: addChildHash}) %>
</script>
<script type="text/template" id="xosAdmin-deployment-listitem-template">
<td> <%= xosDetailLinkTemplate({collectionName: collectionName, id: id, text: id}) %></td>
<td> <%= xosDetailLinkTemplate({collectionName: collectionName, id: id, text: name}) %></td>
<td><%= backend_type %></td>
<td><%= admin_tenant %></td>
<td><%= typeof sites != 'undefined' && sites.length || 0 %></td>
<td><%= xosDeleteButtonTemplate({modelName: modelName, id: id}) %></td>
</script>
<!-- Image -->
<script type="text/template" id="xosAdmin-image-list-template">
<h3 class="xos-list-title"><%= title %></h3>
<%= xosListHeaderTemplate() %>
<table class="test-table">
<thead><tr>
<th>id</th>
<th>name</th>
<th>disk_format</th>
<th>container_format</th>
<th>path</th>
<th>delete</th>
</tr></thead>
<tbody></tbody>
</table>
<%= xosListFooterTemplate({addChildHash: addChildHash}) %>
</script>
<script type="text/template" id="xosAdmin-image-listitem-template">
<td> <%= xosDetailLinkTemplate({collectionName: collectionName, id: id, text: id}) %></td>
<td> <%= xosDetailLinkTemplate({collectionName: collectionName, id: id, text: name}) %></td>
<td><%= disk_format %></td>
<td><%= container_format %></td>
<td><%= path %></td>
<td><%= xosDeleteButtonTemplate({modelName: modelName, id: id}) %></td>
</script>
<!-- NetworkTemplate -->
<script type="text/template" id="xosAdmin-networkTemplate-list-template">
<h3 class="xos-list-title"><%= title %></h3>
<%= xosListHeaderTemplate() %>
<table class="test-table">
<thead><tr>
<th>id</th>
<th>name</th>
<th>description</th>
<th>visibility</th>
<th>translation</th>
<th>sharedNetworkName</th>
<th>sharedNetworkId</th>
<th>delete</th>
</tr></thead>
<tbody></tbody>
</table>
<%= xosListFooterTemplate({addChildHash: addChildHash}) %>
</script>
<script type="text/template" id="xosAdmin-networkTemplate-listitem-template">
<td> <%= xosDetailLinkTemplate({collectionName: collectionName, id: id, text: id}) %></td>
<td> <%= xosDetailLinkTemplate({collectionName: collectionName, id: id, text: name}) %></td>
<td><%= description %></td>
<td><%= visibility %></td>
<td><%= translation %></td>
<td><%= sharedNetworkName %></td>
<td><%= sharedNetworkId %></td>
<td><%= xosDeleteButtonTemplate({modelName: modelName, id: id}) %></td>
</script>
<!-- Network -->
<script type="text/template" id="xosAdmin-network-list-template">
<h3 class="xos-list-title"><%= title %></h3>
<%= xosListHeaderTemplate() %>
<table class="test-table">
<thead><tr>
<th>id</th>
<th>name</th>
<th>template</th>
<th>ports</th>
<th>labels</th>
<th>owner</th>
<th>delete</th>
</tr></thead>
<tbody></tbody>
</table>
<%= xosListFooterTemplate({addChildHash: addChildHash}) %>
</script>
<script type="text/template" id="xosAdmin-network-listitem-template">
<td> <%= xosDetailLinkTemplate({collectionName: collectionName, id: id, text: id}) %></td>
<td> <%= xosDetailLinkTemplate({collectionName: collectionName, id: id, text: name}) %></td>
<td><%= idToName(template,"networkTemplates","name") %></td>
<td><%= ports %></td>
<td><%= labels %></td>
<td><%= idToName(owner,"slices","name") %></td>
<td><%= xosDeleteButtonTemplate({modelName: modelName, id: id}) %></td>
</script>
<!-- NetworkSliver -->
<script type="text/template" id="xosAdmin-networkSliver-list-template">
<h3 class="xos-list-title"><%= title %></h3>
<%= xosListHeaderTemplate() %>
<table class="test-table">
<thead><tr>
<th>id</th>
<th>network</th>
<th>sliver</th>
<th>ip</th>
<th>port_id</th>
<th>delete</th>
</tr></thead>
<tbody></tbody>
</table>
<%= xosListFooterTemplate({addChildHash: addChildHash}) %>
</script>
<script type="text/template" id="xosAdmin-networkSliver-listitem-template">
<td> <%= xosDetailLinkTemplate({collectionName: collectionName, id: id, text: id}) %></td>
<td><%= idToName(network,"networks","name") %></td>
<td><%= idToName(sliver,"slivers","name") %></td>
<td><%= ip %></td>
<td><%= port_id %></td>
<td><%= xosDeleteButtonTemplate({modelName: modelName, id: id}) %></td>
</script>
<!-- NetworkDeployment -->
<script type="text/template" id="xosAdmin-networkDeployment-list-template">
<h3 class="xos-list-title"><%= title %></h3>
<%= xosListHeaderTemplate() %>
<table class="test-table">
<thead><tr>
<th>id</th>
<th>network</th>
<th>deployment</th>
<th>net_id</th>
<th>delete</th>
</tr></thead>
<tbody></tbody>
</table>
<%= xosListFooterTemplate({addChildHash: addChildHash}) %>
</script>
<script type="text/template" id="xosAdmin-networkDeployment-listitem-template">
<td> <%= xosDetailLinkTemplate({collectionName: collectionName, id: id, text: id}) %></td>
<td><%= idToName(network,"networks","name") %></td>
<td><%= idToName(deployment,"deployments","name") %></td>
<td><%= net_id %></td>
<td><%= xosDeleteButtonTemplate({modelName: modelName, id: id}) %></td>
</script>
<!-- Node -->
<script type="text/template" id="xosAdmin-node-list-template">
<h3 class="xos-list-title"><%= title %></h3>
<%= xosListHeaderTemplate() %>
<table class="test-table">
<thead><tr>
<th>id</th>
<th>name</th>
<th>site</th>
<th>deployment</th>
<th>delete</th>
</tr></thead>
<tbody></tbody>
</table>
<%= xosListFooterTemplate({addChildHash: addChildHash}) %>
</script>
<script type="text/template" id="xosAdmin-node-listitem-template">
<td> <%= xosDetailLinkTemplate({collectionName: collectionName, id: id, text: id}) %></td>
<td> <%= xosDetailLinkTemplate({collectionName: collectionName, id: id, text: name}) %></td>
<td><%= idToName(site,"sites","name") %></td>
<td><%= idToName(deployment,"deployments","name") %></td>
<td><%= xosDeleteButtonTemplate({modelName: modelName, id: id}) %></td>
</script>
<!-- SliceRole -->
<script type="text/template" id="xosAdmin-sliceRole-list-template">
<h3 class="xos-list-title"><%= title %></h3>
<%= xosListHeaderTemplate() %>
<table class="test-table">
<thead><tr>
<th>id</th>
<th>role</th>
<th>delete</th>
</tr></thead>
<tbody></tbody>
</table>
<%= xosListFooterTemplate({addChildHash: addChildHash}) %>
</script>
<script type="text/template" id="xosAdmin-sliceRole-listitem-template">
<td> <%= xosDetailLinkTemplate({collectionName: collectionName, id: id, text: id}) %></td>
<td><%= role %></td>
<td><%= xosDeleteButtonTemplate({modelName: modelName, id: id}) %></td>
</script>
<!-- Service -->
<script type="text/template" id="xosAdmin-service-list-template">
<h3 class="xos-list-title"><%= title %></h3>
<%= xosListHeaderTemplate() %>
<table class="test-table">
<thead><tr>
<th>id</th>
<th>name</th>
<th>description</th>
<th>enabled</th>
<th>versionNumber</th>
<th>published</th>
<th>delete</th>
</tr></thead>
<tbody></tbody>
</table>
<%= xosListFooterTemplate({addChildHash: addChildHash}) %>
</script>
<script type="text/template" id="xosAdmin-service-listitem-template">
<td> <%= xosDetailLinkTemplate({collectionName: collectionName, id: id, text: id}) %></td>
<td> <%= xosDetailLinkTemplate({collectionName: collectionName, id: id, text: name}) %></td>
<td><%= description %></td>
<td><%= enabled %></td>
<td><%= versionNumber %></td>
<td><%= published %></td>
<td><%= xosDeleteButtonTemplate({modelName: modelName, id: id}) %></td>
</script>
<!-- Site -->
<script type="text/template" id="xosAdmin-site-list-template">
<h3 class="xos-list-title"><%= title %></h3>
<%= xosListHeaderTemplate() %>
<table class="test-table">
<thead><tr>
<th>id</th>
<th>name</th>
<th>url</th>
<th>enabled</th>
<th>login_base</th>
<th>is_public</th>
<th>abbreviated_name</th>
<th>delete</th>
</tr></thead>
<tbody></tbody>
</table>
<%= xosListFooterTemplate({addChildHash: addChildHash}) %>
</script>
<script type="text/template" id="xosAdmin-site-listitem-template">
<td> <%= xosDetailLinkTemplate({collectionName: collectionName, id: id, text: id}) %></td>
<td> <%= xosDetailLinkTemplate({collectionName: collectionName, id: id, text: name}) %></td>
<td><%= site_url %></td>
<td><%= enabled %></td>
<td><%= login_base %></td>
<td><%= is_public %></td>
<td><%= abbreviated_name %></td>
<td><%= xosDeleteButtonTemplate({modelName: modelName, id: id}) %></td>
</script>
<!-- Slice -->
<script type="text/template" id="xosAdmin-slice-list-template">
<h3 class="xos-list-title"><%= title %></h3>
<%= xosListHeaderTemplate() %>
<table class="test-table">
<thead><tr>
<th>id</th>
<th>name</th>
<th>enabled</th>
<th>omf_friendly</th>
<th>description</th>
<th>slice_url</th>
<th>site</th>
<th>max_slivers</th>
<th>service</th>
<th>delete</th>
</tr></thead>
<tbody></tbody>
</table>
<%= xosListFooterTemplate() %>
</script>
<script type="text/template" id="xosAdmin-slice-listitem-template">
<td> <%= xosDetailLinkTemplate({collectionName: collectionName, id: id, text: id}) %></td>
<td> <%= xosDetailLinkTemplate({collectionName: collectionName, id: id, text: name}) %></td>
<td><%= enabled %></td>
<td><%= omf_friendly %></td>
<td><%= description %></td>
<td><%= slice_url %></td>
<td><%= idToName(site,"sites","name") %></td>
<td><%= max_slivers %></td>
<td><%= idToName(service,"services","name") %></td>
<td><%= xosDeleteButtonTemplate({modelName: modelName, id: id}) %></td>
</script>
<!-- SliceDeployment -->
<script type="text/template" id="xosAdmin-sliceDeployment-list-template">
<h3 class="xos-list-title"><%= title %></h3>
<%= xosListHeaderTemplate() %>
<table class="test-table">
<thead><tr>
<th>id</th>
<th>slice</th>
<th>deployment</th>
<th>tenant_id</th>
<th>delete</th>
</tr></thead>
<tbody></tbody>
</table>
<%= xosListFooterTemplate({addChildHash: addChildHash}) %>
</script>
<script type="text/template" id="xosAdmin-sliceDeployment-listitem-template">
<td> <%= xosDetailLinkTemplate({collectionName: collectionName, id: id, text: id}) %></td>
<td><%= idToName(slice,"slices","name") %></td>
<td><%= idToName(deployment,"deployments","name") %></td>
<td><%= tenant_id %></td>
<td><%= xosDeleteButtonTemplate({modelName: modelName, id: id}) %></td>
</script>
<!-- SlicePrivilege -->
<script type="text/template" id="xosAdmin-slicePrivilege-list-template">
<h3 class="xos-list-title"><%= title %></h3>
<%= xosListHeaderTemplate() %>
<table class="test-table">
<thead><tr>
<th>id</th>
<th>user</th>
<th>slice</th>
<th>role</th>
<th>delete</th>
</tr></thead>
<tbody></tbody>
</table>
<%= xosListFooterTemplate({addChildHash: addChildHash}) %>
</script>
<script type="text/template" id="xosAdmin-slicePrivilege-listitem-template">
<td> <%= xosDetailLinkTemplate({collectionName: collectionName, id: id, text: id}) %></td>
<td><%= idToName(user,"users","username") %></td>
<td><%= idToName(slice,"slices","name") %></td>
<td><%= idToName(role,"sliceRoles","role") %></td>
<td><%= xosDeleteButtonTemplate({modelName: modelName, id: id}) %></td>
</script>
<!-- Sliver -->
<script type="text/template" id="xosAdmin-sliver-list-template">
<h3 class="xos-list-title"><%= title %></h3>
<%= xosListHeaderTemplate() %>
<table class="test-table">
<thead><tr>
<th>id</th>
<th>name</th>
<th>instance_id</th>
<th>instance_name</th>
<th>image</th>
<th>creator</th>
<th>slice</th>
<th>node</th>
<th>deploymentNetwork</th>
<th>flavor</th>
<th>userData</th>
<th>delete</th>
</tr></thead>
<tbody></tbody>
</table>
<%= xosListFooterTemplate({addChildHash: addChildHash}) %>
</script>
<script type="text/template" id="xosAdmin-sliver-listitem-template">
<td> <%= xosDetailLinkTemplate({collectionName: collectionName, id: id, text: id}) %></td>
<td> <%= xosDetailLinkTemplate({collectionName: collectionName, id: id, text: name}) %></td>
<td><%= instance_id %></td>
<td><%= instance_name %></td>
<td><%= idToName(image,"images","name") %></td>
<td><%= idToName(creator,"users","name") %></td>
<td><%= idToName(slice,"slices","name") %></td>
<td><%= idToName(node,"nodes","name") %></td>
<td><%= idToName(deploymentNetwork,"deployments","name") %></td>
<td><%= flavor %></td>
<td><%= userData %></td>
<td><%= xosDeleteButtonTemplate({modelName: modelName, id: id}) %></td>
</script>
<!-- User -->
<script type="text/template" id="xosAdmin-user-list-template">
<h3 class="xos-list-title"><%= title %></h3>
<%= xosListHeaderTemplate() %>
<table class="test-table">
<thead><tr>
<th>id</th>
<th>username</th>
<th>firstname</th>
<th>lastname</th>
<th>phone</th>
<th>user_url</th>
<th>site</th>
<th>delete</th>
</tr></thead>
<tbody></tbody>
</table>
<%= xosListFooterTemplate({addChildHash: addChildHash}) %>
</script>
<script type="text/template" id="xosAdmin-user-listitem-template">
<td> <%= xosDetailLinkTemplate({collectionName: collectionName, id: id, text: id}) %></td>
<td> <%= xosDetailLinkTemplate({collectionName: collectionName, id: id, text: username}) %></td>
<td><%= firstname %></td>
<td><%= lastname %></td>
<td><%= phone %></td>
<td><%= user_url %></td>
<td><%= idToName(site,"sites","name") %></td>
<td><%= xosDeleteButtonTemplate({modelName: modelName, id: id}) %></td>
</script>
<!-- UserDeployments -->
<script type="text/template" id="xosAdmin-userDeployment-list-template">
<h3 class="xos-list-title"><%= title %></h3>
<%= xosListHeaderTemplate() %>
<table class="test-table">
<thead><tr>
<th>id</th>
<th>user</th>
<th>deployment</th>
<th>kuser_id</th>
<th>delete</th>
</tr></thead>
<tbody></tbody>
</table>
<%= xosListFooterTemplate({addChildHash: addChildHash}) %>
</script>
<script type="text/template" id="xosAdmin-userDeployment-listitem-template">
<td> <%= xosDetailLinkTemplate({collectionName: collectionName, id: id, text: id}) %></td>
<td><%= idToName(user,"users","username") %></td>
<td><%= idToName(deployment,"deployments","name") %></td>
<td><%= kuser_id %></td>
<td><%= xosDeleteButtonTemplate({modelName: modelName, id: id}) %></td>
</script>
<script>
xosInlineDetailButtonsTemplate = _.template($("#xos-inline-detail-buttons-template").html());
xosListHeaderTemplate = _.template($("#xos-list-header-template").html());
xosListFooterTemplate = _.template($("#xos-list-footer-template").html());
xosDeleteButtonTemplate = _.template($("#xos-delete-button-template").html());
xosDetailLinkTemplate = _.template($("#xos-detail-link-template").html());
</script>