mirror of https://github.com/nocodb/nocodb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
145 lines
3.8 KiB
145 lines
3.8 KiB
4 years ago
|
<template>
|
||
|
<v-card style="width: 100%">
|
||
|
<v-toolbar height="40" class="elevation-0 toolbar-border-bottom">
|
||
3 years ago
|
<v-spacer />
|
||
4 years ago
|
|
||
3 years ago
|
<x-btn
|
||
3 years ago
|
v-ge="['roles', 'reload']"
|
||
3 years ago
|
outlined
|
||
|
tooltip="Reload log settings"
|
||
|
color="primary"
|
||
|
small
|
||
|
:disabled="loading"
|
||
|
@click="load"
|
||
|
@click.prevent
|
||
|
>
|
||
3 years ago
|
<v-icon small left> refresh </v-icon>
|
||
3 years ago
|
<!-- Reload -->
|
||
|
{{ $t('general.reload') }}
|
||
4 years ago
|
</x-btn>
|
||
3 years ago
|
<x-btn
|
||
3 years ago
|
v-ge="['roles', 'add new']"
|
||
3 years ago
|
outlined
|
||
|
tooltip="Toggle all checkbox"
|
||
|
color="primary"
|
||
|
small
|
||
|
:disabled="loading"
|
||
3 years ago
|
@click="
|
||
|
toggleAll = !toggleAll;
|
||
|
edited = true;
|
||
|
"
|
||
3 years ago
|
@click.prevent
|
||
|
>
|
||
|
<v-icon small left>
|
||
|
{{ toggleAll ? 'mdi-toggle-switch-outline' : 'mdi-toggle-switch-off-outline' }}
|
||
|
</v-icon>
|
||
4 years ago
|
Toggle All
|
||
|
</x-btn>
|
||
3 years ago
|
<x-btn
|
||
3 years ago
|
v-ge="['rows', 'save']"
|
||
3 years ago
|
outlined
|
||
3 years ago
|
:tooltip="$t('tooltip.saveChanges')"
|
||
3 years ago
|
color="primary"
|
||
|
small
|
||
|
:disabled="!edited || loading"
|
||
|
@click="save"
|
||
|
@click.prevent
|
||
|
>
|
||
3 years ago
|
<v-icon small left> save </v-icon>
|
||
3 years ago
|
<!-- Save -->
|
||
|
{{ $t('general.save') }}
|
||
4 years ago
|
</x-btn>
|
||
|
</v-toolbar>
|
||
|
<div class="d-flex justify-center pa-2">
|
||
3 years ago
|
<v-simple-table dense style="min-width: 500px; margin: 0 auto">
|
||
4 years ago
|
<thead>
|
||
3 years ago
|
<tr>
|
||
|
<th />
|
||
|
<th>Name</th>
|
||
|
</tr>
|
||
4 years ago
|
</thead>
|
||
|
<tbody>
|
||
3 years ago
|
<tr v-for="(v, key) in names" :key="key">
|
||
|
<td>
|
||
|
<v-checkbox v-model="names[key]" class="mt-0 pt-0" dense hide-details @change="edited = true" />
|
||
|
</td>
|
||
|
<td>{{ key }}</td>
|
||
|
</tr>
|
||
4 years ago
|
</tbody>
|
||
|
</v-simple-table>
|
||
|
</div>
|
||
|
</v-card>
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
|
export default {
|
||
3 years ago
|
name: 'Logs',
|
||
4 years ago
|
data: () => ({
|
||
|
names: null,
|
||
|
loading: false,
|
||
3 years ago
|
edited: false,
|
||
4 years ago
|
}),
|
||
3 years ago
|
computed: {
|
||
|
toggleAll: {
|
||
3 years ago
|
get() {
|
||
3 years ago
|
return this.names && Object.values(this.names).some(v => v);
|
||
3 years ago
|
},
|
||
3 years ago
|
set(val) {
|
||
3 years ago
|
this.names && Object.keys(this.names).forEach(k => this.$set(this.names, k, val));
|
||
|
},
|
||
|
},
|
||
3 years ago
|
},
|
||
3 years ago
|
async created() {
|
||
3 years ago
|
await this.load();
|
||
4 years ago
|
},
|
||
|
methods: {
|
||
3 years ago
|
async load() {
|
||
3 years ago
|
this.loading = true;
|
||
4 years ago
|
try {
|
||
3 years ago
|
const res = await this.$store.dispatch('sqlMgr/ActSqlOp', [null, 'xcDebugGet']);
|
||
|
this.names = JSON.parse(res.value);
|
||
|
} catch (e) {}
|
||
4 years ago
|
|
||
3 years ago
|
this.loading = false;
|
||
4 years ago
|
},
|
||
3 years ago
|
async save() {
|
||
3 years ago
|
this.loading = true;
|
||
4 years ago
|
try {
|
||
3 years ago
|
await this.$store.dispatch('sqlMgr/ActSqlOp', [null, 'xcDebugSet', this.names]);
|
||
|
this.$toast.success('Updated debug log settings successfully').goAway(3000);
|
||
|
this.edited = false;
|
||
4 years ago
|
} catch (e) {
|
||
3 years ago
|
this.$toast.error('Some error occurred while updating debug log settings').goAway(3000);
|
||
4 years ago
|
}
|
||
3 years ago
|
this.loading = false;
|
||
|
},
|
||
|
},
|
||
|
};
|
||
4 years ago
|
</script>
|
||
|
|
||
3 years ago
|
<style scoped></style>
|
||
4 years ago
|
<!--
|
||
|
/**
|
||
|
* @copyright Copyright (c) 2021, Xgene Cloud Ltd
|
||
|
*
|
||
|
* @author Naveen MR <oof1lab@gmail.com>
|
||
|
* @author Pranav C Balan <pranavxc@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/>.
|
||
|
*
|
||
|
*/
|
||
|
-->
|