未验证 提交 ec3ca348 编写于 作者: D daminglu 提交者: GitHub

Add logic for demo server (#444)

上级 d9a71463
...@@ -80,13 +80,14 @@ export default { ...@@ -80,13 +80,14 @@ export default {
}, },
audioData: {}, audioData: {},
data: [], data: [],
isDemo: process.env.NODE_ENV === 'demo',
}; };
}, },
created() { created() {
this.getOriginAudioData(); this.getOriginAudioData();
}, },
mounted() { mounted() {
if (this.running) { if (this.running && !this.isDemo) {
this.startInterval(); this.startInterval();
} }
}, },
...@@ -97,7 +98,7 @@ export default { ...@@ -97,7 +98,7 @@ export default {
watch: { watch: {
running: function(val) { running: function(val) {
val ? this.startInterval() : this.stopInterval(); (val && !this.isDemo) ? this.startInterval() : this.stopInterval();
}, },
currentIndex: function(index) { currentIndex: function(index) {
if (this.data && this.data[index]) { if (this.data && this.data[index]) {
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
<v-btn <v-btn
:color="config.running ? 'primary' : 'error'" :color="config.running ? 'primary' : 'error'"
v-model="config.running" v-model="config.running"
v-if="!isDemo"
@click="toggleAllRuns" @click="toggleAllRuns"
class="visual-dl-page-run-toggle" class="visual-dl-page-run-toggle"
dark dark
...@@ -44,6 +45,7 @@ export default { ...@@ -44,6 +45,7 @@ export default {
}, },
data() { data() {
return { return {
isDemo: process.env.NODE_ENV === 'demo',
}; };
}, },
methods: { methods: {
......
...@@ -49,6 +49,7 @@ export default { ...@@ -49,6 +49,7 @@ export default {
}, },
embeddingData: [], embeddingData: [],
showLoading: false, showLoading: false,
isDemo: process.env.NODE_ENV === 'demo',
}; };
}, },
created() { created() {
...@@ -61,7 +62,7 @@ export default { ...@@ -61,7 +62,7 @@ export default {
} }
}); });
if (this.config.running) { if (this.config.running && !this.isDemo) {
this.startInterval(); this.startInterval();
} }
}, },
...@@ -79,7 +80,7 @@ export default { ...@@ -79,7 +80,7 @@ export default {
this.fetchDatasets(); this.fetchDatasets();
}, },
'config.running': function(val) { 'config.running': function(val) {
val ? this.startInterval() : this.stopInterval(); (val && !this.isDemo) ? this.startInterval() : this.stopInterval();
}, },
}, },
mounted() { mounted() {
......
...@@ -54,6 +54,7 @@ ...@@ -54,6 +54,7 @@
<v-btn <v-btn
:color="config.running ? 'primary' : 'error'" :color="config.running ? 'primary' : 'error'"
v-model="config.running" v-model="config.running"
v-if="!isDemo"
@click="toggleAllRuns" @click="toggleAllRuns"
class="visual-dl-page-run-toggle" class="visual-dl-page-run-toggle"
dark dark
...@@ -78,6 +79,7 @@ export default { ...@@ -78,6 +79,7 @@ export default {
}, },
data() { data() {
return { return {
isDemo: process.env.NODE_ENV === 'demo',
}; };
}, },
methods: { methods: {
......
...@@ -66,6 +66,7 @@ export default { ...@@ -66,6 +66,7 @@ export default {
return { return {
originData: [], originData: [],
isExpand: false, isExpand: false,
isDemo: process.env.NODE_ENV === 'demo',
}; };
}, },
watch: { watch: {
...@@ -76,7 +77,7 @@ export default { ...@@ -76,7 +77,7 @@ export default {
this.initChartOption(); this.initChartOption();
}, },
running: function(val) { running: function(val) {
val ? this.startInterval() : this.stopInterval(); (val && !this.isDemo) ? this.startInterval() : this.stopInterval();
}, },
isExpand: function(val) { isExpand: function(val) {
this.expandArea(val); this.expandArea(val);
...@@ -85,7 +86,7 @@ export default { ...@@ -85,7 +86,7 @@ export default {
mounted() { mounted() {
let tagInfo = this.tagInfo; let tagInfo = this.tagInfo;
this.initChart(tagInfo); this.initChart(tagInfo);
if (this.running) { if (this.running && !this.isDemo) {
this.startInterval(); this.startInterval();
} }
}, },
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
class="visual-dl-page-run-toggle" class="visual-dl-page-run-toggle"
:color="config.running ? 'primary' : 'error'" :color="config.running ? 'primary' : 'error'"
v-model="config.running" v-model="config.running"
v-if="!isDemo"
@click="toggleAllRuns" @click="toggleAllRuns"
dark dark
block block
...@@ -64,6 +65,7 @@ export default { ...@@ -64,6 +65,7 @@ export default {
value: 'offset', value: 'offset',
}, },
], ],
isDemo: process.env.NODE_ENV === 'demo',
}; };
}, },
methods: { methods: {
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
<v-btn <v-btn
:color="config.running ? 'primary' : 'error'" :color="config.running ? 'primary' : 'error'"
v-model="config.running" v-model="config.running"
v-if="!isDemo"
@click="toggleAllRuns" @click="toggleAllRuns"
class="visual-dl-page-run-toggle" class="visual-dl-page-run-toggle"
dark dark
...@@ -49,6 +50,7 @@ export default { ...@@ -49,6 +50,7 @@ export default {
}, },
data() { data() {
return { return {
isDemo: process.env.NODE_ENV === 'demo',
}; };
}, },
methods: { methods: {
......
...@@ -93,13 +93,14 @@ export default { ...@@ -93,13 +93,14 @@ export default {
data: [], data: [],
height: defaultImgHeight, height: defaultImgHeight,
weight: defaultImgWidth, weight: defaultImgWidth,
isDemo: process.env.NODE_ENV === 'demo',
}; };
}, },
created() { created() {
this.getOriginChartsData(); this.getOriginChartsData();
}, },
mounted() { mounted() {
if (this.running) { if (this.running && !this.isDemo) {
this.startInterval(); this.startInterval();
} }
}, },
...@@ -110,7 +111,7 @@ export default { ...@@ -110,7 +111,7 @@ export default {
watch: { watch: {
running: function(val) { running: function(val) {
val ? this.startInterval() : this.stopInterval(); (val && !this.isDemo) ? this.startInterval() : this.stopInterval();
}, },
currentIndex: function(index) { currentIndex: function(index) {
/* eslint-disable fecs-camelcase */ /* eslint-disable fecs-camelcase */
......
...@@ -64,11 +64,11 @@ ...@@ -64,11 +64,11 @@
<v-btn <v-btn
:color="config.running ? 'primary' : 'error'" :color="config.running ? 'primary' : 'error'"
v-model="config.running" v-model="config.running"
v-if="!isDemo"
@click="toggleAllRuns" @click="toggleAllRuns"
class="visual-dl-page-run-toggle" class="visual-dl-page-run-toggle"
dark dark
block block
v-if="!isDemo"
> >
{{ config.running ? 'Running' : 'Stopped' }} {{ config.running ? 'Running' : 'Stopped' }}
</v-btn> </v-btn>
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
<v-btn <v-btn
:color="config.running ? 'primary' : 'error'" :color="config.running ? 'primary' : 'error'"
v-model="config.running" v-model="config.running"
v-if="!isDemo"
@click="toggleAllRuns" @click="toggleAllRuns"
class="visual-dl-page-run-toggle" class="visual-dl-page-run-toggle"
dark dark
...@@ -46,6 +47,7 @@ export default { ...@@ -46,6 +47,7 @@ export default {
}, },
data() { data() {
return { return {
isDemo: process.env.NODE_ENV === 'demo',
}; };
}, },
methods: { methods: {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册