mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-11 02:33:51 +00:00
composition: botstatus
This commit is contained in:
parent
de0838b97b
commit
166eef6a93
|
@ -39,25 +39,30 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Component, Vue } from 'vue-property-decorator';
|
|
||||||
import { namespace } from 'vuex-class';
|
|
||||||
import { BotState, ProfitInterface } from '@/types';
|
|
||||||
import { BotStoreGetters } from '@/store/modules/ftbot';
|
import { BotStoreGetters } from '@/store/modules/ftbot';
|
||||||
|
|
||||||
import { formatPercent } from '@/shared/formatters';
|
import { formatPercent } from '@/shared/formatters';
|
||||||
import DateTimeTZ from '@/components/general/DateTimeTZ.vue';
|
import DateTimeTZ from '@/components/general/DateTimeTZ.vue';
|
||||||
import StoreModules from '@/store/storeSubModules';
|
import StoreModules from '@/store/storeSubModules';
|
||||||
|
|
||||||
const ftbot = namespace(StoreModules.ftbot);
|
import { defineComponent } from '@vue/composition-api';
|
||||||
|
import { useNamespacedGetters } from 'vuex-composition-helpers';
|
||||||
|
|
||||||
@Component({ components: { DateTimeTZ } })
|
export default defineComponent({
|
||||||
export default class BotStatus extends Vue {
|
name: 'BotStatus',
|
||||||
@ftbot.Getter [BotStoreGetters.version]: string;
|
components: { DateTimeTZ },
|
||||||
|
setup() {
|
||||||
@ftbot.Getter [BotStoreGetters.profit]: ProfitInterface | {};
|
const { version, profit, botState } = useNamespacedGetters(StoreModules.ftbot, [
|
||||||
|
BotStoreGetters.version,
|
||||||
@ftbot.Getter [BotStoreGetters.botState]?: BotState;
|
BotStoreGetters.profit,
|
||||||
|
BotStoreGetters.botState,
|
||||||
formatPercent = formatPercent;
|
]);
|
||||||
}
|
return {
|
||||||
|
version,
|
||||||
|
profit,
|
||||||
|
botState,
|
||||||
|
formatPercent,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user