diff options
author | Björn Schießle <bjoern@schiessle.org> | 2015-11-18 13:38:03 +0100 |
---|---|---|
committer | Björn Schießle <bjoern@schiessle.org> | 2015-11-19 18:07:17 +0100 |
commit | 8f55b1a27d97f24751542b6dc44a89eb03387a75 (patch) | |
tree | e2fefe439ea81b248beb9320f1e620aa733a847d /apps | |
parent | 97c60fd21794a6a0a56dc69ba8b77ab93b5d212c (diff) | |
download | nextcloud-server-8f55b1a27d97f24751542b6dc44a89eb03387a75.tar.gz nextcloud-server-8f55b1a27d97f24751542b6dc44a89eb03387a75.zip |
add status to server list
Diffstat (limited to 'apps')
-rw-r--r-- | apps/federation/css/settings-admin.css | 6 | ||||
-rw-r--r-- | apps/federation/js/settings-admin.js | 5 | ||||
-rw-r--r-- | apps/federation/lib/dbhandler.php | 2 | ||||
-rw-r--r-- | apps/federation/templates/settings-admin.php | 11 |
4 files changed, 19 insertions, 5 deletions
diff --git a/apps/federation/css/settings-admin.css b/apps/federation/css/settings-admin.css index 7dbc949270f..55b1dd64d15 100644 --- a/apps/federation/css/settings-admin.css +++ b/apps/federation/css/settings-admin.css @@ -19,6 +19,8 @@ #listOfTrustedServers li:hover { cursor: pointer; - background: url(../../../core/img/actions/delete.svg) no-repeat left center; - padding-left: 20px; +} + +#listOfTrustedServers .status { + margin-right: 10px; } diff --git a/apps/federation/js/settings-admin.js b/apps/federation/js/settings-admin.js index a1f02a09efe..1bc7a8cc0aa 100644 --- a/apps/federation/js/settings-admin.js +++ b/apps/federation/js/settings-admin.js @@ -40,7 +40,10 @@ $(document).ready(function () { ).done(function (data) { $('#serverUrl').attr('value', ''); $('ul#listOfTrustedServers').prepend( - $('<li>').attr('id', data.id).text(data.url) + $('<li>') + .attr('id', data.id) + .attr('class', 'icon-delete') + .html('<span class="status indeterminate"></span>' + data.url) ); OC.msg.finishedSuccess('#ocFederationAddServer .msg', data.message); }) diff --git a/apps/federation/lib/dbhandler.php b/apps/federation/lib/dbhandler.php index 58cf0f7f3b9..2b57dd75419 100644 --- a/apps/federation/lib/dbhandler.php +++ b/apps/federation/lib/dbhandler.php @@ -110,7 +110,7 @@ class DbHandler { */ public function getAllServer() { $query = $this->connection->getQueryBuilder(); - $query->select('url', 'id')->from($this->dbTable); + $query->select('url', 'id', 'status')->from($this->dbTable); $result = $query->execute()->fetchAll(); return $result; } diff --git a/apps/federation/templates/settings-admin.php b/apps/federation/templates/settings-admin.php index faa1e393158..f9087137d56 100644 --- a/apps/federation/templates/settings-admin.php +++ b/apps/federation/templates/settings-admin.php @@ -1,5 +1,7 @@ <?php /** @var array $_ */ +use OCA\Federation\TrustedServers; + /** @var OC_L10N $l */ script('federation', 'settings-admin'); style('federation', 'settings-admin') @@ -21,7 +23,14 @@ style('federation', 'settings-admin') </p> <ul id="listOfTrustedServers"> <?php foreach($_['trustedServers'] as $trustedServer) { ?> - <li id="<?php p($trustedServer['id']); ?>"> + <li id="<?php p($trustedServer['id']); ?>" class="icon-delete"> + <?php if((int)$trustedServer['status'] === TrustedServers::STATUS_OK) { ?> + <span class="status success"></span> + <?php } elseif((int)$trustedServer['status'] === TrustedServers::STATUS_PENDING) { ?> + <span class="status indeterminate"></span> + <?php } else {?> + <span class="status error"></span> + <?php } ?> <?php p($trustedServer['url']); ?> </li> <?php } ?> |