Compare commits

4 Commits
test ... master

Author SHA1 Message Date
Kamil Klecha
904a75d871 Fixed error notifications 2021-10-20 21:02:15 +02:00
Kamil Klecha
ca85b6a08c Little improvements 2021-10-20 11:14:58 +02:00
Kamil Klecha
43c77180d7 QF build 2021-10-20 11:00:22 +02:00
Kamil Klecha
bb8cd1e295 QF and added dockerfile 2021-10-20 01:01:59 +02:00
4 changed files with 30 additions and 9 deletions

9
Dockerfile Normal file
View File

@@ -0,0 +1,9 @@
FROM node:16
WORKDIR /app
COPY . .
RUN npm install && npm run build
FROM nginx:alpine
WORKDIR /usr/share/nginx/html
COPY --from=0 /app/dist .
ENTRYPOINT ["nginx", "-g", "daemon off;"]

View File

@@ -56,7 +56,9 @@
<v-card-actions> <v-card-actions>
<v-row> <v-row>
<v-col cols="6"> <v-col cols="6">
<v-btn block class="primary" @click="details = true">Szczegóły</v-btn> <v-btn block class="primary" @click="details = true"
>Szczegóły</v-btn
>
</v-col> </v-col>
<v-col cols="6"> <v-col cols="6">
<v-btn block class="error" @click="deleteCity()">Usuń</v-btn> <v-btn block class="error" @click="deleteCity()">Usuń</v-btn>
@@ -64,28 +66,35 @@
</v-row> </v-row>
</v-card-actions> </v-card-actions>
</v-card> </v-card>
<v-skeleton-loader type="card" v-else></v-skeleton-loader> <v-card width="350" v-else>
<Details v-model="details" :city="city" :wdata="data" v-if="city && data"></Details> <v-skeleton-loader type="card"></v-skeleton-loader>
</v-card>
<Details
v-model="details"
:city="city"
:wdata="data"
v-if="city && data"
></Details>
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
import { Component, Prop, Vue } from "vue-property-decorator"; import { Component, Prop, Vue } from "vue-property-decorator";
import Details from '@/components/Details.vue'; import Details from "@/components/Details.vue";
import axios from "axios"; import axios from "axios";
const moment = require("moment"); const moment = require("moment");
@Component({ @Component({
components: { components: {
Details, Details,
} },
}) })
export default class City extends Vue { export default class City extends Vue {
@Prop({ required: true }) private readonly city!: any; @Prop({ required: true }) private readonly city!: any;
private created() { private created() {
this.getData(); this.getData();
//setInterval(this.getData, 1000 * 60); setInterval(this.getData, 1000 * 60);
} }
private getData() { private getData() {
@@ -103,7 +112,10 @@ export default class City extends Vue {
this.$data.data = res.data; this.$data.data = res.data;
}) })
.catch((e) => { .catch((e) => {
console.error(e); this.$store.dispatch(
"errorMessage",
"Błąd " + e.response.status + " przy pobieraniu danych!"
);
}); });
} }
@@ -112,7 +124,7 @@ export default class City extends Vue {
} }
private deleteCity() { private deleteCity() {
this.$emit('delete'); this.$emit("delete");
} }
private data() { private data() {

View File

@@ -96,7 +96,6 @@ export default class NewCity extends Vue {
}, },
}) })
.then((res) => { .then((res) => {
console.log(res.data);
this.$data.items = res.data; this.$data.items = res.data;
}); });
} }

View File

@@ -31,6 +31,7 @@ export default new Vuex.Store({
// ... // ...
}) })
.catch((error) => { .catch((error) => {
dispatch("errorMessage", "Błąd podczas logowania!");
// const errorCode = error.code; // const errorCode = error.code;
// const errorMessage = error.message; // const errorMessage = error.message;
}); });