mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-19 08:19:15 +08:00
parent
4806a57d92
commit
161ccc8039
@ -5,6 +5,7 @@ import "time"
|
|||||||
type PageContainer struct {
|
type PageContainer struct {
|
||||||
PageInfo
|
PageInfo
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
|
State string `json:"state" validate:"required,oneof=all created running paused restarting removing exited dead"`
|
||||||
OrderBy string `json:"orderBy"`
|
OrderBy string `json:"orderBy"`
|
||||||
Order string `json:"order"`
|
Order string `json:"order"`
|
||||||
Filters string `json:"filters"`
|
Filters string `json:"filters"`
|
||||||
|
@ -102,6 +102,17 @@ func (u *ContainerService) Page(req dto.PageContainer) (int64, interface{}, erro
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if req.State != "all" {
|
||||||
|
length, count := len(list), 0
|
||||||
|
for count < length {
|
||||||
|
if list[count].State != req.State {
|
||||||
|
list = append(list[:count], list[(count+1):]...)
|
||||||
|
length--
|
||||||
|
} else {
|
||||||
|
count++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
switch req.OrderBy {
|
switch req.OrderBy {
|
||||||
case "name":
|
case "name":
|
||||||
sort.Slice(list, func(i, j int) bool {
|
sort.Slice(list, func(i, j int) bool {
|
||||||
|
@ -14491,7 +14491,8 @@ const docTemplate = `{
|
|||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
"required": [
|
||||||
"page",
|
"page",
|
||||||
"pageSize"
|
"pageSize",
|
||||||
|
"state"
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
"filters": {
|
"filters": {
|
||||||
@ -14511,6 +14512,19 @@ const docTemplate = `{
|
|||||||
},
|
},
|
||||||
"pageSize": {
|
"pageSize": {
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"state": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"all",
|
||||||
|
"created",
|
||||||
|
"running",
|
||||||
|
"paused",
|
||||||
|
"restarting",
|
||||||
|
"removing",
|
||||||
|
"exited",
|
||||||
|
"dead"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -14484,7 +14484,8 @@
|
|||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
"required": [
|
||||||
"page",
|
"page",
|
||||||
"pageSize"
|
"pageSize",
|
||||||
|
"state"
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
"filters": {
|
"filters": {
|
||||||
@ -14504,6 +14505,19 @@
|
|||||||
},
|
},
|
||||||
"pageSize": {
|
"pageSize": {
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"state": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"all",
|
||||||
|
"created",
|
||||||
|
"running",
|
||||||
|
"paused",
|
||||||
|
"restarting",
|
||||||
|
"removing",
|
||||||
|
"exited",
|
||||||
|
"dead"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -1634,9 +1634,21 @@ definitions:
|
|||||||
type: integer
|
type: integer
|
||||||
pageSize:
|
pageSize:
|
||||||
type: integer
|
type: integer
|
||||||
|
state:
|
||||||
|
enum:
|
||||||
|
- all
|
||||||
|
- created
|
||||||
|
- running
|
||||||
|
- paused
|
||||||
|
- restarting
|
||||||
|
- removing
|
||||||
|
- exited
|
||||||
|
- dead
|
||||||
|
type: string
|
||||||
required:
|
required:
|
||||||
- page
|
- page
|
||||||
- pageSize
|
- pageSize
|
||||||
|
- state
|
||||||
type: object
|
type: object
|
||||||
dto.PageInfo:
|
dto.PageInfo:
|
||||||
properties:
|
properties:
|
||||||
|
@ -8,6 +8,7 @@ export namespace Container {
|
|||||||
}
|
}
|
||||||
export interface ContainerSearch extends ReqPage {
|
export interface ContainerSearch extends ReqPage {
|
||||||
name: string;
|
name: string;
|
||||||
|
state: string;
|
||||||
filters: string;
|
filters: string;
|
||||||
orderBy: string;
|
orderBy: string;
|
||||||
order: string;
|
order: string;
|
||||||
|
@ -28,6 +28,10 @@ const getType = (status: string) => {
|
|||||||
case 'stopped':
|
case 'stopped':
|
||||||
return 'danger';
|
return 'danger';
|
||||||
case 'unhealthy':
|
case 'unhealthy':
|
||||||
|
case 'paused':
|
||||||
|
case 'exited':
|
||||||
|
case 'dead':
|
||||||
|
case 'removing':
|
||||||
return 'warning';
|
return 'warning';
|
||||||
default:
|
default:
|
||||||
return '';
|
return '';
|
||||||
@ -43,6 +47,7 @@ const loadingStatus = [
|
|||||||
'recreating',
|
'recreating',
|
||||||
'creating',
|
'creating',
|
||||||
'starting',
|
'starting',
|
||||||
|
'removing',
|
||||||
];
|
];
|
||||||
|
|
||||||
const loadingIcon = (status: string): boolean => {
|
const loadingIcon = (status: string): boolean => {
|
||||||
|
@ -212,6 +212,7 @@ const message = {
|
|||||||
removing: 'Removing',
|
removing: 'Removing',
|
||||||
paused: 'Paused',
|
paused: 'Paused',
|
||||||
exited: 'Exited',
|
exited: 'Exited',
|
||||||
|
dead: 'Dead',
|
||||||
installing: 'Installing',
|
installing: 'Installing',
|
||||||
enabled: 'Enabled',
|
enabled: 'Enabled',
|
||||||
disabled: 'Disabled',
|
disabled: 'Disabled',
|
||||||
|
@ -208,9 +208,10 @@ const message = {
|
|||||||
restarting: '重啟中',
|
restarting: '重啟中',
|
||||||
uploading: '上傳中',
|
uploading: '上傳中',
|
||||||
unhealthy: '異常',
|
unhealthy: '異常',
|
||||||
removing: '遷移中',
|
removing: '移除中',
|
||||||
paused: '暫停',
|
paused: '已暫停',
|
||||||
exited: '停止',
|
exited: '已停止',
|
||||||
|
dead: '已結束',
|
||||||
installing: '安裝中',
|
installing: '安裝中',
|
||||||
enabled: '已啟用',
|
enabled: '已啟用',
|
||||||
disabled: '已停止',
|
disabled: '已停止',
|
||||||
|
@ -208,9 +208,10 @@ const message = {
|
|||||||
restarting: '重启中',
|
restarting: '重启中',
|
||||||
uploading: '上传中',
|
uploading: '上传中',
|
||||||
unhealthy: '异常',
|
unhealthy: '异常',
|
||||||
removing: '迁移中',
|
removing: '移除中',
|
||||||
paused: '暂停',
|
paused: '已暂停',
|
||||||
exited: '停止',
|
exited: '已停止',
|
||||||
|
dead: '已结束',
|
||||||
installing: '安装中',
|
installing: '安装中',
|
||||||
enabled: '已启用',
|
enabled: '已启用',
|
||||||
disabled: '已停止',
|
disabled: '已停止',
|
||||||
@ -485,6 +486,7 @@ const message = {
|
|||||||
operatorHelper: '将对以下容器进行 {0} 操作,是否继续?',
|
operatorHelper: '将对以下容器进行 {0} 操作,是否继续?',
|
||||||
operatorAppHelper:
|
operatorAppHelper:
|
||||||
'将对以下容器进行 {0} 操作,其中部分来源于应用商店,该操作可能会影响到该服务的正常使用,是否确认?',
|
'将对以下容器进行 {0} 操作,其中部分来源于应用商店,该操作可能会影响到该服务的正常使用,是否确认?',
|
||||||
|
dead: '',
|
||||||
start: '启动',
|
start: '启动',
|
||||||
stop: '停止',
|
stop: '停止',
|
||||||
restart: '重启',
|
restart: '重启',
|
||||||
|
@ -55,6 +55,19 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</template>
|
</template>
|
||||||
|
<template #search>
|
||||||
|
<el-select v-model="searchState" @change="search()" clearable>
|
||||||
|
<template #prefix>{{ $t('commons.table.status') }}</template>
|
||||||
|
<el-option :label="$t('commons.table.all')" value="all"></el-option>
|
||||||
|
<el-option :label="$t('commons.status.created')" value="created"></el-option>
|
||||||
|
<el-option :label="$t('commons.status.running')" value="running"></el-option>
|
||||||
|
<el-option :label="$t('commons.status.paused')" value="paused"></el-option>
|
||||||
|
<el-option :label="$t('commons.status.restarting')" value="restarting"></el-option>
|
||||||
|
<el-option :label="$t('commons.status.removing')" value="removing"></el-option>
|
||||||
|
<el-option :label="$t('commons.status.exited')" value="exited"></el-option>
|
||||||
|
<el-option :label="$t('commons.status.dead')" value="dead"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</template>
|
||||||
<template #main>
|
<template #main>
|
||||||
<ComplexTable
|
<ComplexTable
|
||||||
:pagination-config="paginationConfig"
|
:pagination-config="paginationConfig"
|
||||||
@ -234,7 +247,7 @@
|
|||||||
<ReNameDialog @search="search" ref="dialogReNameRef" />
|
<ReNameDialog @search="search" ref="dialogReNameRef" />
|
||||||
<ContainerLogDialog ref="dialogContainerLogRef" />
|
<ContainerLogDialog ref="dialogContainerLogRef" />
|
||||||
<OperateDialog @search="search" ref="dialogOperateRef" />
|
<OperateDialog @search="search" ref="dialogOperateRef" />
|
||||||
<UpgraeDialog @search="search" ref="dialogUpgradeRef" />
|
<UpgradeDialog @search="search" ref="dialogUpgradeRef" />
|
||||||
<MonitorDialog ref="dialogMonitorRef" />
|
<MonitorDialog ref="dialogMonitorRef" />
|
||||||
<TerminalDialog ref="dialogTerminalRef" />
|
<TerminalDialog ref="dialogTerminalRef" />
|
||||||
|
|
||||||
@ -249,7 +262,7 @@ import TableSetting from '@/components/table-setting/index.vue';
|
|||||||
import PruneDialog from '@/views/container/container/prune/index.vue';
|
import PruneDialog from '@/views/container/container/prune/index.vue';
|
||||||
import ReNameDialog from '@/views/container/container/rename/index.vue';
|
import ReNameDialog from '@/views/container/container/rename/index.vue';
|
||||||
import OperateDialog from '@/views/container/container/operate/index.vue';
|
import OperateDialog from '@/views/container/container/operate/index.vue';
|
||||||
import UpgraeDialog from '@/views/container/container/upgrade/index.vue';
|
import UpgradeDialog from '@/views/container/container/upgrade/index.vue';
|
||||||
import MonitorDialog from '@/views/container/container/monitor/index.vue';
|
import MonitorDialog from '@/views/container/container/monitor/index.vue';
|
||||||
import ContainerLogDialog from '@/views/container/container/log/index.vue';
|
import ContainerLogDialog from '@/views/container/container/log/index.vue';
|
||||||
import TerminalDialog from '@/views/container/container/terminal/index.vue';
|
import TerminalDialog from '@/views/container/container/terminal/index.vue';
|
||||||
@ -288,6 +301,7 @@ const paginationConfig = reactive({
|
|||||||
order: 'null',
|
order: 'null',
|
||||||
});
|
});
|
||||||
const searchName = ref();
|
const searchName = ref();
|
||||||
|
const searchState = ref('all');
|
||||||
const dialogUpgradeRef = ref();
|
const dialogUpgradeRef = ref();
|
||||||
const dialogPortJumpRef = ref();
|
const dialogPortJumpRef = ref();
|
||||||
const handleRef = ref();
|
const handleRef = ref();
|
||||||
@ -345,6 +359,7 @@ const search = async (column?: any) => {
|
|||||||
paginationConfig.order = column?.order ? column.order : paginationConfig.order;
|
paginationConfig.order = column?.order ? column.order : paginationConfig.order;
|
||||||
let params = {
|
let params = {
|
||||||
name: searchName.value,
|
name: searchName.value,
|
||||||
|
state: searchState.value || 'all',
|
||||||
page: paginationConfig.currentPage,
|
page: paginationConfig.currentPage,
|
||||||
pageSize: paginationConfig.pageSize,
|
pageSize: paginationConfig.pageSize,
|
||||||
filters: filterItem,
|
filters: filterItem,
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
sonar.projectKey=1Panel-dev_1Panel
|
sonar.projectKey=1Panel-dev_1Panel
|
||||||
sonar.organization=1panel-dev
|
sonar.organization=1panel-dev
|
||||||
|
|
||||||
|
sonar.exclusions= frontend/src/lang/modules/*
|
||||||
|
|
||||||
# This is the name and version displayed in the SonarCloud UI.
|
# This is the name and version displayed in the SonarCloud UI.
|
||||||
#sonar.projectName=1Panel
|
#sonar.projectName=1Panel
|
||||||
#sonar.projectVersion=1.0
|
#sonar.projectVersion=1.0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user