Skip to content

Commit da5d696

Browse files
committed
improve console
1 parent 017ae33 commit da5d696

File tree

10 files changed

+63
-6
lines changed

10 files changed

+63
-6
lines changed

console/src/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ import { RouterLink, RouterView } from 'vue-router'
4444
</tr>
4545
<tr>
4646
<td>
47-
<a href="/">旧版</a>
47+
<a href="/old">旧版</a>
4848
</td>
4949
</tr>
5050
</table>

console/src/router/index.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,31 @@ const router = createRouter({
5858
path: 'cache',
5959
name: 'cache',
6060
component: ()=>import('../views/config/CacheView.vue'),
61+
},
62+
{
63+
path: 'log',
64+
name: 'log',
65+
component: ()=>import('../views/config/LogView.vue'),
66+
},
67+
{
68+
path: 'io',
69+
name: 'io',
70+
component: ()=>import('../views/config/IoView.vue'),
71+
},
72+
{
73+
path: 'other',
74+
name: 'other',
75+
component: ()=>import('../views/config/OtherView.vue'),
76+
},
77+
{
78+
path: 'manage',
79+
name: 'manage',
80+
component: ()=>import('../views/config/ManageView.vue'),
81+
},
82+
{
83+
path: 'resource',
84+
name: 'resource',
85+
component: ()=>import('../views/config/ResourceView.vue'),
6186
}
6287
]
6388
},
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
<script lang="ts" setup>
22
</script>
33
<template>
4-
<table class="table table-bordered" width="90%">
5-
<tr><td>ddd</td><td>kkk</td></tr>
6-
<tr><td>ddd</td><td>kkk</td></tr>
7-
</table>
4+
connect_per_ip
85
</template>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<script lang="ts" setup>
2+
</script>
3+
<template>
4+
io
5+
</template>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<script lang="ts" setup>
2+
</script>
3+
<template>
4+
log
5+
</template>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<script lang="ts" setup>
2+
</script>
3+
<template>
4+
manage
5+
</template>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<script lang="ts" setup>
2+
</script>
3+
<template>
4+
other
5+
</template>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<script lang="ts" setup>
2+
</script>
3+
<template>
4+
resource
5+
</template>

src/KHttpManage.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1920,7 +1920,7 @@ function sortrq(index)\
19201920
void init_manager_handler() {
19211921
KHttpManage::handler.add(_KS("/*"), [](kgl_str_t* path, void* data, KHttpRequest* rq, kgl_input_stream* in, kgl_output_stream* out) -> KGL_RESULT {
19221922
KHttpManage* hm = (KHttpManage*)data;
1923-
if (path->len == 1 && *path->data == '/') {
1923+
if (strcmp(path->data,"/")==0 || strcmp(path->data,"old")==0) {
19241924
hm->sendMainPage();
19251925
return KGL_OK;
19261926
}

src/work.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,13 @@ KGL_RESULT stageHttpManage(KHttpRequest* rq) {
451451
klog(KLOG_NOTICE, "[ADMIN_SUCCESS]%s %s%s%s\n",
452452
ips, rq->sink->data.raw_url.path,
453453
(rq->sink->data.raw_url.param ? "?" : ""), (rq->sink->data.raw_url.param ? rq->sink->data.raw_url.param : ""));
454+
bool is_static = false;
455+
if (strcmp(rq->sink->data.url->path, "/") == 0) {
456+
KFileName file;
457+
if (file.setName(conf.sysHost->doc_root.c_str(), "/index.html", FOLLOW_LINK_ALL)) {
458+
is_static = true;
459+
}
460+
}
454461
char* ext_file = strrchr(rq->sink->data.url->path, '.');
455462
if (ext_file &&
456463
(strcmp(ext_file, ".whm") == 0 ||
@@ -459,6 +466,9 @@ KGL_RESULT stageHttpManage(KHttpRequest* rq) {
459466
strcmp(ext_file, ".gif") == 0 ||
460467
strcmp(ext_file, ".css") == 0)
461468
) {
469+
is_static = true;
470+
}
471+
if (is_static) {
462472
KBIT_CLR(rq->sink->data.flags, RQ_HAS_AUTHORIZATION);
463473
assert(rq->is_source_empty());
464474
auto svh = conf.sysHost->getFirstSubVirtualHost();

0 commit comments

Comments
 (0)