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>
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,5 +1,6 @@
|
|||
.btn {
|
||||
@apply .rounded .p-2;
|
||||
transition: all 100ms ease-in-out;
|
||||
|
||||
/**
|
||||
* Button Colors
|
||||
|
@ -21,7 +22,9 @@
|
|||
}
|
||||
|
||||
&.btn-red {
|
||||
@apply .bg-red .border-red-dark .border .text-white;
|
||||
&:not(.btn-secondary) {
|
||||
@apply .bg-red .border-red-dark .border .text-white;
|
||||
}
|
||||
|
||||
&:hover:enabled {
|
||||
@apply .bg-red-dark .border-red-darker;
|
||||
|
@ -34,6 +37,10 @@
|
|||
&:hover:enabled {
|
||||
@apply .border-grey .text-grey-darker;
|
||||
}
|
||||
|
||||
&.btn-red:hover:enabled {
|
||||
@apply .bg-red-dark .border-red-darker .text-white;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -51,6 +58,10 @@
|
|||
@apply .px-6 .py-3 .uppercase .tracking-wide .text-sm;
|
||||
}
|
||||
|
||||
&.btn-xs {
|
||||
@apply .py-2 .px-2 .uppercase .text-xs;
|
||||
}
|
||||
|
||||
&:disabled, &.disabled {
|
||||
opacity: 0.55;
|
||||
cursor: default;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue