Fakultas Ilmu Komputer UI

Commit 35e9c95c authored by Muhammad Indra Ramadhan's avatar Muhammad Indra Ramadhan
Browse files

Fix base url for vue

parent e8f246e9
......@@ -57,7 +57,10 @@ export default {
data() {
return {
adminer_databases: [],
admins_uri: "/admin/resource/adminerdatabases",
admins_uri:
(window.location.href.includes("cs.ui.ac.id")
? "https://opensauce.cs.ui.ac.id/_admin"
: "") + "/admin/resource/adminerdatabases",
user_id: "",
db_name: ""
};
......
......@@ -40,7 +40,10 @@ export default {
data() {
return {
admins: [],
admins_uri: "/admin/resource/users/admins"
admins_uri:
(window.location.href.includes("cs.ui.ac.id")
? "https://opensauce.cs.ui.ac.id/_admin"
: "") + "/admin/resource/users/admins"
};
},
methods: {
......
......@@ -55,7 +55,10 @@ export default {
data() {
return {
mahasiswas: [],
mahasiswas_uri: "/admin/resource/mahasiswas",
mahasiswas_uri:
(window.location.href.includes("cs.ui.ac.id")
? "https://opensauce.cs.ui.ac.id/_admin"
: "") + "/admin/resource/mahasiswas",
user_id: ""
};
},
......
......@@ -4,7 +4,12 @@
<div class="col-12">
<div class="card m-b-20">
<div class="card-body">
<table id="datatable" class="table table-bordered dt-responsive nowrap" cellspacing="0" width="100%">
<table
id="datatable"
class="table table-bordered dt-responsive nowrap"
cellspacing="0"
width="100%"
>
<thead>
<tr>
<th></th>
......@@ -15,8 +20,11 @@
</tr>
</thead>
<tbody>
<tr v-for="(admin, index) in admins" :key="admin.id">
<td>{{ index+1 }}</td>
<tr
v-for="(admin, index) in admins"
:key="admin.id"
>
<td>{{ index + 1 }}</td>
<td>{{ admin.name }}</td>
<td>{{ admin.email }}</td>
<td>{{ admin.is_admin }}</td>
......@@ -32,29 +40,30 @@
</template>
<script>
export default {
data(){
return{
admins: [],
admins_uri : '/admin/resource/users'
}
},
methods: {
loadData(){
axios.get(this.admins_uri)
.then(response=>{
$.when(this.putAsyncData(response.data)).then(function(){
$('#datatable').DataTable();
})
export default {
data() {
return {
admins: [],
admins_uri:
(window.location.href.includes("cs.ui.ac.id")
? "https://opensauce.cs.ui.ac.id/_admin"
: "") + "/admin/resource/users"
};
},
methods: {
loadData() {
axios.get(this.admins_uri).then(response => {
$.when(this.putAsyncData(response.data)).then(function() {
$("#datatable").DataTable();
});
},
putAsyncData(data){
this.admins = data
}
});
},
mounted() {
this.loadData();
putAsyncData(data) {
this.admins = data;
}
},
mounted() {
this.loadData();
}
};
</script>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment