fix: 程序状态

This commit is contained in:
Rewrite0
2023-05-12 20:32:39 +08:00
parent 857e853046
commit cacb3da945
2 changed files with 5 additions and 3 deletions

View File

@@ -11,6 +11,8 @@ export const appStop = () => axios.get('api/v1/stop');
/** 状态 */
export async function appStatus() {
const { data } = await axios.get<boolean>('api/v1/status');
return data;
const { data } = await axios.get<{ status: 'stop' | 'running' }>(
'api/v1/status'
);
return data.status !== 'stop';
}

View File

@@ -19,7 +19,7 @@ const { status } = storeToRefs(programStore());
运行状态:
<div
class="i-carbon:dot-mark"
:class="{ 'text-red': !status, 'text-green': status }"
:class="[status ? 'text-green' : 'text-red']"
></div>
</div>
</el-header>