Push beginning of DB deletion stuff
This commit is contained in:
parent
c28e9c1ab7
commit
9be2aa4ca9
9 changed files with 120 additions and 16 deletions
|
@ -12,7 +12,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<div class="content-box mb-6" v-for="database in databases" :key="database.name">
|
||||
<div class="content-box mb-6 hover:border-grey" v-for="database in databases" :key="database.name">
|
||||
<div class="flex items-center text-grey-darker">
|
||||
<database-icon class="flex-none text-green"></database-icon>
|
||||
<div class="flex-1 px-4">
|
||||
|
@ -38,11 +38,16 @@
|
|||
<p class="uppercase text-xs text-grey pb-1 select-none">Server</p>
|
||||
<p><code class="text-sm">{{database.host.address}}:{{database.host.port}}</code></p>
|
||||
</div>
|
||||
<div class="flex-none px-4">
|
||||
<button class="btn btn-xs btn-secondary btn-red" v-on:click="deleteDatabase(database)">
|
||||
<trash2-icon class="w-3 h-3 mx-1"/>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<button class="btn btn-blue btn-lg" v-on:click="showCreateModal = true">Create new database</button>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<button class="btn btn-blue btn-lg" v-on:click="showCreateModal = true">Create new database</button>
|
||||
</div>
|
||||
<modal :show="showCreateModal" v-on:close="showCreateModal = false">
|
||||
<create-database-modal
|
||||
|
@ -55,14 +60,14 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { DatabaseIcon, LockIcon } from 'vue-feather-icons';
|
||||
import { DatabaseIcon, LockIcon, Trash2Icon } from 'vue-feather-icons';
|
||||
import map from 'lodash/map';
|
||||
import Modal from '../../core/Modal';
|
||||
import CreateDatabaseModal from '../components/CreateDatabaseModal';
|
||||
|
||||
export default {
|
||||
name: 'databases-page',
|
||||
components: {CreateDatabaseModal, Modal, DatabaseIcon, LockIcon },
|
||||
components: {CreateDatabaseModal, Modal, DatabaseIcon, LockIcon, Trash2Icon },
|
||||
|
||||
data: function () {
|
||||
return {
|
||||
|
@ -136,6 +141,15 @@
|
|||
|
||||
database.showPassword = !database.showPassword;
|
||||
},
|
||||
|
||||
deleteDatabase: function (database) {
|
||||
window.axios.delete(this.route('api.client.servers.databases.delete', {
|
||||
server: this.$route.params.id,
|
||||
database: database.id,
|
||||
}))
|
||||
.then(response => console.log(response))
|
||||
.catch(err => console.error(err.response));
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue