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 camera" style="box-sizing:border-box;height:490px;margin:10px;">
<div class="card-header"> <div class="card-header">
{{device.displayName}} {{device.displayName}}
@ -23,21 +23,21 @@
<tr> <tr>
<td></td> <td></td>
<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>
<td></td> <td></td>
</tr> </tr>
<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/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/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/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/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/Zoomout')" src="images/zoomout.svg" style="width:32px;" /></td>
</tr> </tr>
<tr> <tr>
<td></td> <td></td>
<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>
<td></td> <td></td>
</tr> </tr>
@ -47,8 +47,7 @@
</div> </div>
</div> </div>
</template> </template>
<script> <script>export default {
export default {
props: ['device', 'edit'], props: ['device', 'edit'],
data() { data() {
return { return {
@ -261,5 +260,4 @@
return false; 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 color-light" style="box-sizing:border-box;height:150px;margin:10px;">
<div class="card-header"> <div class="card-header">
{{device.displayName}} {{device.displayName}}
@ -18,8 +18,8 @@
</div> </div>
</div> </div>
<div class="col-2 align-self-center text-center"> <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-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-else="getDeviceDataValue(device,'状态')==='关'" @click="execApi(device.number,'/Socket/On')" src="images/off.svg" />
</div> </div>
</div> </div>
</div> </div>

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

@ -13,16 +13,15 @@
<div class="col-8 align-self-center"> <div class="col-8 align-self-center">
<div class="row" style="line-height:28px;"> <div class="row" style="line-height:28px;">
<!--<span class="badge badge-info" style="line-height:26px;">{{getDeviceDataValue(device,'状态')}}</span>--> <!--<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="open" src="images/on.svg" />
<!--<img style="height:32px;" @click="close" src="/IoTCenter/images/off.svg" />--> <!--<img style="height:32px;" @click="close" src="/IoTCenterimages/off.svg" />-->
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>export default {
export default {
props: ['device'], props: ['device'],
methods: { methods: {
open: function () { 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" style="box-sizing:border-box;height:150px;margin:10px;">
<div class="card-header"> <div class="card-header">
{{device.displayName}} {{device.displayName}}
@ -14,16 +14,15 @@
<div class="row" style="line-height:28px;"> <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">{{electricity}} kW‧h</span>
<span class="badge badge-info" style="line-height:26px; margin-right: 10px;" v-if="isSmart">{{power}} W</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-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-else="getDeviceDataValue(device,'状态')==='关'" @click="execApi(device.number,'/Socket/On')" src="images/off.svg" />
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>export default {
export default {
props: ['device'], props: ['device'],
computed: { computed: {
isSmart: function () { isSmart: function () {
@ -36,5 +35,4 @@
return parseFloat(this.getDeviceDataValue(this.device, '功率') || 0).toFixed(2); 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" style="box-sizing:border-box;height:150px;margin:10px;">
<div class="card-header"> <div class="card-header">
{{device.displayName}} {{device.displayName}}
@ -12,16 +12,14 @@
</div> </div>
<div class="col-8 align-self-center"> <div class="col-8 align-self-center">
<div class="row" style="line-height:28px;"> <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/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/On')" src="images/off.svg" />
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>export default {
export default {
props: ['device'] 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" style="box-sizing:border-box;height:150px;margin:10px;">
<div class="card-header"> <div class="card-header">
{{device.displayName}} {{device.displayName}}
@ -12,20 +12,18 @@
</div> </div>
<div class="col-8 align-self-center"> <div class="col-8 align-self-center">
<div class="row" style="line-height:28px;"> <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/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,'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/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,'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/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,'L3状态')=='关'" @click="execApi(device.number,'/Switch3/L3On')" src="images/off.svg" />
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>export default {
export default {
props: ['device'] 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> <a ref="fancybox" style="display:block;" :href="src"><img style="height:32px;" :src="src" /></a>
</template> </template>
<script> <script>export default {
export default {
props: ['value'], props: ['value'],
mounted: function () { mounted: function () {
$(this.$refs.fancybox).fancybox(); $(this.$refs.fancybox).fancybox();
}, },
computed: { computed: {
src: function () { src: function () {
return this.value || '/images/empty.png'; return this.value || 'images/empty.png';
} }
} }
}; };</script>
</script>

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

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

@ -383,8 +383,7 @@
</footer> </footer>
</div> </div>
</template> </template>
<script> <script>export default {
export default {
data: function () { data: function () {
return { return {
version: config.version, version: config.version,
@ -393,7 +392,7 @@
openKeys: ['sub1'], openKeys: ['sub1'],
url: config.baseUrl + '/IoTCenter/api/v1/site/getSite', url: config.baseUrl + '/IoTCenter/api/v1/site/getSite',
data: { data: {
logo: '/images/logo.png', logo: 'images/logo.png',
copyright: '', copyright: '',
version: '', version: '',
username: '', username: '',
@ -457,5 +456,4 @@
return window.location.protocol + "//" + window.location.hostname + ":" + port; 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/weui/style/weui.min.css" />
<link rel="stylesheet" href="lib/fancybox/jquery.fancybox.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="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/tree-multiselect/jquery.tree-multiselect.min.css" />
<link rel="stylesheet" href="lib/jqcron/jqCron.css" /> <link rel="stylesheet" href="lib/jqcron/jqCron.css" />
<link rel="stylesheet" href="css/site.css" /> <link rel="stylesheet" href="css/site.css" />

@ -1,25 +1,25 @@
Vue.component('pagination', function (resolve, reject) { 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)); resolve(parseModel(response));
}); });
}); });
Vue.component('layout', function (resolve, reject) { 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)); resolve(parseModel(response));
}); });
}); });
Vue.component('list', function (resolve, reject) { 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)); resolve(parseModel(response));
}); });
}); });
Vue.component('display', function (resolve, reject) { 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)); resolve(parseModel(response));
}); });
}); });
Vue.component('update', function (resolve, reject) { 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)); resolve(parseModel(response));
}); });
}); });

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

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

@ -19,7 +19,7 @@ router.beforeEach((to, from, next) => {
var name = url.replace(/\//g, "-").replace(/\./g, "-").substring(1); var name = url.replace(/\//g, "-").replace(/\./g, "-").substring(1);
var route = routes[name]; var route = routes[name];
if (!route) { if (!route) {
axios.get(url).then(function (response) { axios.get(url.substring(1)).then(function (response) {
var model = parseModel(response); var model = parseModel(response);
route = { route = {
name: name, 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; server_name localhost;
location / { location / {
root /root/nginx/html/desktop; root /root/nginx/html;
if ($http_user_agent ~* "(mobile|android|ipad|iphone|ipod|tablet)") { if ($http_user_agent ~* "(mobile|android|ipad|iphone|ipod|tablet)") {
root /root/nginx/html/mobile; 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