cassandra-web 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 1f209526de365b2704af233260763234adf89ef0
4
- data.tar.gz: 1b118c42d5eeba17ba16e53f860e779d37eaad64
2
+ SHA256:
3
+ metadata.gz: 5a9ea31371804a1da02f444e58199a4277521cd8469a0b0fe6798d61130c2c53
4
+ data.tar.gz: a416890e587a3172918b50729625a350765811f609294bd949cb7e1caa3ae29b
5
5
  SHA512:
6
- metadata.gz: 8514f3521fa4d23ae12cf860b3e6dd75f5c2014f7f4d0c9cd2f051c70da32e66de722318d4f09146affaea8f6e89e49bb268ace562a8e9100604d450c3fa8663
7
- data.tar.gz: 2a1ce7aebc0f6fbb3684624d7c9195abdd9cbb39fecaac37c815cb2ee1d741b3e677337fd0d48957cc4f44877d2043864f300de8a1ef2a3ad5c52eeb30b231f6
6
+ metadata.gz: 2ceb11bb3210c602fd437b08686c7d34287626380cbe9593cde6f75ea447fc2d2bd5d46bb0cf5a0b064affdf452c299f434b1115c400349b22a6c0285a2d7030
7
+ data.tar.gz: f395e483169b29d5e04fa19a553f20fd0764d4a96af5faa2f21a1ba253ba43438865c2e8ff7a618b4fba5d051e716da8938b5c94b006fd55cdbf860655b02c7a
@@ -27,4 +27,49 @@ th.table-actions {
27
27
 
28
28
  .modal-content .rows {
29
29
  overflow: auto;
30
- }
30
+ }
31
+
32
+ .execute-options {
33
+ display: block !important;
34
+ padding: 5px;
35
+ }
36
+
37
+ .row-limit {
38
+ margin: 15px 0 15px 0;
39
+ }
40
+
41
+ .row-limit > input {
42
+ text-align: right;
43
+ border: 1px solid #ddd;
44
+ }
45
+
46
+ .row-limit > label {
47
+ padding-right: 5px;
48
+ }
49
+
50
+ .loading-button {
51
+ margin-top: 15px;
52
+ }
53
+
54
+ .glyphicon-refresh-animate {
55
+ -animation: spin .7s infinite linear;
56
+ -webkit-animation: spin2 .7s infinite linear;
57
+ }
58
+
59
+ @-webkit-keyframes spin2 {
60
+ from {
61
+ -webkit-transform: rotate(0deg);
62
+ }
63
+ to {
64
+ -webkit-transform: rotate(360deg);
65
+ }
66
+ }
67
+
68
+ @keyframes spin {
69
+ from {
70
+ transform: scale(1) rotate(0deg);
71
+ }
72
+ to {
73
+ transform: scale(1) rotate(360deg);
74
+ }
75
+ }
@@ -95,16 +95,16 @@
95
95
  </div>
96
96
  <div class="modal-footer">
97
97
  <form class="form-inline" role="form" ng-submit="execute()">
98
- <div class="checkbox">
98
+ <div class="checkbox execute-options">
99
99
  <label for="consistency">Consistency</label>
100
100
  <select id="consistency" class="form-control" ng-model="options.consistency" ng-options="consistency for consistency in consistencies"></select>
101
101
  </div>
102
- <div class="checkbox">
102
+ <div class="checkbox execute-options">
103
103
  <label for="trace">
104
104
  <input id="trace" type="checkbox" ng-model="options.trace" /> <span ng-if="!options.trace">Enable</span><span ng-if="options.trace">Disable</span> Tracing
105
105
  </label>
106
106
  </div>
107
- <div class="form-group">
107
+ <div class="form-group execute-options">
108
108
  <button type="submit" class="btn btn-danger" ng-disabled="disabled">Execute</button>
109
109
  <a class="text-danger" ng-show="error" tooltip="{{error.class}}: {{error.message}}" tooltip-trigger="mouseenter" tooltip-placement="left"><span class="glyphicon glyphicon-exclamation-sign"></span></a>
110
110
  </div>
@@ -2,7 +2,23 @@
2
2
  <tabset>
