feat: application
This commit is contained in:
parent
6bfee8d072
commit
3540ad8550
@ -1,8 +1,15 @@
|
|||||||
import { Result } from '@/request/Result'
|
import { Result } from '@/request/Result'
|
||||||
import { get, put } from '@/request/index'
|
import { get, put } from '@/request/index'
|
||||||
|
import useStore from '@/stores'
|
||||||
import { type Ref } from 'vue'
|
import { type Ref } from 'vue'
|
||||||
|
|
||||||
const prefix = '/application'
|
const prefix: any = { _value: '/workspace/' }
|
||||||
|
Object.defineProperty(prefix, 'value', {
|
||||||
|
get: function () {
|
||||||
|
const { user } = useStore()
|
||||||
|
return this._value + user.getWorkspaceId() + '/application'
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 替换社区版-获取AccessToken
|
* 替换社区版-获取AccessToken
|
||||||
@ -10,9 +17,9 @@ const prefix = '/application'
|
|||||||
*/
|
*/
|
||||||
const getAccessToken: (application_id: string, loading?: Ref<boolean>) => Promise<Result<any>> = (
|
const getAccessToken: (application_id: string, loading?: Ref<boolean>) => Promise<Result<any>> = (
|
||||||
application_id,
|
application_id,
|
||||||
loading
|
loading,
|
||||||
) => {
|
) => {
|
||||||
return get(`${prefix}/${application_id}/setting`, undefined, loading)
|
return get(`${prefix.value}/${application_id}/setting`, undefined, loading)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -30,12 +37,12 @@ const getAccessToken: (application_id: string, loading?: Ref<boolean>) => Promis
|
|||||||
const putAccessToken: (
|
const putAccessToken: (
|
||||||
application_id: string,
|
application_id: string,
|
||||||
data: any,
|
data: any,
|
||||||
loading?: Ref<boolean>
|
loading?: Ref<boolean>,
|
||||||
) => Promise<Result<any>> = (application_id, data, loading) => {
|
) => Promise<Result<any>> = (application_id, data, loading) => {
|
||||||
return put(`${prefix}/${application_id}/setting`, data, undefined, loading)
|
return put(`${prefix.value}/${application_id}/setting`, data, undefined, loading)
|
||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
getAccessToken,
|
getAccessToken,
|
||||||
putAccessToken
|
putAccessToken,
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,8 +9,8 @@
|
|||||||
<el-form label-position="top" ref="displayFormRef" :model="form">
|
<el-form label-position="top" ref="displayFormRef" :model="form">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<span>{{
|
<span>{{
|
||||||
$t('views.applicationOverview.appInfo.SettingDisplayDialog.languageLabel')
|
$t('views.applicationOverview.appInfo.SettingDisplayDialog.languageLabel')
|
||||||
}}</span>
|
}}</span>
|
||||||
<el-select v-model="form.language" clearable>
|
<el-select v-model="form.language" clearable>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in langList"
|
v-for="item in langList"
|
||||||
@ -21,18 +21,17 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-space direction="vertical" alignment="start">
|
<el-space direction="vertical" alignment="start" :size="2">
|
||||||
<el-checkbox
|
<el-checkbox
|
||||||
v-model="form.show_source"
|
v-model="form.show_source"
|
||||||
:label="$t('views.applicationOverview.appInfo.SettingDisplayDialog.showSourceLabel')"
|
:label="$t('views.applicationOverview.appInfo.SettingDisplayDialog.showSourceLabel')"
|
||||||
/>
|
/>
|
||||||
</el-space>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
|
||||||
<el-space direction="vertical" alignment="start">
|
|
||||||
<el-checkbox
|
<el-checkbox
|
||||||
v-model="form.show_exec"
|
v-model="form.show_exec"
|
||||||
:label="$t('views.applicationOverview.appInfo.SettingDisplayDialog.showExecutionDetail')"
|
:label="
|
||||||
|
$t('views.applicationOverview.appInfo.SettingDisplayDialog.showExecutionDetail')
|
||||||
|
"
|
||||||
/>
|
/>
|
||||||
</el-space>
|
</el-space>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -48,16 +47,16 @@
|
|||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {ref, watch} from 'vue'
|
import { ref, watch } from 'vue'
|
||||||
import {useRoute} from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
import type {FormInstance, FormRules, UploadFiles} from 'element-plus'
|
import type { FormInstance, FormRules, UploadFiles } from 'element-plus'
|
||||||
import applicationApi from '@/api/application/application'
|
import applicationApi from '@/api/application/application'
|
||||||
import {MsgSuccess, MsgError} from '@/utils/message'
|
import { MsgSuccess, MsgError } from '@/utils/message'
|
||||||
import {getBrowserLang, langList, t} from '@/locales'
|
import { getBrowserLang, langList, t } from '@/locales'
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const {
|
const {
|
||||||
params: {id}
|
params: { id },
|
||||||
} = route
|
} = route
|
||||||
|
|
||||||
const emit = defineEmits(['refresh'])
|
const emit = defineEmits(['refresh'])
|
||||||
@ -66,7 +65,7 @@ const displayFormRef = ref()
|
|||||||
const form = ref<any>({
|
const form = ref<any>({
|
||||||
show_source: false,
|
show_source: false,
|
||||||
show_exec: false,
|
show_exec: false,
|
||||||
language: ''
|
language: '',
|
||||||
})
|
})
|
||||||
|
|
||||||
const detail = ref<any>(null)
|
const detail = ref<any>(null)
|
||||||
@ -79,7 +78,7 @@ watch(dialogVisible, (bool) => {
|
|||||||
form.value = {
|
form.value = {
|
||||||
show_source: false,
|
show_source: false,
|
||||||
show_exec: false,
|
show_exec: false,
|
||||||
language: ''
|
language: '',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -105,6 +104,6 @@ const submit = async (formEl: FormInstance | undefined) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
defineExpose({open})
|
defineExpose({ open })
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped></style>
|
<style lang="scss" scoped></style>
|
||||||
|
|||||||
@ -192,12 +192,9 @@
|
|||||||
<APIKeyDialog ref="APIKeyDialogRef" />
|
<APIKeyDialog ref="APIKeyDialogRef" />
|
||||||
<LimitDialog ref="LimitDialogRef" @refresh="refresh" />
|
<LimitDialog ref="LimitDialogRef" @refresh="refresh" />
|
||||||
<EditAvatarDialog ref="EditAvatarDialogRef" @refresh="refreshIcon" />
|
<EditAvatarDialog ref="EditAvatarDialogRef" @refresh="refreshIcon" />
|
||||||
<XPackDisplaySettingDialog
|
<XPackDisplaySettingDialog ref="XPackDisplaySettingDialogRef" @refresh="refresh" />
|
||||||
ref="XPackDisplaySettingDialogRef"
|
<!-- v-if="user.isEnterprise()" -->
|
||||||
@refresh="refresh"
|
<DisplaySettingDialog ref="DisplaySettingDialogRef" @refresh="refresh" />
|
||||||
v-if="user.isEnterprise()"
|
|
||||||
/>
|
|
||||||
<DisplaySettingDialog ref="DisplaySettingDialogRef" @refresh="refresh" v-else />
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
@ -292,11 +289,11 @@ function toUrl(url: string) {
|
|||||||
window.open(url, '_blank')
|
window.open(url, '_blank')
|
||||||
}
|
}
|
||||||
function openDisplaySettingDialog() {
|
function openDisplaySettingDialog() {
|
||||||
if (user.isEnterprise()) {
|
// if (user.isEnterprise()) {
|
||||||
XPackDisplaySettingDialogRef.value?.open(accessToken.value, detail.value)
|
XPackDisplaySettingDialogRef.value?.open(accessToken.value, detail.value)
|
||||||
} else {
|
// } else {
|
||||||
DisplaySettingDialogRef.value?.open(accessToken.value, detail.value)
|
// DisplaySettingDialogRef.value?.open(accessToken.value, detail.value)
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
function openEditAvatar() {
|
function openEditAvatar() {
|
||||||
EditAvatarDialogRef.value.open(detail.value)
|
EditAvatarDialogRef.value.open(detail.value)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user