mirror of
https://github.com/nextcloud/server.git
synced 2024-08-30 05:55:15 +02:00
add status to server list
This commit is contained in:
parent
97c60fd217
commit
8f55b1a27d
@ -19,6 +19,8 @@
|
|||||||
|
|
||||||
#listOfTrustedServers li:hover {
|
#listOfTrustedServers li:hover {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
background: url(../../../core/img/actions/delete.svg) no-repeat left center;
|
}
|
||||||
padding-left: 20px;
|
|
||||||
|
#listOfTrustedServers .status {
|
||||||
|
margin-right: 10px;
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,10 @@ $(document).ready(function () {
|
|||||||
).done(function (data) {
|
).done(function (data) {
|
||||||
$('#serverUrl').attr('value', '');
|
$('#serverUrl').attr('value', '');
|
||||||
$('ul#listOfTrustedServers').prepend(
|
$('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);
|
OC.msg.finishedSuccess('#ocFederationAddServer .msg', data.message);
|
||||||
})
|
})
|
||||||
|
@ -110,7 +110,7 @@ class DbHandler {
|
|||||||
*/
|
*/
|
||||||
public function getAllServer() {
|
public function getAllServer() {
|
||||||
$query = $this->connection->getQueryBuilder();
|
$query = $this->connection->getQueryBuilder();
|
||||||
$query->select('url', 'id')->from($this->dbTable);
|
$query->select('url', 'id', 'status')->from($this->dbTable);
|
||||||
$result = $query->execute()->fetchAll();
|
$result = $query->execute()->fetchAll();
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/** @var array $_ */
|
/** @var array $_ */
|
||||||
|
use OCA\Federation\TrustedServers;
|
||||||
|
|
||||||
/** @var OC_L10N $l */
|
/** @var OC_L10N $l */
|
||||||
script('federation', 'settings-admin');
|
script('federation', 'settings-admin');
|
||||||
style('federation', 'settings-admin')
|
style('federation', 'settings-admin')
|
||||||
@ -21,7 +23,14 @@ style('federation', 'settings-admin')
|
|||||||
</p>
|
</p>
|
||||||
<ul id="listOfTrustedServers">
|
<ul id="listOfTrustedServers">
|
||||||
<?php foreach($_['trustedServers'] as $trustedServer) { ?>
|
<?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']); ?>
|
<?php p($trustedServer['url']); ?>
|
||||||
</li>
|
</li>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
Loading…
Reference in New Issue
Block a user