Browse Source
Remove UI draft
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>pull/32550/head
No known key found for this signature in database
GPG Key ID: A3E2F658B28C760A
4 changed files with 0 additions and 170 deletions
-
123apps/settings/src/components/SetupCheck.vue
-
43apps/settings/src/main-admin-setup-check.js
-
3apps/settings/templates/settings/admin/overview.php
-
1webpack.modules.js
@ -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> |
|||
@ -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') |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue