Compare commits
8 Commits
dev
...
release-1.
Author | SHA1 | Date | |
---|---|---|---|
![]() |
53756c382d | ||
![]() |
8533a71670 | ||
![]() |
6b3c06a057 | ||
![]() |
4fd87568cd | ||
![]() |
56f8caf561 | ||
![]() |
7d2f7a8d3b | ||
![]() |
01a9589be9 | ||
![]() |
72eb02fd39 |
@@ -372,7 +372,6 @@ func applySSL(website model.Website, websiteSSL model.WebsiteSSL, req request.We
|
|||||||
config := nginxFull.SiteConfig.Config
|
config := nginxFull.SiteConfig.Config
|
||||||
server := config.FindServers()[0]
|
server := config.FindServers()[0]
|
||||||
server.UpdateListen("443", website.DefaultServer, "ssl")
|
server.UpdateListen("443", website.DefaultServer, "ssl")
|
||||||
server.UpdateListen("[::]:443", website.DefaultServer, "ssl")
|
|
||||||
|
|
||||||
switch req.HttpConfig {
|
switch req.HttpConfig {
|
||||||
case constant.HTTPSOnly:
|
case constant.HTTPSOnly:
|
||||||
@@ -381,11 +380,9 @@ func applySSL(website model.Website, websiteSSL model.WebsiteSSL, req request.We
|
|||||||
server.RemoveDirective("if", []string{"($scheme"})
|
server.RemoveDirective("if", []string{"($scheme"})
|
||||||
case constant.HTTPToHTTPS:
|
case constant.HTTPToHTTPS:
|
||||||
server.UpdateListen("80", website.DefaultServer)
|
server.UpdateListen("80", website.DefaultServer)
|
||||||
server.UpdateListen("[::]:80", website.DefaultServer)
|
|
||||||
server.AddHTTP2HTTPS()
|
server.AddHTTP2HTTPS()
|
||||||
case constant.HTTPAlso:
|
case constant.HTTPAlso:
|
||||||
server.UpdateListen("80", website.DefaultServer)
|
server.UpdateListen("80", website.DefaultServer)
|
||||||
server.UpdateListen("[::]:80", website.DefaultServer)
|
|
||||||
server.RemoveDirective("if", []string{"($scheme"})
|
server.RemoveDirective("if", []string{"($scheme"})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -5,7 +5,7 @@ const (
|
|||||||
SessionName = "psession"
|
SessionName = "psession"
|
||||||
|
|
||||||
AuthMethodJWT = "jwt"
|
AuthMethodJWT = "jwt"
|
||||||
JWTHeaderName = "Authorization"
|
JWTHeaderName = "PanelAuthorization"
|
||||||
JWTBufferTime = 3600
|
JWTBufferTime = 3600
|
||||||
JWTIssuer = "1Panel"
|
JWTIssuer = "1Panel"
|
||||||
|
|
||||||
|
@@ -99,7 +99,7 @@ func NewFileInfo(op FileOption) (*FileInfo, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (f *FileInfo) search(search string, count int) (files []FileSearchInfo, total int, err 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()
|
output, err := cmd.StdoutPipe()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
|
@@ -1,7 +1,5 @@
|
|||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
listen [::]:80;
|
|
||||||
|
|
||||||
server_name ko.wp-1.com;
|
server_name ko.wp-1.com;
|
||||||
|
|
||||||
index index.php index.html index.htm default.php default.htm default.html;
|
index index.php index.html index.htm default.php default.htm default.html;
|
||||||
|
@@ -9,11 +9,15 @@
|
|||||||
</template>
|
</template>
|
||||||
</Header>
|
</Header>
|
||||||
</template>
|
</template>
|
||||||
<el-descriptions border :column="1" v-if="!edit">
|
<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">
|
<el-descriptions-item v-for="(param, key) in params" :label="getLabel(param)" :key="key">
|
||||||
<span>{{ param.showValue && param.showValue != '' ? param.showValue : param.value }}</span>
|
<span>{{ param.showValue && param.showValue != '' ? param.showValue : param.value }}</span>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
<el-row v-else v-loading="loading">
|
<el-row v-else v-loading="loading">
|
||||||
<el-col :span="22" :offset="1">
|
<el-col :span="22" :offset="1">
|
||||||
<el-alert :title="$t('app.updateHelper')" type="warning" :closable="false" />
|
<el-alert :title="$t('app.updateHelper')" type="warning" :closable="false" />
|
||||||
|
@@ -87,8 +87,10 @@ defineExpose({
|
|||||||
.h-app-card {
|
.h-app-card {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
padding: 10px 15px;
|
padding: 10px 15px;
|
||||||
|
margin-right: 10px;
|
||||||
|
|
||||||
.h-app-content {
|
.h-app-content {
|
||||||
|
padding-left: 15px;
|
||||||
.h-app-title {
|
.h-app-title {
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
|
@@ -290,7 +290,9 @@ const freshChart = (chartName: string, Title: string, Data: number) => {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
nextTick(function () {
|
||||||
myChart.setOption(option, true);
|
myChart.setOption(option, true);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
function loadStatus(val: number) {
|
function loadStatus(val: number) {
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
destroy-on-close
|
destroy-on-close
|
||||||
width="70%"
|
width="70%"
|
||||||
@opened="onOpen"
|
@opened="onOpen"
|
||||||
|
:top="'5vh'"
|
||||||
>
|
>
|
||||||
<el-form :inline="true" :model="config">
|
<el-form :inline="true" :model="config">
|
||||||
<el-form-item :label="$t('file.theme')">
|
<el-form-item :label="$t('file.theme')">
|
||||||
@@ -24,8 +25,8 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div class="coder-editor" v-loading="loading">
|
<div v-loading="loading">
|
||||||
<div id="codeBox" style="height: 60vh"></div>
|
<div id="codeBox" style="height: 55vh"></div>
|
||||||
</div>
|
</div>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<span class="dialog-footer">
|
<span class="dialog-footer">
|
||||||
@@ -214,8 +215,8 @@ onBeforeUnmount(() => {
|
|||||||
defineExpose({ acceptParams });
|
defineExpose({ acceptParams });
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style>
|
||||||
.coder-editor {
|
.dialog-top {
|
||||||
margin-top: 10px;
|
top: 0;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@@ -90,7 +90,7 @@
|
|||||||
clearable
|
clearable
|
||||||
@clear="search()"
|
@clear="search()"
|
||||||
@keydown.enter="search()"
|
@keydown.enter="search()"
|
||||||
:placeholder="req.containSub ? $t('file.searchHelper') : $t('file.search')"
|
:placeholder="$t('file.search')"
|
||||||
>
|
>
|
||||||
<template #prepend>
|
<template #prepend>
|
||||||
<el-checkbox v-model="req.containSub">
|
<el-checkbox v-model="req.containSub">
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div v-loading="loading">
|
<div>
|
||||||
<el-form-item :label="$t('website.rewriteMode')">
|
<el-form-item :label="$t('website.rewriteMode')">
|
||||||
<el-select v-model="req.name" filterable @change="getRewriteConfig(req.name)">
|
<el-select v-model="req.name" filterable @change="getRewriteConfig(req.name)">
|
||||||
<el-option :label="$t('website.current')" :value="'current'"></el-option>
|
<el-option :label="$t('website.current')" :value="'current'"></el-option>
|
||||||
@@ -11,8 +11,9 @@
|
|||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<Codemirror
|
||||||
<codemirror
|
ref="codeRef"
|
||||||
|
v-loading="loading"
|
||||||
:autofocus="true"
|
:autofocus="true"
|
||||||
placeholder=""
|
placeholder=""
|
||||||
:indent-with-tab="true"
|
:indent-with-tab="true"
|
||||||
@@ -37,7 +38,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<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 { Codemirror } from 'vue-codemirror';
|
||||||
import { oneDark } from '@codemirror/theme-one-dark';
|
import { oneDark } from '@codemirror/theme-one-dark';
|
||||||
import { StreamLanguage } from '@codemirror/language';
|
import { StreamLanguage } from '@codemirror/language';
|
||||||
@@ -48,8 +49,9 @@ import { MsgSuccess } from '@/utils/message';
|
|||||||
import i18n from '@/lang';
|
import i18n from '@/lang';
|
||||||
|
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const content = ref('');
|
const content = ref(' ');
|
||||||
const extensions = [StreamLanguage.define(nginx), oneDark];
|
const extensions = [StreamLanguage.define(nginx), oneDark];
|
||||||
|
const codeRef = ref();
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
id: {
|
id: {
|
||||||
@@ -69,7 +71,7 @@ const req = reactive({
|
|||||||
|
|
||||||
const update = reactive({
|
const update = reactive({
|
||||||
websiteID: id.value,
|
websiteID: id.value,
|
||||||
content: '',
|
content: 'd',
|
||||||
name: '',
|
name: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -80,12 +82,24 @@ const getRewriteConfig = async (rewrite: string) => {
|
|||||||
try {
|
try {
|
||||||
const res = await GetRewriteConfig(req);
|
const res = await GetRewriteConfig(req);
|
||||||
content.value = res.data.content;
|
content.value = res.data.content;
|
||||||
|
if (res.data.content == '') {
|
||||||
|
content.value = ' ';
|
||||||
|
}
|
||||||
|
|
||||||
|
setCursorPosition();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const setCursorPosition = () => {
|
||||||
|
nextTick(() => {
|
||||||
|
const codeMirrorInstance = codeRef.value?.codemirror;
|
||||||
|
codeMirrorInstance?.setCursor(0, 0);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
const submit = async () => {
|
const submit = async () => {
|
||||||
update.name = req.name;
|
update.name = req.name;
|
||||||
update.websiteID = id.value;
|
update.websiteID = id.value;
|
||||||
|
2
go.mod
2
go.mod
@@ -93,7 +93,7 @@ require (
|
|||||||
github.com/dgraph-io/ristretto v0.1.1 // indirect
|
github.com/dgraph-io/ristretto v0.1.1 // indirect
|
||||||
github.com/distribution/distribution/v3 v3.0.0-20230223072852-e5d5810851d1 // indirect
|
github.com/distribution/distribution/v3 v3.0.0-20230223072852-e5d5810851d1 // indirect
|
||||||
github.com/docker/buildx v0.10.4 // 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/docker-credential-helpers v0.7.0 // indirect
|
||||||
github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c // indirect
|
github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c // indirect
|
||||||
github.com/docker/go-metrics v0.0.1 // indirect
|
github.com/docker/go-metrics v0.0.1 // indirect
|
||||||
|
2
go.sum
2
go.sum
@@ -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.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 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.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 h1:9GhVsShNWz1hO//9BNg/dpMnZW25KydO4wtVxWAIbho=
|
||||||
github.com/docker/docker v23.0.3+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
|
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=
|
github.com/docker/docker-credential-helpers v0.7.0 h1:xtCHsjxogADNZcdv1pKUHXryefjlVRqWqIhk/uXJp0A=
|
||||||
|
Reference in New Issue
Block a user