[ui] improve index code

This commit is contained in:
Shahin 2024-02-27 08:03:45 +00:00
parent c382420b6e
commit e06ee26711
2 changed files with 11 additions and 12 deletions

View file

@ -104,15 +104,14 @@
<a-col :sm="24" :lg="12"> <a-col :sm="24" :lg="12">
<a-card hoverable> <a-card hoverable>
<b>{{ i18n "pages.index.operationHours" }}:</b> <b>{{ i18n "pages.index.operationHours" }}:</b>
<a-tag color="green">Xray [[ formatSecond(status.appStats.uptime) ]]</a-tag> <a-tag :color="status.xray.color">Xray: [[ formatSecond(status.appStats.uptime) ]]</a-tag>
<a-tag color="green">OS [[ formatSecond(status.uptime) ]]</a-tag> <a-tag color="green">OS: [[ formatSecond(status.uptime) ]]</a-tag>
</a-card> </a-card>
</a-col> </a-col>
<a-col :sm="24" :lg="12"> <a-col :sm="24" :lg="12">
<a-card hoverable> <a-card hoverable>
<b>{{ i18n "pages.index.xrayStatus" }}:</b> <b>{{ i18n "pages.index.xrayStatus" }}:</b>
<a-tag style="text-transform: capitalize;" :color="status.xray.color">[[ status.xray.state ]] <a-tag :color="status.xray.color">[[ status.xray.state ]]</a-tag>
</a-tag>
<a-popover v-if="status.xray.state === State.Error" <a-popover v-if="status.xray.state === State.Error"
:overlay-class-name="themeSwitcher.currentTheme"> :overlay-class-name="themeSwitcher.currentTheme">
<span slot="title" style="font-size: 12pt">An error occurred while running Xray <span slot="title" style="font-size: 12pt">An error occurred while running Xray
@ -153,10 +152,10 @@
<a-card hoverable> <a-card hoverable>
<b>{{ i18n "usage"}}:</b> <b>{{ i18n "usage"}}:</b>
<a-tag color="green"> <a-tag color="green">
RAM [[ sizeFormat(status.appStats.mem) ]] RAM: [[ sizeFormat(status.appStats.mem) ]]
</a-tag> </a-tag>
<a-tag color="green"> <a-tag color="green">
Threads [[ status.appStats.threads ]] Threads: [[ status.appStats.threads ]]
</a-tag> </a-tag>
</a-card> </a-card>
</a-col> </a-col>
@ -357,9 +356,9 @@
<script> <script>
const State = { const State = {
Running: "running", Running: "Running",
Stop: "stop", Stop: "Stop",
Error: "error", Error: "Error",
} }
Object.freeze(State); Object.freeze(State);

View file

@ -34,9 +34,9 @@ import (
type ProcessState string type ProcessState string
const ( const (
Running ProcessState = "running" Running ProcessState = "Running"
Stop ProcessState = "stop" Stop ProcessState = "Stop"
Error ProcessState = "error" Error ProcessState = "Error"
) )
type Status struct { type Status struct {