fix: 优化nginx配置server_name

* fix: 优化lodash-es

* fix: 优化nginx配置server_name
This commit is contained in:
XieYongHong 2023-12-12 15:10:43 +08:00 committed by GitHub
parent 3beae8b718
commit 7986f367ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 33 additions and 14 deletions

View File

@ -1,14 +1,21 @@
#!/usr/bin/env bash
API_BASE_PATH=$API_BASE_PATH;
SERVER_NAME=$SERVER_NAME
NAMESERVERS=$(cat /etc/resolv.conf | grep "nameserver" | awk '{print $2}' | tr '\n' ' ')
if [ -z "$API_BASE_PATH" ]; then
API_BASE_PATH="http://jetlinks:8844/";
fi
if [ -z "$SERVER_NAME" ]; then
SERVER_NAME="localhost";
fi
apiUrl="proxy_pass $API_BASE_PATH\$1;"
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 '20c '"$apiUrl"'' /etc/nginx/conf.d/default.conf

View File

@ -1,7 +1,7 @@
server {
listen 80;
listen [::]:80;
# gzip config
server_name _;
gzip on;
gzip_min_length 1k;
gzip_comp_level 9;

View File

@ -25,7 +25,7 @@
<UserInfo />
</div>
</template>
<Iframe :key="route.path" />
<Iframe :key="route.path" noMargin />
</j-pro-layout>
</template>

View File

@ -7,7 +7,7 @@
visible标识对数据进行递归过滤
*/
import _ from 'lodash';
import _ from 'lodash-es';
export type TreeNode = {
id: string;

View File

@ -1,7 +1,7 @@
import { Badge, Descriptions, Modal, Tooltip, AIcon, DescriptionsItem } from "jetlinks-ui-components"
import TitleComponent from '@/components/TitleComponent/index.vue'
import styles from './index.module.less'
import _ from "lodash";
import _ from "lodash-es";
const DiagnosticAdvice = defineComponent({
props: {
@ -97,4 +97,4 @@ const DiagnosticAdvice = defineComponent({
}
})
export default DiagnosticAdvice
export default DiagnosticAdvice

View File

@ -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 { PropType, VNode } from "vue"
import { _deploy as _deployProduct } from "@/api/device/product"
import _ from "lodash"
import _ from "lodash-es"
import DiagnosticAdvice from './DiagnosticAdvice'
import ManualInspection from './ManualInspection'
import { deployDevice } from "@/api/initHome"
@ -1380,7 +1380,7 @@ const Status = defineComponent({
>
</Button>
{urlMap.get(unref(device)?.accessProvider) || ''}
{urlMap.get(unref(device)?.accessProvider) || ''}
</span>
}
/>,
@ -1392,7 +1392,7 @@ const Status = defineComponent({
text={
<span>
{urlMap.get(unref(device)?.accessProvider) || ''}
URL信息任意上报一条数据
URL信息任意上报一条数据
</span>
}
/>,

View File

@ -1,5 +1,5 @@
<template>
<page-container>
<page-container class="iframe-warp">
<full-page>
<iframe
v-if="loading"
@ -26,6 +26,21 @@ import { TokenLose} from "@/utils/request";
const iframeUrl = ref<string>('');
const route = useRoute()
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 res = await getAppInfo_api(appId);
let menuUrl: any = url;
@ -63,7 +78,7 @@ const handle = async (appId: string, url: string) => {
iframeUrl.value = urlOther;
}
}
};
}
const lowCode = () => {
lowCodeUrl().then(res => {
@ -78,7 +93,6 @@ const lowCode = () => {
}
const onMessage = (msg: any) => {
console.log('onMessage',msg)
if (msg?.data?.token === 'LOSE') {
TokenLose()
setTimeout(() => {
@ -115,7 +129,5 @@ watchEffect(() => {
</script>
<style lang='less' scoped>
:deep(.children-full-height) {
margin: 0 !important;
}
</style>