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 #!/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

View File

@ -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;

View File

@ -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>

View File

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

View File

@ -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

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 { 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>
} }
/>, />,

View File

@ -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>