-
Notifications
You must be signed in to change notification settings - Fork 26
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
Showing
21 changed files
with
234 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,33 @@ | ||
<script lang="ts" setup> | ||
import FooterView from "./FooterView.vue"; | ||
import { whm_get, whm_post } from '@/components/Whm.vue'; | ||
import { onMounted, ref } from 'vue'; | ||
interface ConnectPerIp { | ||
ip: string, | ||
count: number, | ||
} | ||
const connectPerIps = ref(<ConnectPerIp[]>[]) | ||
const maxPerIp = ref(0); | ||
function flushConnectPerIp() { | ||
whm_get("list_connect_per_ip").then((json) => { | ||
connectPerIps.value = json.result.info; | ||
maxPerIp.value = json.result.max_per_ip; | ||
}); | ||
} | ||
onMounted(flushConnectPerIp) | ||
</script> | ||
<template> | ||
connect_per_ip | ||
每IP连接信息({{ maxPerIp }}) [<a href="#" @click="flushConnectPerIp()">刷新</a>] | ||
<table border="1" cellspacing="0"> | ||
<tr> | ||
<th>ip地址</th> | ||
<th>连接数</th> | ||
</tr> | ||
<tr v-for="info in connectPerIps"> | ||
<td>{{ info.ip }}</td> | ||
<td>{{ info.count }}</td> | ||
</tr> | ||
</table> | ||
<FooterView /> | ||
</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
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 |
---|---|---|
@@ -1,7 +1,59 @@ | ||
<script lang="ts" setup> | ||
import FooterView from "./FooterView.vue"; | ||
import { whm_get, whm_post } from '@/components/Whm.vue'; | ||
import { onMounted, ref } from 'vue'; | ||
interface Process { | ||
app: string, | ||
pid: number, | ||
cpu_usage: number, | ||
low_pri: number, | ||
refs: number, | ||
size: number, | ||
total_run: number, | ||
} | ||
interface ProcessGroup { | ||
name: string, | ||
process: Process[] | ||
} | ||
const processGroups = ref(<ProcessGroup[]>[]) | ||
function flushProcess() { | ||
whm_get("list_process").then((json) => { | ||
processGroups.value = json.result.group; | ||
}); | ||
} | ||
function kill_process(name: string, process: Process) { | ||
if (!confirm("确定关闭进程 " + process.pid + "吗?")) { | ||
return; | ||
} | ||
whm_post("kill_process", { name: name, app: process.app, pid: process.pid.toString() }).then((json) => { | ||
flushProcess(); | ||
}) | ||
} | ||
onMounted(flushProcess) | ||
</script> | ||
<template> | ||
process | ||
<FooterView/> | ||
<div>子进程信息 [<a href=# @click="flushProcess()">刷新</a>]</div> | ||
<template v-for="group in processGroups"> | ||
{{ group.name }} ({{ group.process.length }}) | ||
<table border="1" cellspacing="0"> | ||
<tr> | ||
<th>操作</th> | ||
<th>用户名</th> | ||
<th>pid</th> | ||
<th>使用数</th> | ||
<th>空闲数</th> | ||
<th>运行时间</th> | ||
</tr> | ||
<tr v-for="process in group.process"> | ||
<td><a href=# @click="kill_process(group.name, process)">关闭</a></td> | ||
<td>{{ process.app }}</td> | ||
<td>{{ process.pid }}</td> | ||
<td>{{ process.refs }}</td> | ||
<td>{{ process.size }}</td> | ||
<td>{{ process.total_run }}</td> | ||
</tr> | ||
</table> | ||
</template> | ||
<FooterView /> | ||
</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
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
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
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
Oops, something went wrong.