1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-19 08:19:15 +08:00

fix: 解决网站设置 PHP 源文之后没有立即生效的问题 (#2341)

This commit is contained in:
zhengkunwang 2023-09-18 21:52:20 +08:00 committed by GitHub
parent 9f0f3fa6cd
commit 06f6a45289
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 15 deletions

View File

@ -1211,6 +1211,9 @@ func (w WebsiteService) UpdatePHPConfigFile(req request.WebsitePHPFileUpdate) er
if err := files.NewFileOp().WriteFile(configPath, strings.NewReader(req.Content), 0755); err != nil {
return err
}
if _, err := compose.Restart(runtimeInstall.GetComposePath()); err != nil {
return err
}
return nil
}

View File

@ -5,7 +5,7 @@
:placeholder="$t('commons.msg.noneData')"
:indent-with-tab="true"
:tabSize="4"
style="margin-top: 10px; max-height: 700px"
style="max-height: 700px"
:lineWrapping="true"
:matchBrackets="true"
theme="cobalt"
@ -13,11 +13,9 @@
:extensions="extensions"
v-model="content"
/>
<div style="margin-top: 10px">
<el-button type="primary" @click="submit()">
{{ $t('nginx.saveAndReload') }}
</el-button>
</div>
<el-button type="primary" @click="submit()" class="mt-2.5">
{{ $t('nginx.saveAndReload') }}
</el-button>
</div>
</template>
<script lang="ts" setup>

View File

@ -5,7 +5,7 @@
:placeholder="$t('commons.msg.noneData')"
:indent-with-tab="true"
:tabSize="4"
style="margin-top: 10px; max-height: 700px"
style="max-height: 700px"
:lineWrapping="true"
:matchBrackets="true"
theme="cobalt"
@ -13,11 +13,10 @@
:extensions="extensions"
v-model="content"
/>
<div style="margin-top: 10px">
<el-button type="primary" @click="submit()">
{{ $t('nginx.saveAndReload') }}
</el-button>
</div>
<el-button type="primary" @click="openUpdate()" class="mt-2.5">
{{ $t('nginx.saveAndReload') }}
</el-button>
<ConfirmDialog ref="confirmDialogRef" @confirm="submit()"></ConfirmDialog>
</div>
</template>
<script lang="ts" setup>
@ -52,9 +51,10 @@ const id = computed(() => {
return props.id;
});
let data = ref<File.File>();
let loading = ref(false);
let content = ref('');
const data = ref<File.File>();
const loading = ref(false);
const content = ref('');
const confirmDialogRef = ref();
const get = () => {
loading.value = true;
@ -68,6 +68,14 @@ const get = () => {
});
};
const openUpdate = async () => {
confirmDialogRef.value!.acceptParams({
header: i18n.global.t('database.confChange'),
operationInfo: i18n.global.t('database.restartNowHelper'),
submitInputInfo: i18n.global.t('database.restartNow'),
});
};
const submit = async () => {
loading.value = true;
UpdatePHPFile({