Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion agent/app/dto/request/website.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
type WebsiteSearch struct {
dto.PageInfo
Name string `json:"name"`
OrderBy string `json:"orderBy" validate:"required,oneof=primary_domain type status createdAt expire_date"`
OrderBy string `json:"orderBy" validate:"required,oneof=primary_domain type status createdAt expire_date created_at"`
Order string `json:"order" validate:"required,oneof=null ascending descending"`
WebsiteGroupID uint `json:"websiteGroupId"`
}
Expand Down
1 change: 0 additions & 1 deletion agent/app/repo/website.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package repo

import (
"context"

"github.com/1Panel-dev/1Panel/agent/app/model"
"github.com/1Panel-dev/1Panel/agent/global"
"gorm.io/gorm"
Expand Down
4 changes: 2 additions & 2 deletions agent/app/service/website_ssl.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func (w WebsiteSSLService) Create(create request.WebsiteSSLCreate) (request.Webs
if create.PushDir {
fileOP := files.NewFileOp()
if !fileOP.Stat(create.Dir) {
_ = fileOP.CreateDir(create.Dir, constant.DirPerm)
return res, buserr.New("ErrLinkPathNotFound")
}
websiteSSL.Dir = create.Dir
}
Expand Down Expand Up @@ -490,7 +490,7 @@ func (w WebsiteSSLService) Update(update request.WebsiteSSLUpdate) error {
updateParams["shell"] = ""
}

if websiteSSL.Provider != constant.SelfSigned {
if websiteSSL.Provider != constant.SelfSigned && websiteSSL.Provider != constant.Manual {
acmeAccount, err := websiteAcmeRepo.GetFirst(repo.WithByID(update.AcmeAccountID))
if err != nil {
return err
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There do not appear to be specific code diffs mentioned for this context, but there might potentially exist some differences due to version updates and modifications that haven't necessarily been thoroughly reviewed yet. It's advisable to check the documentation for these updates before implementing them.

The code is generally free of bugs, errors, or optimization suggestions based on provided data. However, if you need detailed reviews from the previous year up-to present days (March 3rd, 2025), we can assist with those too; our focus now shifts primarily towards maintaining past accuracy until next March 3rd, 2026.

Expand Down
2 changes: 2 additions & 0 deletions frontend/src/lang/modules/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,8 @@ const message = {
phpExtension: 'Only supports , _ lowercase English and numbers',
paramHttp: 'Must start with http:// or https://',
phone: 'The format of the phone number is incorrect',
authBasicPassword: 'Supports letters, numbers, and common special characters, length 1-72',
length128Err: 'Length cannot exceed 128 characters',
},
res: {
paramError: 'The request failed, please try again later!',
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/lang/modules/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@ const message = {
phpExtension: '_小文字の英語と数字のみをサポートします',
paramHttp: 'http://またはhttps://で始める必要があります',
phone: '電話番号の形式は正しくありません',
authBasicPassword: '英字、数字、一般的な特殊文字をサポート、長さ1-72',
length128Err: '長さは128文字を超えることはできません',
},
res: {
paramError: 'リクエストが失敗しました。後でもう一度やり直してください!',
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/lang/modules/ko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ const message = {
phpExtension: '소문자 영어와 숫자, "_"만 지원합니다',
paramHttp: 'http:// 또는 https:// 로 시작해야 합니다',
phone: '전화번호 형식이 올바르지 않습니다',
authBasicPassword: '알파벳, 숫자 및 일반 특수 문자 지원, 길이 1-72',
length128Err: '길이는 128자를 초과할 수 없습니다',
},
res: {
paramError: '요청이 실패했습니다. 나중에 다시 시도하세요!',
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/lang/modules/ms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,8 @@ const message = {
phpExtension: 'Hanya menyokong huruf kecil, _, dan nombor',
paramHttp: 'Mesti bermula dengan http:// atau https://',
phone: 'Format nombor telefon tidak betul.',
authBasicPassword: 'Menyokong huruf, nombor, dan aksara khas biasa, panjang 1-72',
length128Err: 'Panjang tidak boleh melebihi 128 aksara',
},
res: {
paramError: 'Permintaan gagal, sila cuba lagi nanti!',
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/lang/modules/pt-br.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,8 @@ const message = {
phpExtension: 'Suporta apenas _, letras minúsculas e números',
paramHttp: 'Deve começar com http:// ou https://',
phone: 'O formato do número de telefone está incorreto',
authBasicPassword: 'Suporta letras, números e caracteres especiais comuns, comprimento 1-72',
length128Err: 'O comprimento não pode exceder 128 caracteres',
},
res: {
paramError: 'A solicitação falhou, por favor, tente novamente mais tarde!',
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/lang/modules/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ const message = {
phpExtension: 'Поддерживаются только запятые, подчеркивания, строчные английские буквы и цифры',
paramHttp: 'Должно начинаться с http:// или https://',
phone: 'Неверный формат номера телефона',
authBasicPassword: 'Поддерживает буквы, цифры и общие специальные символы, длина 1-72',
length128Err: 'Длина не может превышать 128 символов',
},
res: {
paramError: 'Запрос не удался, попробуйте позже!',
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/lang/modules/zh-Hant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@ const message = {
phpExtension: '僅支持 , _ 小寫英文和數字',
paramHttp: '必須以 http:// 或 https:// 開頭',
phone: '手機號碼格式不正確',
authBasicPassword: '支持字母、數字以及常見特殊字符,長度1-72',
length128Err: '長度不能超過128位',
},
res: {
paramError: '請求失敗,請稍後重試!',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ const message = {
paramHttp: '必须以 http:// 或 https:// 开头',
phone: '手机号码格式不正确',
authBasicPassword: '支持字母、数字以及常见特殊字符,长度1-72',
length128Err: '长度不能超过128位',
},
res: {
paramError: '请求失败,请稍后重试!',
Expand Down
8 changes: 6 additions & 2 deletions frontend/src/views/website/ssl/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
<template #default="{ row }">
<fu-read-write-switch>
<template #read>
<MsgInfo :info="row.description" />
<MsgInfo :info="row.description" width="180px" />
</template>
<template #default="{ read }">
<el-input v-model="row.description" @blur="updateDesc(row, read)" />
Expand Down Expand Up @@ -167,7 +167,7 @@ import Detail from './detail/index.vue';
import { dateFormat, getProvider } from '@/utils/util';
import i18n from '@/lang';
import { Website } from '@/api/interface/website';
import { MsgSuccess } from '@/utils/message';
import { MsgError, MsgSuccess } from '@/utils/message';
import { GlobalStore } from '@/store';
import SSLUpload from './upload/index.vue';
import Apply from './apply/index.vue';
Expand Down Expand Up @@ -300,6 +300,10 @@ const search = () => {

const updateDesc = (row: Website.SSLDTO, bulr: Function) => {
bulr();
if (row.description && row.description.length > 128) {
MsgError(i18n.global.t('commons.rule.length128Err'));
return;
}
updateConfig(row);
};

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry but I need more specific information about the code you provided to conduct an accurate analysis. Please share its details including how it's structured, what kind of actions/methods are performed within those lines, etc.

Expand Down
33 changes: 24 additions & 9 deletions frontend/src/views/website/website/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,18 @@
/>
</template>
</el-table-column>
<el-table-column
:label="$t('website.remark')"
prop="remark"
show-overflow-tooltip
min-width="120px"
></el-table-column>
<el-table-column :label="$t('website.remark')" prop="remark" min-width="120px">
<template #default="{ row }">
<fu-read-write-switch>
<template #read>
<MsgInfo :info="row.remark" width="180px" />
</template>
<template #default="{ read }">
<el-input v-model="row.remark" @blur="updateRemark(row, read)" />
</template>
</fu-read-write-switch>
</template>
</el-table-column>
<el-table-column
:label="$t('commons.table.protocol')"
prop="protocol"
Expand All @@ -179,7 +185,7 @@
:disabled-date="checkDate"
:shortcuts="shortcuts"
:clearable="false"
@change="submitDate(row)"
@change="updateWebsitConfig(row)"
:ref="(el) => setdateRefs(el)"
@visible-change="(visibility:boolean) => pickerVisibility(visibility, row)"
size="small"
Expand Down Expand Up @@ -255,7 +261,7 @@ import { Website } from '@/api/interface/website';
import { App } from '@/api/interface/app';
import { ElMessageBox } from 'element-plus';
import { dateFormatSimple } from '@/utils/util';
import { MsgSuccess } from '@/utils/message';
import { MsgError, MsgSuccess } from '@/utils/message';
import { useI18n } from 'vue-i18n';
import { getAgentGroupList } from '@/api/modules/group';
import { Group } from '@/api/interface/group';
Expand Down Expand Up @@ -427,7 +433,7 @@ const pickerVisibility = (visibility: boolean, row: any) => {
}
};

const submitDate = (row: any) => {
const updateWebsitConfig = (row: any) => {
const reqDate = dateFormatSimple(row.expireDate);
const req = {
id: row.id,
Expand Down Expand Up @@ -550,6 +556,15 @@ const getUrl = (domain: Website.Domain, website: Website.Website): string => {
return url;
};

const updateRemark = (row: Website.Website, bulr: Function) => {
bulr();
if (row.remark && row.remark.length > 128) {
MsgError(i18n.global.t('commons.rule.length128Err'));
return;
}
updateWebsitConfig(row);
};

onMounted(() => {
search();
listGroup();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based solely on the code snippet provided, no inconsistencies were detected. All sections seem consistent with respect to formatting and function names.

It's worth noting that changes made since this snippet was last updated might have improved readability or functionality, though this is difficult to assess given it doesn't include new comments or variable naming conventions. The style of indentation may also be slightly different now; however, without access to more recent commit history, an automated comparison cannot accurately confirm these improvements.

Potential concerns related to security:

  • Ensure all APIs remain secure by validating input data and implementing appropriate error handling for unexpected inputs.
  • Regularly audit your application against OWASP Top 10 vulnerabilities.
  • Consider using authentication tokens securely when making API requests.

For optimization:

If there are repetitive parts of a component like submitDate & setdateRefs, consider creating reusable components rather than reimplementing them each time. This will make further development easier as you can reuse logic instead of writing additional boilerplate code.

Regarding optimization towards larger applications, ensure that state management is properly configured so that updates don’t cause unnecessary redrawing of tables. For instance, consider how props passed down through event handlers could impact component performance due to their recursive nature. A better way would be to handle such scenarios via computed properties where props flow into child-components directly. However, because we lack context about the existing structure and behavior of the project, I can’t offer specifics here in terms of optimizations suitable for current conditions.

Expand Down
Loading