diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2023-10-12 12:04:46 +0200 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2023-10-19 11:44:02 +0200 |
commit | 968b82caccb78b30a89b76187e999973774cf62d (patch) | |
tree | 25da6f3fdae2f989c86fe7677d0a44dcf87f40f5 /apps/settings | |
parent | 6bc3e008c77d53a63526466f3e382399ee91bf26 (diff) | |
download | nextcloud-server-968b82caccb78b30a89b76187e999973774cf62d.tar.gz nextcloud-server-968b82caccb78b30a89b76187e999973774cf62d.zip |
Remove UI draft
For now we will keep the existing UI and only change the API behind it
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/settings')
-rw-r--r-- | apps/settings/src/components/SetupCheck.vue | 123 | ||||
-rw-r--r-- | apps/settings/src/main-admin-setup-check.js | 43 | ||||
-rw-r--r-- | apps/settings/templates/settings/admin/overview.php | 3 |
3 files changed, 0 insertions, 169 deletions
diff --git a/apps/settings/src/components/SetupCheck.vue b/apps/settings/src/components/SetupCheck.vue deleted file mode 100644 index 885145bfffa..00000000000 --- a/apps/settings/src/components/SetupCheck.vue +++ /dev/null @@ -1,123 +0,0 @@ -<template> - <NcSettingsSection :title="t('settings', 'Setup Checks')" - :description="t('settings', `It's important for the security and performance of your instance that everything is configured correctly. To help you with that we are doing some automatic checks. Please see the linked documentation for more information.`)"> - <div v-for="(checks, category) in results" - :key="category" - class="check-card"> - <div class="check-card__header" @click="toggleCollapse(category)"> - <h3>{{ category }}</h3> - <Check v-if="stats[category].successes === stats[category].total" - :size="20" - :fill-color="'var(--color-success)'" /> - <Check v-else-if="stats[category].errors > 0" - :size="20" - :fill-color="'var(--color-error)'" /> - <Check v-else-if="stats[category].warnings > 0" - :size="20" - :fill-color="'var(--color-warning)'" /> - <span> - {{ stats[category].successes }} / {{ stats[category].total }} - </span> - </div> - <div class="card__body" v-if="!collapsed[category]"> - <div v-for="(check, name) in checks" - :key="name" - class="row-check" - :class="['row-check__' + check.severity]"> - <template v-if="check.severity === 'success'"> - <Check :size="20" :fill-color="'var(--color-success)'" /> - </template> - {{ name }} - </div> - </div> - </div> - </NcSettingsSection> -</template> - -<script> -import NcSettingsSection from '@nextcloud/vue/dist/Components/NcSettingsSection.js' -import axios from '@nextcloud/axios' -import { generateUrl } from '@nextcloud/router' -import Check from 'vue-material-design-icons/Check.vue' - -export default { - name: 'SetupCheck', - components: { - NcSettingsSection, - Check, - }, - data() { - return { - results: [], - collapsed: {}, - stats: {}, - } - }, - mounted() { - this.loadSetupChecks() - }, - methods: { - toggleCollapse(category) { - this.collapsed[category] = !this.collapsed[category] - }, - async loadSetupChecks() { - const { data } = await axios.get(generateUrl('/settings/setupcheck')) - const collapsed = {} - const stats = {} - for (const [category, checks] of Object.entries(data)) { - const values = Object.values(checks) - stats[category] = { - total: values.length, - successes: values.filter((check) => check.severity === 'success').length, - warnings: values.filter((check) => check.severity === 'warning').length, - errors: values.filter((check) => check.severity === 'errors').length, - } - collapsed[category] = stats[category].errors > 0 - } - this.collapsed = collapsed - this.stats = stats - this.results = data - }, - }, -} -</script> - -<style lang="scss" scoped> -.check-card { - border: 1px solid var(--color-border); - border-radius: var(--border-radius); - &__header { - padding: 0.5rem 1rem; - display: flex; - align-items: center; - h3 { - margin: 0; - } - .material-design-icon { - margin-left: auto; - margin-right: 0.5rem; - } - } -} -.row-check { - color: var(--color-text-light); - background-color: var(--note-background); - box-shadow: rgba(43, 42, 51, 0.05) 0 1px 2px 0; - margin: 0; - padding: 0.5rem 1rem; - display: flex; - align-items: center; - &__success { - --note-background: rgba(var(--color-success-rgb), 0.2); - --note-theme: var(--color-success); - } - &__error { - --note-background: rgba(var(--color-error-rgb), 0.2); - --note-theme: var(--color-error); - } - &__warning { - --note-background: rgba(var(--color-warning-rgb), 0.2); - --note-theme: var(--color-warning); - } -} -</style> diff --git a/apps/settings/src/main-admin-setup-check.js b/apps/settings/src/main-admin-setup-check.js deleted file mode 100644 index 5f984fd626a..00000000000 --- a/apps/settings/src/main-admin-setup-check.js +++ /dev/null @@ -1,43 +0,0 @@ -/** - * @copyright 2022 Christopher Ng <chrng8@gmail.com> - * - * @author Christopher Ng <chrng8@gmail.com> - * - * @license GNU AGPL version 3 or any later version - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - */ - -import Vue from 'vue' -import { getRequestToken } from '@nextcloud/auth' -import { translate as t } from '@nextcloud/l10n' - -import logger from './logger.js' - -import SetupCheck from './components/SetupCheck.vue' - -__webpack_nonce__ = btoa(getRequestToken()) - -Vue.mixin({ - props: { - logger, - }, - methods: { - t, - }, -}) - -const SetupCheckView = Vue.extend(SetupCheck) -new SetupCheckView().$mount('#vue-admin-setup-check') diff --git a/apps/settings/templates/settings/admin/overview.php b/apps/settings/templates/settings/admin/overview.php index 69f1479fc16..d8b3674f47e 100644 --- a/apps/settings/templates/settings/admin/overview.php +++ b/apps/settings/templates/settings/admin/overview.php @@ -25,7 +25,6 @@ /** @var array $_ */ /** @var \OCP\Defaults $theme */ -\OCP\Util::addScript('settings', 'vue-settings-admin-setup-check'); ?> <div id="security-warning" class="section"> @@ -67,8 +66,6 @@ </div> -<div id="vue-admin-setup-check"></div> - <div id="version" class="section"> <!-- should be the last part, so Updater can follow if enabled (it has no heading therefore). --> <h2><?php p($l->t('Version'));?></h2> |