QF and added dockerfile

This commit is contained in:
Kamil Klecha
2021-10-20 01:01:59 +02:00
parent 1050e3e12a
commit bb8cd1e295
3 changed files with 27 additions and 8 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:latest-alpine
WORKDIR /usr/share/nginx/html
COPY --from=0 /app/dist .
ENTRYPOINT [ "start-nginx.sh" ]

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>
@@ -65,27 +67,33 @@
</v-card-actions> </v-card-actions>
</v-card> </v-card>
<v-skeleton-loader type="card" v-else></v-skeleton-loader> <v-skeleton-loader type="card" v-else></v-skeleton-loader>
<Details v-model="details" :city="city" :wdata="data" v-if="city && data"></Details> <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");
const Config = require("@/config.json");
@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 +111,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.status.code + " przy pobieraniu danych!"
);
}); });
} }
@@ -112,7 +123,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;
}); });
} }