mirror of
https://github.com/Spythere/station-manager-2.0.git
synced 2026-05-03 13:38:13 +00:00
poprawki changeloga
This commit is contained in:
@@ -4,35 +4,37 @@
|
|||||||
<hr color="white" />
|
<hr color="white" />
|
||||||
|
|
||||||
<!-- Changelog -->
|
<!-- Changelog -->
|
||||||
<div v-for="(item, listIndex) in changeList" :key="listIndex">
|
<ul>
|
||||||
<b class="text--accent">{{ item.name }}</b> ->
|
<li v-for="(item, listIndex) in changeList" :key="listIndex">
|
||||||
|
<b class="text--accent">{{ item.name }}</b> ->
|
||||||
|
|
||||||
<!-- Info dla scenerii do usunięcia -->
|
<!-- Info dla scenerii do usunięcia -->
|
||||||
<span v-if="item.toRemove" class="text--accent"> do usunięcia</span>
|
<span v-if="item.toRemove" class="text--accent"> do usunięcia</span>
|
||||||
|
|
||||||
<!-- Info dla scenerii do ze zmianiami do zaktualizowania -->
|
<!-- Info dla scenerii do ze zmianiami do zaktualizowania -->
|
||||||
<span v-else>
|
<span v-else>
|
||||||
<span v-for="({ name: changeName, value: changeValue }, changeIndex) in item.changes" :key="changeIndex">
|
<span v-for="({ name: changeName, value: changeValue }, changeIndex) in item.changes" :key="changeIndex">
|
||||||
<i style="color: white">{{ (HeaderTypes as any)[changeName] }}: </i>
|
<i style="color: white">{{ (HeaderTypes as any)[changeName] }}: </i>
|
||||||
|
|
||||||
<span v-if="changeName == 'availability'">
|
<span v-if="changeName == 'availability'">
|
||||||
{{ getAvailabilityValue(changeValue as Availability) }}
|
{{ getAvailabilityValue(changeValue as Availability) }}
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<RouteList v-else-if="changeName == 'routesInfo'" :routes="changeValue" />
|
||||||
|
|
||||||
|
<span v-else-if="typeof changeValue === 'boolean'">
|
||||||
|
{{ changeValue ? 'TAK' : 'NIE' }}
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<span v-else>
|
||||||
|
{{ changeValue }}
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<span v-if="changeIndex < item.changes.length - 1">; </span>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<RouteList v-else-if="changeName == 'routesInfo'" :routes="changeValue" />
|
|
||||||
|
|
||||||
<span v-else-if="typeof changeValue === 'boolean'">
|
|
||||||
{{ changeValue ? 'TAK' : 'NIE' }}
|
|
||||||
</span>
|
|
||||||
|
|
||||||
<span v-else>
|
|
||||||
{{ changeValue }}
|
|
||||||
</span>
|
|
||||||
|
|
||||||
<span v-if="changeIndex < item.changes.length - 1">; </span>
|
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</li>
|
||||||
</div>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -63,27 +65,21 @@ export default defineComponent({
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// changelog() {
|
|
||||||
// return this.store.changeList
|
|
||||||
// .map((changeItem) => {
|
|
||||||
// let itemChanges = [];
|
|
||||||
// if (changeItem.toRemove) return `<b class='text--accent'>${changeItem.name} -></b> do usunięcia`;
|
|
||||||
// for (let change in changeItem) {
|
|
||||||
// let propChange = change as ChangeProp;
|
|
||||||
// if (/^(id|name)$/.test(propChange)) continue;
|
|
||||||
// let value = typeof changeItem[propChange] === 'boolean' ? (changeItem[propChange] ? 'TAK' : 'NIE') : changeItem[propChange];
|
|
||||||
// if (propChange == 'availability') value = getAvailabilityValue(changeItem[propChange] as Availability);
|
|
||||||
// // if (propChange == 'routesInfo') value = this.getRouteNames(changeItem[propChange] as SceneryRoutesInfo[]);
|
|
||||||
// itemChanges.push(`<i style='color: white'>${(HeaderTypes as any)[propChange]}:</i> ${value ?? '-'}`);
|
|
||||||
// }
|
|
||||||
// console.log(itemChanges);
|
|
||||||
// return `<b class='text--accent'>${changeItem.name} -></b> ` + itemChanges.join('; ');
|
|
||||||
// })
|
|
||||||
// .join(' <br /> ');
|
|
||||||
// },
|
|
||||||
},
|
},
|
||||||
components: { RouteList },
|
components: { RouteList },
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped></style>
|
<style lang="scss" scoped>
|
||||||
|
ul {
|
||||||
|
height: 200px;
|
||||||
|
overflow: auto;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
list-style: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
h3 {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -174,11 +174,10 @@ export default defineComponent({
|
|||||||
|
|
||||||
if (index == -1) return;
|
if (index == -1) return;
|
||||||
|
|
||||||
const routeString = this.parseRoutes();
|
// const routeString = this.parseRoutes();
|
||||||
|
|
||||||
this.addChange(this.store.currentStation!, 'routesInfo', this.routeBackup, this.currentRoutes);
|
this.addChange(this.store.currentStation!, 'routesInfo', this.routeBackup, this.currentRoutes);
|
||||||
this.store.stationList[index]['routesInfo'] = this.currentRoutes;
|
this.store.stationList[index]['routesInfo'] = this.currentRoutes;
|
||||||
// this.currentRoutes.push(this.cur)
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -61,25 +61,19 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="pane">
|
<div class="pane">
|
||||||
<button @click="changelogVisible = !changelogVisible">{{ changelogVisible ? 'Ukryj' : 'Pokaż' }} changelog</button>
|
<button @click="changelogVisible = !changelogVisible">
|
||||||
|
{{ changelogVisible ? 'Ukryj' : 'Pokaż' }} changelog ({{ store.changeList.length }})
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Changelog />
|
<Changelog v-if="changelogVisible" />
|
||||||
|
|
||||||
<!-- <div class="changelog" v-if="changelogVisible">
|
|
||||||
<h3>Changelog:</h3>
|
|
||||||
<hr color="white" />
|
|
||||||
|
|
||||||
<div v-html="changelog || 'brak zmian'"></div>
|
|
||||||
</div> -->
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import { useStore } from '../store';
|
import { useStore } from '../store';
|
||||||
import { Availability, ChangeProp, HeaderTypes, SceneryRoutesInfo, SceneryRowItem } from '../types/types';
|
import { SceneryRowItem } from '../types/types';
|
||||||
import { getAvailabilityValue } from '../types/typeUitls';
|
|
||||||
import client from '../common/http';
|
import client from '../common/http';
|
||||||
|
|
||||||
import { version } from '../../package.json';
|
import { version } from '../../package.json';
|
||||||
@@ -97,27 +91,6 @@ export default defineComponent({
|
|||||||
packageVersion: version,
|
packageVersion: version,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
|
||||||
// changelog() {
|
|
||||||
// return this.store.changeList
|
|
||||||
// .map((changeItem) => {
|
|
||||||
// let itemChanges = [];
|
|
||||||
// if (changeItem.toRemove) return `<b class='text--accent'>${changeItem.name} -></b> do usunięcia`;
|
|
||||||
// for (let change in changeItem) {
|
|
||||||
// let propChange = change as ChangeProp;
|
|
||||||
// if (/^(id|name)$/.test(propChange)) continue;
|
|
||||||
// let value = typeof changeItem[propChange] === 'boolean' ? (changeItem[propChange] ? 'TAK' : 'NIE') : changeItem[propChange];
|
|
||||||
// if (propChange == 'availability') value = getAvailabilityValue(changeItem[propChange] as Availability);
|
|
||||||
// // if (propChange == 'routesInfo') value = this.getRouteNames(changeItem[propChange] as SceneryRoutesInfo[]);
|
|
||||||
// itemChanges.push(`<i style='color: white'>${(HeaderTypes as any)[propChange]}:</i> ${value ?? '-'}`);
|
|
||||||
// }
|
|
||||||
// console.log(itemChanges);
|
|
||||||
// return `<b class='text--accent'>${changeItem.name} -></b> ` + itemChanges.join('; ');
|
|
||||||
// })
|
|
||||||
// .join(' <br /> ');
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
confirmLoadData() {
|
confirmLoadData() {
|
||||||
const confirmed = confirm('Czy na pewno chcesz odświeżyć dane? Wszelkie niezapisane zmiany zostaną utracone!');
|
const confirmed = confirm('Czy na pewno chcesz odświeżyć dane? Wszelkie niezapisane zmiany zostaną utracone!');
|
||||||
@@ -186,6 +159,7 @@ export default defineComponent({
|
|||||||
routeSpeed: 0,
|
routeSpeed: 0,
|
||||||
routeTracks: 1,
|
routeTracks: 1,
|
||||||
routeName: 'Test',
|
routeName: 'Test',
|
||||||
|
hidden: false,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
checkpoints: '',
|
checkpoints: '',
|
||||||
@@ -196,7 +170,6 @@ export default defineComponent({
|
|||||||
this.store.changeList.push({ ...newSt });
|
this.store.changeList.push({ ...newSt });
|
||||||
// this.store.changeBackupList[newSt.id] = null;
|
// this.store.changeBackupList[newSt.id] = null;
|
||||||
this.store.searchedSceneryName = name;
|
this.store.searchedSceneryName = name;
|
||||||
this.store.unsavedChanges = true;
|
|
||||||
this.store.stationList.unshift(newSt);
|
this.store.stationList.unshift(newSt);
|
||||||
},
|
},
|
||||||
restoreList() {
|
restoreList() {
|
||||||
@@ -204,7 +177,6 @@ export default defineComponent({
|
|||||||
this.store.stationList = JSON.parse(JSON.stringify(this.store.backupList));
|
this.store.stationList = JSON.parse(JSON.stringify(this.store.backupList));
|
||||||
this.store.changeList = [];
|
this.store.changeList = [];
|
||||||
this.store.stationsToRemove = [];
|
this.store.stationsToRemove = [];
|
||||||
this.store.unsavedChanges = false;
|
|
||||||
this.store.searchedSceneryName = '';
|
this.store.searchedSceneryName = '';
|
||||||
},
|
},
|
||||||
clearInput() {
|
clearInput() {
|
||||||
@@ -299,19 +271,6 @@ label.notify {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.changelog {
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
div {
|
|
||||||
height: 200px;
|
|
||||||
|
|
||||||
overflow: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
h3 {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media screen and (max-width: 550px) {
|
@media screen and (max-width: 550px) {
|
||||||
.pane {
|
.pane {
|
||||||
|
|||||||
@@ -33,19 +33,21 @@ export default defineComponent({
|
|||||||
|
|
||||||
if (Object.keys(changeItem).length == 2 && changeItem.id)
|
if (Object.keys(changeItem).length == 2 && changeItem.id)
|
||||||
this.store.changeList = this.store.changeList.filter((item) => changeItem?.id != item.id);
|
this.store.changeList = this.store.changeList.filter((item) => changeItem?.id != item.id);
|
||||||
|
|
||||||
this.store.unsavedChanges = this.store.changeList.length != 0;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
addRemovalChange(sceneryData: SceneryRowItem) {
|
addRemovalChange(sceneryData: SceneryRowItem) {
|
||||||
const sceneryId = sceneryData.id;
|
const sceneryId = sceneryData.id;
|
||||||
|
|
||||||
|
// Sceneria niewpisana do bazy danych (id stworzone przez stronę)
|
||||||
|
if (sceneryId.startsWith('#')) {
|
||||||
|
this.store.changeList.filter((item) => item.id != sceneryId);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let changeItem = this.store.changeList.find((item) => item.id == sceneryId);
|
let changeItem = this.store.changeList.find((item) => item.id == sceneryId);
|
||||||
|
|
||||||
if (!changeItem) this.store.changeList.push({ id: sceneryId, name: sceneryData.name, toRemove: true });
|
if (!changeItem) this.store.changeList.push({ id: sceneryId, name: sceneryData.name, toRemove: true });
|
||||||
else changeItem['toRemove'] = true;
|
else changeItem['toRemove'] = true;
|
||||||
|
|
||||||
this.store.unsavedChanges = Object.keys(this.store.changeList).length != 0;
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
+4
-2
@@ -8,7 +8,6 @@ export const useStore = defineStore('store', {
|
|||||||
dataState: 'LOADING',
|
dataState: 'LOADING',
|
||||||
authState: AuthState.LOADING,
|
authState: AuthState.LOADING,
|
||||||
|
|
||||||
unsavedChanges: false,
|
|
||||||
stationList: [],
|
stationList: [],
|
||||||
backupList: [],
|
backupList: [],
|
||||||
stationsToRemove: [],
|
stationsToRemove: [],
|
||||||
@@ -39,7 +38,6 @@ export const useStore = defineStore('store', {
|
|||||||
this.dataState = 'LOADED';
|
this.dataState = 'LOADED';
|
||||||
this.backupList = JSON.parse(JSON.stringify(data));
|
this.backupList = JSON.parse(JSON.stringify(data));
|
||||||
this.stationList = data;
|
this.stationList = data;
|
||||||
this.unsavedChanges = false;
|
|
||||||
this.changeList = [];
|
this.changeList = [];
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
this.dataState = 'ERROR';
|
this.dataState = 'ERROR';
|
||||||
@@ -80,5 +78,9 @@ export const useStore = defineStore('store', {
|
|||||||
.sort((a, b) => (a.name > b.name ? 1 : -1))
|
.sort((a, b) => (a.name > b.name ? 1 : -1))
|
||||||
.filter((_, i) => i < state.maxVisibleResults);
|
.filter((_, i) => i < state.maxVisibleResults);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
unsavedChanges(state) {
|
||||||
|
return Object.keys(state.changeList).length != 0;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -101,7 +101,6 @@ export interface IStore {
|
|||||||
dataState: string;
|
dataState: string;
|
||||||
authState: AuthState;
|
authState: AuthState;
|
||||||
|
|
||||||
unsavedChanges: boolean;
|
|
||||||
stationList: SceneryRowItem[];
|
stationList: SceneryRowItem[];
|
||||||
backupList: SceneryRowItem[];
|
backupList: SceneryRowItem[];
|
||||||
stationsToRemove: string[];
|
stationsToRemove: string[];
|
||||||
|
|||||||
@@ -182,6 +182,8 @@ table {
|
|||||||
color: white;
|
color: white;
|
||||||
position: relative;
|
position: relative;
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
|
width: 100%;
|
||||||
|
min-width: 1600px;
|
||||||
}
|
}
|
||||||
|
|
||||||
table thead {
|
table thead {
|
||||||
|
|||||||
Reference in New Issue
Block a user