Commit 2f8a418d authored by pengxin's avatar pengxin

应用接入修改。

parent b5fd853c
export default class applicationAccess {
static list (sender, params, axiosOption, httpOption) {
return sender.doUrl('/admin/app/applicationAccess/list', 'post', params, axiosOption, httpOption);
}
static view (sender, params, axiosOption, httpOption) {
return sender.doUrl('/admin/app/applicationAccess/view', 'get', params, axiosOption, httpOption);
}
static add (sender, params, axiosOption, httpOption) {
return sender.doUrl('/admin/app/applicationAccess/add', 'post', params, axiosOption, httpOption);
}
static update (sender, params, axiosOption, httpOption) {
return sender.doUrl('/admin/app/applicationAccess/update', 'post', params, axiosOption, httpOption);
}
static delete (sender, params, axiosOption, httpOption) {
return sender.doUrl('/admin/app/applicationAccess/delete', 'post', params, axiosOption, httpOption);
}
}
export default class ApiManage {
static list (sender, params, axiosOption, httpOption) {
return sender.doUrl('/admin/app/apiManage/list', 'post', params, axiosOption, httpOption);
}
static view (sender, params, axiosOption, httpOption) {
return sender.doUrl('/admin/app/apiManage/view', 'get', params, axiosOption, httpOption);
}
static add (sender, params, axiosOption, httpOption) {
return sender.doUrl('/admin/app/apiManage/add', 'post', params, axiosOption, httpOption);
}
static update (sender, params, axiosOption, httpOption) {
return sender.doUrl('/admin/app/apiManage/update', 'post', params, axiosOption, httpOption);
}
static delete (sender, params, axiosOption, httpOption) {
return sender.doUrl('/admin/app/apiManage/delete', 'post', params, axiosOption, httpOption);
}
}
......@@ -19,7 +19,7 @@ import DatasetData from './GptController/DatasetData.js';
import ModelDeployment from './GptController/ModelDeployment.js';
import KnowledgeGraph from './GptController/KnowledgeGraph.js';
import DataSetCleaning from './GptController/DataSetCleaning.js';
import applicationAccess from './GptController/applicationAccess.js';
import ApiManage from './GptController/ApiManage.js';
export {
TemplateController,
......@@ -42,5 +42,5 @@ export {
ModelDeployment,
KnowledgeGraph,
DataSetCleaning,
applicationAccess
ApiManage
}
module.exports = {
// baseUrl: 'http://218.76.0.69:8082/',
// baseUrl: 'http://192.168.0.34:8082/',
baseUrl: 'http://192.168.0.36:8082/',
baseUrl: 'http://192.168.0.168:8082/',
// baseUrl: 'http://192.168.0.34:8082/',
wsUrl: 'ws://218.76.0.69:7860/',
projectName: '灵境大模型平台'
......
......@@ -56,7 +56,7 @@ const routers = [
{ path: 'modelDeployment', component: _import('gptTraining/modelManagement/modelDeployment/index'), name: 'modelDeployment', props: getProps, meta: { title: '模型部署' } },
// 模型服务
{ path: 'serviceManagement', component: _import('gptTraining/modelService/serviceManagement/index'), name: 'serviceManagement', props: getProps, meta: { title: '在线服务' } },
{ path: 'applicationAccess', component: _import('gptTraining/modelService/applicationAccess/index'), name: 'applicationAccess', props: getProps, meta: { title: '应用接入' } },
{ path: 'apiManage', component: _import('gptTraining/modelService/apiManage/index'), name: 'apiManage', props: getProps, meta: { title: '应用接入' } },
{ path: 'testOnline', component: _import('gptTraining/modelService/testOnline/index'), name: 'testOnline', props: getProps, meta: { title: '在线测试' } },
{ path: 'callStatistics', component: _import('gptTraining/modelService/callStatistics/index'), name: 'callStatistics', props: getProps, meta: { title: '调用统计' } },
// Prompt工程
......
<!-- 基本信息-->
<template>
<el-form label-position="left" ref="form" label-width="100px" :model="form" :size="defaultFormItemSize" :rules="rules">
<el-row class="title">基本信息</el-row>
<el-form-item label="应用名称:" prop="applicationAccessDto.applicationName">
<el-input v-model="form.applicationAccessDto.applicationName" class="inputWidth" :size="defaultFormItemSize"></el-input>
<el-row> <span class="introduce">支持中英文、数字、下划线(_),2-20个字符,不能以下划线为开头</span></el-row>
</el-form-item>
<el-form-item label="应用描述:">
<el-input v-model="form.applicationAccessDto.applicationDescribe" type="textarea" class="inputWidth" :rows="5" :size="defaultFormItemSize"></el-input>
</el-form-item>
<el-row type="flex" justify="end" class="dialog-btn-layer mt20">
<el-button :size="defaultFormItemSize" :plain="true" @click="onCancel(false)">取消</el-button>
<el-button type="primary" :size="defaultFormItemSize" @click="onSubmit">确定</el-button>
</el-row>
</el-form>
</template>
<script>
import { applicationAccess } from '@/api/gptController.js'
export default {
data() {
return {
taskList: [],
runNameList: [],
form: {
applicationAccessDto: {
applicationDescribe: '',
applicationName: ''
}
},
rules: {
'applicationAccessDto.applicationName': [{ required: true, message: '请输入应用名称', trigger: 'blur' }]
}
}
},
props: ['isEdit', 'item'],
components: {},
computed: {},
mounted() {
this.intFrom()
this.getTaskList()
// this.getTuningRun()
},
methods: {
intFrom() {
this.form = { ...this.form, ...this.item }
try {
this.form.templateLabel = JSON.parse(this.item.templateLabel)
} catch (error) {
// console.log(error);
}
},
onCancel(isSuccess) {
if (this.observer != null) {
this.observer.cancel(isSuccess)
}
},
onSubmit() {
return new Promise((resolve, reject) => {
this.$refs['form'].validate((valid) => {
if (valid) {
let params = {}
params = { ...this.form }
if (this.isEdit) {
applicationAccess.update(this, params)
.then((res) => {
resolve(res)
this.$message.success('编辑成功')
this.onCancel(true)
})
.catch((e) => {
reject(e)
})
} else {
applicationAccess.add(this, params)
.then((res) => {
resolve(res)
this.$message.success('添加成功')
this.onCancel(true)
})
.catch((e) => {
reject(e)
})
}
} else {
// reject();
}
})
})
}
}
}
</script>
<style scoped>
.inputWidth {
width: 600px;
}
.title {
font-size: 20px;
margin-bottom: 16px;
}
.introduce {
font-size: 12px;
color: #909399;
}
</style>
<!-- 基本信息-->
<template>
<el-form label-position="left" ref="form" label-width="100px" :model="form" :size="defaultFormItemSize" :rules="rules">
<el-row class="title">基本信息</el-row>
<el-form-item label="应用名称:" prop="apiManageDto.apiName">
<el-input v-model="form.apiManageDto.apiName" class="inputWidth" :size="defaultFormItemSize"></el-input>
<el-row> <span class="introduce">支持中英文、数字、下划线(_),2-20个字符,不能以下划线为开头</span></el-row>
</el-form-item>
<el-form-item label="应用描述:">
<el-input v-model="form.apiManageDto.remark" type="textarea" class="inputWidth" :rows="5" :size="defaultFormItemSize"></el-input>
</el-form-item>
<el-row type="flex" justify="end" class="dialog-btn-layer mt20">
<el-button :size="defaultFormItemSize" :plain="true" @click="onCancel(false)">取消</el-button>
<el-button type="primary" :size="defaultFormItemSize" @click="onSubmit">确定</el-button>
</el-row>
</el-form>
</template>
<script>
import { ApiManage } from '@/api/gptController.js'
export default {
data() {
return {
taskList: [],
runNameList: [],
form: {
apiManageDto: {
remark: '',
apiName: ''
}
},
rules: {
'apiManageDto.apiName': [{ required: true, message: '请输入应用名称', trigger: 'blur' }]
}
}
},
props: ['isEdit', 'item'],
components: {},
computed: {},
mounted() {
this.intFrom()
this.getTaskList()
// this.getTuningRun()
},
methods: {
intFrom() {
this.form = { ...this.form, ...this.item }
try {
this.form.templateLabel = JSON.parse(this.item.templateLabel)
} catch (error) {
// console.log(error);
}
},
onCancel(isSuccess) {
if (this.observer != null) {
this.observer.cancel(isSuccess)
}
},
onSubmit() {
return new Promise((resolve, reject) => {
this.$refs['form'].validate((valid) => {
if (valid) {
let params = {}
params = { ...this.form }
if (this.isEdit) {
ApiManage.update(this, params)
.then((res) => {
resolve(res)
this.$message.success('编辑成功')
this.onCancel(true)
})
.catch((e) => {
reject(e)
})
} else {
ApiManage.add(this, params)
.then((res) => {
resolve(res)
this.$message.success('添加成功')
this.onCancel(true)
})
.catch((e) => {
reject(e)
})
}
} else {
// reject();
}
})
})
}
}
}
</script>
<style scoped>
.inputWidth {
width: 600px;
}
.title {
font-size: 20px;
margin-bottom: 16px;
}
.introduce {
font-size: 12px;
color: #909399;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment