-
Notifications
You must be signed in to change notification settings - Fork 3.2k
fix(website): fix issue with create website with local php-fpm failed #8379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -606,7 +606,7 @@ const initData = () => ({ | |
| ftpUser: '', | ||
| ftpPassword: '', | ||
| proxyType: 'tcp', | ||
| port: 0, | ||
| port: 9000, | ||
| proxyProtocol: 'http://', | ||
| proxyAddress: '', | ||
| runtimeType: 'php', | ||
|
|
@@ -808,9 +808,13 @@ const changeRuntime = (runID: number) => { | |
| runtimes.value.forEach((item) => { | ||
| if (item.id === runID) { | ||
| runtimeResource.value = item.resource; | ||
| runtimePorts.value = item.port.split(',').map((port: string) => parseInt(port.trim(), 10)); | ||
| if (runtimePorts.value.length > 0) { | ||
| website.value.port = runtimePorts.value[0]; | ||
| if (runtimeResource.value == 'local') { | ||
| website.value.port = 9000; | ||
| } else { | ||
| runtimePorts.value = item.port.split(',').map((port: string) => parseInt(port.trim(), 10)); | ||
| if (runtimePorts.value.length > 0) { | ||
| website.value.port = runtimePorts.value[0]; | ||
| } | ||
| } | ||
| } | ||
| }); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is an issue with the line Here's a corrected version: const changeRuntime = (runID: number) => {
runtimes.value.forEach((item) => {
if (item.id === runID) {
runtimeResource.value = item.resource;
runtimePorts.value = item.port ? item.port.split(',').map((port: string) => parseInt(port.trim(), 10)) : [];
website.value.port = runtime ports.length > 0 ? runtimePorts[0] : null;
// Optimization suggestion: Handle cases when multiple resource types are present
if ((item.resource === 'docker' && !website.value.port) ||
(item.resource === 'remote' && !website.value.port)) {
console.warn(`No specified port found for resource type '${item.resource}'. Using default port.`);
website.value.port = 9000;
}
break; // Once a matching run ID is found, exit the loop
}
});
};In this version:
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -51,15 +51,14 @@ | |
| </div> | ||
| </el-select> | ||
| <TableSearch @search="search()" v-model:searchName="req.name" /> | ||
| <div class="!ml-2.5"> | ||
| <fu-table-column-select | ||
| :columns="columns" | ||
| trigger="hover" | ||
| :title="$t('commons.table.selectColumn')" | ||
| popper-class="popper-class" | ||
| :only-icon="true" | ||
| /> | ||
| </div> | ||
| <TableRefresh @search="search()" /> | ||
| <fu-table-column-select | ||
| :columns="columns" | ||
| trigger="hover" | ||
| :title="$t('commons.table.selectColumn')" | ||
| popper-class="popper-class" | ||
| :only-icon="true" | ||
| /> | ||
| </template> | ||
| <template v-if="!openNginxConfig" #main> | ||
| <ComplexTable | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are minor changes to your code. Here is an updated list of observations:
Here's a concise version of the updated code block: @@ -51,18 +51,17 @@
</div>
</el-select>
<TableSearch @search="search()" v-model:searchName="req.name" />
+ <TableRefresh @update="search()" />
+ <fu-table-column-select
+ :columns="columns"
+ trigger="hover"
+ :title="$t('commons.table.selectColumn')"
+ popper-class="popper-class"
+ :only-icon="true"
+ />
</template>
<template v-if="!openNginxConfig" #main>
<ComplexTableThis should eliminate unnecessary redundancy and improve clarity in the component structure. |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is an issue with this code in terms of logic. Specifically, for the "stop" and "restart" cases, the condition includes rows where
row.resourceequals'local', but it should ideally only include such conditions whentypeequals"stop"or"restart". This discrepancy could cause unexpected behavior.Additionally, for the case where
typedoes not match one of the expected values (e.g.,null), the function will still returnfalsebecause all other checks will returntrue.Here's a more precise implementation:
Changes Made:
rows.resource = 'local').