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 | <template> | 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 | <component :is="currentView" /> | 22 | <component :is="currentView" /> |
| 17 | </template> | 23 | </template> |
| @@ -21,9 +27,11 @@ import { ref, computed } from 'vue' | @@ -21,9 +27,11 @@ import { ref, computed } from 'vue' | ||
| 21 | import NotFound from './components/NotFound.vue' | 27 | import NotFound from './components/NotFound.vue' |
| 22 | import Home from './components/PlayerEdit.vue' | 28 | import Home from './components/PlayerEdit.vue' |
| 23 | import PlayerQuery from './components/PlayerQuery.vue' | 29 | import PlayerQuery from './components/PlayerQuery.vue' |
| 30 | +import Cicd from './components/Cicd.vue' | ||
| 24 | const routes = { | 31 | const routes = { |
| 25 | '/': Home, | 32 | '/': Home, |
| 26 | '/playerquery': PlayerQuery, | 33 | '/playerquery': PlayerQuery, |
| 34 | + '/cicd': Cicd, | ||
| 27 | } | 35 | } |
| 28 | const currentPath = ref(window.location.hash) | 36 | const currentPath = ref(window.location.hash) |
| 29 | window.addEventListener('hashchange', () => { | 37 | window.addEventListener('hashchange', () => { |
| @@ -0,0 +1,35 @@ | @@ -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,15 +267,20 @@ export default { | ||
| 267 | }, | 267 | }, |
| 268 | data() { | 268 | data() { |
| 269 | return { | 269 | return { |
| 270 | - servers: [{ | 270 | + servers: [ |
| 271 | + { | ||
| 271 | value: '本机', | 272 | value: '本机', |
| 272 | - }, { | 273 | + }, |
| 274 | + { | ||
| 273 | value: '内网测试服', | 275 | value: '内网测试服', |
| 274 | - }, { | 276 | + }, |
| 277 | + { | ||
| 275 | value: '审核服', | 278 | value: '审核服', |
| 276 | - }, { | ||
| 277 | - value: '正式服', | ||
| 278 | - }], | 279 | + }, |
| 280 | + // { | ||
| 281 | + // value: '正式服', | ||
| 282 | + // }, | ||
| 283 | + ], | ||
| 279 | serversDict: { | 284 | serversDict: { |
| 280 | '本机': 'http://localhost:9002/api/gm/action', | 285 | '本机': 'http://localhost:9002/api/gm/action', |
| 281 | '内网测试服': 'http://172.10.10.18:9002/api/gm/action', | 286 | '内网测试服': 'http://172.10.10.18:9002/api/gm/action', |
src/main.js
| @@ -11,7 +11,7 @@ import 'element-plus/dist/index.css' | @@ -11,7 +11,7 @@ import 'element-plus/dist/index.css' | ||
| 11 | var app = createApp(App) | 11 | var app = createApp(App) |
| 12 | 12 | ||
| 13 | // app.config.globalProperties.$gvEnv = 'dev'; | 13 | // app.config.globalProperties.$gvEnv = 'dev'; |
| 14 | -app.config.globalProperties.$gvEnv = 'prod'; | 14 | +app.config.globalProperties.$gvEnv = 'dev'; |
| 15 | 15 | ||
| 16 | if (app.config.globalProperties.$gvEnv == "prod"){ | 16 | if (app.config.globalProperties.$gvEnv == "prod"){ |
| 17 | app = createApp(AppProd) | 17 | app = createApp(AppProd) |