Commit 0e6f7290 authored by mhw's avatar mhw

新增应用接入

parent a65dee81
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);
}
}
...@@ -19,6 +19,7 @@ import DatasetData from './GptController/DatasetData.js'; ...@@ -19,6 +19,7 @@ import DatasetData from './GptController/DatasetData.js';
import ModelDeployment from './GptController/ModelDeployment.js'; import ModelDeployment from './GptController/ModelDeployment.js';
import KnowledgeGraph from './GptController/KnowledgeGraph.js'; import KnowledgeGraph from './GptController/KnowledgeGraph.js';
import DataSetCleaning from './GptController/DataSetCleaning.js'; import DataSetCleaning from './GptController/DataSetCleaning.js';
import applicationAccess from './GptController/applicationAccess.js';
export { export {
TemplateController, TemplateController,
...@@ -40,5 +41,6 @@ export { ...@@ -40,5 +41,6 @@ export {
DatasetData, DatasetData,
ModelDeployment, ModelDeployment,
KnowledgeGraph, KnowledgeGraph,
DataSetCleaning DataSetCleaning,
applicationAccess
} }
module.exports = { module.exports = {
// baseUrl: 'http://218.76.0.69:8082/', // baseUrl: 'http://218.76.0.69:8082/',
// baseUrl: 'http://192.168.0.34:8082/', baseUrl: 'http://192.168.0.34:8082/',
baseUrl: 'http://192.168.0.36:8082/', // baseUrl: 'http://192.168.0.36:8082/',
// baseUrl: 'http://192.168.0.34:8082/', // baseUrl: 'http://192.168.0.34:8082/',
wsUrl: 'ws://218.76.0.69:7860/', wsUrl: 'ws://218.76.0.69:7860/',
projectName: '灵境大模型平台' projectName: '灵境大模型平台'
......
...@@ -45,9 +45,9 @@ ...@@ -45,9 +45,9 @@
</el-tooltip> </el-tooltip>
</div> --> </div> -->
<div style="margin-bottom:10px"> <div style="margin-bottom:10px">
<el-button type="primary" plain :size="defaultFormItemSize" @click.stop="testLink(item)">测试连接</el-button> <el-button plain :size="defaultFormItemSize" @click.stop="testLink(item)">测试连接</el-button>
<el-button type="primary" :size="defaultFormItemSize" :plain="true" @click.stop="edit(item)">编辑</el-button> <el-button :size="defaultFormItemSize" plain @click.stop="edit(item)">编辑</el-button>
<el-button type="danger" :size="defaultFormItemSize" :plain="true" @click.stop="del(item)">删除</el-button> <el-button :size="defaultFormItemSize" plain @click.stop="del(item)">删除</el-button>
</div> </div>
</div> </div>
</el-card> </el-card>
......
...@@ -272,6 +272,9 @@ export default { ...@@ -272,6 +272,9 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import '@/assets/style/element-variables.scss'; @import '@/assets/style/element-variables.scss';
.title {
font-size: 16px;
}
.instructions { .instructions {
background-color: white; background-color: white;
width: 100%; width: 100%;
......
<!--模型评估 -->
<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">
...@@ -68,8 +67,8 @@ ...@@ -68,8 +67,8 @@
<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 { ModelEstimate } from '@/api/gptController.js' import { ModelEstimate } from '@/api/gptController.js'
import { TableWidget } from '@/utils/widget.js'
import editOrAdd from './dialog/editOrAdd' import editOrAdd from './dialog/editOrAdd'
import particulars from './dialog/particulars' import particulars from './dialog/particulars'
...@@ -261,7 +260,9 @@ export default { ...@@ -261,7 +260,9 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import '@/assets/style/element-variables.scss'; @import '@/assets/style/element-variables.scss';
.title {
font-size: 16px;
}
.instructions { .instructions {
background-color: white; background-color: white;
width: 100%; width: 100%;
......
<!-- 基本信息-->
<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> <template>
<div style="position: relative"> <div style="position: relative">
<el-collapse <el-collapse v-model="activeName" accordion ref="collapse" v-resize="resize" style="margin-bottom:20px">
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 <div class="item" v-for="(item, index) in instructionsList" :key="index">
class="item"
v-for="(item, index) in instructionsList"
:key="index"
>
<div> <div>
<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 <span class="head-index">{{ index + 1 }} &nbsp;</span>{{ item.title }}
>{{ item.title }}
</div> </div>
<div class="itemDescribe">{{ item.describe }}</div> <div class="itemDescribe">{{ item.describe }}</div>
</div> </div>
<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>
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-button <filter-box :item-width="350" @search="refresh()" @reset="onReset">
class="add" <el-form-item label-width="0px">
type="primary" <el-button class="add" type="primary" icon="el-icon-plus" :size="defaultFormItemSize" @click="add">创建应用</el-button>
icon="el-icon-plus" </el-form-item>
:size="defaultFormItemSize" <el-form-item label="应用名称" prop="formFilter.modelName" label-width="120px">
>创建应用</el-button <el-input class="filter-item" v-model="myDataSetPage.formFilter.applicationName" :clearable="true" placeholder="应用名称" />
> </el-form-item>
</filter-box>
<vxe-table </el-form>
border
show-header-overflow <vxe-table border show-header-overflow show-overflow :row-config="{ isHover: true }" :data="myDataSetPage.tableData.impl.dataList" min-height="96">
show-overflow <vxe-column field="applicationName" title="应用名称"></vxe-column>
:row-config="{ isHover: true }" <vxe-column field="appId" title="AppID"></vxe-column>
:data="tableData"
min-height="96"
>
<vxe-column field="appName" title="应用名称"></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="creationTime" title="创建时间"></vxe-column> <vxe-column field="applicationDescribe" 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 <el-button type="text" :size="defaultFormItemSize" @click="del(scope.row)">删除</el-button>
type="text" </template>
:size="defaultFormItemSize"
@click="del(scope.row)"
>删除</el-button
>
</template> -->
</vxe-column> </vxe-column>
</vxe-table> </vxe-table>
<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>
</el-row>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex'
/* eslint-disable-next-line */
import { DropdownWidget, TableWidget, UploadWidget, ChartWidget } from '@/utils/widget.js'
import { applicationAccess } from '@/api/gptController.js'
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')
}, },
{ {
...@@ -106,53 +89,121 @@ export default { ...@@ -106,53 +89,121 @@ export default {
}, },
{ {
title: '查看用量', title: '查看用量',
describe: describe: '查看报表了解使用情况',
'查看报表了解使用情况',
img: require('@/assets/img/pg3.svg') img: require('@/assets/img/pg3.svg')
} }
], ],
myDataSetPage: { myDataSetPage: {
formFilter: { formFilter: {
dataName: '' applicationName: ''
} },
},
tableData: [ tableData: {
{ impl: new TableWidget(this.getwidgetData, true, true, false, undefined, false)
id: 10001,
name: 'Test1',
role: 'Develop',
sex: 'Man',
age: 28,
address: 'test abc'
} }
] }
}; }
}, },
components: {}, components: {},
computed: { computed: {
...mapGetters(['getMainContextHeight']), ...mapGetters(['getMainContextHeight']),
tableHeight() {
tableHeight () { return this.getMainContextHeight - this.collapseHeight - 55 + 'px'
return this.getMainContextHeight - this.collapseHeight - 54 + 'px';
} }
}, },
mounted () {},
methods: { methods: {
resize (e) { getwidgetData(params) {
setTimeout(() => { if (params == null) params = {}
this.collapseHeight = e.height; params = {
}, 300); ...params,
applicationAccessDtoFilter: { ...this.myDataSetPage.formFilter }
}
return new Promise((resolve, reject) => {
applicationAccess
.list(this, params)
.then((res) => {
resolve({
dataList: res.data.dataList,
totalCount: res.data.totalCount
})
})
.catch((e) => {
reject(e)
})
})
}, },
onReset () {} add() {
this.$dialog
.show(
'创建应用',
editOrAdd,
{
area: ['50%', '70%']
},
{ isEdit: false }
)
.then((res) => {
this.refresh()
})
.catch((e) => {
this.refresh()
})
},
del(item) {
this.$confirm('是否确认删除', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let params = { kgId: item.kgId }
applicationAccess
.delete(this, params)
.then((res) => {
this.$message.success('删除成功')
this.refresh()
})
.catch((e) => {
console.log(e)
})
})
},
refresh(reloadData = false) {
if (reloadData) {
this.myDataSetPage.tableData.impl.refreshTable(true, 1)
} else {
this.myDataSetPage.tableData.impl.refreshTable()
}
},
onReset() {
this.$refs.myDataSetPage.resetFields()
this.refresh(true)
},
formInit() {
this.refresh()
},
resize(e) {
setTimeout(() => {
this.collapseHeight = e?.height
}, 300)
}
},
mounted() {
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 {
font-size: 16px;
}
.instructions { .instructions {
background-color: white; background-color: white;
width: 100%; width: 100%;
......
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