8 Commits

12 changed files with 46 additions and 26 deletions

View File

@@ -372,7 +372,6 @@ func applySSL(website model.Website, websiteSSL model.WebsiteSSL, req request.We
config := nginxFull.SiteConfig.Config
server := config.FindServers()[0]
server.UpdateListen("443", website.DefaultServer, "ssl")
server.UpdateListen("[::]:443", website.DefaultServer, "ssl")
switch req.HttpConfig {
case constant.HTTPSOnly:
@@ -381,11 +380,9 @@ func applySSL(website model.Website, websiteSSL model.WebsiteSSL, req request.We
server.RemoveDirective("if", []string{"($scheme"})
case constant.HTTPToHTTPS:
server.UpdateListen("80", website.DefaultServer)
server.UpdateListen("[::]:80", website.DefaultServer)
server.AddHTTP2HTTPS()
case constant.HTTPAlso:
server.UpdateListen("80", website.DefaultServer)
server.UpdateListen("[::]:80", website.DefaultServer)
server.RemoveDirective("if", []string{"($scheme"})
}

View File

@@ -5,7 +5,7 @@ const (
SessionName = "psession"
AuthMethodJWT = "jwt"
JWTHeaderName = "Authorization"
JWTHeaderName = "PanelAuthorization"
JWTBufferTime = 3600
JWTIssuer = "1Panel"

View File

@@ -99,7 +99,7 @@ func NewFileInfo(op FileOption) (*FileInfo, error) {
}
func (f *FileInfo) search(search string, count int) (files []FileSearchInfo, total int, err error) {
cmd := exec.Command("find", f.Path, "-name", search)
cmd := exec.Command("find", f.Path, "-name", fmt.Sprintf("*%s*", search))
output, err := cmd.StdoutPipe()
if err != nil {
return

View File

@@ -1,7 +1,5 @@
server {
listen 80;
listen [::]:80;
server_name ko.wp-1.com;
index index.php index.html index.htm default.php default.htm default.html;

View File

@@ -9,11 +9,15 @@
</template>
</Header>
</template>
<el-descriptions border :column="1" v-if="!edit">
<el-descriptions-item v-for="(param, key) in params" :label="getLabel(param)" :key="key">
<span>{{ param.showValue && param.showValue != '' ? param.showValue : param.value }}</span>
</el-descriptions-item>
</el-descriptions>
<el-row v-if="!edit">
<el-col :span="22" :offset="1">
<el-descriptions border :column="1">
<el-descriptions-item v-for="(param, key) in params" :label="getLabel(param)" :key="key">
<span>{{ param.showValue && param.showValue != '' ? param.showValue : param.value }}</span>
</el-descriptions-item>
</el-descriptions>
</el-col>
</el-row>
<el-row v-else v-loading="loading">
<el-col :span="22" :offset="1">
<el-alert :title="$t('app.updateHelper')" type="warning" :closable="false" />

View File

@@ -87,8 +87,10 @@ defineExpose({
.h-app-card {
cursor: pointer;
padding: 10px 15px;
margin-right: 10px;
.h-app-content {
padding-left: 15px;
.h-app-title {
font-weight: 500;
font-size: 15px;

View File

@@ -290,7 +290,9 @@ const freshChart = (chartName: string, Title: string, Data: number) => {
},
],
};
myChart.setOption(option, true);
nextTick(function () {
myChart.setOption(option, true);
});
};
function loadStatus(val: number) {

View File

@@ -6,6 +6,7 @@
destroy-on-close
width="70%"
@opened="onOpen"
:top="'5vh'"
>
<el-form :inline="true" :model="config">
<el-form-item :label="$t('file.theme')">
@@ -24,8 +25,8 @@
</el-select>
</el-form-item>
</el-form>
<div class="coder-editor" v-loading="loading">
<div id="codeBox" style="height: 60vh"></div>
<div v-loading="loading">
<div id="codeBox" style="height: 55vh"></div>
</div>
<template #footer>
<span class="dialog-footer">
@@ -214,8 +215,8 @@ onBeforeUnmount(() => {
defineExpose({ acceptParams });
</script>
<style lang="scss">
.coder-editor {
margin-top: 10px;
<style>
.dialog-top {
top: 0;
}
</style>

View File

@@ -90,7 +90,7 @@
clearable
@clear="search()"
@keydown.enter="search()"
:placeholder="req.containSub ? $t('file.searchHelper') : $t('file.search')"
:placeholder="$t('file.search')"
>
<template #prepend>
<el-checkbox v-model="req.containSub">

View File

@@ -1,5 +1,5 @@
<template>
<div v-loading="loading">
<div>
<el-form-item :label="$t('website.rewriteMode')">
<el-select v-model="req.name" filterable @change="getRewriteConfig(req.name)">
<el-option :label="$t('website.current')" :value="'current'"></el-option>
@@ -11,8 +11,9 @@
></el-option>
</el-select>
</el-form-item>
<codemirror
<Codemirror
ref="codeRef"
v-loading="loading"
:autofocus="true"
placeholder=""
:indent-with-tab="true"
@@ -37,7 +38,7 @@
</template>
<script lang="ts" setup>
import { computed, onMounted, reactive, ref } from 'vue';
import { computed, nextTick, onMounted, reactive, ref } from 'vue';
import { Codemirror } from 'vue-codemirror';
import { oneDark } from '@codemirror/theme-one-dark';
import { StreamLanguage } from '@codemirror/language';
@@ -48,8 +49,9 @@ import { MsgSuccess } from '@/utils/message';
import i18n from '@/lang';
const loading = ref(false);
const content = ref('');
const content = ref(' ');
const extensions = [StreamLanguage.define(nginx), oneDark];
const codeRef = ref();
const props = defineProps({
id: {
@@ -69,7 +71,7 @@ const req = reactive({
const update = reactive({
websiteID: id.value,
content: '',
content: 'd',
name: '',
});
@@ -80,12 +82,24 @@ const getRewriteConfig = async (rewrite: string) => {
try {
const res = await GetRewriteConfig(req);
content.value = res.data.content;
if (res.data.content == '') {
content.value = ' ';
}
setCursorPosition();
} catch (error) {
} finally {
loading.value = false;
}
};
const setCursorPosition = () => {
nextTick(() => {
const codeMirrorInstance = codeRef.value?.codemirror;
codeMirrorInstance?.setCursor(0, 0);
});
};
const submit = async () => {
update.name = req.name;
update.websiteID = id.value;

2
go.mod
View File

@@ -93,7 +93,7 @@ require (
github.com/dgraph-io/ristretto v0.1.1 // indirect
github.com/distribution/distribution/v3 v3.0.0-20230223072852-e5d5810851d1 // indirect
github.com/docker/buildx v0.10.4 // indirect
github.com/docker/distribution v2.8.1+incompatible // indirect
github.com/docker/distribution v2.8.2+incompatible // indirect
github.com/docker/docker-credential-helpers v0.7.0 // indirect
github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c // indirect
github.com/docker/go-metrics v0.0.1 // indirect

2
go.sum
View File

@@ -201,6 +201,8 @@ github.com/docker/compose/v2 v2.17.2/go.mod h1:h5uld3t0RsL5h8rtkRaJtrFLJ3TJ9GOKd
github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68=
github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8=
github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/docker v23.0.3+incompatible h1:9GhVsShNWz1hO//9BNg/dpMnZW25KydO4wtVxWAIbho=
github.com/docker/docker v23.0.3+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker-credential-helpers v0.7.0 h1:xtCHsjxogADNZcdv1pKUHXryefjlVRqWqIhk/uXJp0A=