refactor: domain name config
parent
4e4a838045
commit
0d7f53c937
|
|
@ -0,0 +1,16 @@
|
|||
var config = {
|
||||
dev: {
|
||||
apiBaseURL: 'http://localhost:8080/hdpos/api'
|
||||
},
|
||||
prod: {
|
||||
apiBaseURL: 'http://V-XSTO-A01-IIDC.adic.lan/hdpos/api'
|
||||
}
|
||||
};
|
||||
|
||||
// Now we check the hostname where the script is running
|
||||
var env = window.location.hostname.includes('localhost') ? 'dev' : 'prod';
|
||||
|
||||
var selectedConfig = config[env];
|
||||
|
||||
// Make the selected configuration available for other scripts
|
||||
window.config = selectedConfig;
|
||||
|
|
@ -369,6 +369,7 @@ Contact: frederik.benoist@inetum.com
|
|||
<script src="assets/plugins/custom/datatables/datatables.bundle.js"></script>
|
||||
<!--end::Vendors Javascript-->
|
||||
<!--begin::Custom Javascript(used for this page only)-->
|
||||
<script src="config/config.js"></script>
|
||||
<script src="store/list/table.js"></script>
|
||||
<!--end::Custom Javascript-->
|
||||
<!--end::Javascript-->
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ var KTUsersList = function () {
|
|||
{ data: 'telephone', name: "telephone"}
|
||||
],
|
||||
ajax: {
|
||||
"url": "http://localhost:8080/hdpos/api/stores/getAll",
|
||||
"url": config.apiBaseURL + "/stores/getAll",
|
||||
"dataSrc": ""
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
|
|
|
|||
|
|
@ -807,6 +807,7 @@ Contact: frederik.benoist@inetum.com
|
|||
<script src="assets/plugins/custom/datatables/datatables.bundle.js"></script>
|
||||
<script src="assets/js/widgets.bundle.js"></script>
|
||||
<script src="assets/js/custom/widgets.js"></script>
|
||||
<script src="config/config.js"></script>
|
||||
<script src="store/view/view-store.js"></script>
|
||||
<!--end::Custom Javascript-->
|
||||
<!--end::Javascript-->
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ var KTStoreView = function () {
|
|||
});
|
||||
|
||||
// call StoreDetails API
|
||||
fetch('http://localhost:8080/hdpos/api/stores/getStoreDetails?dbHost='+ipAddress+'&storeId='+storeId)
|
||||
fetch(config.apiBaseURL + "/stores/getStoreDetails?dbHost="+ipAddress+"&storeId="+storeId)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
debugger;
|
||||
|
|
@ -118,7 +118,7 @@ var KTStoreView = function () {
|
|||
left: 1
|
||||
},
|
||||
ajax: {
|
||||
"url": "http://localhost:8080/hdpos/api/items/" + itemId,
|
||||
"url": config.apiBaseURL + "/items/" + itemId,
|
||||
"dataSrc": "",
|
||||
"data": {
|
||||
"dbHost": ipAddress
|
||||
|
|
@ -143,7 +143,7 @@ var KTStoreView = function () {
|
|||
});
|
||||
} else {
|
||||
statusItem.innerHTML = 'Loading...';
|
||||
datatableItem.ajax.url("http://localhost:8080/hdpos/api/items/" + itemId);
|
||||
datatableItem.ajax.url(config.apiBaseURL + "/items/" + itemId);
|
||||
datatableItem.ajax.reload(function() {
|
||||
dtUpdateStatus(statusItem, "Last refresh", "", false)
|
||||
}, true);
|
||||
|
|
@ -168,7 +168,7 @@ var KTStoreView = function () {
|
|||
left: 1
|
||||
},
|
||||
ajax: {
|
||||
"url": "http://localhost:8080/hdpos/api/items/" + itemId + "/options",
|
||||
"url": config.apiBaseURL + "/items/" + itemId + "/options",
|
||||
"dataSrc": "",
|
||||
"data": {
|
||||
"dbHost": ipAddress
|
||||
|
|
@ -199,7 +199,7 @@ var KTStoreView = function () {
|
|||
});
|
||||
} else {
|
||||
statusItemOptions.innerHTML = 'Loading...';
|
||||
datatableItemOptions.ajax.url("http://localhost:8080/hdpos/api/items/" + itemId + "/options");
|
||||
datatableItemOptions.ajax.url(config.apiBaseURL + "/items/" + itemId + "/options");
|
||||
datatableItemOptions.ajax.reload(function() {
|
||||
dtUpdateStatus(statusItemOptions, "Last refresh", "", false)
|
||||
}, true);
|
||||
|
|
@ -224,7 +224,7 @@ var KTStoreView = function () {
|
|||
left: 1
|
||||
},
|
||||
ajax: {
|
||||
"url": "http://localhost:8080/hdpos/api/items/" + itemId + "/price",
|
||||
"url": config.apiBaseURL + "/items/" + itemId + "/price",
|
||||
"dataSrc": "",
|
||||
"data": {
|
||||
"dbHost": ipAddress
|
||||
|
|
@ -256,7 +256,7 @@ var KTStoreView = function () {
|
|||
});
|
||||
} else {
|
||||
statusItemPrice.innerHTML = 'Loading...';
|
||||
datatableItemPrice.ajax.url("http://localhost:8080/hdpos/api/items/" + itemId + "/price");
|
||||
datatableItemPrice.ajax.url(config.apiBaseURL + "/items/" + itemId + "/price");
|
||||
datatableItemPrice.ajax.reload(function() {
|
||||
dtUpdateStatus(statusItemPrice, "Last refresh", "", false)
|
||||
}, true);
|
||||
|
|
@ -281,7 +281,7 @@ var KTStoreView = function () {
|
|||
left: 1
|
||||
},
|
||||
ajax: {
|
||||
"url": "http://localhost:8080/hdpos/api/items/" + itemId + "/stock",
|
||||
"url": config.apiBaseURL + "/items/" + itemId + "/stock",
|
||||
"dataSrc": "",
|
||||
"data": {
|
||||
"dbHost": ipAddress
|
||||
|
|
@ -307,7 +307,7 @@ var KTStoreView = function () {
|
|||
});
|
||||
} else {
|
||||
statusItemStock.innerHTML = 'Loading...';
|
||||
datatableItemStock.ajax.url("http://localhost:8080/hdpos/api/items/" + itemId + "/stock");
|
||||
datatableItemStock.ajax.url(config.apiBaseURL + "/items/" + itemId + "/stock");
|
||||
datatableItemStock.ajax.reload(function() {
|
||||
dtUpdateStatus(statusItemStock, "Last refresh", "", false)
|
||||
}, true);
|
||||
|
|
@ -329,7 +329,7 @@ var KTStoreView = function () {
|
|||
paging: false,
|
||||
autoWidth: false,
|
||||
ajax: {
|
||||
"url": "http://localhost:8080/hdpos/api/stores/version",
|
||||
"url": config.apiBaseURL + "/stores/version",
|
||||
"dataSrc": "",
|
||||
"data": {
|
||||
"dbHost": ipAddress
|
||||
|
|
@ -372,7 +372,7 @@ var KTStoreView = function () {
|
|||
paging: true,
|
||||
autoWidth: false,
|
||||
ajax: {
|
||||
"url": "http://localhost:8080/hdpos/api/stores/sequence",
|
||||
"url": config.apiBaseURL + "/stores/sequence",
|
||||
"dataSrc": "",
|
||||
"data": {
|
||||
"dbHost": ipAddress
|
||||
|
|
@ -448,7 +448,7 @@ var KTStoreView = function () {
|
|||
left: 2
|
||||
},
|
||||
ajax: {
|
||||
"url": "http://localhost:8080/hdpos/api/stores/signature",
|
||||
"url": config.apiBaseURL + "/stores/signature",
|
||||
"dataSrc": "",
|
||||
"data": {
|
||||
"dbHost": ipAddress
|
||||
|
|
|
|||
Loading…
Reference in New Issue