Skip to content

Commit 1733163

Browse files
authored
GH-164 [Feature] 支持应用删除 #166
1 parent e8e64f9 commit 1733163

File tree

4 files changed

+38
-4
lines changed

4 files changed

+38
-4
lines changed

build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,11 @@ tasks.register('docker', Exec) {
156156
'''
157157
}
158158

159+
// ssh-copy-id root@zhishuyun.isxcode.com
159160
tasks.register('upload-ali-oss', Exec) {
160161

161162
commandLine 'sh', '-c', '''
162-
ossutil cp torch-yun-dist/build/distributions/zhishuyun.tar.gz oss://isxcode/zhishuyun/ -f
163+
scp torch-yun-dist/build/distributions/zhishuyun.tar.gz root@zhishuyun.isxcode.com:/data/file/
163164
'''
164165
}
165166

torch-yun-backend/torch-yun-modules/src/main/java/com/isxcode/torch/modules/app/service/AppBizService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public AddAppRes addApp(AddAppReq addAppReq) {
5151
}
5252

5353
AppEntity appEntity = appMapper.addAppReqToAppEntity(addAppReq);
54-
appEntity.setStatus(AppStatus.DISABLE);
54+
appEntity.setStatus(AppStatus.ENABLE);
5555
appEntity.setDefaultApp(DefaultAppStatus.DISABLE);
5656
appEntity.setCheckDateTime(LocalDateTime.now());
5757

torch-yun-frontend/src/services/app-management.service.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,12 @@ export function SetDefaultAppData(params: any): Promise<any> {
7878
})
7979
}
8080

81+
// 删除应用
82+
export function DeleteAppData(params: any): Promise<any> {
83+
return http.request({
84+
method: 'post',
85+
url: '/app/deleteApp',
86+
params: params
87+
})
88+
}
89+

torch-yun-frontend/src/views/ai-center/app-management/index.vue

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@
4646
<el-dropdown-item v-if="scopeSlot.row.defaultApp !== 'ENABLE'" @click="setDefaultApp(scopeSlot.row)">
4747
默认
4848
</el-dropdown-item>
49+
<el-dropdown-item @click="deleteApp(scopeSlot.row)" style="color: #f56c6c;">
50+
删除
51+
</el-dropdown-item>
4952
</el-dropdown-menu>
5053
</template>
5154
</el-dropdown>
@@ -63,9 +66,9 @@ import { reactive, ref, onMounted } from 'vue'
6366
import Breadcrumb from '@/layout/bread-crumb/index.vue'
6467
import LoadingPage from '@/components/loading/index.vue'
6568
import { BreadCrumbList, TableConfig } from './list.config'
66-
import { QueryAppList, AddAppData, UpdateAppData, EnableAppData, DisableAppData, SetDefaultAppData } from '@/services/app-management.service'
69+
import { QueryAppList, AddAppData, UpdateAppData, EnableAppData, DisableAppData, SetDefaultAppData, DeleteAppData } from '@/services/app-management.service'
6770
import AddModal from './add-modal/index.vue'
68-
import { ElMessage } from 'element-plus'
71+
import { ElMessage, ElMessageBox } from 'element-plus'
6972
import { UserFilled } from '@element-plus/icons-vue'
7073
import { useRouter } from 'vue-router'
7174
@@ -178,6 +181,27 @@ function setDefaultApp(data: any) {
178181
})
179182
}
180183
184+
function deleteApp(data: any) {
185+
ElMessageBox.confirm(
186+
`确定要删除应用 "${data.name}" 吗?删除后无法恢复。`,
187+
'删除确认',
188+
{
189+
confirmButtonText: '确定',
190+
cancelButtonText: '取消',
191+
type: 'warning',
192+
}
193+
).then(() => {
194+
DeleteAppData({ id: data.id }).then((res: any) => {
195+
ElMessage.success('删除成功')
196+
initData()
197+
}).catch((error: any) => {
198+
ElMessage.error('删除失败')
199+
})
200+
}).catch(() => {
201+
// 用户取消删除
202+
})
203+
}
204+
181205
onMounted(() => {
182206
tableConfig.pagination.currentPage = 1
183207
tableConfig.pagination.pageSize = 10

0 commit comments

Comments
 (0)