fix: 优化nginx配置server_name
* fix: 优化lodash-es * fix: 优化nginx配置server_name
This commit is contained in:
parent
3beae8b718
commit
7986f367ca
|
@ -1,14 +1,21 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
API_BASE_PATH=$API_BASE_PATH;
|
API_BASE_PATH=$API_BASE_PATH;
|
||||||
|
SERVER_NAME=$SERVER_NAME
|
||||||
NAMESERVERS=$(cat /etc/resolv.conf | grep "nameserver" | awk '{print $2}' | tr '\n' ' ')
|
NAMESERVERS=$(cat /etc/resolv.conf | grep "nameserver" | awk '{print $2}' | tr '\n' ' ')
|
||||||
if [ -z "$API_BASE_PATH" ]; then
|
if [ -z "$API_BASE_PATH" ]; then
|
||||||
API_BASE_PATH="http://jetlinks:8844/";
|
API_BASE_PATH="http://jetlinks:8844/";
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -z "$SERVER_NAME" ]; then
|
||||||
|
SERVER_NAME="localhost";
|
||||||
|
fi
|
||||||
|
|
||||||
apiUrl="proxy_pass $API_BASE_PATH\$1;"
|
apiUrl="proxy_pass $API_BASE_PATH\$1;"
|
||||||
resolver="resolver $NAMESERVERS ipv6=off;"
|
resolver="resolver $NAMESERVERS ipv6=off;"
|
||||||
|
serverName="server_name $SERVER_NAME;"
|
||||||
|
|
||||||
|
sed -i '4c '"$serverName"'' /etc/nginx/conf.d/default.conf
|
||||||
sed -i '11c '"$resolver"'' /etc/nginx/conf.d/default.conf
|
sed -i '11c '"$resolver"'' /etc/nginx/conf.d/default.conf
|
||||||
sed -i '20c '"$apiUrl"'' /etc/nginx/conf.d/default.conf
|
sed -i '20c '"$apiUrl"'' /etc/nginx/conf.d/default.conf
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
listen [::]:80;
|
listen [::]:80;
|
||||||
# gzip config
|
server_name _;
|
||||||
gzip on;
|
gzip on;
|
||||||
gzip_min_length 1k;
|
gzip_min_length 1k;
|
||||||
gzip_comp_level 9;
|
gzip_comp_level 9;
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
<UserInfo />
|
<UserInfo />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<Iframe :key="route.path" />
|
<Iframe :key="route.path" noMargin />
|
||||||
</j-pro-layout>
|
</j-pro-layout>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
根据visible标识对数据进行递归过滤,得到最后的数据
|
根据visible标识对数据进行递归过滤,得到最后的数据
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import _ from 'lodash';
|
import _ from 'lodash-es';
|
||||||
|
|
||||||
export type TreeNode = {
|
export type TreeNode = {
|
||||||
id: string;
|
id: string;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { Badge, Descriptions, Modal, Tooltip, AIcon, DescriptionsItem } from "jetlinks-ui-components"
|
import { Badge, Descriptions, Modal, Tooltip, AIcon, DescriptionsItem } from "jetlinks-ui-components"
|
||||||
import TitleComponent from '@/components/TitleComponent/index.vue'
|
import TitleComponent from '@/components/TitleComponent/index.vue'
|
||||||
import styles from './index.module.less'
|
import styles from './index.module.less'
|
||||||
import _ from "lodash";
|
import _ from "lodash-es";
|
||||||
|
|
||||||
const DiagnosticAdvice = defineComponent({
|
const DiagnosticAdvice = defineComponent({
|
||||||
props: {
|
props: {
|
||||||
|
@ -97,4 +97,4 @@ const DiagnosticAdvice = defineComponent({
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
export default DiagnosticAdvice
|
export default DiagnosticAdvice
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { useInstanceStore } from "@/store/instance"
|
||||||
import { startNetwork, startGateway, getGatewayDetail, queryGatewayState, queryProtocolDetail, detail, queryProductState, queryProductConfig, queryDeviceConfig, _deploy } from '@/api/device/instance'
|
import { startNetwork, startGateway, getGatewayDetail, queryGatewayState, queryProtocolDetail, detail, queryProductState, queryProductConfig, queryDeviceConfig, _deploy } from '@/api/device/instance'
|
||||||
import { PropType, VNode } from "vue"
|
import { PropType, VNode } from "vue"
|
||||||
import { _deploy as _deployProduct } from "@/api/device/product"
|
import { _deploy as _deployProduct } from "@/api/device/product"
|
||||||
import _ from "lodash"
|
import _ from "lodash-es"
|
||||||
import DiagnosticAdvice from './DiagnosticAdvice'
|
import DiagnosticAdvice from './DiagnosticAdvice'
|
||||||
import ManualInspection from './ManualInspection'
|
import ManualInspection from './ManualInspection'
|
||||||
import { deployDevice } from "@/api/initHome"
|
import { deployDevice } from "@/api/initHome"
|
||||||
|
@ -1380,7 +1380,7 @@ const Status = defineComponent({
|
||||||
>
|
>
|
||||||
设备接入配置
|
设备接入配置
|
||||||
</Button>
|
</Button>
|
||||||
中{urlMap.get(unref(device)?.accessProvider) || ''}信息,任意上报一条数据
|
中{urlMap.get(unref(device)?.accessProvider) || ''}信息,任意上报一条数据
|
||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
/>,
|
/>,
|
||||||
|
@ -1392,7 +1392,7 @@ const Status = defineComponent({
|
||||||
text={
|
text={
|
||||||
<span>
|
<span>
|
||||||
请联系管理员提供{urlMap.get(unref(device)?.accessProvider) || ''}
|
请联系管理员提供{urlMap.get(unref(device)?.accessProvider) || ''}
|
||||||
信息,并根据URL信息任意上报一条数据
|
信息,并根据URL信息任意上报一条数据
|
||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
/>,
|
/>,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<page-container>
|
<page-container class="iframe-warp">
|
||||||
<full-page>
|
<full-page>
|
||||||
<iframe
|
<iframe
|
||||||
v-if="loading"
|
v-if="loading"
|
||||||
|
@ -26,6 +26,21 @@ import { TokenLose} from "@/utils/request";
|
||||||
const iframeUrl = ref<string>('');
|
const iframeUrl = ref<string>('');
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
noMargin: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const className = computed(() => {
|
||||||
|
return {
|
||||||
|
'iframe-warp': true,
|
||||||
|
'margin-full': props.hasOwnProperty('noMargin') && props.noMargin !== false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
const handle = async (appId: string, url: string) => {
|
const handle = async (appId: string, url: string) => {
|
||||||
const res = await getAppInfo_api(appId);
|
const res = await getAppInfo_api(appId);
|
||||||
let menuUrl: any = url;
|
let menuUrl: any = url;
|
||||||
|
@ -63,7 +78,7 @@ const handle = async (appId: string, url: string) => {
|
||||||
iframeUrl.value = urlOther;
|
iframeUrl.value = urlOther;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
const lowCode = () => {
|
const lowCode = () => {
|
||||||
lowCodeUrl().then(res => {
|
lowCodeUrl().then(res => {
|
||||||
|
@ -78,7 +93,6 @@ const lowCode = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const onMessage = (msg: any) => {
|
const onMessage = (msg: any) => {
|
||||||
console.log('onMessage',msg)
|
|
||||||
if (msg?.data?.token === 'LOSE') {
|
if (msg?.data?.token === 'LOSE') {
|
||||||
TokenLose()
|
TokenLose()
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
@ -115,7 +129,5 @@ watchEffect(() => {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang='less' scoped>
|
<style lang='less' scoped>
|
||||||
:deep(.children-full-height) {
|
|
||||||
margin: 0 !important;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|
Loading…
Reference in New Issue