Initial import
This commit is contained in:
20
one-ui/system/one-replication/api/replication.js
Normal file
20
one-ui/system/one-replication/api/replication.js
Normal file
@@ -0,0 +1,20 @@
|
||||
const URL = "/one-api/tools/";
|
||||
|
||||
export async function load(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'replication/monitor', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
401
one-ui/system/one-replication/api/sales.js
Normal file
401
one-ui/system/one-replication/api/sales.js
Normal file
@@ -0,0 +1,401 @@
|
||||
const URL = "/one-api/v1/management/";
|
||||
|
||||
export async function search(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'sales/search', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function searchconfirm(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'sales/searchconfirm', prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function getsexreg(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'sales/getsexreg',{token:token});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function getdatas_riau(prm) {
|
||||
try {
|
||||
var resp = await axios.post('http://riau.aplikasi.web.id/one-api/tools/management/sales/getdatas',prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function getdatas_pajajaran(prm) {
|
||||
try {
|
||||
var resp = await axios.post('http://pajajaran.aplikasi.web.id/one-api/tools/management/sales/getdatas',prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function getdatas_toha(prm) {
|
||||
try {
|
||||
var resp = await axios.post('http://toha.aplikasi.web.id/one-api/tools/management/sales/getdatas',prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function getdatas_cimahi(prm) {
|
||||
try {
|
||||
var resp = await axios.post('http://cimahi.aplikasi.web.id/one-api/tools/management/sales/getdatas',prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export async function removecode(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'sales/removecode',prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export async function attachdoctor(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'sales/attachdoctor',prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
export async function save(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'sales/save',prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function newdoctor(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'sales/newdoctor',prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function xdelete(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'sales/deletedoctor',prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function getaddress(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'sales/getaddress',prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function searchcity(token,prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'sales/searchcity',{token:token,search:prm});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export async function searchstaff(token,prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'sales/searchstaff',{token:token,name:prm});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function getdistrict(token,prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'sales/getdistrict',{id:prm.M_CityID,token:token});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function getkelurahan(token,prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'sales/getkelurahan',{token:token,id:prm.M_DistrictID});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function getjpa(token) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'sales/getjpa',{token:token});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
export async function savenewaddress(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'sales/savenewaddress',prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function saveeditaddress(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'sales/saveeditaddress',prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function deleteaddress(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'sales/deleteaddress',prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
32
one-ui/system/one-replication/components/oneChart.vue
Normal file
32
one-ui/system/one-replication/components/oneChart.vue
Normal file
@@ -0,0 +1,32 @@
|
||||
<template>
|
||||
<div class="example">
|
||||
<apexcharts width="500" height="350" type="bar" :options="chartOptions" :series="series"></apexcharts>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Chart from './components/oneChart.vue'
|
||||
|
||||
export default {
|
||||
name: 'Chart',
|
||||
components: {
|
||||
apexcharts: VueApexCharts,
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
chartOptions: {
|
||||
chart: {
|
||||
id: 'basic-bar'
|
||||
},
|
||||
xaxis: {
|
||||
categories: [1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998]
|
||||
}
|
||||
},
|
||||
series: [{
|
||||
name: 'series-1',
|
||||
data: [30, 40, 45, 50, 49, 60, 70, 91]
|
||||
}]
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
159
one-ui/system/one-replication/components/oneSales.vue
Normal file
159
one-ui/system/one-replication/components/oneSales.vue
Normal file
@@ -0,0 +1,159 @@
|
||||
<template>
|
||||
<v-layout wrap>
|
||||
<v-flex xs12 and-down>
|
||||
<v-layout row>
|
||||
<v-flex sm12 and-down>
|
||||
<v-card color="#C8DFC3">
|
||||
<v-card-title class="pa-1" style="background:#3F848F" >
|
||||
|
||||
</v-card-title>
|
||||
<v-card-text class="pt-1">
|
||||
<v-layout row>
|
||||
<v-flex class="text-xs-left" sm6 and-down>
|
||||
<p class="mb-0 caption mono" style="color:#616161">PASIEN</p>
|
||||
<p class="mb-1 text--primary"><span class="display-1 font-weight-black">3.500</span> <span class="subtitle-2 font-weight-light">org</span></p>
|
||||
</v-flex>
|
||||
<v-flex class="text-xs-right" sm6 and-down>
|
||||
<p class="mb-0 caption mono" style="color:#616161">PENJUALAN</p>
|
||||
<p class="mb-1 text--primary"><span class="display-1 font-weight-black">1.500</span> <span class="subtitle-2 font-weight-light">jt</span></p>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-divider style="border-color:#0D7F8B"></v-divider>
|
||||
<v-layout mt-2 align-center row>
|
||||
<v-flex sm6 d-flex>
|
||||
<p class="mb-0">bandung raya</p>
|
||||
</v-flex>
|
||||
<v-flex sm6 class="text-xs-right" d-flex>
|
||||
<p class="mb-0">april 2020</p>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout row>
|
||||
<v-flex sm12 and-down>
|
||||
<v-card color="#C8DFC3">
|
||||
<v-card-title class="pa-1" style="background:#3F848F" >
|
||||
|
||||
</v-card-title>
|
||||
<v-card-text class="pt-1">
|
||||
<v-layout row>
|
||||
<v-flex class="text-xs-left" sm12 and-down>
|
||||
<div id="chart">
|
||||
<apexchart type="bar" height="350" :options="chartOptions" :series="series"></apexchart>
|
||||
</div>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.searchbox .v-input.v-text-field .v-input__slot {
|
||||
min-height: 60px;
|
||||
}
|
||||
|
||||
.searchbox .v-btn {
|
||||
min-height: 60px;
|
||||
}
|
||||
|
||||
table.v-table tbody td,
|
||||
table.v-table tbody th {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
table.v-table thead tr {
|
||||
height: 40px;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
window.Promise ||
|
||||
document.write(
|
||||
'<script src="https://cdn.jsdelivr.net/npm/promise-polyfill@8/dist/polyfill.min.js"><\/script>'
|
||||
)
|
||||
window.Promise ||
|
||||
document.write(
|
||||
'<script src="https://cdn.jsdelivr.net/npm/eligrey-classlist-js-polyfill@1.2.20171210/classList.min.js"><\/script>'
|
||||
)
|
||||
window.Promise ||
|
||||
document.write(
|
||||
'<script src="https://cdn.jsdelivr.net/npm/findindex_polyfill_mdn"><\/script>'
|
||||
)
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/apexcharts"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/vue-apexcharts"></script>
|
||||
<script>
|
||||
|
||||
module.exports = {
|
||||
|
||||
components: {
|
||||
'apexchart': VueApexCharts,
|
||||
'one-dialog-info': httpVueLoader('../../../common/oneDialogInfo.vue'),
|
||||
'one-dialog-alert': httpVueLoader('../../../common/oneDialogAlert.vue')
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
reHTMLAddress(xxaddresses){
|
||||
var rtn = ''
|
||||
if(xxaddresses && xxaddresses !== ''){
|
||||
var peraddress = xxaddresses.split("+")
|
||||
peraddress.forEach(function(entry) {
|
||||
var perpart = entry.split("^")
|
||||
rtn += "<p class='mb-0 font-weight-black' style='font-size:11px'>"+perpart[0].toUpperCase()+"</p>"
|
||||
rtn += "<p class='mb-1 caption mono'>"+perpart[1]+"</p>"
|
||||
})
|
||||
}
|
||||
|
||||
return rtn
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
in_saving: {
|
||||
get() {
|
||||
return this.$store.state.sales.in_saving
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("sales/update_in_saving", val)
|
||||
}
|
||||
}
|
||||
},
|
||||
data: {
|
||||
|
||||
series: [{
|
||||
data: [400, 430, 448, 470, 540, 580, 690, 1100, 1200, 1380]
|
||||
}],
|
||||
chartOptions: {
|
||||
chart: {
|
||||
type: 'bar',
|
||||
height: 350
|
||||
},
|
||||
plotOptions: {
|
||||
bar: {
|
||||
horizontal: true,
|
||||
}
|
||||
},
|
||||
dataLabels: {
|
||||
enabled: false
|
||||
},
|
||||
xaxis: {
|
||||
categories: ['South Korea', 'Canada', 'United Kingdom', 'Netherlands', 'Italy', 'France', 'Japan',
|
||||
'United States', 'China', 'Germany'
|
||||
],
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
}
|
||||
</script>
|
||||
174
one-ui/system/one-replication/index.php
Normal file
174
one-ui/system/one-replication/index.php
Normal file
@@ -0,0 +1,174 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title>One</title>
|
||||
<link rel="stylesheet" href="../../libs/vendor/css/google-fonts.css">
|
||||
<link rel="stylesheet" href="../../libs/vendor/css/icomoon-fonts.css">
|
||||
<link rel="stylesheet" href="../../libs/vendor/css/vuetify.min.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div v-cloak id="app">
|
||||
<v-app id="smartApp" >
|
||||
<v-card tile elevation="5" color="#85352e" class="pt-2 pb-2 mb-1">
|
||||
<v-flex class="text-xs-center" xs12>
|
||||
<h3 style="font-family: 'Days One', sans-serif;color:#FFFFFF">BISONE</h3>
|
||||
</v-flex>
|
||||
</v-card>
|
||||
<v-content
|
||||
style="max-height: 1000px;background:#fcfcfc!important" >
|
||||
<v-layout class="align-center pr-2" row>
|
||||
<v-flex class="text-xs-left mt-2" xs6>
|
||||
<p class="pl-2 mb-0 font-weight-black">Replication Status</p>
|
||||
</v-flex>
|
||||
<v-flex class="text-xs-right mt-2" xs6>
|
||||
<v-icon @click="reload">autorenew</v-icon>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-progress-linear v-if="is_loading" :indeterminate="true" :active="is_loading"></v-progress-linear>
|
||||
<v-container fluid fill-height class="pl-1 pr-1 pt-1 pb-2">
|
||||
<v-layout row wrap >
|
||||
<v-flex xs12 fill-height pa-1>
|
||||
<v-layout row>
|
||||
<v-flex sm12 and-down>
|
||||
<v-card tile color="#C8DFC3">
|
||||
<v-card-title class="pa-1" style="background:#3F848F" >
|
||||
</v-card-title>
|
||||
<v-card-text class="pt-1">
|
||||
<v-layout row>
|
||||
<v-flex class="text-xs-left" sm6 and-down>
|
||||
<p class="mb-0 caption mono" style="color:#616161">Master</p>
|
||||
</v-flex>
|
||||
<v-flex class="text-xs-right" sm6 and-down>
|
||||
<p class="mb-0 caption mono" style="color:#616161">Status</p>
|
||||
<p class="mb-1 text--primary">
|
||||
<span class="font-weight-black">{{master.status}}</span>
|
||||
</p>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-divider style="border-color:#0D7F8B"></v-divider>
|
||||
<v-layout mt-2 align-center row>
|
||||
<v-flex sm6 d-flex>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout class="pb-3" row>
|
||||
<v-flex sm12 and-down>
|
||||
<v-card v-for="slave in slaves" tile color="#F0EACF" style="margin-bottom:10px; margin-top:5px;">
|
||||
<v-card-title class="pa-1 white--text" style="background:#3F848F" >
|
||||
{{slave.name}}
|
||||
</v-card-title>
|
||||
<v-card-text class="pt-1">
|
||||
<v-layout row>
|
||||
<v-flex class="text-xs-left pr-2" sm6 and-down>
|
||||
Status
|
||||
</v-flex>
|
||||
<v-flex class="text-xs-left" sm6 and-down>
|
||||
{{slave.status}}
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout v-if="slave.status=='Running'" row>
|
||||
<v-flex class="text-xs-left pr-2" sm6 and-down>
|
||||
Behind
|
||||
</v-flex>
|
||||
<v-flex class="text-xs-left" sm6 and-down>
|
||||
{{slave.Behind}}
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout v-if="slave.status=='Running'" row>
|
||||
<v-flex class="text-xs-left pr-2" sm6 and-down>
|
||||
Tables
|
||||
</v-flex>
|
||||
<v-flex class="text-xs-left" sm6 and-down>
|
||||
<br/>
|
||||
<span style="block" v-for="(tb,idx) in slave.Table">
|
||||
<span v-if="idx > 0">,</span> {{tb}}
|
||||
</span>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-container>
|
||||
</v-content>
|
||||
</v-app>
|
||||
</div>
|
||||
|
||||
<!-- Vendor -->
|
||||
<script src="../../libs/vendor/moment.min.js"></script>
|
||||
<script src="../../libs/vendor/numeral.min.js"></script>
|
||||
<script src="../../libs/vendor/moment-locale-id.js"></script>
|
||||
<script src="../../libs/vendor/lodash.js"></script>
|
||||
<script src="../../libs/vendor/axios.min.js"></script>
|
||||
<script src="../../libs/vendor/vue.js"></script>
|
||||
<script src="../../libs/vendor/vuex.js"></script>
|
||||
<script src="../../libs/vendor/vuetify.js"></script>
|
||||
<script src="../../libs/vendor/httpVueLoader.js"></script>
|
||||
<script src="../../libs/one_global.js"></script>
|
||||
<script> </script>
|
||||
|
||||
|
||||
|
||||
<!-- App Script -->
|
||||
<?php
|
||||
$ts = "?ts=" . Date("ymdhis");
|
||||
?>
|
||||
<script type="module">
|
||||
import { store } from './store.js<?php echo $ts ?>';
|
||||
window.store = store;
|
||||
|
||||
new Vue({
|
||||
store,
|
||||
el: '#app',
|
||||
methods: {
|
||||
reload: function(event){
|
||||
this.$store.dispatch('replication/load')
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
let self = this
|
||||
self.$store.dispatch('replication/load')
|
||||
},
|
||||
computed: {
|
||||
is_loading() {
|
||||
return this.$store.state.replication.loading
|
||||
},
|
||||
master() {
|
||||
let master = this.$store.state.replication.master;
|
||||
return master
|
||||
},
|
||||
slaves() {
|
||||
let slaves = this.$store.state.replication.slave
|
||||
return slaves
|
||||
}
|
||||
},
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
[v-cloak] {
|
||||
display: none
|
||||
}
|
||||
.left {
|
||||
}
|
||||
.right {
|
||||
}
|
||||
.v-toolbar__content, .v-toolbar__extension {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
padding: 0 ;
|
||||
}
|
||||
</style>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
55
one-ui/system/one-replication/modules/replication.js
Normal file
55
one-ui/system/one-replication/modules/replication.js
Normal file
@@ -0,0 +1,55 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/replication.js"
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
error: "",
|
||||
loading: false,
|
||||
master: {},
|
||||
slave: []
|
||||
},
|
||||
mutations: {
|
||||
update_loading(state,val) {
|
||||
state.loading = val
|
||||
},
|
||||
update_master(state, val) {
|
||||
state.master = val
|
||||
},
|
||||
update_slave(state, val) {
|
||||
state.slave= val
|
||||
},
|
||||
update_error(state, val) {
|
||||
state.error = val
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async load(context) {
|
||||
context.commit("update_loading", true)
|
||||
context.commit("update_error", "")
|
||||
try {
|
||||
context.commit("update_slave",[])
|
||||
let resp = await api.load()
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_loading", false)
|
||||
context.commit("update_error", resp.message)
|
||||
} else {
|
||||
context.commit("update_loading", false)
|
||||
context.commit("update_error", "")
|
||||
for(let idx=0;idx < resp.slave.length; idx++) {
|
||||
for(let j=0;j<resp.slave[idx].Table.length; j++) {
|
||||
resp.slave[idx].Table[j] = resp.slave[idx].Table[j].replace('one.','')
|
||||
}
|
||||
}
|
||||
context.commit("update_master", resp.master)
|
||||
context.commit("update_slave", resp.slave)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_loading", false)
|
||||
context.commit("update_error", e.message )
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
1138
one-ui/system/one-replication/modules/sales.js
Normal file
1138
one-ui/system/one-replication/modules/sales.js
Normal file
File diff suppressed because it is too large
Load Diff
20
one-ui/system/one-replication/store.js
Normal file
20
one-ui/system/one-replication/store.js
Normal file
@@ -0,0 +1,20 @@
|
||||
// State
|
||||
// data ...
|
||||
// Mutations
|
||||
//
|
||||
//
|
||||
// Actions
|
||||
import replication from "./modules/replication.js"
|
||||
import system from "../../apps/modules/system/system.js"
|
||||
export const store = new Vuex.Store({
|
||||
modules: {
|
||||
replication: replication,
|
||||
system: system
|
||||
},
|
||||
state: {
|
||||
},
|
||||
mutations: {
|
||||
},
|
||||
actions: {
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user