зеркало из https://github.com/Azure/reddog-code.git
Коммит
5a0c8991bc
|
@ -10,6 +10,13 @@ RUN npm ci
|
|||
RUN npm run build
|
||||
|
||||
ENV NODE_ENV "production"
|
||||
ENV VUE_APP_IS_CORP true
|
||||
ENV VUE_APP_STORE_ID "Austin"
|
||||
ENV VUE_APP_SITE_TYPE "Pharmacia"
|
||||
ENV VUE_APP_SITE_TITLE "Contoso :: Pharmacy & Bodega"
|
||||
ENV VUE_APP_MAKELINE_BASE_URL "http://austin.makeline.brianredmond.io"
|
||||
ENV VUE_APP_ACCOUNTING_BASE_URL "http://austin.accounting.brianredmond.io"
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
CMD [ "npm", "run", "container" ]
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -21,6 +21,7 @@
|
|||
"chart.js": "2.8",
|
||||
"chartjs-plugin-streaming": "1.8",
|
||||
"currency.js": "^2.0.3",
|
||||
"dotenv-webpack": "^7.0.2",
|
||||
"moment": "^2.29.1",
|
||||
"node-fetch": "^2.6.1",
|
||||
"node-sass": "4.14",
|
||||
|
@ -30,8 +31,8 @@
|
|||
"vue-i18n": "^8.18.2",
|
||||
"vue-router": "^3.3.4",
|
||||
"vue-router-prefetch": "^1.6.0",
|
||||
"vue2-transitions": "^0.3.0",
|
||||
"vue-template-compiler": "^2.6.11"
|
||||
"vue-template-compiler": "^2.6.11",
|
||||
"vue2-transitions": "^0.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/cli-plugin-babel": "^4.4.6",
|
||||
|
|
Двоичные данные
RedDog.UI/public/img/hex-back-pat.png
Двоичные данные
RedDog.UI/public/img/hex-back-pat.png
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 3.9 MiB После Ширина: | Высота: | Размер: 2.3 MiB |
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<nav class="navbar navbar-expand-lg navbar-absolute"
|
||||
<nav class="navbar navbar-expand-lg navbar-absolute"
|
||||
:class="{'bg-white': showMenu, 'navbar-transparent': !showMenu}">
|
||||
<div class="container-fluid">
|
||||
<div class="navbar-wrapper">
|
||||
|
@ -15,7 +15,7 @@
|
|||
</div>
|
||||
<div class="logo-content">
|
||||
<div class="left-logo"><img src="img/contoso-pharmacy-tl-logo.png" width="184px"/></div>
|
||||
<div class="right-logo logo-simple-text">{{ siteName }}</div>
|
||||
<div class="right-logo logo-simple-text">{{ storeId }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<button class="navbar-toggler" type="button"
|
||||
|
@ -89,8 +89,8 @@
|
|||
return {
|
||||
activeNotifications: false,
|
||||
showMenu: false,
|
||||
siteType: (process.env.SITE_TYPE || 'PHARMACY'),
|
||||
siteName: (process.env.SITE_ID || 'Redmond'),
|
||||
siteType: (process.env.VUE_APP_SITE_TYPE || 'PHARMACY-Local'),
|
||||
storeId: (process.env.VUE_APP_STORE_ID || 'Redmond-Local'),
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
|
@ -112,6 +112,9 @@
|
|||
toggleMenu() {
|
||||
this.showMenu = !this.showMenu;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// console.log(process.env.VUE_APP_STORE_ID)
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -222,7 +222,7 @@ export default {
|
|||
}
|
||||
}
|
||||
);
|
||||
}, 5000);
|
||||
}, 3000);
|
||||
},
|
||||
|
||||
getOrderChart(){
|
||||
|
@ -238,7 +238,7 @@ export default {
|
|||
console.log('some kind of connection issue - you might want to get that looked at')
|
||||
}
|
||||
});
|
||||
}, 1000);
|
||||
}, 3000);
|
||||
},
|
||||
getCurrentOrders(){
|
||||
clearInterval(this.pollingInflight)
|
||||
|
@ -261,7 +261,7 @@ export default {
|
|||
}
|
||||
})
|
||||
})
|
||||
}, 10000);
|
||||
}, 3000);
|
||||
},
|
||||
createOrderLineChart(labels, totals, prevTotals, segment){
|
||||
this.chartData= {
|
||||
|
@ -407,8 +407,7 @@ export default {
|
|||
}
|
||||
},
|
||||
created() {
|
||||
document.title = (process.env.SITE_TITLE || 'Contoso :: Pharmacy & Convenience Store');
|
||||
// this.getOrderChart(this.orderChartSegment);
|
||||
document.title = process.env.VUE_APP_SITE_TITLE
|
||||
this.getOrderChart();
|
||||
this.getAccountingOrderMetrics();
|
||||
this.getCurrentOrders();
|
||||
|
|
|
@ -1,13 +1,16 @@
|
|||
const webpack = require("webpack");
|
||||
const fetch = require("node-fetch");
|
||||
const Dotenv = require("dotenv-webpack");
|
||||
|
||||
const STORE_ID = process.env.STORE_ID || "Austin";
|
||||
const SITE_TYPE = process.env.SITE_TYPE || 'Pharmacy';
|
||||
const SITE_TITLE = process.env.SITE_TITLE || 'Contoso :: Pharmacy & Convenience Store';
|
||||
const MAKELINE_BASE_URL = process.env.MAKELINE_BASE_URL || 'http://austin.makeline.brianredmond.io';
|
||||
const ACCOUNTING_BASE_URL = process.env.MAKELINE_BASE_URL || 'http://austin.accounting.brianredmond.io';
|
||||
const IS_CORP = (process.env.VUE_APP_IS_CORP || false);
|
||||
const STORE_ID = (process.env.VUE_APP_STORE_ID || "Redmond");
|
||||
const SITE_TYPE = (process.env.VUE_APP_SITE_TYPE || "Pharmacy");
|
||||
const SITE_TITLE = (process.env.VUE_APP_SITE_TITLE || "Contoso :: Pharmacy & Convenience Store");
|
||||
const MAKELINE_BASE_URL = (process.env.VUE_APP_MAKELINE_BASE_URL || "http://austin.makeline.brianredmond.io");
|
||||
const ACCOUNTING_BASE_URL = (process.env.VUE_APP_ACCOUNTING_BASE_URL || "http://austin.accounting.brianredmond.io");
|
||||
|
||||
let variables = {
|
||||
IS_CORP: IS_CORP,
|
||||
STORE_ID: STORE_ID,
|
||||
SITE_TYPE: SITE_TYPE,
|
||||
SITE_TITLE: SITE_TITLE,
|
||||
|
@ -18,14 +21,14 @@ let variables = {
|
|||
let MAKELINE_SERVICE = MAKELINE_BASE_URL + "/orders/" + STORE_ID
|
||||
let ACCOUNTING_SERVICE = ACCOUNTING_BASE_URL
|
||||
|
||||
if (process.env.NODE_ENV === 'production'){
|
||||
console.log('setting PROD environment variables')
|
||||
MAKELINE_SERVICE = "http://0.0.0.0:3500/v1.0/invoke/make-line-service/method/orders/" + STORE_ID
|
||||
ACCOUNTING_SERVICE = "http://0.0.0.0:3500/v1.0/invoke/accounting-service/method/"
|
||||
if (process.env.NODE_ENV === "production"){
|
||||
console.log("setting PROD environment variables")
|
||||
// MAKELINE_SERVICE = "http://0.0.0.0:3500/v1.0/invoke/make-line-service/method/orders/" + STORE_ID
|
||||
// ACCOUNTING_SERVICE = "http://0.0.0.0:3500/v1.0/invoke/accounting-service/method/"
|
||||
}else{
|
||||
console.log('setting DEV environment variables')
|
||||
console.log(MAKELINE_SERVICE)
|
||||
console.log(ACCOUNTING_SERVICE)
|
||||
console.log("setting DEV environment variables")
|
||||
// console.log(MAKELINE_SERVICE)
|
||||
// console.log(ACCOUNTING_SERVICE)
|
||||
}
|
||||
|
||||
|
||||
|
@ -41,9 +44,10 @@ module.exports = {
|
|||
new webpack.optimize.LimitChunkCountPlugin({
|
||||
maxChunks: 6
|
||||
}),
|
||||
new webpack.DefinePlugin({
|
||||
"process.env": variables
|
||||
})
|
||||
new Dotenv({
|
||||
path: ".env", // Path to .env file (this is the default)
|
||||
safe: false, // load .env.example (defaults to "false" which does not use dotenv-safe)
|
||||
})
|
||||
]
|
||||
},
|
||||
devServer: {
|
||||
|
@ -59,78 +63,82 @@ module.exports = {
|
|||
port: 8080,
|
||||
before: (app)=> {
|
||||
|
||||
app.get('/variables', (req, res)=>{
|
||||
|
||||
app.get("/variables", (req, res)=>{
|
||||
res.json({e: -1, payload:variables}).status(200)
|
||||
|
||||
})
|
||||
|
||||
app.get('/orders/inflight', (req, res)=>{
|
||||
app.get("/orders/inflight", (req, res)=>{
|
||||
|
||||
fetch(MAKELINE_SERVICE)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
res.json({e: 0, payload:data}).status(200)
|
||||
if( data.length >= 10){
|
||||
res.json({e: 0, payload:data.slice(data.length-10, data.length)}).status(200)
|
||||
}
|
||||
else{
|
||||
res.json({e: 0, payload:data}).status(200)
|
||||
}
|
||||
|
||||
})
|
||||
.catch(error=>{
|
||||
console.log('error', error)
|
||||
console.log("error", error)
|
||||
res.json({e: -1, payload: {}})
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
app.get('/orders/metrics', (req, res)=>{
|
||||
app.get("/orders/metrics", (req, res)=>{
|
||||
|
||||
fetch(ACCOUNTING_SERVICE + '/OrderMetrics?StoreId=' + STORE_ID)
|
||||
fetch(ACCOUNTING_SERVICE + "/OrderMetrics?StoreId=" + STORE_ID)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
res.json({e: 0, payload:data}).status(200)
|
||||
})
|
||||
.catch(error=>{
|
||||
console.log('error', error)
|
||||
console.log("error", error)
|
||||
res.json({e: -1, payload: {}})
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
app.get('/orders/count/minute', (req, res)=>{
|
||||
app.get("/orders/count/minute", (req, res)=>{
|
||||
|
||||
fetch(ACCOUNTING_SERVICE + '/Orders/Minute/PT20M?StoreId=' + STORE_ID)
|
||||
fetch(ACCOUNTING_SERVICE + "/Orders/Minute/PT20M?StoreId=" + STORE_ID)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
res.json({e: 0, payload:data}).status(200)
|
||||
})
|
||||
.catch(error=>{
|
||||
console.log('error', error)
|
||||
console.log("error", error)
|
||||
res.json({e: -1, payload: {}})
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
|
||||
// app.get('/orders/count/hour', (req, res)=>{
|
||||
// app.get("/orders/count/hour", (req, res)=>{
|
||||
|
||||
// fetch(ACCOUNTING_SERVICE + 'Orders/Hour/P1D?StoreId=' + STORE_ID)
|
||||
// fetch(ACCOUNTING_SERVICE + "Orders/Hour/P1D?StoreId=" + STORE_ID)
|
||||
// .then(response => response.json())
|
||||
// .then(data => {
|
||||
// res.json({e: 0, payload:data}).status(200)
|
||||
// })
|
||||
// .catch(error=>{
|
||||
// console.log('error', error)
|
||||
// console.log("error", error)
|
||||
// res.json({e: -1, payload: {}})
|
||||
// })
|
||||
|
||||
// })
|
||||
|
||||
// app.get('/orders/count/day', (req, res)=>{
|
||||
// app.get("/orders/count/day", (req, res)=>{
|
||||
|
||||
// fetch(ACCOUNTING_SERVICE + 'Orders/Day/P2D?StoreId=' + STORE_ID)
|
||||
// fetch(ACCOUNTING_SERVICE + "Orders/Day/P2D?StoreId=" + STORE_ID)
|
||||
// .then(response => response.json())
|
||||
// .then(data => {
|
||||
// res.json({e: 0, payload:data}).status(200)
|
||||
// })
|
||||
// .catch(error=>{
|
||||
// console.log('error', error)
|
||||
// console.log("error", error)
|
||||
// res.json({e: -1, payload: {}})
|
||||
// })
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче