Desktop端作为子目录,去掉ajax请求地址和组件图片地址的根目录"/"

Former-commit-id: cebe2a80273a58bad54f9c66c6028fb4e0471236
Former-commit-id: 848c6786a36da3351257a1b27f468a6cc8fc519e
TSXN
wanggang 5 years ago
parent ab97b31e64
commit 592925624a

@ -1,4 +1,4 @@
<template>
<template>
<div class="card camera" style="box-sizing:border-box;height:490px;margin:10px;">
<div class="card-header">
{{device.displayName}}
@ -23,21 +23,21 @@
<tr>
<td></td>
<td></td>
<td><img @click="execApi(device.number,'/Onvif/Up')" src="/images/up.svg" style="width:32px;" /></td>
<td><img @click="execApi(device.number,'/Onvif/Up')" src="images/up.svg" style="width:32px;" /></td>
<td></td>
<td></td>
</tr>
<tr>
<td><img @click="execApi(device.number,'/Onvif/Zoomin')" src="/images/zoomin.svg" style="width:32px;" /></td>
<td><img @click="execApi(device.number,'/Onvif/Left')" src="/images/left.svg" style="width:32px;" /></td>
<td><img @click="execApi(device.number,'/Onvif/Stop')" src="/images/stop.svg" style="width:32px;" /></td>
<td><img @click="execApi(device.number,'/Onvif/Right')" src="/images/right.svg" style="width:32px;" /></td>
<td><img @click="execApi(device.number,'/Onvif/Zoomout')" src="/images/zoomout.svg" style="width:32px;" /></td>
<td><img @click="execApi(device.number,'/Onvif/Zoomin')" src="images/zoomin.svg" style="width:32px;" /></td>
<td><img @click="execApi(device.number,'/Onvif/Left')" src="images/left.svg" style="width:32px;" /></td>
<td><img @click="execApi(device.number,'/Onvif/Stop')" src="images/stop.svg" style="width:32px;" /></td>
<td><img @click="execApi(device.number,'/Onvif/Right')" src="images/right.svg" style="width:32px;" /></td>
<td><img @click="execApi(device.number,'/Onvif/Zoomout')" src="images/zoomout.svg" style="width:32px;" /></td>
</tr>
<tr>
<td></td>
<td></td>
<td><img @click="execApi(device.number,'/Onvif/Down')" src="/images/down.svg" style="width:32px;" /></td>
<td><img @click="execApi(device.number,'/Onvif/Down')" src="images/down.svg" style="width:32px;" /></td>
<td></td>
<td></td>
</tr>
@ -47,8 +47,7 @@
</div>
</div>
</template>
<script>
export default {
<script>export default {
props: ['device', 'edit'],
data() {
return {
@ -261,5 +260,4 @@
return false;
}
}
};
</script>
};</script>

@ -1,4 +1,4 @@
<template>
<template>
<div class="card color-light" style="box-sizing:border-box;height:150px;margin:10px;">
<div class="card-header">
{{device.displayName}}
@ -18,8 +18,8 @@
</div>
</div>
<div class="col-2 align-self-center text-center">
<img style="height:32px;" v-if="getDeviceDataValue(device,'状态')==='开'" @click="execApi(device.number,'/Socket/Off')" src="/images/on.svg" />
<img style="height:32px;" v-else="getDeviceDataValue(device,'状态')==='关'" @click="execApi(device.number,'/Socket/On')" src="/images/off.svg" />
<img style="height:32px;" v-if="getDeviceDataValue(device,'状态')==='开'" @click="execApi(device.number,'/Socket/Off')" src="images/on.svg" />
<img style="height:32px;" v-else="getDeviceDataValue(device,'状态')==='关'" @click="execApi(device.number,'/Socket/On')" src="images/off.svg" />
</div>
</div>
</div>

@ -1,4 +1,4 @@
<template>
<template>
<div class="card" style="box-sizing:border-box;height:150px;margin:10px;">
<div class="card-header">
{{device.displayName}}
@ -13,17 +13,15 @@
<div class="col-8 align-self-center">
<div class="row" style="line-height:28px;">
<span class="badge badge-info" style="line-height:26px;">{{getDeviceDataValue(device,'状态')}}</span>
<img style="height:32px;" @click="execApi(device.number,'/Curtain/On')" src="/images/left.svg" />
<img style="height:32px;" @click="execApi(device.number,'/Curtain/Stop')" src="/images/stop.svg" />
<img style="height:32px;" @click="execApi(device.number,'/Curtain/Off')" src="/images/right.svg" />
<img style="height:32px;" @click="execApi(device.number,'/Curtain/On')" src="images/left.svg" />
<img style="height:32px;" @click="execApi(device.number,'/Curtain/Stop')" src="images/stop.svg" />
<img style="height:32px;" @click="execApi(device.number,'/Curtain/Off')" src="images/right.svg" />
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
<script>export default {
props: ['device']
};
</script>
};</script>

@ -13,16 +13,15 @@
<div class="col-8 align-self-center">
<div class="row" style="line-height:28px;">
<!--<span class="badge badge-info" style="line-height:26px;">{{getDeviceDataValue(device,'状态')}}</span>-->
<img style="height:32px;" @click="open" src="/images/on.svg" />
<!--<img style="height:32px;" @click="close" src="/IoTCenter/images/off.svg" />-->
<img style="height:32px;" @click="open" src="images/on.svg" />
<!--<img style="height:32px;" @click="close" src="/IoTCenterimages/off.svg" />-->
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
<script>export default {
props: ['device'],
methods: {
open: function () {
@ -38,5 +37,4 @@
}
}
}
};
</script>
};</script>

@ -1,4 +1,4 @@
<template>
<template>
<div class="card" style="box-sizing:border-box;height:150px;margin:10px;">
<div class="card-header">
{{device.displayName}}
@ -14,16 +14,15 @@
<div class="row" style="line-height:28px;">
<span class="badge badge-info" style="line-height:26px; margin-right: 10px;" v-if="isSmart">{{electricity}} kW‧h</span>
<span class="badge badge-info" style="line-height:26px; margin-right: 10px;" v-if="isSmart">{{power}} W</span>
<img style="height:32px;" v-if="getDeviceDataValue(device,'状态')==='开'" @click="execApi(device.number,'/Socket/Off')" src="/images/on.svg" />
<img style="height:32px;" v-else="getDeviceDataValue(device,'状态')==='关'" @click="execApi(device.number,'/Socket/On')" src="/images/off.svg" />
<img style="height:32px;" v-if="getDeviceDataValue(device,'状态')==='开'" @click="execApi(device.number,'/Socket/Off')" src="images/on.svg" />
<img style="height:32px;" v-else="getDeviceDataValue(device,'状态')==='关'" @click="execApi(device.number,'/Socket/On')" src="images/off.svg" />
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
<script>export default {
props: ['device'],
computed: {
isSmart: function () {
@ -36,5 +35,4 @@
return parseFloat(this.getDeviceDataValue(this.device, '功率') || 0).toFixed(2);
}
}
};
</script>
};</script>

@ -1,4 +1,4 @@
<template>
<template>
<div class="card" style="box-sizing:border-box;height:150px;margin:10px;">
<div class="card-header">
{{device.displayName}}
@ -12,16 +12,14 @@
</div>
<div class="col-8 align-self-center">
<div class="row" style="line-height:28px;">
<img style="height:32px;" v-if="getDeviceDataValue(device,'状态')=='开'" @click="execApi(device.number,'/Switch/Off')" src="/images/on.svg" />
<img style="height:32px;" v-if="getDeviceDataValue(device,'状态')=='关'" @click="execApi(device.number,'/Switch/On')" src="/images/off.svg" />
<img style="height:32px;" v-if="getDeviceDataValue(device,'状态')=='开'" @click="execApi(device.number,'/Switch/Off')" src="images/on.svg" />
<img style="height:32px;" v-if="getDeviceDataValue(device,'状态')=='关'" @click="execApi(device.number,'/Switch/On')" src="images/off.svg" />
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
<script>export default {
props: ['device']
};
</script>
};</script>

@ -1,4 +1,4 @@
<template>
<template>
<div class="card" style="box-sizing:border-box;height:150px;margin:10px;">
<div class="card-header">
{{device.displayName}}
@ -12,20 +12,18 @@
</div>
<div class="col-8 align-self-center">
<div class="row" style="line-height:28px;">
<img style="height:32px;" v-if="getDeviceDataValue(device,'L1状态')=='开'" @click="execApi(device.number,'/Switch3/L1Off')" src="/images/on.svg" />
<img style="height:32px;" v-if="getDeviceDataValue(device,'L1状态')=='关'" @click="execApi(device.number,'/Switch3/L1On')" src="/images/off.svg" />
<img style="height:32px;" v-if="getDeviceDataValue(device,'L2状态')=='开'" @click="execApi(device.number,'/Switch3/L2Off')" src="/images/on.svg" />
<img style="height:32px;" v-if="getDeviceDataValue(device,'L2状态')=='关'" @click="execApi(device.number,'/Switch3/L2On')" src="/images/off.svg" />
<img style="height:32px;" v-if="getDeviceDataValue(device,'L3状态')=='开'" @click="execApi(device.number,'/Switch3/L3Off')" src="/images/on.svg" />
<img style="height:32px;" v-if="getDeviceDataValue(device,'L3状态')=='关'" @click="execApi(device.number,'/Switch3/L3On')" src="/images/off.svg" />
<img style="height:32px;" v-if="getDeviceDataValue(device,'L1状态')=='开'" @click="execApi(device.number,'/Switch3/L1Off')" src="images/on.svg" />
<img style="height:32px;" v-if="getDeviceDataValue(device,'L1状态')=='关'" @click="execApi(device.number,'/Switch3/L1On')" src="images/off.svg" />
<img style="height:32px;" v-if="getDeviceDataValue(device,'L2状态')=='开'" @click="execApi(device.number,'/Switch3/L2Off')" src="images/on.svg" />
<img style="height:32px;" v-if="getDeviceDataValue(device,'L2状态')=='关'" @click="execApi(device.number,'/Switch3/L2On')" src="images/off.svg" />
<img style="height:32px;" v-if="getDeviceDataValue(device,'L3状态')=='开'" @click="execApi(device.number,'/Switch3/L3Off')" src="images/on.svg" />
<img style="height:32px;" v-if="getDeviceDataValue(device,'L3状态')=='关'" @click="execApi(device.number,'/Switch3/L3On')" src="images/off.svg" />
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
<script>export default {
props: ['device']
};
</script>
};</script>

@ -1,16 +1,14 @@
<template>
<template>
<a ref="fancybox" style="display:block;" :href="src"><img style="height:32px;" :src="src" /></a>
</template>
<script>
export default {
<script>export default {
props: ['value'],
mounted: function () {
$(this.$refs.fancybox).fancybox();
},
computed: {
src: function () {
return this.value || '/images/empty.png';
return this.value || 'images/empty.png';
}
}
};
</script>
};</script>

@ -1,10 +1,9 @@
<template>
<template>
<div>
<textarea :name="name">{{value}}</textarea>
</div>
</template>
<script>
export default {
<script>export default {
props: ['name', 'value'], watch: {
value(val) {
this.$emit('update:value', val)
@ -21,8 +20,7 @@
},
computed: {
src: function () {
return this.value || '/images/empty.png';
return this.value || 'images/empty.png';
}
}
};
</script>
};</script>

@ -1,4 +1,4 @@
<template>
<template>
<div>
<input ref="input" type="text" style="visibility: hidden; position: absolute;" :value="currentValue" />
<a ref="link" :href="src"><img ref="img" style="height:32px;" :src="src" /></a>
@ -6,8 +6,7 @@
<button ref="btn" class="btn btn-sm btn-default" type="button" id="btn_Image" style="margin-top:5px;">上传</button>
</div>
</template>
<script>
export default {
<script>export default {
props: ['name', 'value', 'data'],
data: function () {
return {
@ -49,8 +48,7 @@
},
computed: {
src: function () {
return this.currentValue || '/images/empty.png';
return this.currentValue || 'images/empty.png';
}
}
};
</script>
};</script>

@ -383,8 +383,7 @@
</footer>
</div>
</template>
<script>
export default {
<script>export default {
data: function () {
return {
version: config.version,
@ -393,7 +392,7 @@
openKeys: ['sub1'],
url: config.baseUrl + '/IoTCenter/api/v1/site/getSite',
data: {
logo: '/images/logo.png',
logo: 'images/logo.png',
copyright: '',
version: '',
username: '',
@ -457,5 +456,4 @@
return window.location.protocol + "//" + window.location.hostname + ":" + port;
}
}
}
</script>
}</script>

@ -13,7 +13,7 @@
<link rel="stylesheet" href="lib/weui/style/weui.min.css" />
<link rel="stylesheet" href="lib/fancybox/jquery.fancybox.min.css" />
<link rel="stylesheet" href="lib/sweetalert2/dist/minimal.min.css" />
<link rel="stylesheet" href="/IoTCenter/lib/kindeditor/themes/default/default.css">
<link rel="stylesheet" href="lib/kindeditor/themes/default/default.css">
<link rel="stylesheet" href="lib/tree-multiselect/jquery.tree-multiselect.min.css" />
<link rel="stylesheet" href="lib/jqcron/jqCron.css" />
<link rel="stylesheet" href="css/site.css" />

@ -1,25 +1,25 @@
Vue.component('pagination', function (resolve, reject) {
axios.get("/components/shared/pagination.html").then(function (response) {
axios.get("components/shared/pagination.html").then(function (response) {
resolve(parseModel(response));
});
});
Vue.component('layout', function (resolve, reject) {
axios.get("/components/shared/layout.html").then(function (response) {
axios.get("components/shared/layout.html").then(function (response) {
resolve(parseModel(response));
});
});
Vue.component('list', function (resolve, reject) {
axios.get("/components/shared/list.html").then(function (response) {
axios.get("components/shared/list.html").then(function (response) {
resolve(parseModel(response));
});
});
Vue.component('display', function (resolve, reject) {
axios.get("/components/shared/display.html").then(function (response) {
axios.get("components/shared/display.html").then(function (response) {
resolve(parseModel(response));
});
});
Vue.component('update', function (resolve, reject) {
axios.get("/components/shared/update.html").then(function (response) {
axios.get("components/shared/update.html").then(function (response) {
resolve(parseModel(response));
});
});
});

@ -21,6 +21,6 @@
];
for (var i = 0; i < formComponents.length; i++) {
var name = formComponents[i];
var url = "/components/shared/" + name.replace('-', '/') + ".html";
var url = "components/shared/" + name.replace('-', '/') + ".html";
vueComponent(name, url);
}

@ -88,7 +88,7 @@ var iotComponents = [
];
for (var i = 0; i < iotComponents.length; i++) {
var name = 'iot-'+iotComponents[i];
var url = "/components/iot/" + iotComponents[i] + ".html";
var url = "components/iot/" + iotComponents[i] + ".html";
vueComponent(name, url);
}
var deviceInfo = [];

@ -19,7 +19,7 @@ router.beforeEach((to, from, next) => {
var name = url.replace(/\//g, "-").replace(/\./g, "-").substring(1);
var route = routes[name];
if (!route) {
axios.get(url).then(function (response) {
axios.get(url.substring(1)).then(function (response) {
var model = parseModel(response);
route = {
name: name,

@ -1,32 +0,0 @@
#docker-compose up -d
version: "3.8"
services:
zookeeper:
image: wurstmeister/zookeeper:latest
restart: always
ports:
- 2181:2181
networks:
default:
ipv4_address: 172.172.0.201
kafka:
image: wurstmeister/kafka:2.13-2.6.0
restart: always
environment:
KAFKA_ZOOKEEPER_CONNECT: 172.172.0.201:2181
KAFKA_ADVERTISED_HOST_NAME: localhost
KAFKA_HEAP_OPTS: "-Xmx256m -Xms256m"
volumes:
- ./docker/data/kafka:/kafka
ports:
- 9092:9092
networks:
default:
ipv4_address: 172.172.0.210
kafka-manager:
image: sheepkiller/kafka-manager
environment:
ZK_HOSTS: 172.172.0.201
KAFKA_BROKERS: 172.172.0.210:9092
ports:
- "9010:9000"

@ -24,7 +24,7 @@ http {
server_name localhost;
location / {
root /root/nginx/html/desktop;
root /root/nginx/html;
if ($http_user_agent ~* "(mobile|android|ipad|iphone|ipod|tablet)") {
root /root/nginx/html/mobile;
}

@ -1 +0,0 @@
docker-compose -f docker-compose.yml -f docker-compose.override.yml -f docker-compose.temp.yml up --remove-orphans -d
Loading…
Cancel
Save