Skip to content

Commit b99682f

Browse files
dploegerDennis Ploeger
authored andcommitted
feat: Fixed a lot of regressions
I updated vue and vuetify before to a new major version without fixing the breaking changes apparently. This code layout now matches with the recommended way of doing Vue and Vuetify.
1 parent a8cb01f commit b99682f

8 files changed

Lines changed: 877 additions & 803 deletions

File tree

ccc-client/package-lock.json

Lines changed: 626 additions & 525 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ccc-client/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@
77
"preview": "vite preview"
88
},
99
"dependencies": {
10-
"axios": "^1.7.4",
10+
"axios": "1.8.2",
1111
"@mdi/font": "7.0.96",
1212
"roboto-fontface": "*",
13-
"vue": "^3.4.35",
14-
"vuetify": "^3.6.14",
13+
"vue": "^3.5.13",
14+
"vuetify": "^3.8.1",
1515
"vue-markdown-render": "^2.0.1"
1616
},
1717
"devDependencies": {
1818
"@babel/types": "^7.21.4",
1919
"@types/node": "^18.15.0",
2020
"@types/markdown-it": "^13.0.1",
21-
"@vitejs/plugin-vue": "^4.0.0",
21+
"@vitejs/plugin-vue": "^5.2.3",
2222
"typescript": "^5.0.0",
23-
"unplugin-fonts": "^1.0.3",
24-
"vite": "^4.5.2",
25-
"vite-plugin-vuetify": "^1.0.0",
23+
"unplugin-fonts": "^1.3.1",
24+
"vite": "^6.2.5",
25+
"vite-plugin-vuetify": "^2.1.1",
2626
"vue-tsc": "^1.2.0",
2727
"miragejs": "^0.1.47",
2828
"lorem-ipsum": "^2.0.8"

ccc-client/src/App.vue

Lines changed: 30 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
<template>
22
<v-app>
3-
<v-main>
4-
<v-container class="fill-height" fluid>
5-
<v-row align="center" justify="center">
6-
<v-col cols="12" sm="8" md="8">
7-
<Startup v-if="status === 'INIT'"/>
8-
<MainScreen v-if="status === 'INITIALIZED'"/>
9-
</v-col>
10-
</v-row>
11-
</v-container>
12-
<v-footer absolute>
3+
<v-layout ref="app">
4+
<v-main class="d-flex align-center justify-center">
5+
<v-container>
6+
<Progress v-if="status === 'INIT'"/>
7+
<MainScreen v-if="status === 'INITIALIZED'"/>
8+
</v-container>
9+
</v-main>
10+
<v-footer app>
1311
<v-sheet class="text-body-2 w-100">
1412
<v-container fluid>
1513
<v-row dense>
@@ -23,49 +21,35 @@
2321
</v-container>
2422
</v-sheet>
2523
</v-footer>
26-
</v-main>
24+
</v-layout>
2725
</v-app>
2826
</template>
2927

30-
<script lang="ts">
31-
import Vue, { defineComponent } from 'vue';
32-
import Progress from '@/components/Progress.vue';
28+
<script setup lang="ts">
29+
import { onMounted, onUnmounted, Ref, ref } from 'vue';
3330
import * as axios from 'axios';
3431
import MainScreen from '@/components/MainScreen.vue';
35-
import logoUrl from './assets/logo.svg?url';
32+
import logoUrlImport from './assets/logo.svg?url';
33+
import Progress from '@/components/Progress.vue';
3634
37-
let status: string = 'INIT';
38-
let loadStatusInterval: NodeJS.Timer | null = null;
35+
const status = ref('');
36+
const loadStatusInterval: Ref<NodeJS.Timer | null> = ref(null);
37+
const logoUrl = ref(logoUrlImport);
3938
40-
export default defineComponent({
41-
components: { MainScreen, Startup: Progress },
42-
data() {
43-
return {
44-
status,
45-
loadStatusInterval,
46-
logoUrl,
47-
};
48-
},
49-
created() {
50-
this.loadStatusInterval = setInterval(this.loadStatus.bind(this), 3000);
51-
this.loadStatus();
52-
},
53-
methods: {
54-
beforeDestroy() {
55-
if (this.loadStatusInterval) {
56-
clearInterval(loadStatusInterval as NodeJS.Timer);
57-
}
58-
this.loadStatusInterval = null;
59-
},
60-
loadStatus() {
61-
axios.default.get('/api/status')
62-
.then(
63-
(backendStatus) => {
64-
this.status = backendStatus.data.status;
65-
},
66-
);
67-
},
68-
},
39+
async function loadStatus() {
40+
const backendStatus = await axios.default.get('/api/status');
41+
status.value = backendStatus.data.status;
42+
}
43+
44+
onMounted(async () => {
45+
loadStatusInterval.value = setInterval(loadStatus.bind(this), 3000);
46+
await loadStatus();
6947
});
7048
49+
onUnmounted(() => {
50+
if (loadStatusInterval.value) {
51+
clearInterval(loadStatusInterval.value as NodeJS.Timer);
52+
}
53+
loadStatusInterval.value = null;
54+
});
7155
</script>

ccc-client/src/components/MainScreen.vue

Lines changed: 12 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -45,45 +45,29 @@
4545
</v-card>
4646
</template>
4747

48-
<script lang="ts">
49-
import { defineComponent } from 'vue';
48+
<script setup lang="ts">
49+
import { onMounted, Ref, ref } from 'vue';
5050
import * as axios from 'axios';
5151
import VueMarkdown from 'vue-markdown-render';
52-
import logoUrl from '../assets/logo.svg?url';
52+
import logoUrlImport from '../assets/logo.svg?url';
5353
5454
interface Feature {
5555
Icon: string;
5656
Title: string;
5757
Description: string;
5858
}
5959
60-
export default defineComponent({
61-
components: {
62-
VueMarkdown,
63-
},
64-
data() {
65-
const features: Feature[] = [];
60+
const features: Ref<Feature[]> = ref([])
61+
const logoUrl = ref(logoUrlImport)
6662
67-
return {
68-
features,
69-
logoUrl,
70-
};
71-
},
72-
mounted() {
73-
axios.default.get('/api/features')
74-
.then(
75-
(backendFeatures) => {
76-
this.features = backendFeatures.data;
77-
},
78-
);
79-
},
80-
methods: {
81-
async copyCommand(command: string) {
82-
await navigator.clipboard.writeText(command);
83-
},
84-
},
85-
});
63+
async function copyCommand(command: string) {
64+
await navigator.clipboard.writeText(command)
65+
}
8666
67+
onMounted(async () => {
68+
const backendFeatures = await axios.default.get('/api/features')
69+
features.value = backendFeatures.data
70+
})
8771
</script>
8872

8973
<style scoped>

0 commit comments

Comments
 (0)