Skip to content

Commit

Permalink
refactor:update
Browse files Browse the repository at this point in the history
  • Loading branch information
gphper committed Aug 23, 2022
1 parent 4e39de7 commit 3e7e17a
Show file tree
Hide file tree
Showing 13 changed files with 46 additions and 38 deletions.
9 changes: 7 additions & 2 deletions router/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ package router
import (
"grm/controllers"
"grm/middleware"
"net/http"

"github.com/gin-contrib/gzip"
"github.com/gin-contrib/sessions"
Expand All @@ -21,7 +22,11 @@ func Init() *gin.Engine {
store := cookie.NewStore([]byte("goredismanagerphper"))
router.Use(middleware.StaticCache(), gzip.Gzip(gzip.DefaultCompression), sessions.Sessions("goredismanager", store))

app := router.Group("/api")
router.NoRoute(func(ctx *gin.Context) {
ctx.Redirect(http.StatusMovedPermanently, "/static/#")
})

app := router.Group("/grmapix")

userRouter := app.Group("/user")
{
Expand Down Expand Up @@ -97,7 +102,7 @@ func Init() *gin.Engine {
streamRouter.POST("/add", controllers.Stc.AddItem)
}

wsapp := router.Group("/ws")
wsapp := app.Group("/ws")
{
wsapp.GET("/cmd", controllers.Wsc.Ws)
}
Expand Down
8 changes: 4 additions & 4 deletions web/src/api/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,31 @@ import request from '@/utils/request';

export const getConnList = query => {
return request({
url: 'api/conn/list',
url: 'grmapix/conn/list',
method: 'get',
params: query
});
};

export const delConn = data => {
return request({
url: 'api/conn/del',
url: 'grmapix/conn/del',
method: 'post',
data
});
};

export const addConn = data => {
return request({
url: 'api/conn/add',
url: 'grmapix/conn/add',
method: 'post',
data
});
};

export const testConn = data => {
return request({
url: 'api/conn/test',
url: 'grmapix/conn/test',
method: 'post',
data
});
Expand Down
6 changes: 3 additions & 3 deletions web/src/api/hash.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@ import request from '@/utils/request';

export const showHash = data => {
return request({
url: 'api/hash/show',
url: 'grmapix/hash/show',
method: 'post',
data
});
};

export const delHash = data => {
return request({
url: 'api/hash/del',
url: 'grmapix/hash/del',
method: 'post',
data
});
};

export const addHash = data => {
return request({
url: 'api/hash/add',
url: 'grmapix/hash/add',
method: 'post',
data
});
Expand Down
18 changes: 9 additions & 9 deletions web/src/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,71 +2,71 @@ import request from '@/utils/request';

export const openDb = data => {
return request({
url: 'api/index/open',
url: 'grmapix/index/open',
method: 'post',
data
});
};

export const getKeys = data => {
return request({
url: 'api/index/getkeys',
url: 'grmapix/index/getkeys',
method: 'post',
data
});
};

export const getKeyType = data => {
return request({
url: 'api/index/getkeytype',
url: 'grmapix/index/getkeytype',
method: 'post',
data
});
};

export const delKeys = data => {
return request({
url: 'api/index/delkey',
url: 'grmapix/index/delkey',
method: 'post',
data
});
};

export const ttlKey = data => {
return request({
url: 'api/index/ttlkey',
url: 'grmapix/index/ttlkey',
method: 'post',
data
});
};

export const serInfo = data => {
return request({
url: 'api/index/serinfo',
url: 'grmapix/index/serinfo',
method: 'post',
data
});
}

export const luaRun = data => {
return request({
url: 'api/index/luarun',
url: 'grmapix/index/luarun',
method: 'post',
data
});
}

export const setting = data => {
return request({
url: 'api/index/setting',
url: 'grmapix/index/setting',
method: 'post',
data
});
}

export const getSetting = () => {
return request({
url: 'api/index/setting',
url: 'grmapix/index/setting',
method: 'get'
});
};
6 changes: 3 additions & 3 deletions web/src/api/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@ import request from '@/utils/request';

export const showList = data => {
return request({
url: 'api/list/show',
url: 'grmapix/list/show',
method: 'post',
data
});
};

export const delList = data => {
return request({
url: 'api/list/del',
url: 'grmapix/list/del',
method: 'post',
data
});
};

export const addList = data => {
return request({
url: 'api/list/add',
url: 'grmapix/list/add',
method: 'post',
data
});
Expand Down
6 changes: 3 additions & 3 deletions web/src/api/set.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@ import request from '@/utils/request';

export const showSet = data => {
return request({
url: 'api/set/show',
url: 'grmapix/set/show',
method: 'post',
data
});
};

export const delSet = data => {
return request({
url: 'api/set/del',
url: 'grmapix/set/del',
method: 'post',
data
});
};

export const addSet = data => {
return request({
url: 'api/set/add',
url: 'grmapix/set/add',
method: 'post',
data
});
Expand Down
6 changes: 3 additions & 3 deletions web/src/api/stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@ import request from '@/utils/request';

export const showStream = data => {
return request({
url: 'api/stream/show',
url: 'grmapix/stream/show',
method: 'post',
data
});
};

export const delStream = data => {
return request({
url: 'api/stream/del',
url: 'grmapix/stream/del',
method: 'post',
data
});
};

export const addStream = data => {
return request({
url: 'api/stream/add',
url: 'grmapix/stream/add',
method: 'post',
data
});
Expand Down
4 changes: 2 additions & 2 deletions web/src/api/string.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import request from '@/utils/request';

export const showString = data => {
return request({
url: 'api/string/show',
url: 'grmapix/string/show',
method: 'post',
data
});
};

export const addString = data => {
return request({
url: 'api/string/add',
url: 'grmapix/string/add',
method: 'post',
data
});
Expand Down
2 changes: 1 addition & 1 deletion web/src/api/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import request from '@/utils/request';

export const login = data => {
return request({
url: 'api/user/login',
url: 'grmapix/user/login',
method: 'post',
data
});
Expand Down
6 changes: 3 additions & 3 deletions web/src/api/zset.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@ import request from '@/utils/request';

export const showZset = data => {
return request({
url: 'api/zset/show',
url: 'grmapix/zset/show',
method: 'post',
data
});
};

export const delZset = data => {
return request({
url: 'api/zset/del',
url: 'grmapix/zset/del',
method: 'post',
data
});
};

export const addZset = data => {
return request({
url: 'api/zset/add',
url: 'grmapix/zset/add',
method: 'post',
data
});
Expand Down
2 changes: 1 addition & 1 deletion web/src/utils/terminal.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ const NewShell = (id,sk,db,name)=>{
}, 58*1000)
}

let socket = new WebSocket('ws://'+wsUrl+"/ws/cmd")
let socket = new WebSocket('ws://'+wsUrl+"/grmapix/ws/cmd")
socket.onopen = () => {
// 连接成功后
term.loadAddon(fitAddon)
Expand Down
10 changes: 6 additions & 4 deletions web/src/views/HomeView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import MainHeader from "@/components/MainHeader.vue";
import MainIndex from "@/components/MainIndex.vue";
import { ref } from '@vue/reactivity';
import { useStore } from "vuex";
import { watch } from '@vue/runtime-core';
import { onMounted, watch } from '@vue/runtime-core';
export default {
name: "HomeView",
components: {
Expand All @@ -25,16 +25,18 @@ export default {
setup(){
let loading = ref(false);
const store = useStore();
document.title = "go redis manager";
watch(
() => store.state.loadReq,
(value) => {
loading.value = value
}
)
onMounted(()=>{
document.title = "go redis manager";
})
return {
loading
}
Expand Down
1 change: 1 addition & 0 deletions web/src/views/LoginView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export default {
const formRef = ref(null)

onMounted(()=>{
document.title = "go redis manager";
top.value = document.documentElement.clientHeight/2-100 + 'px';
})

Expand Down

0 comments on commit 3e7e17a

Please sign in to comment.