3
3
  <tab>
4
4
  <tab-heading>Rows <span class="badge">{{result.rows.length}}</span></tab-heading>
5
- <table class="table table-striped table-hover">
5
+
6
+ <div class="row-limit">
7
+ <label for="limit">Row Limit</label>
8
+ <input type="checkbox" title="Row Limit Checkbox" ng-model="rowLimit.enabled" value="rowLimit.enabled" />
9
+ <input id="limit" ng-model="rowLimit.value" ng-if="rowLimit.enabled" value="rowLimit.value" />
10
+ </div>
11
+
12
+ <div>
13
+ <button type="button" class="btn btn-danger" ng-click="executeStatement()">Fetch Rows</button>
14
+ </div>
15
+
16
+ <button class="btn btn-sm btn-warning loading-button" ng-show="loading">
17
+ <span class="glyphicon glyphicon-refresh glyphicon-refresh-animate"></span>
18
+ Loading...
19
+ </button>
20
+
21
+ <table class="table table-striped table-hover" ng-if="result || error">
6
22
  <thead>
7
23
  <tr>
8
24
  <th ng-repeat="column in table.columns">{{column.name}}</th>
@@ -25,7 +41,6 @@
25
41
  <tfoot>
26
42
  <tr>
27
43
  <td colspan="{{table.columns.length}}">
28
- <span ng-show="!result && !error">Loading...</span>
29
44
  <span ng-show="result">Total: {{result.rows.length}} results</span>
30
45
  <dl ng-show="error">
31
46
  <dt>{{error.class}}: {{error.message}}</dt>
@@ -393,6 +393,13 @@ if (!Object.keys) {
393
393
  '$location',
394
394
  'escapeIdentifier',
395
395
  function($scope, cluster, $routeParams, $location, escapeIdentifier) {
396
+
397
+ $scope.rowLimit = {
398
+ enabled: true,
399
+ value: 15
400
+ };
401
+ $scope.loading = false;
402
+
396
403
  cluster.keyspaces.forEach(function(keyspace) {
397
404
  if ($routeParams.keyspace == keyspace.name) {
398
405
  $scope.keyspace = keyspace
@@ -433,19 +440,34 @@ if (!Object.keys) {
433
440
  if (!exists) {
434
441
  $location.path('/' + $scope.keyspace.name)
435
442
  }
436
- })
443
+ });
444
+
445
+ $scope.executeStatement = function() {
446
+ $scope.result = undefined;
447
+ $scope.loading = true;
448
+
449
+ var selectStatement = 'SELECT * FROM ' + escapeIdentifier($scope.keyspace.name) + '.' + escapeIdentifier($scope.table.name);
450
+ if ($scope.rowLimit.enabled) {
451
+ selectStatement = selectStatement + ' LIMIT ' + $scope.rowLimit.value;
452
+ }
453
+
454
+ cluster.execute(selectStatement)
455
+ .then(
456
+ function(result) {
457
+ $scope.result = result;
458
+ $scope.loading = false;
459
+ },
460
+ function(error) {
461
+ $scope.error = error;
462
+ $scope.loading = false;
463
+ }
464
+ );
465
+ };
466
+
467
+ $scope.executeStatement();
437
468
 
438
- cluster.execute('SELECT * FROM ' + escapeIdentifier($scope.keyspace.name) + '.' + escapeIdentifier($scope.table.name))
439
- .then(
440
- function(result) {
441
- $scope.result = result
442
- },
443
- function(error) {
444
- $scope.error = error
445
- }
446
- )
447
469
  }
448
- ])
470
+ ]);
449
471
 
450
472
  app.controller('actions', [
451
473
  '$scope',
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cassandra-web
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bulat Shakirzyanov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-25 00:00:00.000000000 Z
11
+ date: 2019-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cassandra-driver
@@ -181,7 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
181
181
  version: '0'
182
182
  requirements: []
183
183
  rubyforge_project:
184
- rubygems_version: 2.5.1
184
+ rubygems_version: 2.7.3
185
185
  signing_key:
186
186
  specification_version: 4
187
187
  summary: A simple web ui for Apache Cassandra