You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ja...@apache.org on 2013/10/03 16:11:33 UTC
[33/50] [abbrv] git commit: updated refs/heads/1867-feature-plugins
to 95d6e35
check if plugins are already installed& better install feedback
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/f9f10fe2
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/f9f10fe2
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/f9f10fe2
Branch: refs/heads/1867-feature-plugins
Commit: f9f10fe292fed3a203ad44a15d0a46177c0f752b
Parents: 21e839a
Author: Jan Lehnardt <ja...@apache.org>
Authored: Thu Aug 1 18:56:07 2013 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Thu Oct 3 16:08:36 2013 +0200
----------------------------------------------------------------------
share/www/plugins.html | 28 ++++++++++++++++++++++++----
1 file changed, 24 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb/blob/f9f10fe2/share/www/plugins.html
----------------------------------------------------------------------
diff --git a/share/www/plugins.html b/share/www/plugins.html
index 473531d..b42ed2e 100644
--- a/share/www/plugins.html
+++ b/share/www/plugins.html
@@ -42,7 +42,7 @@ specific language governing permissions and limitations under the License.
</ul>
</p>
<p>
- <button href="#" class="install_plugin" data-url="http://people.apache.org/~jan" data-checksums='{"R15B03":"QVKzRsQGKhSdLkLTdHtgUYtr0wU="}' data-name="geocouch" data-version="couchdb1.2.x_v0.3.0-12-g4ea0bea">Install GeoCouch Now</button>
+ <button href="#" class="install-plugin" data-url="http://people.apache.org/~jan" data-checksums='{"R15B03":"QVKzRsQGKhSdLkLTdHtgUYtr0wU="}' data-name="geocouch" data-version="couchdb1.2.x_v0.3.0-12-g4ea0bea">Install GeoCouch Now</button>
</p>
</div>
<div class="row">
@@ -56,13 +56,28 @@ specific language governing permissions and limitations under the License.
</ul>
</p>
<p>
- <button href="#" class="install_plugin" data-url="http://people.apache.org/~jan" data-checksums='{"R15B03":"2IvVuihCBAE4SIN3qgjofx23wJs="}' data-name="couchperuser" data-version="1.0.0">Install CouchPerUser Now</button>
+ <button href="#" class="install-plugin" data-url="http://people.apache.org/~jan" data-checksums='{"R15B03":"2IvVuihCBAE4SIN3qgjofx23wJs="}' data-name="couchperuser" data-version="1.0.0">Install CouchPerUser Now</button>
</p>
</div>
</div>
</div></body>
<script>
- $('.install_plugin').click(function(event) {
+ $('.install-plugin').each(function() {
+ var button = $(this);
+ var name = button.data('name');
+ var version = button.data('version');
+ $.get("/_config/plugins/" + name + "/", function(body, textStatus) {
+ body = JSON.parse(body);
+ if(body == version) {
+ button.html("Already Installed");
+ } else {
+ button.html("Other Version Installed: " + body);
+ }
+ button.attr("disabled", true);
+ });
+ });
+
+ $('.install-plugin').click(function(event) {
var button = $(this);
var plugin_spec = JSON.stringify({
name: button.data('name'),
@@ -79,7 +94,12 @@ specific language governing permissions and limitations under the License.
dataType: 'json', // expected from the server
processData: false, // keep our precious JSON
success: function(data, textStatus, jqXhr) {
- button.html(textStatus);
+ if(textStatus == "success") {
+ button.html("Sucessfully Installed");
+ button.attr("disabled", true);
+ } else {
+ button.html(textStatus);
+ }
},
beforeSend: function(xhr) {
xhr.setRequestHeader('Accept', 'application/json');