Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Protection.vue « views « src - github.com/undo-ransomware/ransomware_detection.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 46eb5daf0d4651ca78eb7e75cdd04b7f6afaba43 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<template>
    <AppContent>
		<iron-pages selected="0">
			<div id="loading">
				<paper-spinner active></paper-spinner>
			</div>
			<div>
				<ProtectionStatus :detection-link="detectionUrl" id="protection-status" v-on:protection-state-changed="protectionStateChanged"></ProtectionStatus>
			</div>
		</iron-pages>
    </AppContent>
</template>

<script>
import '@polymer/paper-spinner/paper-spinner.js';
import '@polymer/iron-pages/iron-pages.js';
import AppContent from 'nextcloud-vue/dist/Components/AppContent'
import ProtectionStatus from '../components/ProtectionStatus'

export default {
    name: 'Protection',
    components: {
        AppContent,
		ProtectionStatus
	},
	data() {
        return {
			protectionReady: false,
        };
    },
    computed: {
		detectionUrl() {
            return OC.generateUrl('/apps/ransomware_detection/api/v1/detection');
		}
	},
	methods: {
		protectionStateChanged() {
			this.protectionReady = true;
			this.hideSpinner();
		},
		hideSpinner() {
			if (this.protectionReady) {
				document.querySelector('iron-pages').selectIndex(1);
			}
		}
	}
}
</script>

<style lang="scss">
	#protection-status {
		height: 40vh;
	}
	#loading {
		display: flex;
		align-items: center;
		height: 90vh;
		justify-content: center;
	}
</style>