Commit 5dff2b8c19513b8b8ee72dbdef52eff21f5131c7
1 parent
07c85ada
Exists in
master
【工具】GM工具
Showing
4 changed files
with
66 additions
and
18 deletions
Show diff stats
src/App.vue
| 1 | 1 | <template> |
| 2 | 2 | |
| 3 | - <nav class="navbar navbar-expand-sm bg-primary navbar-dark"> | |
| 4 | - <a class="navbar-brand" href="#">梦幻合合合</a> | |
| 3 | + <div class="container-fluid"> | |
| 4 | + <nav class="navbar navbar-expand-sm bg-primary navbar-dark"> | |
| 5 | + <a class="navbar-brand mx-3">梦幻合合合</a> | |
| 5 | 6 | |
| 6 | - <ul class="navbar-nav"> | |
| 7 | - <li class="nav-item"> | |
| 8 | - <a class="nav-link" href="#">玩家修改</a> | |
| 9 | - </li> | |
| 10 | - <li class="nav-item"> | |
| 11 | - <a class="nav-link" href="#/playerquery">玩家查询</a> | |
| 12 | - </li> | |
| 13 | - </ul> | |
| 14 | - </nav> | |
| 7 | + <ul class="navbar-nav"> | |
| 8 | + <li class="nav-item"> | |
| 9 | + <a class="nav-link" href="#">玩家修改</a> | |
| 10 | + </li> | |
| 11 | + <li class="nav-item"> | |
| 12 | + <a class="nav-link" href="#/playerquery">玩家查询</a> | |
| 13 | + </li> | |
| 14 | + <li class="nav-item"> | |
| 15 | + <a class="nav-link" href="#/cicd">CICD</a> | |
| 16 | + </li> | |
| 17 | + </ul> | |
| 18 | + </nav> | |
| 19 | + | |
| 20 | + </div> | |
| 15 | 21 | |
| 16 | 22 | <component :is="currentView" /> |
| 17 | 23 | </template> |
| ... | ... | @@ -21,9 +27,11 @@ import { ref, computed } from 'vue' |
| 21 | 27 | import NotFound from './components/NotFound.vue' |
| 22 | 28 | import Home from './components/PlayerEdit.vue' |
| 23 | 29 | import PlayerQuery from './components/PlayerQuery.vue' |
| 30 | +import Cicd from './components/Cicd.vue' | |
| 24 | 31 | const routes = { |
| 25 | 32 | '/': Home, |
| 26 | 33 | '/playerquery': PlayerQuery, |
| 34 | + '/cicd': Cicd, | |
| 27 | 35 | } |
| 28 | 36 | const currentPath = ref(window.location.hash) |
| 29 | 37 | window.addEventListener('hashchange', () => { | ... | ... |
| ... | ... | @@ -0,0 +1,35 @@ |
| 1 | +<template> | |
| 2 | + <button type="button" class="btn btn-info btn-block" @click="onHtRestart($event)">重启海滩测试服</button> | |
| 3 | +</template> | |
| 4 | + | |
| 5 | +<script> | |
| 6 | +import axios from 'axios'; | |
| 7 | +import moment from 'moment'; | |
| 8 | +export default { | |
| 9 | + name: 'Cicd', | |
| 10 | + props: { | |
| 11 | + msg: String | |
| 12 | + }, | |
| 13 | + data() { | |
| 14 | + return { | |
| 15 | + | |
| 16 | + } | |
| 17 | + }, | |
| 18 | + mounted: function () { | |
| 19 | + }, | |
| 20 | + methods: { | |
| 21 | + onHtRestart(event) { | |
| 22 | + // 发起 GET 请求 | |
| 23 | + axios.get('http://172.10.10.18:5001/cicd/ht/bat/?name=ht_restart') | |
| 24 | + .then(response => { | |
| 25 | + // 请求成功处理 | |
| 26 | + console.log(response.data); | |
| 27 | + }) | |
| 28 | + .catch(error => { | |
| 29 | + // 请求失败处理 | |
| 30 | + console.error(error); | |
| 31 | + }); | |
| 32 | + }, | |
| 33 | + } | |
| 34 | +} | |
| 35 | +</script> | ... | ... |
src/components/PlayerEdit.vue
| ... | ... | @@ -267,15 +267,20 @@ export default { |
| 267 | 267 | }, |
| 268 | 268 | data() { |
| 269 | 269 | return { |
| 270 | - servers: [{ | |
| 270 | + servers: [ | |
| 271 | + { | |
| 271 | 272 | value: '本机', |
| 272 | - }, { | |
| 273 | + }, | |
| 274 | + { | |
| 273 | 275 | value: '内网测试服', |
| 274 | - }, { | |
| 276 | + }, | |
| 277 | + { | |
| 275 | 278 | value: '审核服', |
| 276 | - }, { | |
| 277 | - value: '正式服', | |
| 278 | - }], | |
| 279 | + }, | |
| 280 | + // { | |
| 281 | + // value: '正式服', | |
| 282 | + // }, | |
| 283 | + ], | |
| 279 | 284 | serversDict: { |
| 280 | 285 | '本机': 'http://localhost:9002/api/gm/action', |
| 281 | 286 | '内网测试服': 'http://172.10.10.18:9002/api/gm/action', | ... | ... |
src/main.js
| ... | ... | @@ -11,7 +11,7 @@ import 'element-plus/dist/index.css' |
| 11 | 11 | var app = createApp(App) |
| 12 | 12 | |
| 13 | 13 | // app.config.globalProperties.$gvEnv = 'dev'; |
| 14 | -app.config.globalProperties.$gvEnv = 'prod'; | |
| 14 | +app.config.globalProperties.$gvEnv = 'dev'; | |
| 15 | 15 | |
| 16 | 16 | if (app.config.globalProperties.$gvEnv == "prod"){ |
| 17 | 17 | app = createApp(AppProd) | ... | ... |