-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Accept Merge Request #100: (testing -> master)
Merge Request: release Created By: @frank Accepted By: @frank URL: https://andoromeda.coding.net/p/matataki-management/d/matataki-management/git/merge/100
- Loading branch information
Showing
5 changed files
with
84 additions
and
27 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
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
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
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 |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<template> | ||
<div class="reboot-page"> | ||
<h1 class="title">重启服务</h1> | ||
<el-alert | ||
title="仅在无法完成后端交互时使用" | ||
type="warning"> | ||
</el-alert> | ||
<p>先 Stop ,等待停止完成且返回结果无异常后,再操作 Start。</p> | ||
<el-button | ||
:disabled="isSendingCmd" | ||
type="danger" | ||
@click="trigger('start')" | ||
>Start</el-button> | ||
<el-button | ||
:disabled="isSendingCmd" | ||
type="danger" | ||
@click="trigger('stop')" | ||
>Stop</el-button> | ||
<div v-if="apiResult" class="output"> | ||
<h2 class="subtitle">操作结果</h2> | ||
<pre class="cmd-output">{{ apiResult }}</pre> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import axios from 'axios' | ||
export default { | ||
name: 'Reboot', | ||
data: () => ({ | ||
apiResult: null, | ||
isSendingCmd: false | ||
}), | ||
methods: { | ||
async trigger(scriptName) { | ||
try { | ||
this.isSendingCmd = true | ||
const result = await axios.get('/_switch_status_api/', { | ||
params: { | ||
scriptName | ||
} | ||
}) | ||
this.apiResult = result.cmdExecResult | ||
} catch (error) { | ||
if (axios.isAxiosError(error)) { | ||
this.$message.error(`Server Error: ${error.response.data}`) | ||
} else { | ||
this.$message.error(`Error when switching server: ${error}`) | ||
} | ||
} finally { | ||
this.isSendingCmd = false | ||
} | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
.reboot-page { | ||
margin: 2rem; | ||
} | ||
.cmd-output { | ||
background: black; | ||
color: gray; | ||
} | ||
</style> |
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