Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#2000 Removal of unnecessary api calls: #2943

Merged
merged 2 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion WebContent/WEB-INF/jsp/app.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta charset=utf-8>
<meta http-equiv=X-UA-Compatible content="IE=edge">
<meta name=viewport content="width=device-width,initial-scale=1">
<link rel=icon href=/favicon.ico>
<link rel=icon href="images/favicon.ico">
<title>SCADA-LTS</title>
<link href=resources/js-ui/app/css/app.css rel=preload as=style>
<link href=resources/js-ui/app/css/chunk-vendors.css rel=preload as=style>
Expand Down
2 changes: 0 additions & 2 deletions WebContent/WEB-INF/jsp/include/vue/vue-charts.js.jsp

This file was deleted.

3 changes: 1 addition & 2 deletions WebContent/WEB-INF/jsp/include/vue/vue-view.js.jsp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<script src="resources/js-ui/views/js/cmp-component.js"/></script>
<script src="resources/js-ui/views/js/isalive-component.js"></script>
<script src="resources/js-ui/views/js/simple-component-svg.js"></script>
<script src="resources/js-ui/views/js/test-component.js"></script>
<script src="resources/js-ui/liveAlarms/js/live-alarms-component.js"></script>
<script src="resources/js-ui/views/js/live-alarms-component.js"></script>
3 changes: 1 addition & 2 deletions WebContent/WEB-INF/jsp/views.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -296,5 +296,4 @@

</tag:page>
<%@ include file="/WEB-INF/jsp/include/vue/vue-app.js.jsp"%>
<%@ include file="/WEB-INF/jsp/include/vue/vue-view.js.jsp"%>
<%@ include file="/WEB-INF/jsp/include/vue/vue-charts.js.jsp"%>
<%@ include file="/WEB-INF/jsp/include/vue/vue-view.js.jsp"%>
4 changes: 1 addition & 3 deletions scadalts-ui/src/apps/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@
</template>

<script>
import NavigationBar from '../layout/NavigationBar.vue'
import webSocketMixin from '@/utils/web-socket-utils';
import NavigationBar from '../layout/NavigationBar.vue';
import internetMixin from '@/utils/connection-status-utils';
import NotificationAlert from '../layout/snackbars/NotificationAlert.vue';

Expand Down Expand Up @@ -136,7 +135,6 @@ export default {
this.$store.dispatch('getUserInfo');
}
this.$store.dispatch('getLocaleInfo');
this.$store.dispatch('getHighestUnsilencedAlarmLevel');
this.connectToWebSocket();
},

Expand Down
7 changes: 0 additions & 7 deletions scadalts-ui/src/components/graphical_views/RefreshView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,6 @@ export default {
} else {
console.log('Err get viewId');
}

setInterval(
function () {
this.check(this.id);
}.bind(this),
this.timeToCheckRefresh,
);
}
};
</script>
Expand Down
35 changes: 26 additions & 9 deletions scadalts-ui/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,21 @@ Vue.use(svgJS);

Vue.config.devtools = true;

new Vue({
router,
store,
i18n,
vuetify,
render: (h) => h(App),
}).$mount('#app');
if (window.location.href.indexOf('app.shtm') != -1) {
console.log('app.shtm');
new Vue({
router,
store,
i18n,
vuetify,
render: (h) => h(App),
}).$mount('#app');
}

Vue.use(uiv);

