<script setup>
import Keyword from "@/components/common/Keyword.vue";
import TTag from "@/components/ui/TTag.vue";

const props = defineProps(["v-log", "v-keyword"])
const {log, keyword} = (function () {
	return {
		log: props.vLog,
		keyword: props.vKeyword
	}
})()
</script>

<template>
	<div class="p-0 m-0">
		<span :class="{red:log.level == 'error', orange:log.level == 'warning', green: log.level == 'success'}"><span v-if="!log.isToday">[{{ log.createdTime }}]</span><strong v-if="log.isToday">[{{ log.createdTime }}]</strong><Keyword :v-word="keyword">[{{ log.tag }}]{{ log.description }}</Keyword></span> &nbsp;
		<TTag info v-if="log.count > 1" :class="{red:log.level == 'error', orange:log.level == 'warning'}">共{{ log.count }}条</TTag>
		<span v-if="log.server != null && log.server.id > 0"><a :href="'/servers/server?serverId=' + log.server.id"><TTag>{{ log.server.name }}</TTag></a></span>
	</div>
</template>

<style scoped>

</style>