This commit is contained in:
zhenorzz 2022-03-02 18:54:53 +08:00
parent 9f46591b34
commit 2839cbc97d
9 changed files with 71 additions and 70 deletions

View File

@ -1,7 +1,7 @@
import { Request, Pagination, ID } from './types'
export class CronData {
public datagram!: {
public declare datagram: {
id: number
serverId: number
expression: string
@ -27,7 +27,7 @@ export class CronList extends Request {
}
public pagination: Pagination
public datagram!: {
public declare datagram: {
list: CronData['datagram'][]
}
constructor(param: CronList['param'], pagination: Pagination) {
@ -47,7 +47,7 @@ export class CronAdd extends Request {
logLevel: number
description: string
}
public datagram!: ID
public declare datagram: ID
constructor(param: CronAdd['param']) {
super()
this.param = param

View File

@ -1,10 +1,10 @@
import { Request, Pagination, ID } from './types'
import { Request, Pagination, Total, ID } from './types'
import { ProjectData } from './project'
export class DeployList extends Request {
readonly url = '/deploy/getList'
readonly method = 'get'
public datagram!: {
public declare datagram: {
list: ProjectData['datagram'][]
}
}
@ -16,7 +16,7 @@ export class DeployRebuild extends Request {
projectId: number
token: string
}
public datagram!: string
public declare datagram: string
constructor(param: DeployRebuild['param']) {
super()
this.param = param
@ -24,7 +24,7 @@ export class DeployRebuild extends Request {
}
export class PublishTraceData {
public datagram!: {
public declare datagram: {
id: number
token: string
projectId: number
@ -58,9 +58,9 @@ export class DeployPreviewList extends Request {
}
public pagination: Pagination
public datagram!: {
public declare datagram: {
list: PublishTraceData['datagram'][]
pagination: Pagination
pagination: Pagination & Total
}
constructor(param: DeployPreviewList['param'], pagination: Pagination) {
super()
@ -75,7 +75,7 @@ export class DeployTrace extends Request {
public param: {
lastPublishToken: string
}
public datagram!: {
public declare datagram: {
list: PublishTraceData['datagram'][]
}
constructor(param: DeployTrace['param']) {
@ -89,7 +89,7 @@ export class DeployTraceDetail extends Request {
readonly method = 'get'
readonly timeout = 0
public param: ID
public datagram!: {
public declare datagram: {
detail: string
}
constructor(param: DeployTraceDetail['param']) {
@ -190,7 +190,7 @@ export class ManageProcess extends Request {
projectProcessId: number
command: string
}
public datagram!: {
public declare datagram: {
execRes: boolean
stdout: string
stderr: string

View File

@ -1,7 +1,7 @@
import { Request, Pagination, Total } from './types'
export class LoginLogData {
public datagram!: {
public declare datagram: {
id: number
account: string
remoteAddr: string
@ -22,7 +22,7 @@ export class LoginLogList extends Request {
account: string
}
public datagram!: {
public declare datagram: {
list: LoginLogData['datagram'][]
}
constructor(param: LoginLogList['param'], pagination: Pagination) {
@ -40,7 +40,7 @@ export class LoginLogTotal extends Request {
account: string
}
public datagram!: Total
public declare datagram: Total
constructor(param: LoginLogTotal['param']) {
super()
@ -49,7 +49,7 @@ export class LoginLogTotal extends Request {
}
export class SftpLogData {
public datagram!: {
public declare datagram: {
id: number
namespaceId: number
userId: number
@ -75,7 +75,7 @@ export class SftpLogList extends Request {
serverName: string
}
public datagram!: {
public declare datagram: {
list: SftpLogData['datagram'][]
}
constructor(param: SftpLogList['param'], pagination: Pagination) {
@ -94,7 +94,7 @@ export class SftpLogTotal extends Request {
serverName: string
}
public datagram!: Total
public declare datagram: Total
constructor(param: SftpLogTotal['param']) {
super()
@ -103,7 +103,7 @@ export class SftpLogTotal extends Request {
}
export class TerminalLogData {
public datagram!: {
public declare datagram: {
id: number
namespaceId: number
userId: number
@ -128,7 +128,7 @@ export class TerminalLogList extends Request {
serverName: string
}
public datagram!: {
public declare datagram: {
list: TerminalLogData['datagram'][]
}
constructor(param: TerminalLogList['param'], pagination: Pagination) {
@ -147,7 +147,7 @@ export class TerminalLogTotal extends Request {
serverName: string
}
public datagram!: Total
public declare datagram: Total
constructor(param: TerminalLogTotal['param']) {
super()
@ -156,7 +156,7 @@ export class TerminalLogTotal extends Request {
}
export class PublishLogData {
public datagram!: {
public declare datagram: {
token: string
publisherId: number
publisherName: string
@ -178,7 +178,7 @@ export class PublishLogList extends Request {
projectName: string
}
public datagram!: {
public declare datagram: {
list: PublishLogData['datagram'][]
}
constructor(param: PublishLogList['param'], pagination: Pagination) {
@ -197,7 +197,7 @@ export class PublishLogTotal extends Request {
projectName: string
}
public datagram!: Total
public declare datagram: Total
constructor(param: PublishLogTotal['param']) {
super()

View File

@ -1,7 +1,7 @@
import { Request, Pagination, ID, Total } from './types'
export class MonitorData {
public datagram!: {
public declare datagram: {
id: number
namespaceId: number
name: string
@ -24,7 +24,7 @@ export class MonitorList extends Request {
readonly method = 'get'
public pagination: Pagination
public datagram!: {
public declare datagram: {
list: MonitorData['datagram'][]
}
constructor(pagination: Pagination) {
@ -38,7 +38,7 @@ export class MonitorTotal extends Request {
readonly url = '/monitor/getTotal'
readonly method = 'get'
public datagram!: Total
public declare datagram: Total
}
export class MonitorAdd extends Request {

View File

@ -1,7 +1,7 @@
import { Request, Pagination, ID, Total } from './types'
export class NamespaceData {
public datagram!: {
public declare datagram: {
id: number
name: string
userId: number
@ -12,7 +12,7 @@ export class NamespaceData {
}
export class NamespaceUserData {
public datagram!: {
public declare datagram: {
id: number
namespaceId: number
namespaceName: string
@ -30,7 +30,7 @@ export class NamespaceList extends Request {
public pagination: Pagination
public datagram!: {
public declare datagram: {
list: NamespaceData['datagram'][]
}
constructor(pagination: Pagination) {
@ -44,14 +44,14 @@ export class NamespaceTotal extends Request {
readonly url = '/namespace/getTotal'
readonly method = 'get'
public datagram!: Total
public declare datagram: Total
}
export class NamespaceUserOption extends Request {
readonly url = '/namespace/getUserOption'
readonly method = 'get'
public datagram!: {
public declare datagram: {
list: NamespaceUserData['datagram'][]
}
}
@ -60,7 +60,7 @@ export class NamespaceOption extends Request {
readonly url = '/namespace/getOption'
readonly method = 'get'
public datagram!: {
public declare datagram: {
list: NamespaceUserData['datagram'][]
}
}
@ -69,7 +69,7 @@ export class NamespaceUserList extends Request {
readonly url = '/namespace/getBindUserList'
readonly method = 'get'
public param: ID
public datagram!: {
public declare datagram: {
list: NamespaceUserData['datagram'][]
}
constructor(param: NamespaceUserList['param']) {
@ -84,7 +84,7 @@ export class NamespaceAdd extends Request {
public param: {
name: string
}
public datagram!: ID
public declare datagram: ID
constructor(param: NamespaceAdd['param']) {
super()
this.param = param

View File

@ -1,7 +1,7 @@
import { Request, Pagination, ID, Total } from './types'
export class ProjectData {
public datagram!: {
public declare datagram: {
id: number
namespaceId: number
userId: number
@ -44,7 +44,7 @@ export class ProjectList extends Request {
}
public pagination: Pagination
public datagram!: {
public declare datagram: {
list: ProjectData['datagram'][]
}
constructor(param: ProjectList['param'], pagination: Pagination) {
@ -62,7 +62,7 @@ export class ProjectTotal extends Request {
projectName: string
}
public datagram!: Total
public declare datagram: Total
constructor(param: ProjectTotal['param']) {
super()
this.param = { ...param }
@ -78,7 +78,7 @@ export class ProjectPingRepos extends Request {
url: string
}
public datagram!: {
public declare datagram: {
branch: string[]
}
constructor(param: ProjectPingRepos['param']) {
@ -96,7 +96,7 @@ export class ProjectRemoteBranchList extends Request {
url: string
}
public datagram!: {
public declare datagram: {
branch: string[]
}
constructor(param: ProjectRemoteBranchList['param']) {
@ -173,7 +173,7 @@ export class ProjectRemove extends Request {
}
export class ProjectServerData {
public datagram!: {
public declare datagram: {
id: number
projectId: number
serverId: number
@ -192,7 +192,7 @@ export class ProjectServerList extends Request {
readonly url = '/project/getBindServerList'
readonly method = 'get'
public param: ID
public datagram!: {
public declare datagram: {
list: ProjectServerData['datagram'][]
}
constructor(param: ProjectServerList['param']) {
@ -227,7 +227,7 @@ export class ProjectServerRemove extends Request {
}
export class ProjectUserData {
public datagram!: {
public declare datagram: {
id: number
namespaceId: number
projectId: number
@ -243,7 +243,7 @@ export class ProjectUserList extends Request {
readonly url = '/project/getBindUserList'
readonly method = 'get'
public param: ID
public datagram!: {
public declare datagram: {
list: ProjectUserData['datagram'][]
}
constructor(param: ProjectUserList['param']) {
@ -278,7 +278,7 @@ export class ProjectUserRemove extends Request {
}
export class ProjectFileData {
public datagram!: {
public declare datagram: {
detail: {
id: number
projectId: number
@ -292,7 +292,7 @@ export class ProjectFileList extends Request {
readonly url = '/project/getProjectFileList'
readonly method = 'get'
public param: ID
public datagram!: {
public declare datagram: {
list: ProjectFileData['datagram'][]
}
constructor(param: ProjectUserList['param']) {
@ -305,7 +305,7 @@ export class ProjectFileContent extends Request {
readonly url = '/project/getProjectFileContent'
readonly method = 'get'
public param: ID
public datagram!: {
public declare datagram: {
content: string
}
constructor(param: ProjectUserList['param']) {
@ -322,7 +322,7 @@ export class ProjectFileAdd extends Request {
content: string
filename: string
}
public datagram!: ID
public declare datagram: ID
constructor(param: ProjectFileAdd['param']) {
super()
this.param = param
@ -355,7 +355,7 @@ export class ProjectFileRemove extends Request {
}
export class ProjectTaskData {
public datagram!: {
public declare datagram: {
id: number
projectId: number
branch: string
@ -378,9 +378,9 @@ export class ProjectTaskList extends Request {
public param: ID
public pagination: Pagination
public datagram!: {
public declare datagram: {
list: ProjectTaskData['datagram'][]
pagination: Pagination
pagination: Pagination & Total
}
constructor(param: ProjectTaskList['param'], pagination: Pagination) {
super()
@ -398,7 +398,7 @@ export class ProjectTaskAdd extends Request {
commit: string
date: string
}
public datagram!: ID
public declare datagram: ID
constructor(param: ProjectTaskAdd['param']) {
super()
this.param = param
@ -434,9 +434,9 @@ export class ProjectReviewList extends Request {
public param: ID
public pagination: Pagination
public datagram!: {
public declare datagram: {
list: ProjectTaskData['datagram'][]
pagination: Pagination
pagination: Pagination & Total
}
constructor(param: ProjectReviewList['param'], pagination: Pagination) {
super()
@ -460,7 +460,7 @@ export class ReposFileList extends Request {
}
export class ProjectProcessData {
public datagram!: {
public declare datagram: {
id: number
projectId: number
name: string
@ -481,7 +481,7 @@ export class ProjectProcessList extends Request {
}
public pagination: Pagination
public datagram!: {
public declare datagram: {
list: ProjectProcessData['datagram'][]
}
constructor(param: ProjectProcessList['param'], pagination: Pagination) {
@ -502,7 +502,7 @@ export class ProjectProcessAdd extends Request {
status: string
restart: string
}
public datagram!: ID
public declare datagram: ID
constructor(param: ProjectProcessAdd['param']) {
super()
this.param = param

View File

@ -1,7 +1,7 @@
import { Request, ID } from './types'
export class CommitData {
public datagram!: {
public declare datagram: {
branch: string
commit: string
author: string
@ -18,7 +18,7 @@ export class RepositoryBranchList extends Request {
readonly timeout = 0
public param: ID
public datagram!: {
public declare datagram: {
list: string[]
}
constructor(param: RepositoryBranchList['param']) {
@ -36,7 +36,7 @@ export class RepositoryCommitList extends Request {
branch: string
}
public datagram!: {
public declare datagram: {
list: CommitData['datagram'][]
}
constructor(param: RepositoryCommitList['param']) {
@ -51,7 +51,7 @@ export class RepositoryTagList extends Request {
readonly timeout = 0
public param: ID
public datagram!: {
public declare datagram: {
list: CommitData['datagram'][]
}
constructor(param: RepositoryTagList['param']) {

View File

@ -1,7 +1,7 @@
import { HttpResponse, Request, Pagination, Total, ID } from './types'
export class ServerData {
public datagram!: {
public declare datagram: {
id: number
label: string
name: string
@ -29,7 +29,7 @@ export class ServerList extends Request {
public pagination: Pagination
public datagram!: {
public declare datagram: {
list: ServerData['datagram'][]
}
constructor(pagination: Pagination) {
@ -55,7 +55,7 @@ export class ServerList extends Request {
export class ServerTotal extends Request {
readonly url = '/server/getTotal'
readonly method = 'get'
public datagram!: Total
public declare datagram: Total
}
export class ServerPublicKey extends Request {
@ -66,7 +66,7 @@ export class ServerPublicKey extends Request {
path: string
}
public datagram!: {
public declare datagram: {
key: string
}
@ -80,7 +80,7 @@ export class ServerOption extends Request {
readonly url = '/server/getOption'
readonly method = 'get'
public datagram!: {
public declare datagram: {
list: ServerData['datagram'][]
}
public request(): Promise<HttpResponse<this['datagram']>> {
@ -196,7 +196,7 @@ export class ServerReport extends Request {
}
export class ServerMonitorData {
public datagram!: {
public declare datagram: {
id: number
serverId: number
item: string
@ -223,7 +223,7 @@ export class ServerMonitorList extends Request {
serverId: number
}
public datagram!: {
public declare datagram: {
list: ServerMonitorData['datagram'][]
}

View File

@ -158,6 +158,7 @@
</template>
<script lang="ts" setup>
import {
ProjectData,
ProjectTaskList,
ProjectTaskAdd,
ProjectTaskRemove,
@ -167,7 +168,7 @@ import TheCommitListDialog from './TheCommitListDialog.vue'
import { ElMessageBox, ElMessage } from 'element-plus'
import { getRole } from '@/utils/namespace'
import { parseGitURL, parseTime } from '@/utils'
import { computed, watch, ref, reactive } from 'vue'
import { PropType, computed, watch, ref, reactive } from 'vue'
import dayjs from 'dayjs'
import { useStore } from 'vuex'
import { useI18n } from 'vue-i18n'
@ -179,7 +180,7 @@ const props = defineProps({
default: false,
},
projectRow: {
type: Object,
type: Object as PropType<ProjectData['datagram']>,
required: true,
},
})