docker變數設定
This commit is contained in:
parent
f88bd7fc4a
commit
eaaaf3ad9d
@ -1,4 +0,0 @@
|
|||||||
VITE_API_BASEURL = "https://ibms-cvilux-api.production.mjmtech.com.tw"
|
|
||||||
VITE_FILE_API_BASEURL = "https://cgems.cvilux-group.com:8088"
|
|
||||||
VITE_MQTT_BASEURL = "wss://mqttwss.mjm-staging.developers-homelab.net"
|
|
||||||
VITE_FORGE_BASEURL = "https://cgems.cvilux-group.com:8088/dist"
|
|
@ -1,4 +0,0 @@
|
|||||||
VITE_API_BASEURL = "https://ibms-cvilux-api.production.mjmtech.com.tw"
|
|
||||||
VITE_FILE_API_BASEURL = "https://cgems.cvilux-group.com:8088"
|
|
||||||
VITE_MQTT_BASEURL = "wss://mqttwss.mjm-staging.developers-homelab.net"
|
|
||||||
# VITE_FORGE_BASEURL = "https://cgems.cvilux-group.com:8088/dist"
|
|
@ -1,3 +0,0 @@
|
|||||||
VITE_API_BASEURL = "http://220.132.206.5:8008"
|
|
||||||
VITE_FILE_API_BASEURL = "http://220.132.206.5:8085/file"
|
|
||||||
VITE_FORGE_BASEURL = "http://localhost:5173"
|
|
@ -33,4 +33,8 @@ COPY --from=builder /app/dist /usr/share/nginx/html
|
|||||||
# 暴露 Nginx 預設的 80 端口
|
# 暴露 Nginx 預設的 80 端口
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
# Nginx 已經預設啟動,所以不需要 CMD 指令
|
# Nginx 已經預設啟動,所以不需要 CMD 指令
|
||||||
|
COPY docker-entrypoint.sh /docker-entrypoint.sh
|
||||||
|
RUN chmod +x /docker-entrypoint.sh
|
||||||
|
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||||
|
CMD ["nginx", "-g", "daemon off;"]
|
3
docker-entrypoint.sh
Normal file
3
docker-entrypoint.sh
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
echo "window.env = { VITE_API_BASEURL: '${VITE_API_BASEURL}', VITE_FILE_API_BASEURL: '${VITE_FILE_API_BASEURL}', VITE_MQTT_BASEURL: '${VITE_MQTT_BASEURL}' };" > /usr/share/nginx/html/env.js
|
||||||
|
exec "$@"
|
@ -17,6 +17,7 @@
|
|||||||
type="text/javascript"
|
type="text/javascript"
|
||||||
src="/module/js/com/tridium/js/ext/require/require.min.js?"
|
src="/module/js/com/tridium/js/ext/require/require.min.js?"
|
||||||
></script> -->
|
></script> -->
|
||||||
|
<script src="/env.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
// graph
|
// graph
|
||||||
const BASEURL = import.meta.env.VITE_API_BASEURL;
|
const BASEURL = window.env?.VITE_API_BASEURL;
|
||||||
export const GET_GRAPH_SIDEBAR_API = `/GraphManage/GraphManageTreeList`;
|
export const GET_GRAPH_SIDEBAR_API = `/GraphManage/GraphManageTreeList`;
|
||||||
|
|
||||||
export const UPDATE_GRAPH_SIDEBAR_API = `/GraphManage/EditGraphManageTree`;
|
export const UPDATE_GRAPH_SIDEBAR_API = `/GraphManage/EditGraphManageTree`;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
// history
|
// history
|
||||||
const BASEURL = import.meta.env.VITE_API_BASEURL;
|
const BASEURL = window.env?.VITE_API_BASEURL;
|
||||||
export const GET_HISTORY_SIDEBAR_API = `/api/History/GetDeviceInfo`;
|
export const GET_HISTORY_SIDEBAR_API = `/api/History/GetDeviceInfo`;
|
||||||
export const GET_HISTORY_POINT_API = `/api/History/GetAllDevPoi`;
|
export const GET_HISTORY_POINT_API = `/api/History/GetAllDevPoi`;
|
||||||
export const GET_HISTORY_DATA_API = `/api/History/GetHistoryData`;
|
export const GET_HISTORY_DATA_API = `/api/History/GetHistoryData`;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted, onUnmounted } from "vue";
|
import { ref, onMounted, onUnmounted } from "vue";
|
||||||
|
|
||||||
const FILE_BASEURL = import.meta.env.VITE_FILE_API_BASEURL;
|
const FILE_BASEURL = window.env?.VITE_FILE_API_BASEURL;
|
||||||
|
|
||||||
const forgeDom = ref(null);
|
const forgeDom = ref(null);
|
||||||
let viewer = null;
|
let viewer = null;
|
||||||
|
@ -164,7 +164,7 @@ const initForge = async () => {
|
|||||||
// });
|
// });
|
||||||
// });
|
// });
|
||||||
// });
|
// });
|
||||||
const FILE_BASEURL = import.meta.env.VITE_FILE_API_BASEURL;
|
const FILE_BASEURL = window.env?.VITE_FILE_API_BASEURL;
|
||||||
const viewer = await initViewer(forgeDom.value)
|
const viewer = await initViewer(forgeDom.value)
|
||||||
const filePath = `${FILE_BASEURL}/upload/forge/0.svf`;
|
const filePath = `${FILE_BASEURL}/upload/forge/0.svf`;
|
||||||
await loadModel(viewer, filePath)
|
await loadModel(viewer, filePath)
|
||||||
|
@ -93,7 +93,7 @@ const createSprites = async (dataVizExtn) => {
|
|||||||
const DataVizCore = Autodesk.DataVisualization.Core;
|
const DataVizCore = Autodesk.DataVisualization.Core;
|
||||||
const viewableType = DataVizCore.ViewableType.SPRITE;
|
const viewableType = DataVizCore.ViewableType.SPRITE;
|
||||||
let spriteColor = new THREE.Color(0xffffff);
|
let spriteColor = new THREE.Color(0xffffff);
|
||||||
const BASEURL = import.meta.env.VITE_FILE_API_BASEURL;
|
const BASEURL = window.env?.VITE_FILE_API_BASEURL;
|
||||||
const spriteIconUrl = `${BASEURL}/dist/hotspot.svg`;
|
const spriteIconUrl = `${BASEURL}/dist/hotspot.svg`;
|
||||||
const style = new DataVizCore.ViewableStyle(
|
const style = new DataVizCore.ViewableStyle(
|
||||||
viewableType,
|
viewableType,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
const BASEURL = import.meta.env.VITE_API_BASEURL;
|
const BASEURL = window.env?.VITE_API_BASEURL;
|
||||||
export const POST_LOGIN = `${BASEURL}/api/Login/`;
|
export const POST_LOGIN = `${BASEURL}/api/Login/`;
|
||||||
export const GET_AUTHPAGE_API = `${BASEURL}/api/GetUsrFroList`;
|
export const GET_AUTHPAGE_API = `${BASEURL}/api/GetUsrFroList`;
|
||||||
export const GET_SUBAUTHPAGE_API = `${BASEURL}/api/Device/GetMainSub`;
|
export const GET_SUBAUTHPAGE_API = `${BASEURL}/api/Device/GetMainSub`;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
const BASEURL = import.meta.env.VITE_API_BASEURL;
|
const BASEURL = window.env?.VITE_API_BASEURL;
|
||||||
export const GET_FORGETOKEN_API = `${BASEURL}/api/forge/oauth/token`;
|
export const GET_FORGETOKEN_API = `${BASEURL}/api/forge/oauth/token`;
|
||||||
|
|
||||||
export const GET_FORGEURN_API = `${BASEURL}/api/Device/GetBuild`;
|
export const GET_FORGEURN_API = `${BASEURL}/api/Device/GetBuild`;
|
||||||
|
@ -72,7 +72,7 @@ export default function useForgeSprite() {
|
|||||||
const DataVizCore = Autodesk.DataVisualization.Core;
|
const DataVizCore = Autodesk.DataVisualization.Core;
|
||||||
const viewableType = DataVizCore.ViewableType.SPRITE;
|
const viewableType = DataVizCore.ViewableType.SPRITE;
|
||||||
let spriteColor = new THREE.Color(0xffffff);
|
let spriteColor = new THREE.Color(0xffffff);
|
||||||
const BASEURL = import.meta.env.VITE_FILE_API_BASEURL;
|
const BASEURL = window.env?.VITE_FILE_API_BASEURL;
|
||||||
const spriteIconUrl = `${BASEURL}/dist/hotspot.svg`;
|
const spriteIconUrl = `${BASEURL}/dist/hotspot.svg`;
|
||||||
const style = new DataVizCore.ViewableStyle(
|
const style = new DataVizCore.ViewableStyle(
|
||||||
viewableType,
|
viewableType,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
const BASEURL = import.meta.env.VITE_API_BASEURL;
|
const BASEURL = window.env?.VITE_API_BASEURL;
|
||||||
|
|
||||||
export default function downloadExcel(res) {
|
export default function downloadExcel(res) {
|
||||||
let disposition = res.headers.get("Content-Disposition");
|
let disposition = res.headers.get("Content-Disposition");
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import useGetCookie from "@/hooks/useGetCookie";
|
import useGetCookie from "@/hooks/useGetCookie";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
const BASEURL = import.meta.env.VITE_API_BASEURL;
|
const BASEURL = window.env?.VITE_API_BASEURL;
|
||||||
|
|
||||||
const instance = axios.create({
|
const instance = axios.create({
|
||||||
baseURL: BASEURL,
|
baseURL: BASEURL,
|
||||||
|
@ -10,7 +10,7 @@ import { useI18n } from "vue-i18n";
|
|||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { openToast, cancelToastOpen } = inject("app_toast");
|
const { openToast, cancelToastOpen } = inject("app_toast");
|
||||||
const { companyOptions, departmentList, floors } = inject("asset_modal_options");
|
const { companyOptions, departmentList, floors } = inject("asset_modal_options");
|
||||||
const FILE_BASEURL = import.meta.env.VITE_FILE_API_BASEURL;
|
const FILE_BASEURL = window.env?.VITE_FILE_API_BASEURL;
|
||||||
const { searchParams, changeParams } = useSearchParam();
|
const { searchParams, changeParams } = useSearchParam();
|
||||||
|
|
||||||
const totalCoordinates = ref({});
|
const totalCoordinates = ref({});
|
||||||
|
@ -10,7 +10,7 @@ import useUserInfoStore from "@/stores/useUserInfoStore";
|
|||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import { useI18n } from "vue-i18n";
|
import { useI18n } from "vue-i18n";
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const FILE_BASEURL = import.meta.env.VITE_FILE_API_BASEURL;
|
const FILE_BASEURL = window.env?.VITE_FILE_API_BASEURL;
|
||||||
const { searchParams, changeParams } = useSearchParam();
|
const { searchParams, changeParams } = useSearchParam();
|
||||||
const { updateLeftFields, formErrorMsg, formState } = inject(
|
const { updateLeftFields, formErrorMsg, formState } = inject(
|
||||||
"asset_table_modal_form"
|
"asset_table_modal_form"
|
||||||
|
@ -4,7 +4,7 @@ import { ref, computed, inject, watch, onMounted } from "vue";
|
|||||||
import { useI18n } from "vue-i18n";
|
import { useI18n } from "vue-i18n";
|
||||||
import Menu from "@/components/customUI/Menu.vue";
|
import Menu from "@/components/customUI/Menu.vue";
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const FILE_BASEURL = import.meta.env.VITE_FILE_API_BASEURL;
|
const FILE_BASEURL = window.env?.VITE_FILE_API_BASEURL;
|
||||||
const { formState } = inject("asset_table_modal_form");
|
const { formState } = inject("asset_table_modal_form");
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
|
@ -7,7 +7,7 @@ import dayjs from "dayjs";
|
|||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { openToast, cancelToastOpen } = inject("app_toast");
|
const { openToast, cancelToastOpen } = inject("app_toast");
|
||||||
const { formState } = inject("asset_table_modal_form");
|
const { formState } = inject("asset_table_modal_form");
|
||||||
const BASEURL = import.meta.env.VITE_MQTT_BASEURL;
|
const BASEURL = window.env?.VITE_MQTT_BASEURL;
|
||||||
// MQTT相關
|
// MQTT相關
|
||||||
const mqttClient = ref(null); // MQTT客戶端
|
const mqttClient = ref(null); // MQTT客戶端
|
||||||
const receivedMessages = ref([]); // 儲存接收到的訊息
|
const receivedMessages = ref([]); // 儲存接收到的訊息
|
||||||
|
@ -7,7 +7,7 @@ import { twMerge } from "tailwind-merge";
|
|||||||
import { useI18n } from "vue-i18n";
|
import { useI18n } from "vue-i18n";
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const FILE_BASEURL = import.meta.env.VITE_FILE_API_BASEURL;
|
const FILE_BASEURL = window.env?.VITE_FILE_API_BASEURL;
|
||||||
const { totalCoordinates } = inject("asset_table_data");
|
const { totalCoordinates } = inject("asset_table_data");
|
||||||
const { floors } = inject("asset_modal_options");
|
const { floors } = inject("asset_modal_options");
|
||||||
const { updateRightFields, formErrorMsg, formState } = inject(
|
const { updateRightFields, formErrorMsg, formState } = inject(
|
||||||
|
@ -7,7 +7,7 @@ import "yup-phone-lite";
|
|||||||
import useFormErrorMessage from "@/hooks/useFormErrorMessage";
|
import useFormErrorMessage from "@/hooks/useFormErrorMessage";
|
||||||
import { useI18n } from "vue-i18n";
|
import { useI18n } from "vue-i18n";
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const FILE_BASEURL = import.meta.env.VITE_FILE_API_BASEURL;
|
const FILE_BASEURL = window.env?.VITE_FILE_API_BASEURL;
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
editRecord: Object,
|
editRecord: Object,
|
||||||
|
@ -5,7 +5,7 @@ import { twMerge } from "tailwind-merge";
|
|||||||
import useBuildingStore from "@/stores/useBuildingStore";
|
import useBuildingStore from "@/stores/useBuildingStore";
|
||||||
const store = useBuildingStore();
|
const store = useBuildingStore();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const FILE_BASEURL = import.meta.env.VITE_FILE_API_BASEURL;
|
const FILE_BASEURL = window.env?.VITE_FILE_API_BASEURL;
|
||||||
const navigateToSubSystem = (mainSystemId, subSystemId) => {
|
const navigateToSubSystem = (mainSystemId, subSystemId) => {
|
||||||
router.push({
|
router.push({
|
||||||
name: "sub_system",
|
name: "sub_system",
|
||||||
|
@ -10,7 +10,7 @@ import {
|
|||||||
} from "@/apis/graph";
|
} from "@/apis/graph";
|
||||||
import { useI18n } from "vue-i18n";
|
import { useI18n } from "vue-i18n";
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const BASEURL = import.meta.env.VITE_FILE_API_BASEURL;
|
const BASEURL = window.env?.VITE_FILE_API_BASEURL;
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
updateEditRecord: Function,
|
updateEditRecord: Function,
|
||||||
|
@ -8,7 +8,7 @@ import { useI18n } from "vue-i18n";
|
|||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { openToast, cancelToastOpen } = inject("app_toast");
|
const { openToast, cancelToastOpen } = inject("app_toast");
|
||||||
const { sidebar_data } = inject("current_dir");
|
const { sidebar_data } = inject("current_dir");
|
||||||
const FILE_BASEURL = import.meta.env.VITE_FILE_API_BASEURL;
|
const FILE_BASEURL = window.env?.VITE_FILE_API_BASEURL;
|
||||||
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
|
@ -8,7 +8,7 @@ import useSearchParam from "@/hooks/useSearchParam";
|
|||||||
import { useI18n } from "vue-i18n";
|
import { useI18n } from "vue-i18n";
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { openToast, cancelToastOpen } = inject("app_toast");
|
const { openToast, cancelToastOpen } = inject("app_toast");
|
||||||
const FILE_BASEURL = import.meta.env.VITE_FILE_API_BASEURL;
|
const FILE_BASEURL = window.env?.VITE_FILE_API_BASEURL;
|
||||||
const { searchParams } = useSearchParam();
|
const { searchParams } = useSearchParam();
|
||||||
|
|
||||||
const { dataSource, openModal, updateEditRecord, search, tableLoading } =
|
const { dataSource, openModal, updateEditRecord, search, tableLoading } =
|
||||||
|
@ -12,7 +12,7 @@ import Select from "@/components/customUI/Select.vue";
|
|||||||
import SearchSelect from "@/components/customUI/SearchSelect.vue";
|
import SearchSelect from "@/components/customUI/SearchSelect.vue";
|
||||||
import { useI18n } from "vue-i18n";
|
import { useI18n } from "vue-i18n";
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const FILE_BASEURL = import.meta.env.VITE_FILE_API_BASEURL;
|
const FILE_BASEURL = window.env?.VITE_FILE_API_BASEURL;
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
editRecord: Object,
|
editRecord: Object,
|
||||||
|
@ -7,7 +7,7 @@ import { useI18n } from "vue-i18n";
|
|||||||
import useBuildingStore from "@/stores/useBuildingStore";
|
import useBuildingStore from "@/stores/useBuildingStore";
|
||||||
|
|
||||||
const storeBuild = useBuildingStore();
|
const storeBuild = useBuildingStore();
|
||||||
const FILE_BASEURL = import.meta.env.VITE_FILE_API_BASEURL;
|
const FILE_BASEURL = window.env?.VITE_FILE_API_BASEURL;
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { openToast, cancelToastOpen } = inject("app_toast");
|
const { openToast, cancelToastOpen } = inject("app_toast");
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ const { currentFloor, subscribeData } = inject("system_deviceList");
|
|||||||
const { getCurrentInfoModalData, selected_dbid } = inject(
|
const { getCurrentInfoModalData, selected_dbid } = inject(
|
||||||
"system_selectedDevice"
|
"system_selectedDevice"
|
||||||
);
|
);
|
||||||
const FILE_BASEURL = import.meta.env.VITE_FILE_API_BASEURL;
|
const FILE_BASEURL = window.env?.VITE_FILE_API_BASEURL;
|
||||||
|
|
||||||
const asset_floor_chart = ref(null);
|
const asset_floor_chart = ref(null);
|
||||||
const sameOption = {
|
const sameOption = {
|
||||||
|
@ -8,7 +8,7 @@ const { getCurrentInfoModalData, selected_dbid } = inject(
|
|||||||
const { subscribeData } = inject("system_deviceList");
|
const { subscribeData } = inject("system_deviceList");
|
||||||
|
|
||||||
const { showData } = useSystemShowData();
|
const { showData } = useSystemShowData();
|
||||||
const FILE_BASEURL = import.meta.env.VITE_FILE_API_BASEURL;
|
const FILE_BASEURL = window.env?.VITE_FILE_API_BASEURL;
|
||||||
|
|
||||||
const fitToView = (forge_dbid, spriteDbId) => {
|
const fitToView = (forge_dbid, spriteDbId) => {
|
||||||
selected_dbid.value = [forge_dbid, spriteDbId];
|
selected_dbid.value = [forge_dbid, spriteDbId];
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
import { computed, inject, watch, ref } from "vue";
|
import { computed, inject, watch, ref } from "vue";
|
||||||
import { useI18n } from "vue-i18n";
|
import { useI18n } from "vue-i18n";
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const FILE_BASEURL = import.meta.env.VITE_FILE_API_BASEURL;
|
const FILE_BASEURL = window.env?.VITE_FILE_API_BASEURL;
|
||||||
const { selectedDeviceCog } = inject("system_selectedDevice");
|
const { selectedDeviceCog } = inject("system_selectedDevice");
|
||||||
const imgData = ref([]);
|
const imgData = ref([]);
|
||||||
|
|
||||||
|
@ -13,15 +13,6 @@ export default defineConfig({
|
|||||||
outDir: "./dist",
|
outDir: "./dist",
|
||||||
emptyOutDir: true,
|
emptyOutDir: true,
|
||||||
},
|
},
|
||||||
server: {
|
|
||||||
proxy: {
|
|
||||||
'/upload': {
|
|
||||||
target: "https://ibms-cvilux.production.mjmtech.com.tw",
|
|
||||||
changeOrigin: true,
|
|
||||||
secure: false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
plugins: [
|
plugins: [
|
||||||
vue(),
|
vue(),
|
||||||
Components({
|
Components({
|
||||||
@ -47,4 +38,4 @@ export default defineConfig({
|
|||||||
"@ASSET": fileURLToPath(new URL("./src/assets", import.meta.url)),
|
"@ASSET": fileURLToPath(new URL("./src/assets", import.meta.url)),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
Loading…
Reference in New Issue
Block a user