fix skit2
This commit is contained in:
Vendored
+3
-3
@@ -70,15 +70,15 @@ Vue.use(require('vue-pusher'), {
|
||||
}
|
||||
});
|
||||
|
||||
Vue.prototype.$api1 = 'http://api.arrahn'
|
||||
Vue.prototype.$api1 = 'http://localhost:8000'
|
||||
|
||||
let initial = 'KB2';
|
||||
let initialhostname = 'http://api.arrahn';
|
||||
let initialhostname = 'http://localhost:8000';
|
||||
|
||||
const store = new Vuex.Store({
|
||||
state: {
|
||||
$kodcaw: 'KB2',
|
||||
$hostname: 'http://api.arrahn'
|
||||
$hostname: 'http://localhost:8000'
|
||||
},
|
||||
plugins: [createPersistedState()],
|
||||
mutations: {
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
case 'JLI':
|
||||
case 'ARP':
|
||||
case '020303':{
|
||||
this.sethostname('http://api.arrahn')
|
||||
this.sethostname('http://localhost:8000')
|
||||
break;
|
||||
}
|
||||
case '010621':
|
||||
@@ -114,7 +114,7 @@
|
||||
this.sethostname('http://api3.arrahn')
|
||||
break;
|
||||
}
|
||||
default: this.sethostname('http://api.arrahn')
|
||||
default: this.sethostname('http://localhost:8000')
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,152 +1,72 @@
|
||||
<template>
|
||||
<div>
|
||||
<button @click="show = true">Click</button>
|
||||
|
||||
<!-- This example requires Tailwind CSS v2.0+ -->
|
||||
<transition leave-active-class="duration-300">
|
||||
<div
|
||||
v-show="show"
|
||||
class="fixed z-10 inset-0 overflow-y-auto"
|
||||
aria-labelledby="modal-title"
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
>
|
||||
<div
|
||||
class="flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0"
|
||||
>
|
||||
<!--
|
||||
Background overlay, show/hide based on modal state.
|
||||
|
||||
Entering: "ease-out duration-300"
|
||||
From: "opacity-0"
|
||||
To: "opacity-100"
|
||||
Leaving: "ease-in duration-200"
|
||||
From: "opacity-100"
|
||||
To: "opacity-0"
|
||||
-->
|
||||
<transition name="ease-out-overlay">
|
||||
<div
|
||||
v-show="show"
|
||||
class="fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"
|
||||
></div>
|
||||
</transition>
|
||||
|
||||
<!-- This element is to trick the browser into centering the modal contents. -->
|
||||
<span
|
||||
class="hidden sm:inline-block sm:align-middle sm:h-screen"
|
||||
aria-hidden="true"
|
||||
>​</span
|
||||
>
|
||||
|
||||
<!--
|
||||
Modal panel, show/hide based on modal state.
|
||||
|
||||
Entering: "ease-out duration-300"
|
||||
From: "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
|
||||
To: "opacity-100 translate-y-0 sm:scale-100"
|
||||
Leaving: "ease-in duration-200"
|
||||
From: "opacity-100 translate-y-0 sm:scale-100"
|
||||
To: "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
|
||||
-->
|
||||
<transition name="ease-out-modal">
|
||||
<div
|
||||
v-show="show"
|
||||
class="inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full"
|
||||
>
|
||||
<div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4">
|
||||
<div class="sm:flex sm:items-start">
|
||||
<div
|
||||
class="mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-red-100 sm:mx-0 sm:h-10 sm:w-10"
|
||||
>
|
||||
<!-- Heroicon name: outline/exclamation -->
|
||||
<svg
|
||||
class="h-6 w-6 text-red-600"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
stroke="currentColor"
|
||||
>
|
||||
<path
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
stroke-width="2"
|
||||
d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"
|
||||
/>
|
||||
</svg>
|
||||
<div>
|
||||
<transition name="modal-fade">
|
||||
<!-- Delete Product Modal -->
|
||||
<div v-if="showDelete" class="overflow-x-hidden overflow-y-auto fixed inset-0 z-50 outline-none focus:outline-none justify-center items-center flex" id="popup-modal">
|
||||
<div class="relative px-4 w-full max-w-xl h-full md:h-auto">
|
||||
<!-- Modal content -->
|
||||
<div class="relative bg-white rounded-lg shadow dark:bg-gray-700">
|
||||
<!-- Modal header -->
|
||||
<div class="flex justify-end p-2">
|
||||
<button v-on:click="showDelete = false" type="button" class="text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white">
|
||||
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd"></path></svg>
|
||||
</button>
|
||||
</div>
|
||||
<div class="mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left">
|
||||
<h3
|
||||
class="text-lg leading-6 font-medium text-gray-900"
|
||||
id="modal-title"
|
||||
>
|
||||
Deactivate account
|
||||
</h3>
|
||||
<div class="mt-2">
|
||||
<p class="text-sm text-gray-500">
|
||||
Are you sure you want to deactivate your account? All of
|
||||
your data will be permanently removed. This action
|
||||
cannot be undone.
|
||||
</p>
|
||||
</div>
|
||||
<!-- Modal body -->
|
||||
<div class="p-6 pt-0 text-center">
|
||||
<svg class="mx-auto mb-4 w-14 h-14 text-gray-400 dark:text-gray-200" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>
|
||||
<h3 class="mb-3 text-lg font-normal text-gray-500 dark:text-gray-400">Padam nama ini dalam senarai hitam?</h3>
|
||||
<h3 class=" text-lg font-bold text-blue-500 dark:text-red-400">{{ this.nama }}</h3>
|
||||
<h3 class="mb-5 text-lg font-bold text-blue-500 dark:text-red-400">{{ this.nokp }}</h3>
|
||||
<button v-on:click="deleteBlacklist()" type="button" class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:ring-red-300 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center mr-2">
|
||||
Setuju
|
||||
</button>
|
||||
<button v-on:click="showDelete = false" type="button" class="text-gray-500 bg-white hover:bg-gray-100 focus:ring-4 focus:ring-gray-300 rounded-lg border border-gray-200 text-sm font-medium px-5 py-2.5 hover:text-gray-900 focus:z-10 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-500 dark:hover:text-white dark:hover:bg-gray-600">Batal</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse"
|
||||
>
|
||||
<button
|
||||
@click="show = false"
|
||||
type="button"
|
||||
class="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"
|
||||
>
|
||||
Deactivate
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"
|
||||
>
|
||||
Cancel
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</transition>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</transition>
|
||||
</div>
|
||||
|
||||
<div v-if="showDelete" class="opacity-25 fixed inset-0 z-40 bg-black"></div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "delmodal",
|
||||
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
};
|
||||
showDelete: false,
|
||||
deleteid: 0,
|
||||
nama:'',
|
||||
nokp:''
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="postcss" scoped>
|
||||
.badge {
|
||||
@apply inline-block bg-gray-200 rounded-full px-3 py-1 text-sm font-semibold text-gray-700;
|
||||
&:hover {
|
||||
@apply bg-gray-300;
|
||||
methods: {
|
||||
async deleteBlacklist(){
|
||||
let response = await this.EngineDelete(this.deleteid)
|
||||
if(response.data === 1)
|
||||
{
|
||||
this.showDelete = !this.showDelete;
|
||||
this.$toast.success('Berjaya! nama tersebut berjaya disenarai putih.')
|
||||
setTimeout(()=>{
|
||||
this.$emit('clickDelete_', 1)
|
||||
},1000);
|
||||
}else{
|
||||
this.$toast.danger('Tidak Berjaya! memadamkan nama tersebut.')
|
||||
}
|
||||
},
|
||||
EngineDelete(id){
|
||||
return this.axios.post(this.$api1 + '/admin/DeleteBlacklist',
|
||||
{
|
||||
id: id
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
.ease-out-overlay-enter-active,
|
||||
.ease-out-overlay-leave-active {
|
||||
@apply opacity-100 duration-300;
|
||||
}
|
||||
|
||||
.ease-out-overlay-enter, .ease-out-overlay-leave-to /* .fade-leave-active below version 2.1.8 */ {
|
||||
@apply opacity-0 duration-200;
|
||||
}
|
||||
|
||||
.ease-out-modal-enter-active,
|
||||
.ease-out-modal-leave-active {
|
||||
@apply opacity-100 translate-y-0 sm:scale-100 duration-300;
|
||||
}
|
||||
|
||||
.ease-out-modal-enter, .ease-out-modal-leave-to /* .fade-leave-active below version 2.1.8 */ {
|
||||
@apply ease-in opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95 duration-200;
|
||||
}
|
||||
</style>
|
||||
@@ -1,6 +1,7 @@
|
||||
<template>
|
||||
<div class="">
|
||||
|
||||
<deletemodal ref="delmodal" @clickDelete_="getBlacklist"></deletemodal>
|
||||
<modal ref="modal" @clickEvent_="getBlacklist"></modal>
|
||||
|
||||
<div class="flex justify-between mb-2">
|
||||
@@ -70,7 +71,7 @@
|
||||
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
|
||||
<div class="flex items-center">
|
||||
<div class="ml-3">
|
||||
<button class="border border-red-600 text-red-600 font-montserrat py-2 px-4 font-medium rounded-xl hover:bg-red-600 hover:text-white transition-all duration-300">
|
||||
<button data-modal-toggle="popup-modal" @click="deleteBlacklist(blacklist.id,blacklist.nama,blacklist.nokp)" class="border border-red-600 text-red-600 font-montserrat py-2 px-4 font-medium rounded-xl hover:bg-red-600 hover:text-white transition-all duration-300">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" />
|
||||
</svg>
|
||||
@@ -90,11 +91,14 @@
|
||||
<script>
|
||||
import pagination from '../components/pagination.vue'
|
||||
import modal from '../components/util/BlacklistModal.vue'
|
||||
import deletemodal from '../components/util/Deletemodal.vue'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
pagination,
|
||||
modal
|
||||
modal,
|
||||
deletemodal
|
||||
|
||||
},
|
||||
data(){
|
||||
return{
|
||||
@@ -139,6 +143,12 @@ export default {
|
||||
this.$refs.modal.showModal = true;
|
||||
this.$refs.modal.kodcaw = this.$kodcaw;
|
||||
|
||||
},
|
||||
deleteBlacklist(id,nama,nokp){
|
||||
this.$refs.delmodal.deleteid = id;
|
||||
this.$refs.delmodal.nama = nama;
|
||||
this.$refs.delmodal.nokp = nokp;
|
||||
this.$refs.delmodal.showDelete = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -423,7 +423,7 @@
|
||||
|
||||
</table> --}}
|
||||
|
||||
<div style="margin-left:70px;">
|
||||
{{-- <div style="margin-left:70px;">
|
||||
<span class ="signature"><span style="margin-top:20px;">Disemak Oleh</span></span>
|
||||
<span class ="signature">Disahkan Oleh</span>
|
||||
</div>
|
||||
</div> --}}
|
||||
|
||||
Reference in New Issue
Block a user