Commit ae51aa5c authored by mhw's avatar mhw

Merge branch 'master' of http://192.168.0.35:3000/lmp/lmp_web

parents b2839d72 2f8a418d
export default class applicationAccess { export default class ApiManage {
static list (sender, params, axiosOption, httpOption) { static list (sender, params, axiosOption, httpOption) {
return sender.doUrl('/admin/app/applicationAccess/list', 'post', params, axiosOption, httpOption); return sender.doUrl('/admin/app/apiManage/list', 'post', params, axiosOption, httpOption);
} }
static view (sender, params, axiosOption, httpOption) { static view (sender, params, axiosOption, httpOption) {
return sender.doUrl('/admin/app/applicationAccess/view', 'get', params, axiosOption, httpOption); return sender.doUrl('/admin/app/apiManage/view', 'get', params, axiosOption, httpOption);
} }
static add (sender, params, axiosOption, httpOption) { static add (sender, params, axiosOption, httpOption) {
return sender.doUrl('/admin/app/applicationAccess/add', 'post', params, axiosOption, httpOption); return sender.doUrl('/admin/app/apiManage/add', 'post', params, axiosOption, httpOption);
} }
static update (sender, params, axiosOption, httpOption) { static update (sender, params, axiosOption, httpOption) {
return sender.doUrl('/admin/app/applicationAccess/update', 'post', params, axiosOption, httpOption); return sender.doUrl('/admin/app/apiManage/update', 'post', params, axiosOption, httpOption);
} }
static delete (sender, params, axiosOption, httpOption) { static delete (sender, params, axiosOption, httpOption) {
return sender.doUrl('/admin/app/applicationAccess/delete', 'post', params, axiosOption, httpOption); return sender.doUrl('/admin/app/apiManage/delete', 'post', params, axiosOption, httpOption);
} }
} }
...@@ -21,6 +21,7 @@ import KnowledgeGraph from './GptController/KnowledgeGraph.js'; ...@@ -21,6 +21,7 @@ import KnowledgeGraph from './GptController/KnowledgeGraph.js';
import DataSetCleaning from './GptController/DataSetCleaning.js'; import DataSetCleaning from './GptController/DataSetCleaning.js';
import applicationAccess from './GptController/applicationAccess.js' import applicationAccess from './GptController/applicationAccess.js'
import plugOrchestration from './GptController/plugOrchestration.js'; import plugOrchestration from './GptController/plugOrchestration.js';
import ApiManage from './GptController/ApiManage.js';
export { export {
TemplateController, TemplateController,
...@@ -45,4 +46,5 @@ export { ...@@ -45,4 +46,5 @@ export {
DataSetCleaning, DataSetCleaning,
applicationAccess, applicationAccess,
plugOrchestration plugOrchestration
ApiManage
} }
...@@ -56,7 +56,7 @@ const routers = [ ...@@ -56,7 +56,7 @@ const routers = [
{ path: 'modelDeployment', component: _import('gptTraining/modelManagement/modelDeployment/index'), name: 'modelDeployment', props: getProps, meta: { title: '模型部署' } }, { 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: '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: '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: '调用统计' } }, { path: 'callStatistics', component: _import('gptTraining/modelService/callStatistics/index'), name: 'callStatistics', props: getProps, meta: { title: '调用统计' } },
{ path: 'plugOrchestration', component: _import('gptTraining/modelService/plugOrchestration/index'), name: 'plugOrchestration', props: getProps, meta: { title: '插件编排' } }, { path: 'plugOrchestration', component: _import('gptTraining/modelService/plugOrchestration/index'), name: 'plugOrchestration', props: getProps, meta: { title: '插件编排' } },
......
<!-- 基本信息--> <!-- 基本信息-->
<template> <template>
<el-form label-position="left" ref="form" label-width="100px" :model="form" :size="defaultFormItemSize" :rules="rules"> <el-form label-position="left" ref="form" label-width="100px" :model="form" :size="defaultFormItemSize" :rules="rules">
<el-row class="title">基本信息</el-row> <el-row class="title">基本信息</el-row>
<el-form-item label="应用名称:" prop="applicationAccessDto.applicationName"> <el-form-item label="应用名称:" prop="apiManageDto.apiName">
<el-input v-model="form.applicationAccessDto.applicationName" class="inputWidth" :size="defaultFormItemSize"></el-input> <el-input v-model="form.apiManageDto.apiName" class="inputWidth" :size="defaultFormItemSize"></el-input>
<el-row> <span class="introduce">支持中英文、数字、下划线(_),2-20个字符,不能以下划线为开头</span></el-row> <el-row> <span class="introduce">支持中英文、数字、下划线(_),2-20个字符,不能以下划线为开头</span></el-row>
</el-form-item> </el-form-item>
<el-form-item label="应用描述:"> <el-form-item label="应用描述:">
<el-input v-model="form.applicationAccessDto.applicationDescribe" type="textarea" class="inputWidth" :rows="5" :size="defaultFormItemSize"></el-input> <el-input v-model="form.apiManageDto.remark" type="textarea" class="inputWidth" :rows="5" :size="defaultFormItemSize"></el-input>
</el-form-item> </el-form-item>
<el-row type="flex" justify="end" class="dialog-btn-layer mt20"> <el-row type="flex" justify="end" class="dialog-btn-layer mt20">
<el-button :size="defaultFormItemSize" :plain="true" @click="onCancel(false)">取消</el-button> <el-button :size="defaultFormItemSize" :plain="true" @click="onCancel(false)">取消</el-button>
<el-button type="primary" :size="defaultFormItemSize" @click="onSubmit">确定</el-button> <el-button type="primary" :size="defaultFormItemSize" @click="onSubmit">确定</el-button>
</el-row> </el-row>
</el-form> </el-form>
</template> </template>
<script> <script>
import { applicationAccess } from '@/api/gptController.js' import { ApiManage } from '@/api/gptController.js'
export default { export default {
data() { data() {
return { return {
taskList: [], taskList: [],
runNameList: [], runNameList: [],
form: { form: {
applicationAccessDto: { apiManageDto: {
applicationDescribe: '', remark: '',
applicationName: '' apiName: ''
} }
}, },
rules: { rules: {
'applicationAccessDto.applicationName': [{ required: true, message: '请输入应用名称', trigger: 'blur' }] 'apiManageDto.apiName': [{ required: true, message: '请输入应用名称', trigger: 'blur' }]
} }
} }
}, },
props: ['isEdit', 'item'], props: ['isEdit', 'item'],
components: {}, components: {},
computed: {}, computed: {},
mounted() { mounted() {
this.intFrom() this.intFrom()
this.getTaskList() this.getTaskList()
// this.getTuningRun() // this.getTuningRun()
}, },
methods: { methods: {
intFrom() { intFrom() {
this.form = { ...this.form, ...this.item } this.form = { ...this.form, ...this.item }
try { try {
this.form.templateLabel = JSON.parse(this.item.templateLabel) this.form.templateLabel = JSON.parse(this.item.templateLabel)
} catch (error) { } catch (error) {
// console.log(error); // console.log(error);
} }
}, },
onCancel(isSuccess) { onCancel(isSuccess) {
if (this.observer != null) { if (this.observer != null) {
this.observer.cancel(isSuccess) this.observer.cancel(isSuccess)
} }
}, },
onSubmit() { onSubmit() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
if (valid) { if (valid) {
let params = {} let params = {}
params = { ...this.form } params = { ...this.form }
if (this.isEdit) { if (this.isEdit) {
applicationAccess.update(this, params) ApiManage.update(this, params)
.then((res) => { .then((res) => {
resolve(res) resolve(res)
this.$message.success('编辑成功') this.$message.success('编辑成功')
this.onCancel(true) this.onCancel(true)
}) })
.catch((e) => { .catch((e) => {
reject(e) reject(e)
}) })
} else { } else {
applicationAccess.add(this, params) ApiManage.add(this, params)
.then((res) => { .then((res) => {
resolve(res) resolve(res)
this.$message.success('添加成功') this.$message.success('添加成功')
this.onCancel(true) this.onCancel(true)
}) })
.catch((e) => { .catch((e) => {
reject(e) reject(e)
}) })
} }
} else { } else {
// reject(); // reject();
} }
}) })
}) })
} }
} }
} }
</script> </script>
<style scoped> <style scoped>
.inputWidth { .inputWidth {
width: 600px; width: 600px;
} }
.title { .title {
font-size: 20px; font-size: 20px;
margin-bottom: 16px; margin-bottom: 16px;
} }
.introduce { .introduce {
font-size: 12px; font-size: 12px;
color: #909399; color: #909399;
} }
</style> </style>
<!--应用接入--> <!--应用接入-->
<template> <template>
<div style="position: relative"> <div style="position: relative">
<el-collapse v-model="activeName" accordion ref="collapse" v-resize="resize" style="margin-bottom:20px"> <el-collapse v-model="activeName" accordion ref="collapse" v-resize="resize" style="margin-bottom:20px">
<el-collapse-item name="1"> <el-collapse-item name="1">
<template slot="title"> <template slot="title">
<div class="title">操作指引</div> <div class="title">操作指引</div>
</template> </template>
<div class="instructions"> <div class="instructions">
<div class="instructionsList"> <div class="instructionsList">
<div class="item" v-for="(item, index) in instructionsList" :key="index"> <div class="item" v-for="(item, index) in instructionsList" :key="index">
<div style="height:100%"> <div style="height:100%">
<img class="img" :src="item.img" alt="" /> <img class="img" :src="item.img" alt="" />
<div class="itemTitle"> <div class="itemTitle">
<span class="head-index">{{ index + 1 }} &nbsp;</span>{{ item.title }} <span class="head-index">{{ index + 1 }} &nbsp;</span>{{ item.title }}
</div> </div>
<div class="itemDescribe">{{ item.describe }}</div> <div class="itemDescribe">{{ item.describe }}</div>
</div> </div>
<i v-if="instructionsList.length!==index+1" class="el-icon-arrow-right" style="margin-left: 50px; font-size: 30px; font-weight: bolder;color:#b8babf"></i> <i v-if="instructionsList.length!==index+1" class="el-icon-arrow-right" style="margin-left: 50px; font-size: 30px; font-weight: bolder;color:#b8babf"></i>
</div> </div>
</div> </div>
</div> </div>
</el-collapse-item> </el-collapse-item>
</el-collapse> </el-collapse>
<div class="tableBox" :style="{ height: tableHeight }"> <div class="tableBox" :style="{ height: tableHeight }">
<el-form ref="myDataSetPage" :model="myDataSetPage" label-width="75px" :size="defaultFormItemSize" label-position="right" @submit.native.prevent> <el-form ref="myDataSetPage" :model="myDataSetPage" label-width="75px" :size="defaultFormItemSize" label-position="right" @submit.native.prevent>
<filter-box :item-width="350" @search="refresh()" @reset="onReset"> <filter-box :item-width="350" @search="refresh()" @reset="onReset">
<el-form-item label-width="0px"> <el-form-item label-width="0px">
<el-button class="add" type="primary" icon="el-icon-plus" :size="defaultFormItemSize" @click="add">创建应用</el-button> <el-button class="add" type="primary" icon="el-icon-plus" :size="defaultFormItemSize" @click="add">创建应用</el-button>
</el-form-item> </el-form-item>
<el-form-item label="应用名称" prop="formFilter.modelName" label-width="120px"> <el-form-item label="应用名称" prop="formFilter.modelName" label-width="120px">
<el-input class="filter-item" v-model="myDataSetPage.formFilter.applicationName" :clearable="true" placeholder="应用名称" /> <el-input class="filter-item" v-model="myDataSetPage.formFilter.apiName" :clearable="true" placeholder="应用名称" />
</el-form-item> </el-form-item>
</filter-box> </filter-box>
</el-form> </el-form>
<vxe-table border show-header-overflow show-overflow :row-config="{ isHover: true }" :data="myDataSetPage.tableData.impl.dataList" min-height="96"> <vxe-table border show-header-overflow show-overflow :row-config="{ isHover: true }" :data="myDataSetPage.tableData.impl.dataList" min-height="96">
<vxe-column field="applicationName" title="应用名称"></vxe-column> <vxe-column field="apiName" title="应用名称"></vxe-column>
<vxe-column field="appId" title="AppID"></vxe-column> <vxe-column field="appId" title="AppID"></vxe-column>
<vxe-column field="apiKey" title="API Key"></vxe-column> <vxe-column field="apiKey" title="API Key"></vxe-column>
<vxe-column field="secretKey" title="Secret Key"></vxe-column> <vxe-column field="secretKey" title="Secret Key"></vxe-column>
<vxe-column field="applicationDescribe" title="描述"></vxe-column> <vxe-column field="remark" title="描述"></vxe-column>
<vxe-column field="createTime" title="创建时间"></vxe-column> <vxe-column field="createTime" title="创建时间"></vxe-column>
<vxe-column field="operation" title="操作"> <vxe-column field="operation" title="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <el-button <!-- <el-button
type="text" type="text"
:size="defaultFormItemSize" :size="defaultFormItemSize"
@click="dataImport(scope.row)" @click="dataImport(scope.row)"
>导入</el-button >导入</el-button
> --> > -->
<el-button type="text" icon="el-icon-delete" :size="defaultFormItemSize" @click="del(scope.row)">删除</el-button> <el-button type="text" icon="el-icon-delete" :size="defaultFormItemSize" @click="del(scope.row)">删除</el-button>
</template> </template>
</vxe-column> </vxe-column>
</vxe-table> </vxe-table>
<el-row slot="pagination" type="flex" justify="end" style="margin-top: 16px;width: 100%;"> <el-row slot="pagination" type="flex" justify="end" style="margin-top: 16px;width: 100%;">
<el-pagination :total="myDataSetPage.tableData.impl.totalCount" :current-page="myDataSetPage.tableData.impl.currentPage" :page-size="myDataSetPage.tableData.impl.pageSize" :page-sizes="[10, 20, 50, 100]" layout="total, prev, pager, next, sizes" @current-change="myDataSetPage.tableData.impl.onCurrentPageChange" @size-change="myDataSetPage.tableData.impl.onPageSizeChange"> <el-pagination :total="myDataSetPage.tableData.impl.totalCount" :current-page="myDataSetPage.tableData.impl.currentPage" :page-size="myDataSetPage.tableData.impl.pageSize" :page-sizes="[10, 20, 50, 100]" layout="total, prev, pager, next, sizes" @current-change="myDataSetPage.tableData.impl.onCurrentPageChange" @size-change="myDataSetPage.tableData.impl.onPageSizeChange">
</el-pagination> </el-pagination>
</el-row> </el-row>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
/* eslint-disable-next-line */ /* eslint-disable-next-line */
import { DropdownWidget, TableWidget, UploadWidget, ChartWidget } from '@/utils/widget.js' import { DropdownWidget, TableWidget, UploadWidget, ChartWidget } from '@/utils/widget.js'
import { applicationAccess } from '@/api/gptController.js' import { ApiManage } from '@/api/gptController.js'
import editOrAdd from './dialog/editOrAdd' import editOrAdd from './dialog/editOrAdd'
export default { export default {
data() { data() {
return { return {
activeName: '1', activeName: '1',
collapseHeight: 0, collapseHeight: 0,
instructionsList: [ instructionsList: [
{ {
title: '创建应用', title: '创建应用',
describe: '创建应用, 获取密钥', describe: '创建应用, 获取密钥',
img: require('@/assets/img/pg1.svg') img: require('@/assets/img/pg1.svg')
}, },
{ {
title: '调用服务', title: '调用服务',
describe: '查看请求示例, 调用服务', describe: '查看请求示例, 调用服务',
img: require('@/assets/img/pg2.svg') img: require('@/assets/img/pg2.svg')
}, },
{ {
title: '查看用量', title: '查看用量',
describe: '查看报表了解使用情况', describe: '查看报表了解使用情况',
img: require('@/assets/img/pg3.svg') img: require('@/assets/img/pg3.svg')
} }
], ],
myDataSetPage: { myDataSetPage: {
formFilter: { formFilter: {
applicationName: '' apiName: ''
}, },
tableData: { tableData: {
impl: new TableWidget(this.getwidgetData, true, true, false, undefined, false) impl: new TableWidget(this.getwidgetData, true, true, false, undefined, false)
} }
} }
} }
}, },
components: {}, components: {},
computed: { computed: {
...mapGetters(['getMainContextHeight']), ...mapGetters(['getMainContextHeight']),
tableHeight() { tableHeight() {
return this.getMainContextHeight - this.collapseHeight - 55 + 'px' return this.getMainContextHeight - this.collapseHeight - 55 + 'px'
} }
}, },
methods: { methods: {
getwidgetData(params) { getwidgetData(params) {
if (params == null) params = {} if (params == null) params = {}
params = { params = {
...params, ...params,
applicationAccessDtoFilter: { ...this.myDataSetPage.formFilter } apiManageDtoFilter: { ...this.myDataSetPage.formFilter }
} }
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
applicationAccess ApiManage
.list(this, params) .list(this, params)
.then((res) => { .then((res) => {
resolve({ resolve({
dataList: res.data.dataList, dataList: res.data.dataList,
totalCount: res.data.totalCount totalCount: res.data.totalCount
}) })
}) })
.catch((e) => { .catch((e) => {
reject(e) reject(e)
}) })
}) })
}, },
add() { add() {
this.$dialog this.$dialog
.show( .show(
'创建应用', '创建应用',
editOrAdd, editOrAdd,
{ {
area: ['50%', '70%'] area: ['50%', '70%']
}, },
{ isEdit: false } { isEdit: false }
) )
.then((res) => { .then((res) => {
this.refresh() this.refresh()
}) })
.catch((e) => { .catch((e) => {
this.refresh() this.refresh()
}) })
}, },
del(item) { del(item) {
this.$confirm('是否确认删除', '提示', { this.$confirm('是否确认删除', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
let params = { kgId: item.kgId } let params = { kgId: item.kgId }
applicationAccess ApiManage
.delete(this, params) .delete(this, params)
.then((res) => { .then((res) => {
this.$message.success('删除成功') this.$message.success('删除成功')
this.refresh() this.refresh()
}) })
.catch((e) => { .catch((e) => {
console.log(e) console.log(e)
}) })
}) })
}, },
refresh(reloadData = false) { refresh(reloadData = false) {
if (reloadData) { if (reloadData) {
this.myDataSetPage.tableData.impl.refreshTable(true, 1) this.myDataSetPage.tableData.impl.refreshTable(true, 1)
} else { } else {
this.myDataSetPage.tableData.impl.refreshTable() this.myDataSetPage.tableData.impl.refreshTable()
} }
}, },
onReset() { onReset() {
this.$refs.myDataSetPage.resetFields() this.$refs.myDataSetPage.resetFields()
this.refresh(true) this.refresh(true)
}, },
formInit() { formInit() {
this.refresh() this.refresh()
}, },
resize(e) { resize(e) {
setTimeout(() => { setTimeout(() => {
this.collapseHeight = e?.height this.collapseHeight = e?.height
}, 300) }, 300)
} }
}, },
mounted() { mounted() {
this.formInit() this.formInit()
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import '@/assets/style/element-variables.scss'; @import '@/assets/style/element-variables.scss';
.title { .title {
font-size: 16px; font-size: 16px;
} }
.instructions { .instructions {
background-color: white; background-color: white;
width: 100%; width: 100%;
padding: 0px 20px 20px 20px; padding: 0px 20px 20px 20px;
height: 180px; height: 180px;
.instructionsList { .instructionsList {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: space-around; justify-content: space-around;
.item { .item {
display: flex; display: flex;
align-items: center; align-items: center;
} }
} }
.title { .title {
color: $--color-text-primary; color: $--color-text-primary;
font-size: 16px; font-size: 16px;
font-weight: 500; font-weight: 500;
margin-bottom: 8px; margin-bottom: 8px;
} }
.describe { .describe {
color: $--color-text-secondary; color: $--color-text-secondary;
margin-bottom: 16px; margin-bottom: 16px;
} }
.itemTitle { .itemTitle {
color: $--color-text-primary; color: $--color-text-primary;
font-size: 16px; font-size: 16px;
font-weight: 500; font-weight: 500;
margin-bottom: 8px; margin-bottom: 8px;
} }
.head-index { .head-index {
font-size: 24px; font-size: 24px;
color: #e8e9eb; color: #e8e9eb;
line-height: 32px; line-height: 32px;
} }
.itemDescribe { .itemDescribe {
width: 170px; width: 170px;
color: $--color-text-secondary; color: $--color-text-secondary;
} }
.img { .img {
height: 72px; height: 72px;
width: 140px; width: 140px;
} }
} }
.tableBox { .tableBox {
background-color: white; background-color: white;
width: 100%; width: 100%;
padding: 20px; padding: 20px;
overflow: auto; overflow: auto;
.add { .add {
margin-bottom: 20px; margin-bottom: 20px;
} }
} }
div /deep/ .el-collapse-item__content { div /deep/ .el-collapse-item__content {
padding-bottom: 0; padding-bottom: 0;
} }
div /deep/ .el-collapse-item__header { div /deep/ .el-collapse-item__header {
padding-left: 20px; padding-left: 20px;
} }
</style> </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