if (window.document.getElementById('app-isalive') != undefined) {
console.log('app-isalive');
const isAliveDom = document.getElementById('app-isalive');
new Vue({
store,
Expand All @@ -111,8 +115,9 @@ if (window.document.getElementById('app-isalive') != undefined) {
}).$mount('#app-isalive');
}

const watchdogId = "app-isalive2";
if (!!window.document.getElementById(watchdogId)) {
const watchdogId = 'app-isalive2';
if (window.document.getElementById(watchdogId) != undefined) {
console.log(watchdogId);
const watchdogEl = document.getElementById(watchdogId);
new Vue({
store,
Expand All @@ -137,6 +142,7 @@ if (!!window.document.getElementById(watchdogId)) {
for (let i = 0; i < 20; i++) {
const cmpId = `app-cmp-${i}`;
if (window.document.getElementById(cmpId) != undefined) {
console.log('cmpId: ' + cmpId);
new Vue({
vuetify,
render: (h) =>
Expand All @@ -161,6 +167,7 @@ for (let i = 0; i < 10; i++) {
const cmpId = `app-cmp2-${i}`;
const el = window.document.getElementById(cmpId);
if (el != undefined) {
console.log('cmpId: ' + cmpId);
new Vue({
store,
i18n,
Expand All @@ -187,6 +194,7 @@ for (let i = 0; i < 10; i++) {
const cmpId = `app-cmp3-${i}`;
const el = window.document.getElementById(cmpId);
if (el != undefined) {
console.log('cmpId: ' + cmpId);
new Vue({
store,
i18n,
Expand All @@ -213,6 +221,7 @@ for (let i = 0; i < 10; i++) {


if (window.document.getElementById('simple-component-svg') != undefined) {
console.log('simple-component-svg');
new Vue({
render: (h) =>
h(SimpleComponentSVG, {
Expand All @@ -235,19 +244,22 @@ if (window.document.getElementById('simple-component-svg') != undefined) {
}

if (window.document.getElementById('sleep-reactivation-ds') != undefined) {
console.log('sleep-reactivation-ds');
new Vue({
render: (h) => h(SleepAndReactivationDS),
}).$mount('#sleep-reactivation-ds');
}

if (window.document.getElementById('sms-domain') != undefined) {
console.log('sms-domain');
new Vue({
vuetify,
render: (h) => h(SMSDomain),
}).$mount('#sms-domain');
}

if (window.document.getElementById('export-import-ph') != undefined) {
console.log('export-import-ph');
new Vue({
render: (h) => h(ExportImportPointHierarchy),
}).$mount('#export-import-ph');
Expand All @@ -257,6 +269,7 @@ for (let x = 0; x < 10; x++) {
const chartId = `chart-line-${x}`;
const el = window.document.getElementById(chartId);
if (el != undefined) {
console.log('chartId: ' + chartId);
new Vue({
render: (h) =>
h(LineChartComponent, {
Expand Down Expand Up @@ -292,6 +305,7 @@ for (let x = 0; x < 10; x++) {
const chartId = `chart-range-${x}`;
const el = window.document.getElementById(chartId);
if (el != undefined) {
console.log('chartId: ' + chartId);
new Vue({
store,
vuetify,
Expand Down Expand Up @@ -323,6 +337,7 @@ for (let x = 0; x < 10; x++) {
const baseId = `simple-table-${x}`;
const el = window.document.getElementById(baseId);
if (el != undefined) {
console.log('baseId: ' + baseId);
new Vue({
store,
vuetify,
Expand All @@ -345,6 +360,7 @@ for (let x = 0; x < 10; x++) {
}

if (window.document.getElementById('refresh-view') != undefined) {
console.log('refresh-view');
new Vue({
store,
render: (h) =>
Expand All @@ -360,6 +376,7 @@ if (window.document.getElementById('refresh-view') != undefined) {
}

if (window.document.getElementById('live-alarms') != undefined) {
console.log('live-alarms');
console.log(
`test+ ${window.document
.getElementById('live-alarms')
Expand Down
1 change: 0 additions & 1 deletion scadalts-ui/src/views/Alarms/EventList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,6 @@ export default {
}
// document.getElementsByClassName('v-data-footer__pagination')[0].innerHTML=''
this.loading = false;
await this.$store.dispatch('getHighestUnsilencedAlarmLevel');
},
async fetchEventSelected() {
this.loading = true;
Expand Down
Loading