-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.vue
132 lines (112 loc) · 2.98 KB
/
app.vue
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<script setup>
import "./assets/index.scss";
const store = useStore();
const route = useRoute();
const router = useRouter();
const isHeader = computed(() => store.serverUrl || store.flags.login);
const activeIndex = computed(() => {
const dict = {
scan: "1",
index: "2",
};
return dict[route.name] || "0";
});
// import firebase from "firebase/app";
import { initializeApp } from "firebase/app";
import { getAnalytics } from "firebase/analytics";
const firebaseConfig = {
apiKey: "AIzaSyCdKjLhrXLHy46sYfx3qpHTqIE7w5-ew9w",
authDomain: "site-audit-seo-1597591908441.firebaseapp.com",
projectId: "site-audit-seo-1597591908441",
storageBucket: "site-audit-seo-1597591908441.appspot.com",
messagingSenderId: "416232515295",
appId: "1:416232515295:web:82f6bee07c6b76f3b2eb6a",
measurementId: "G-ZKXVHXZL2R",
};
const firebaseApp = initializeApp(firebaseConfig);
store.$patch({ firebaseApp: firebaseApp });
const analytics = getAnalytics(firebaseApp);
migrate();
function handleSelect(index) {
const dict = {
1: "/scan",
2: "/",
};
const path = dict[index];
if (path) router.push({ path: path });
}
function migrate() {
// if store.jsonUrlHistory is object and not is array, convert to array with key as field url
if (typeof store.jsonUrlHistory === "object" && !Array.isArray(store.jsonUrlHistory)) {
console.info("Convert jsonUrlHistory to array");
const jsonUrlHistory = [];
for (let key in store.jsonUrlHistory) {
jsonUrlHistory.push({ url: key, ...store.jsonUrlHistory[key] });
}
store.$patch({ jsonUrlHistory: jsonUrlHistory });
}
}
</script>
<style>
html {
font-family: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
font-size: 16px;
word-spacing: 1px;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
box-sizing: border-box;
height: 100%;
}
body {
overflow-x: auto;
height: 100%;
font-size: 14px;
}
#__nuxt, #__layout {
height: 100%;
}
.el-container {
display: flex;
flex-direction: column;
height: 100%;
}
.el-footer {
padding: 8px 8px;
}
.el-footer a {
color: #ccc;
}
*, *:before, *:after {
box-sizing: border-box;
margin: 0;
}
/* 100% width */
.container {
width: auto;
}
</style>
<template>
<el-container>
<el-header height="66px" v-if="isHeader">
<el-row>
<el-col :span="14">
<el-menu :default-active="activeIndex" mode="horizontal" @select="handleSelect" class="header__menu">
<el-menu-item v-if="store.serverUrl" index="1">Scan</el-menu-item>
<el-menu-item index="2">Results</el-menu-item>
</el-menu>
</el-col>
<el-col :span="10">
<Profile v-if="store.flags.login"></Profile>
</el-col>
</el-row>
</el-header>
<el-main>
<NuxtLayout>
<NuxtPage />
</NuxtLayout>
</el-main>
<Footer></Footer>
</el-container>
</template>