-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
951adb0
commit d7a2115
Showing
2 changed files
with
31 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,26 @@ | ||
<script lang="ts"> | ||
<script setup lang="ts"> | ||
import { LogLevel } from "@/types/SettingTypes"; | ||
import { computed } from "vue"; | ||
export default { | ||
name: "PhotonLogEntry", | ||
props: { | ||
index: { | ||
type: Number | ||
}, | ||
source: { | ||
type: Object, | ||
default() { | ||
return {}; | ||
} | ||
} | ||
}, | ||
methods: { | ||
getLogColor(level: LogLevel): string { | ||
switch (level) { | ||
case LogLevel.ERROR: | ||
return "red"; | ||
case LogLevel.WARN: | ||
return "yellow"; | ||
case LogLevel.INFO: | ||
return "light-blue"; | ||
case LogLevel.DEBUG: | ||
return "white"; | ||
} | ||
return ""; | ||
} | ||
const props = defineProps<{ source: any }>(); | ||
const logColorClass = computed<string>(() => { | ||
switch (props.source.level) { | ||
case LogLevel.ERROR: | ||
return "red--text"; | ||
case LogLevel.WARN: | ||
return "yellow--text"; | ||
case LogLevel.INFO: | ||
return "light-blue--text"; | ||
case LogLevel.DEBUG: | ||
return "white--text"; | ||
} | ||
}; | ||
return ""; | ||
}); | ||
</script> | ||
|
||
<template> | ||
<div :class="[getLogColor(source.level) + '--text', 'log-item']"> | ||
<div :class="logColorClass"> | ||
{{ source.message }} | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters