Reformat code

This commit is contained in:
2020-05-26 22:29:41 +03:00
parent 3c118341d3
commit f69a6e629b
33 changed files with 288 additions and 74 deletions

View File

@ -6,7 +6,11 @@
</h1>
<p>
<a href="#" v-on:click.prevent="pause">
pause <span v-if="shared.pauseSeconds && shared.pauseSeconds > 0" v-text="shared.pauseSeconds"></span>
pause
<span
v-if="shared.pauseSeconds && shared.pauseSeconds > 0"
v-text="shared.pauseSeconds"
></span>
</a>
<a href="#" v-on:click.prevent="toggleLogs">logs</a>
</p>

View File

@ -57,7 +57,8 @@ export function createStore(villageFactory: VillageFactory) {
state.logs = logs;
},
[Mutations.ToggleVillageEditor](state, visible?: any) {
state.views.villageEditor = visible === undefined ? !state.views.villageEditor : !!visible;
state.views.villageEditor =
visible === undefined ? !state.views.villageEditor : !!visible;
},
[Mutations.SetVillageSettings](state, settings) {
state.villageSettings = settings;
@ -90,9 +91,11 @@ export function createStore(villageFactory: VillageFactory) {
const villageName = state.villageSettings.villageName;
const newSettings: VillageSettings = {
sendResourcesThreshold:
state.villageSettings.sendResourcesThreshold || VillageSettingsDefaults.sendResourcesThreshold,
state.villageSettings.sendResourcesThreshold ||
VillageSettingsDefaults.sendResourcesThreshold,
sendResourcesTimeout:
state.villageSettings.sendResourcesTimeout || VillageSettingsDefaults.sendResourcesTimeout,
state.villageSettings.sendResourcesTimeout ||
VillageSettingsDefaults.sendResourcesTimeout,
sendResourcesMultiplier:
state.villageSettings.sendResourcesMultiplier ||
VillageSettingsDefaults.sendResourcesMultiplier,

View File

@ -9,14 +9,32 @@
</p>
<div class="container">
<table class="task-table">
<tr v-for="task in shared.taskList" class="task-item" :class="{ 'this-village': isThisVillageTask(task) }">
<td class="time-column" :title="formatDate(task.ts) + ', ' + task.id" v-text="formatDate(task.ts)"></td>
<tr
v-for="task in shared.taskList"
class="task-item"
:class="{ 'this-village': isThisVillageTask(task) }"
>
<td
class="time-column"
:title="formatDate(task.ts) + ', ' + task.id"
v-text="formatDate(task.ts)"
></td>
<td class="actions-column">
<a href="#" title="Remove task" class="remove-action" v-on:click.prevent="onRemove(task.id)">&times;</a>
<a
href="#"
title="Remove task"
class="remove-action"
v-on:click.prevent="onRemove(task.id)"
>&times;</a
>
</td>
<td class="village-column" v-text="task.args.villageId || ''"></td>
<td class="name-column" :title="task.name" v-text="task.name"></td>
<td class="args-column" :title="JSON.stringify(task.args)" v-text="JSON.stringify(task.args)"></td>
<td
class="args-column"
:title="JSON.stringify(task.args)"
v-text="JSON.stringify(task.args)"
></td>
</tr>
</table>
</div>

View File

@ -15,7 +15,11 @@
<tbody>
<template v-for="villageState in shared.villageStates">
<tr class="normal-line top-line">
<td class="right" :class="{ active: villageState.village.active }" :title="villageHint(villageState)">
<td
class="right"
:class="{ active: villageState.village.active }"
:title="villageHint(villageState)"
>
{{ villageState.village.name }}
[<a href="#" v-on:click.prevent="openEditor(villageState.id)">ред</a>]:
</td>
@ -146,12 +150,18 @@
v-if="s.id !== villageState.id"
class="village-quick-link"
:href="marketPath(villageState.village, s.village)"
:title="'Отправить ресурсы из ' + villageState.village.name + ' в ' + s.village.name"
:title="
'Отправить ресурсы из ' + villageState.village.name + ' в ' + s.village.name
"
>$->{{ s.village.name }}</a
>
<a class="village-quick-link" :href="quartersPath(villageState.village)">Казармы</a>
<a class="village-quick-link" :href="horseStablePath(villageState.village)">Конюшни</a>
<a class="village-quick-link" :href="collectionPointPath(villageState.village)">Войска</a>
<a class="village-quick-link" :href="horseStablePath(villageState.village)"
>Конюшни</a
>
<a class="village-quick-link" :href="collectionPointPath(villageState.village)"
>Войска</a
>
</td>
</tr>