Compare commits

...
Author SHA1 Message Date
zhengkunwang b438a4483d feat: 文件列表行内权限支持修改用户和用户组 (#5093)
Refs https://github.com/1Panel-dev/1Panel/issues/4981
2024-05-22 14:31:49 +08:00
zhengkunwang fa00c9fadb fix: 解决网站排序错误的问题 (#5092)
Refs https://github.com/1Panel-dev/1Panel/issues/5021
2024-05-22 14:27:43 +08:00
ssongliu 77c73b6710 feat: 进程守护增加运行目录跳转 (#5088)
Refs #4953
2024-05-22 14:22:47 +08:00
zhengkunwang a73d13de00 fix: 解决部分应用图标不显示的问题 (#5080) 2024-05-22 14:22:26 +08:00
Anye 5e0abeaf47 添加WordPress的PHP扩展模板 (#5016) 2024-05-22 14:21:51 +08:00
Zolo e22f1dc313 feat: 首页监控中上下行流量数据单位自动格式化 (#4207) (#4989) 2024-05-22 14:21:43 +08:00
zhengkunwang 56ce7ddc88 fix: 解决上传证书状态异常的问题 (#4999)
Refs https://github.com/1Panel-dev/1Panel/issues/4976
2024-05-22 14:21:35 +08:00
lewisay 2ec19fb7d4 fix: 解决编辑证书时,其他域名格式不正确问题 (#4991)
#### What this PR does / why we need it?

#### Summary of your change

#### Please indicate you've done the following:

- [ ] Made sure tests are passing and test coverage is added if needed.
- [ ] Made sure commit message follow the rule of [Conventional Commits specification](https://www.conventionalcommits.org/).
- [ ] Considered the docs impact and opened a new docs issue or PR with docs changes if needed.
2024-05-22 14:21:23 +08:00
zhengkunwang b808038f37 fix: 解决进程守护命令不能输入空格的问题 (#4997) 2024-05-22 14:21:18 +08:00
ssongliu c8154901d5 feat: 存储卷清理增加清除所有标签 (#4994) 2024-05-22 14:21:12 +08:00
zhengkunwang 284aced52c fix: 解决应用名称存在大写导致无法升级的问题 (#4987)
Refs https://github.com/1Panel-dev/1Panel/issues/4986
2024-05-22 14:21:05 +08:00
13 changed files with 57 additions and 26 deletions
+1 -1
View File
@@ -849,7 +849,7 @@ func (a AppService) SyncAppListFromRemote() (err error) {
return err return err
} }
iconStr := "" iconStr := ""
if !strings.Contains(string(body), "xml") { if !strings.Contains(string(body), "<xml>") {
iconStr = base64.StdEncoding.EncodeToString(body) iconStr = base64.StdEncoding.EncodeToString(body)
} }
_ = iconRes.Body.Close() _ = iconRes.Body.Close()
+3 -2
View File
@@ -455,7 +455,7 @@ func upgradeInstall(installID uint, detailID uint, backup, pullImage bool) error
upErr error upErr error
backupFile string backupFile string
) )
global.LOG.Infof(i18n.GetMsgByKey("UpgradeAppStart")) global.LOG.Infof(i18n.GetMsgWithName("UpgradeAppStart", install.Name, nil))
if backup { if backup {
backupRecord, err := NewIBackupService().AppBackup(dto.CommonBackup{Name: install.App.Key, DetailName: install.Name}) backupRecord, err := NewIBackupService().AppBackup(dto.CommonBackup{Name: install.App.Key, DetailName: install.Name})
if err == nil { if err == nil {
@@ -587,7 +587,8 @@ func upgradeInstall(installID uint, detailID uint, backup, pullImage bool) error
} }
if pullImage { if pullImage {
images, err := composeV2.GetDockerComposeImages(install.Name, content, []byte(detail.DockerCompose)) projectName := strings.ToLower(install.Name)
images, err := composeV2.GetDockerComposeImages(projectName, content, []byte(detail.DockerCompose))
if err != nil { if err != nil {
upErr = err upErr = err
return return
+7
View File
@@ -323,6 +323,13 @@ func (u *ContainerService) Prune(req dto.ContainerPrune) (dto.ContainerPruneRepo
} }
report.DeletedNumber = len(rep.NetworksDeleted) report.DeletedNumber = len(rep.NetworksDeleted)
case "volume": case "volume":
versions, err := client.ServerVersion(context.Background())
if err != nil {
return report, err
}
if common.ComparePanelVersion(versions.APIVersion, "1.42") {
pruneFilters.Add("all", "true")
}
rep, err := client.VolumesPrune(context.Background(), pruneFilters) rep, err := client.VolumesPrune(context.Background(), pruneFilters)
if err != nil { if err != nil {
return report, err return report, err
+2 -2
View File
@@ -307,7 +307,7 @@ func (h *HostToolService) OperateSupervisorProcess(req request.SupervisorProcess
if err != nil { if err != nil {
return err return err
} }
_, _ = section.NewKey("command", req.Command) _, _ = section.NewKey("command", strings.TrimSpace(req.Command))
_, _ = section.NewKey("directory", req.Dir) _, _ = section.NewKey("directory", req.Dir)
_, _ = section.NewKey("autorestart", "true") _, _ = section.NewKey("autorestart", "true")
_, _ = section.NewKey("startsecs", "3") _, _ = section.NewKey("startsecs", "3")
@@ -338,7 +338,7 @@ func (h *HostToolService) OperateSupervisorProcess(req request.SupervisorProcess
} }
commandKey := section.Key("command") commandKey := section.Key("command")
commandKey.SetValue(req.Command) commandKey.SetValue(strings.TrimSpace(req.Command))
directoryKey := section.Key("directory") directoryKey := section.Key("directory")
directoryKey.SetValue(req.Dir) directoryKey.SetValue(req.Dir)
userKey := section.Key("user") userKey := section.Key("user")
+1
View File
@@ -431,6 +431,7 @@ func (w WebsiteSSLService) Upload(req request.WebsiteSSLUpload) error {
websiteSSL := &model.WebsiteSSL{ websiteSSL := &model.WebsiteSSL{
Provider: constant.Manual, Provider: constant.Manual,
Description: req.Description, Description: req.Description,
Status: constant.SSLReady,
} }
var err error var err error
if req.SSLID > 0 { if req.SSLID > 0 {
@@ -124,6 +124,9 @@ var AddTablePHPExtensions = &gormigrate.Migration{
if err := tx.Create(&model.PHPExtensions{Name: "默认", Extensions: "bcmath,gd,gettext,intl,pcntl,shmop,soap,sockets,sysvsem,xmlrpc,zip"}).Error; err != nil { if err := tx.Create(&model.PHPExtensions{Name: "默认", Extensions: "bcmath,gd,gettext,intl,pcntl,shmop,soap,sockets,sysvsem,xmlrpc,zip"}).Error; err != nil {
return err return err
} }
if err := tx.Create(&model.PHPExtensions{Name: "WordPress", Extensions: "exif,igbinary,imagick,intl,zip,apcu,memcached,opcache,redis,bc,image,shmop,mysqli,pdo_mysql"}).Error; err != nil {
return err
}
if err := tx.Create(&model.PHPExtensions{Name: "苹果CMS-V10", Extensions: "mysqli,pdo_mysql,zip,gd,redis,memcache,memcached"}).Error; err != nil { if err := tx.Create(&model.PHPExtensions{Name: "苹果CMS-V10", Extensions: "mysqli,pdo_mysql,zip,gd,redis,memcache,memcached"}).Error; err != nil {
return err return err
} }
+7 -3
View File
@@ -125,8 +125,12 @@
<template #body> <template #body>
<div style="position: relative; margin-top: 20px"> <div style="position: relative; margin-top: 20px">
<div class="monitor-tags" v-if="chartOption === 'network'"> <div class="monitor-tags" v-if="chartOption === 'network'">
<el-tag>{{ $t('monitor.up') }}: {{ currentChartInfo.netBytesSent }} KB/s</el-tag> <el-tag>
<el-tag>{{ $t('monitor.down') }}: {{ currentChartInfo.netBytesRecv }} KB/s</el-tag> {{ $t('monitor.up') }}: {{ computeSizeFromKBs(currentChartInfo.netBytesSent) }}
</el-tag>
<el-tag>
{{ $t('monitor.down') }}: {{ computeSizeFromKBs(currentChartInfo.netBytesRecv) }}
</el-tag>
<el-tag>{{ $t('home.totalSend') }}: {{ computeSize(currentInfo.netBytesSent) }}</el-tag> <el-tag>{{ $t('home.totalSend') }}: {{ computeSize(currentInfo.netBytesSent) }}</el-tag>
<el-tag>{{ $t('home.totalRecv') }}: {{ computeSize(currentInfo.netBytesRecv) }}</el-tag> <el-tag>{{ $t('home.totalRecv') }}: {{ computeSize(currentInfo.netBytesRecv) }}</el-tag>
</div> </div>
@@ -247,7 +251,7 @@ import LicenseImport from '@/components/license-import/index.vue';
import CardWithHeader from '@/components/card-with-header/index.vue'; import CardWithHeader from '@/components/card-with-header/index.vue';
import i18n from '@/lang'; import i18n from '@/lang';
import { Dashboard } from '@/api/interface/dashboard'; import { Dashboard } from '@/api/interface/dashboard';
import { dateFormatForSecond, computeSize } from '@/utils/util'; import { dateFormatForSecond, computeSize, computeSizeFromKBs } from '@/utils/util';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { loadBaseInfo, loadCurrentInfo } from '@/api/modules/dashboard'; import { loadBaseInfo, loadCurrentInfo } from '@/api/modules/dashboard';
import { getIOOptions, getNetworkOptions } from '@/api/modules/host'; import { getIOOptions, getNetworkOptions } from '@/api/modules/host';
@@ -244,7 +244,7 @@
</el-link> </el-link>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('file.group')" prop="group"> <el-table-column :label="$t('file.group')" prop="group" show-overflow-tooltip>
<template #default="{ row }"> <template #default="{ row }">
<el-link :underline="false" @click="openChown(row)"> <el-link :underline="false" @click="openChown(row)">
{{ row.group ? row.group : '-' }} ({{ row.gid }}) {{ row.group ? row.group : '-' }} ({{ row.gid }})
@@ -863,7 +863,9 @@ const buttons = [
}, },
{ {
label: i18n.global.t('file.mode'), label: i18n.global.t('file.mode'),
click: openMode, click: (row: File.File) => {
openBatchRole([row]);
},
}, },
{ {
label: i18n.global.t('file.compress'), label: i18n.global.t('file.compress'),
@@ -21,7 +21,7 @@
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item :label="$t('tool.supervisor.command')" prop="command"> <el-form-item :label="$t('tool.supervisor.command')" prop="command">
<el-input v-model.trim="process.command"></el-input> <el-input v-model="process.command"></el-input>
</el-form-item> </el-form-item>
<el-form-item :label="$t('tool.supervisor.numprocs')" prop="numprocsNum"> <el-form-item :label="$t('tool.supervisor.numprocs')" prop="numprocsNum">
<el-input type="number" v-model.number="process.numprocsNum"></el-input> <el-input type="number" v-model.number="process.numprocsNum"></el-input>
@@ -33,13 +33,11 @@
fix fix
show-overflow-tooltip show-overflow-tooltip
></el-table-column> ></el-table-column>
<el-table-column <el-table-column :label="$t('tool.supervisor.dir')" prop="dir" min-width="100px" fix>
:label="$t('tool.supervisor.dir')" <template #default="{ row }">
prop="dir" <Tooltip @click="toFolder(row.dir)" :text="row.dir" />
min-width="100px" </template>
fix </el-table-column>
show-overflow-tooltip
></el-table-column>
<el-table-column <el-table-column
:label="$t('tool.supervisor.user')" :label="$t('tool.supervisor.user')"
prop="user" prop="user"
@@ -161,6 +159,7 @@ import i18n from '@/lang';
import { HostTool } from '@/api/interface/host-tool'; import { HostTool } from '@/api/interface/host-tool';
import { MsgSuccess } from '@/utils/message'; import { MsgSuccess } from '@/utils/message';
import { VideoPlay, VideoPause, RefreshRight } from '@element-plus/icons-vue'; import { VideoPlay, VideoPause, RefreshRight } from '@element-plus/icons-vue';
import router from '@/routers';
const globalStore = GlobalStore(); const globalStore = GlobalStore();
const loading = ref(false); const loading = ref(false);
@@ -186,6 +185,10 @@ const getStatus = (status: any) => {
search(); search();
}; };
const toFolder = (folder: string) => {
router.push({ path: '/hosts/files', query: { path: folder } });
};
const showStopped = computed((): boolean => { const showStopped = computed((): boolean => {
if (supervisorStatus.value.init || setSuperVisor.value) { if (supervisorStatus.value.init || setSuperVisor.value) {
return false; return false;
@@ -256,7 +256,7 @@ const acceptParams = (op: string, websiteSSL: Website.SSLDTO) => {
ssl.value.primaryDomain = websiteSSL.primaryDomain; ssl.value.primaryDomain = websiteSSL.primaryDomain;
ssl.value.pushDir = websiteSSL.pushDir; ssl.value.pushDir = websiteSSL.pushDir;
ssl.value.dir = websiteSSL.dir; ssl.value.dir = websiteSSL.dir;
ssl.value.otherDomains = websiteSSL.domains; ssl.value.otherDomains = websiteSSL.domains?.replace(/,/g, '\n');
ssl.value.autoRenew = websiteSSL.autoRenew; ssl.value.autoRenew = websiteSSL.autoRenew;
ssl.value.description = websiteSSL.description; ssl.value.description = websiteSSL.description;
ssl.value.id = websiteSSL.id; ssl.value.id = websiteSSL.id;
+2 -2
View File
@@ -239,8 +239,8 @@ const buttons = [
click: function (row: Website.SSLDTO) { click: function (row: Website.SSLDTO) {
onEdit(row); onEdit(row);
}, },
disabled: function (row: Website.SSLDTO) { show: function (row: Website.SSLDTO) {
return row.provider == 'selfSigned'; return row.provider != 'manual' && row.provider != 'selfSigned';
}, },
}, },
{ {
+15 -5
View File
@@ -54,7 +54,7 @@
<ComplexTable <ComplexTable
:pagination-config="paginationConfig" :pagination-config="paginationConfig"
:data="data" :data="data"
@sort-change="search" @sort-change="changeSort"
@search="search()" @search="search()"
:class="{ mask: nginxStatus != 'Running' }" :class="{ mask: nginxStatus != 'Running' }"
> >
@@ -251,12 +251,22 @@ let req = reactive({
const mobile = computed(() => { const mobile = computed(() => {
return globalStore.isMobile(); return globalStore.isMobile();
}); });
const search = async (column?: any) => {
const changeSort = ({ prop, order }) => {
if (order) {
req.orderBy = prop == 'primaryDomain' ? 'primary_domain' : prop;
req.order = order;
} else {
req.orderBy = 'created_at';
req.order = 'null';
}
search();
};
const search = async () => {
req.page = paginationConfig.currentPage; req.page = paginationConfig.currentPage;
req.pageSize = paginationConfig.pageSize; req.pageSize = paginationConfig.pageSize;
req.orderBy = column?.order ? column.prop : 'created_at';
req.orderBy = req.orderBy === 'primaryDomain' ? 'primary_domain' : req.orderBy;
req.order = column?.order ? column.order : 'null';
loading.value = true; loading.value = true;
await SearchWebsites(req) await SearchWebsites(req)
.then((res) => { .then((res) => {