Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added luwak empty and disabled to rekon

  • Loading branch information...
commit 2d66cd6313266f1ceb2494a891e84860d97dfa64 1 parent 27f6330
@adamhunter adamhunter authored
View
8 app/luwak-row.html.template
@@ -3,16 +3,16 @@
<em><%= Rekon.luwakUrl() %>/</em><%= file %>
</th>
<td>
- <a href="#/luwak/<%= file %>" class="view icon" onclick="alert('This feature is pending');return false;">View</a>
- </td>
- <td>
<a href="<%= Rekon.luwakUrl() %>/<%= file %>" class="riak icon" target="_blank">Riak</a>
</td>
+ <!--<td>
+ <a href="#/luwak/<%= file %>" class="view icon" onclick="alert('This feature is pending');return false;">View</a>
+ </td>
<td>
<a href="#" class="edit icon" onclick="alert('This feature is pending');return false;">Edit</a>
</td>
<td>
<a href="#" class="delete icon" onclick="alert('This feature is pending');return false;">Delete</a>
- </td>
+ </td>-->
</tr>
View
6 app/luwak.html.template
@@ -6,15 +6,15 @@
<input id="row_search" type="text" />
<em class="hint">Type to filter rows</em>
</th>
- <th>View</th>
<th>Riak</th>
+ <!--<th>View</th>
<th>Edit</th>
- <th>Delete</th>
+ <th>Delete</th>-->
</tr>
</thead>
<tbody>
<tr class="pending">
- <td colspan='5'>
+ <td colspan='2'>
<p class="spinner">
<img src="spinner.gif" alt="Loading..." />
Loading Files... <em class="hint">(This may take a minute if you have a lot)</em>
View
26 app/rekon.js
@@ -228,17 +228,23 @@ rekonApp = Sammy('#container', function(){
// TODO: check Luwak is enabled
header('Luwak', document.location.origin + "/luwak");
- context.render('luwak.html.template').appendTo('#main');
+ context.render('luwak.html.template').appendTo('#main').then(function(){
- luwak.files(function(files) {
- if (files.length > 0) {
- fileRows = files.map(function(file){ return {file:file};});
- context.renderEach('luwak-row.html.template', fileRows).replace('#files tbody').then(
- function() { searchable('#luwak tbody'); }
- );
- } else{
- alert("Luwak is empty!");
- }
+ luwak.files(function(files) {
+ if (files === null) {
+ console.log('not working');
+ $('#files .pending td').html(
+ '<p><b>Luwak is not enabled.</b> Please add <code>{luwak, [{enabled, true}]}</code> to your app.config.</p>');
+ }
+ else if (files.length > 0) {
+ fileRows = files.map(function(file){ return {file:file};});
+ context.renderEach('luwak-row.html.template', fileRows).replace('#files tbody').then(
+ function() { searchable('#luwak tbody'); }
+ );
+ } else{
+ $('#files .pending td').html('<p>You have not added any files to luwak.</p>');
+ }
+ });
});
});
View
6 app/riak.js
@@ -1021,7 +1021,7 @@ function Luwak(client) {
* @param files Array
*/
Luwak.prototype.files = function(callback) {
- jQuery.getJSON(this.client.luwakUrl + "?keys=true", function(data){
- callback(data.keys);
- });
+ jQuery.getJSON(this.client.luwakUrl + "?keys=true").success(
+ function(data){callback(data.keys);}
+ ).error(function(){ callback(null);});
};
Please sign in to comment.
Something went wrong with that request. Please try again.