Skip to content

Commit

Permalink
feat(federatedfilesharing): improve admin docs and settings
Browse files Browse the repository at this point in the history
Signed-off-by: skjnldsv <[email protected]>
  • Loading branch information
skjnldsv committed Dec 28, 2024
1 parent 094727a commit 8b3c276
Show file tree
Hide file tree
Showing 10 changed files with 79 additions and 25 deletions.
30 changes: 25 additions & 5 deletions apps/federatedfilesharing/src/components/AdminSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,17 @@
{{ t('federatedfilesharing', 'Allow people to publish their data to a global and public address book') }}
</NcCheckboxRadioSwitch>

<NcCheckboxRadioSwitch type="switch"
:checked.sync="federatedTrustedShareAutoAccept"
@update:checked="update('federatedTrustedShareAutoAccept', federatedTrustedShareAutoAccept)">
{{ t('federatedfilesharing', 'Automatically accept shares from federated accounts and groups by default') }}
</NcCheckboxRadioSwitch>
<!-- Trusted server handling -->
<div class="settings-subsection">
<h3 class="settings-subsection__name">
{{ t('federatedfilesharing', 'Trusted federation') }}
</h3>
<NcCheckboxRadioSwitch type="switch"
:checked.sync="federatedTrustedShareAutoAccept"
@update:checked="update('federatedTrustedShareAutoAccept', federatedTrustedShareAutoAccept)">
{{ t('federatedfilesharing', 'Automatically accept shares from trusted federated accounts and groups by default') }}
</NcCheckboxRadioSwitch>
</div>
</NcSettingsSection>
</template>

Expand Down Expand Up @@ -118,3 +124,17 @@ export default {
},
}
</script>
<style scoped>
.settings-subsection {
margin-top: 20px;
}
.settings-subsection__name {
display: inline-flex;
align-items: center;
justify-content: center;
font-size: 16px;
font-weight: bold;
max-width: 900px;
margin-top: 0;
}
</style>
26 changes: 20 additions & 6 deletions apps/federation/templates/settings-admin.php
Original file line number Diff line number Diff line change
@@ -1,20 +1,34 @@
<?php

/**
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2015-2016 ownCloud, Inc.
* SPDX-License-Identifier: AGPL-3.0-only
*/
/** @var array $_ */

use OCA\Federation\TrustedServers;
use OCP\IL10N;
use OCP\IURLGenerator;
use OCP\Server;
use OCP\Util;

/** @var IL10N $l */

Util::addScript('federation', 'settings-admin');
Util::addStyle('federation', 'settings-admin');

/** @var \OCP\IL10N $l */
script('federation', 'settings-admin');
style('federation', 'settings-admin')
$urlGenerator = Server::get(IURLGenerator::class);
$documentationLink = $urlGenerator->linkToDocs('admin-sharing-federated') . '#configuring-trusted-nextcloud-servers';
$documentationLabel = $l->t('External documentation for Federated Cloud Sharing');
?>
<div id="ocFederationSettings" class="section">
<h2><?php p($l->t('Trusted servers')); ?></h2>
<h2>
<?php p($l->t('Trusted servers')); ?>
<a target="_blank" rel="noreferrer noopener" class="icon-info"
title="<?php p($documentationLabel);?>"
href="<?php p($documentationLink); ?>"></a>
</h2>
<p class="settings-hint"><?php p($l->t('Federation allows you to connect with other trusted servers to exchange the account directory. For example this will be used to auto-complete external accounts for federated sharing. It is not necessary to add a server as trusted server in order to create a federated share.')); ?></p>
<p class="settings-hint"><?php p($l->t('Each server must validate the other. This process may require a few cron cycles.')); ?></p>

<ul id="listOfTrustedServers">
<?php foreach ($_['trustedServers'] as $trustedServer) { ?>
Expand Down
2 changes: 1 addition & 1 deletion apps/settings/css/settings.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/settings/css/settings.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 25 additions & 5 deletions apps/settings/css/settings.scss
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,7 @@ span.usersLastLoginTooltip {
}

/* SETTINGS SECTIONS */
// to match with NcSettingsSection component
.section {
margin-bottom: 0;
/* section divider lines, none needed for last one */
Expand All @@ -577,13 +578,32 @@ span.usersLastLoginTooltip {

/* correctly display help icons next to headings */
h2 {
margin-bottom: 22px;
display: inline-flex;
align-items: center;
justify-content: center;
font-size: 20px;
font-weight: bold;
max-width: 900px;
margin-top: 0;

.icon-info {
padding: 6px 20px;
vertical-align: text-bottom;
display: inline-block;
.icon-info {
display: flex;
align-items: center;
justify-content: center;
width: var(--default-clickable-area);
height: var(--default-clickable-area);
margin: calc((var(--default-clickable-area) - 16px) / 2* -1);
margin-left: 0;
color: var(--color-text-maxcontrast);
}

}

p {
margin-top: -0.2em;
margin-bottom: 1em;
color: var(--color-text-maxcontrast);
max-width: 900px;
}
}

Expand Down
2 changes: 1 addition & 1 deletion dist/9701-9701.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/federatedfilesharing-vue-settings-admin.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/federatedfilesharing-vue-settings-admin.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/files_sharing-init.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files_sharing-init.js.map

Large diffs are not rendered by default.

0 comments on commit 8b3c276

Please sign in to comment.