118 changed files with 2140 additions and 807 deletions
@ -0,0 +1,17 @@ |
|||||
|
import { i18n } from '@/platform/plugin'; |
||||
|
|
||||
|
const yesNoFormater = (value) => { |
||||
|
if (value) { |
||||
|
return i18n.global.t('yes'); |
||||
|
} |
||||
|
return i18n.global.t('no'); |
||||
|
}; |
||||
|
|
||||
|
const trueFalseFormater = (value) => { |
||||
|
if (value) { |
||||
|
return i18n.global.t('true'); |
||||
|
} |
||||
|
return i18n.global.t('false'); |
||||
|
}; |
||||
|
|
||||
|
export { yesNoFormater, trueFalseFormater }; |
@ -0,0 +1,15 @@ |
|||||
|
import { DateTools } from '@/platform/utils'; |
||||
|
|
||||
|
/** |
||||
|
* 日期格式化(仅显示日期,不显示时间,完整的日期时间可通过鼠标移到元素上显示) |
||||
|
* @param value 日期字符串(YYYY-MM-DD HH:mm:ss) |
||||
|
* @returns 日期字符串 |
||||
|
*/ |
||||
|
const dateOnlyFormater = (value) => { |
||||
|
if (value) { |
||||
|
return '<span title="' + value + '">' + DateTools.format(value, 'YYYY-MM-DD') + '</span>'; |
||||
|
} |
||||
|
return ''; |
||||
|
}; |
||||
|
|
||||
|
export { dateOnlyFormater }; |
@ -0,0 +1,21 @@ |
|||||
|
import type { OptionItemType } from '@/platform/types'; |
||||
|
import { i18n } from '@/platform/plugin'; |
||||
|
|
||||
|
class EnumFormater { |
||||
|
#enumMap = {}; |
||||
|
|
||||
|
constructor(options: OptionItemType[]) { |
||||
|
for (const option of options) { |
||||
|
this.#enumMap[option.value] = option.label; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public formater() { |
||||
|
const enumMap = this.#enumMap; |
||||
|
return (value) => { |
||||
|
return i18n.global.t(enumMap[value]); |
||||
|
}; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
export { EnumFormater }; |
@ -0,0 +1,33 @@ |
|||||
|
import type { EnumType } from '@/platform/types'; |
||||
|
import { yesNoFormater, trueFalseFormater } from './BooleanFormater'; |
||||
|
import { dateOnlyFormater } from './DatetimeFormater'; |
||||
|
import { EnumFormater } from './EnumFormater'; |
||||
|
|
||||
|
class Formater { |
||||
|
static #enumFormaterMap = {}; |
||||
|
|
||||
|
public static yesNo() { |
||||
|
return yesNoFormater; |
||||
|
} |
||||
|
|
||||
|
public static trueFalse() { |
||||
|
return trueFalseFormater; |
||||
|
} |
||||
|
|
||||
|
public static dateOnly() { |
||||
|
return dateOnlyFormater; |
||||
|
} |
||||
|
|
||||
|
public static enum(enumType: EnumType) { |
||||
|
if (enumType) { |
||||
|
let enumFormater = Formater.#enumFormaterMap[enumType.name]; |
||||
|
if (!enumFormater) { |
||||
|
enumFormater = new EnumFormater(enumType.items); |
||||
|
Formater.#enumFormaterMap[enumType.name] = enumFormater; |
||||
|
} |
||||
|
return enumFormater.formater(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
export { Formater }; |
@ -0,0 +1,2 @@ |
|||||
|
export { Formater } from './formater'; |
||||
|
export { Options } from './options'; |
@ -0,0 +1,17 @@ |
|||||
|
import { i18n } from '@/platform/plugin'; |
||||
|
|
||||
|
const yesNo = () => { |
||||
|
return [ |
||||
|
{ value: true, label: i18n.global.t('yes') }, |
||||
|
{ value: false, label: i18n.global.t('no') }, |
||||
|
]; |
||||
|
}; |
||||
|
|
||||
|
const trueFalse = () => { |
||||
|
return [ |
||||
|
{ value: true, label: i18n.global.t('true') }, |
||||
|
{ value: false, label: i18n.global.t('false') }, |
||||
|
]; |
||||
|
}; |
||||
|
|
||||
|
export { yesNo, trueFalse }; |
@ -0,0 +1,26 @@ |
|||||
|
import type { OptionItemType } from '@/platform/types'; |
||||
|
import { i18n } from '@/platform/plugin'; |
||||
|
|
||||
|
class EnumOptions { |
||||
|
#options; |
||||
|
|
||||
|
constructor(options: OptionItemType[]) { |
||||
|
this.#options = options; |
||||
|
} |
||||
|
|
||||
|
public options() { |
||||
|
if (this.#options) { |
||||
|
const result = []; |
||||
|
for (const option of this.#options) { |
||||
|
result.push({ |
||||
|
value: option.value, |
||||
|
label: i18n.global.t(option.label), |
||||
|
}); |
||||
|
} |
||||
|
return result; |
||||
|
} |
||||
|
return []; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
export { EnumOptions }; |
@ -0,0 +1,28 @@ |
|||||
|
import type { EnumType } from '@/platform/types'; |
||||
|
import { yesNo, trueFalse } from './BooleanOptions'; |
||||
|
import { EnumOptions } from './EnumOptions'; |
||||
|
|
||||
|
class Options { |
||||
|
static #enumOptionsMap = {}; |
||||
|
|
||||
|
public static yesNo() { |
||||
|
return yesNo(); |
||||
|
} |
||||
|
|
||||
|
public static truefalse(t: any) { |
||||
|
return trueFalse(); |
||||
|
} |
||||
|
|
||||
|
public static enum(enumType: EnumType) { |
||||
|
if (enumType) { |
||||
|
let enumOptions = Options.#enumOptionsMap[enumType.name]; |
||||
|
if (!enumOptions) { |
||||
|
enumOptions = new EnumOptions(enumType.items); |
||||
|
Options.#enumOptionsMap[enumType.name] = enumOptions; |
||||
|
} |
||||
|
return enumOptions.options(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
export { Options }; |
@ -1,6 +1,6 @@ |
|||||
import type {OptionItemType} from './OptionItemType'; |
import type {OptionItemType} from './OptionItemType'; |
||||
|
|
||||
export type EnumType = { |
export type EnumType = { |
||||
list:OptionItemType[]; |
name: string; |
||||
map: object; |
items: OptionItemType[]; |
||||
}; |
}; |
||||
|
@ -1,32 +0,0 @@ |
|||||
import type { EnumType, OptionItemType } from '@/platform/types'; |
|
||||
import { axios, Environment } from '@/platform/plugin'; |
|
||||
|
|
||||
class BackendTools { |
|
||||
public static async enums(type: string, t: any = null): EnumType { |
|
||||
const response = await axios.get(Environment.apiContextPath('/api/enums/list/') + type); |
|
||||
if (response) { |
|
||||
const result: EnumType = { list: [], map: {} }; |
|
||||
|
|
||||
// list
|
|
||||
const list: OptionItemType[] = response.data as OptionItemType[]; |
|
||||
if (t) { |
|
||||
for (const option of list) { |
|
||||
option.label = t(option.label); |
|
||||
} |
|
||||
} |
|
||||
result.list = list; |
|
||||
|
|
||||
// map
|
|
||||
const map = {}; |
|
||||
for (const option of list) { |
|
||||
map[option.value] = t(option.label); |
|
||||
} |
|
||||
result.map = map; |
|
||||
return result; |
|
||||
} else { |
|
||||
return { list: [], map: {} }; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
export { BackendTools }; |
|
@ -0,0 +1,15 @@ |
|||||
|
import * as dayjs from 'dayjs'; |
||||
|
import * as customParseFormat from 'dayjs/plugin/customParseFormat'; |
||||
|
|
||||
|
dayjs.extend(customParseFormat); |
||||
|
|
||||
|
class DateTools { |
||||
|
public static format(datetime: string, format: string): string { |
||||
|
if (datetime) { |
||||
|
return dayjs(datetime).format(format || 'YYYY-MM-DD HH:mm:ss'); |
||||
|
} |
||||
|
return ''; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
export { DateTools }; |
@ -1,4 +1,30 @@ |
|||||
<template> |
<template> |
||||
<div>ApplicationProperties</div> |
<w-grid |
||||
|
:title="$t('menu.developer.plugin.applicationProperties')" |
||||
|
:toolbar-actions="['refresh', 'separator', 'view', 'export']" |
||||
|
:fetch-data-url="Environment.apiContextPath('/api/developer/plugins/applicationProperties')" |
||||
|
row-key="id" |
||||
|
:columns="[ |
||||
|
{ width: '20%', name: 'order', label: $t('order') }, |
||||
|
{ width: '20%', name: 'module', label: $t('module') }, |
||||
|
{ width: '40%', name: 'description', label: $t('description') }, |
||||
|
{ |
||||
|
width: '40%', |
||||
|
name: 'properties', |
||||
|
label: $t('properties'), |
||||
|
format: (properties) => { |
||||
|
properties = properties || []; |
||||
|
let result = ''; |
||||
|
for (const property of properties) { |
||||
|
result += property + '<br/>'; |
||||
|
} |
||||
|
return result; |
||||
|
}, |
||||
|
}, |
||||
|
{ width: '40%', name: 'configurationFileUrl', label: $t('url') }, |
||||
|
]" |
||||
|
></w-grid> |
||||
</template> |
</template> |
||||
<script setup lang="ts"></script> |
<script setup lang="ts"> |
||||
|
import { Environment } from 'platform-core'; |
||||
|
</script> |
||||
|
@ -1,4 +1,40 @@ |
|||||
<template> |
<template> |
||||
<div>Components</div> |
<w-grid |
||||
|
:title="$t('menu.developer.plugin.components')" |
||||
|
:toolbar-actions="['refresh', 'separator', 'view', 'export']" |
||||
|
:fetch-data-url="Environment.apiContextPath('/api/developer/plugins/components')" |
||||
|
row-key="id" |
||||
|
:columns="[ |
||||
|
{ |
||||
|
width: '40%', |
||||
|
name: 'includes', |
||||
|
label: $t('include'), |
||||
|
format: (includes) => { |
||||
|
includes = includes || []; |
||||
|
let result = ''; |
||||
|
for (const include of includes) { |
||||
|
result += include + '<br/>'; |
||||
|
} |
||||
|
return result; |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
width: '40%', |
||||
|
name: 'excludes', |
||||
|
label: $t('exclude'), |
||||
|
format: (excludes) => { |
||||
|
excludes = excludes || []; |
||||
|
let result = ''; |
||||
|
for (const exclude of excludes) { |
||||
|
result += exclude + '<br/>'; |
||||
|
} |
||||
|
return result; |
||||
|
}, |
||||
|
}, |
||||
|
{ width: '40%', name: 'configurationFileUrl', label: $t('url') }, |
||||
|
]" |
||||
|
></w-grid> |
||||
</template> |
</template> |
||||
<script setup lang="ts"></script> |
<script setup lang="ts"> |
||||
|
import { Environment } from 'platform-core'; |
||||
|
</script> |
||||
|
@ -1,4 +1,17 @@ |
|||||
<template> |
<template> |
||||
<div>Directories</div> |
<w-grid |
||||
|
:title="$t('menu.developer.plugin.directories')" |
||||
|
:toolbar-actions="['refresh', 'separator', 'view', 'export']" |
||||
|
:fetch-data-url="Environment.apiContextPath('/api/developer/plugins/directories')" |
||||
|
row-key="id" |
||||
|
:columns="[ |
||||
|
{ width: '20%', name: 'name', label: $t('name') }, |
||||
|
{ width: '40%', name: 'path', label: $t('path') }, |
||||
|
{ width: '40%', name: 'autoCreate', label: $t('autoCreate') }, |
||||
|
{ width: '40%', name: 'configurationFileUrl', label: $t('url') }, |
||||
|
]" |
||||
|
></w-grid> |
||||
</template> |
</template> |
||||
<script setup lang="ts"></script> |
<script setup lang="ts"> |
||||
|
import { Environment } from 'platform-core'; |
||||
|
</script> |
||||
|
@ -1,4 +1,40 @@ |
|||||
<template> |
<template> |
||||
<div>FrontendModule</div> |
<w-grid |
||||
|
:title="$t('menu.developer.plugin.frontendModule')" |
||||
|
:toolbar-actions="['refresh', 'separator', 'view', 'export']" |
||||
|
:fetch-data-url="Environment.apiContextPath('/api/developer/plugins/frontendModule')" |
||||
|
:columns="[ |
||||
|
{ width: 100, name: 'name', label: $t('name') }, |
||||
|
{ |
||||
|
width: '40%', |
||||
|
name: 'components', |
||||
|
label: $t('component'), |
||||
|
format: (components) => { |
||||
|
components = components || []; |
||||
|
let result = ''; |
||||
|
for (const component of components) { |
||||
|
result += component + '<br/>'; |
||||
|
} |
||||
|
return result; |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
width: '40%', |
||||
|
name: 'resources', |
||||
|
label: $t('resource'), |
||||
|
format: (resources) => { |
||||
|
resources = resources || []; |
||||
|
let result = ''; |
||||
|
for (const resource of resources) { |
||||
|
result += resource + '<br/>'; |
||||
|
} |
||||
|
return result; |
||||
|
}, |
||||
|
}, |
||||
|
{ width: '40%', name: 'configurationFileUrl', label: $t('url') }, |
||||
|
]" |
||||
|
></w-grid> |
||||
</template> |
</template> |
||||
<script setup lang="ts"></script> |
<script setup lang="ts"> |
||||
|
import { Environment } from 'platform-core'; |
||||
|
</script> |
||||
|
@ -1,4 +1,20 @@ |
|||||
<template> |
<template> |
||||
<div>FrontendRoutes</div> |
<w-grid |
||||
|
:title="$t('menu.developer.plugin.frontendModule')" |
||||
|
:toolbar-actions="['refresh', 'separator', 'view', 'export']" |
||||
|
:fetch-data-url="Environment.apiContextPath('/api/developer/plugins/frontendRoute')" |
||||
|
:columns="[ |
||||
|
{ width: '40%', name: 'name', label: $t('name') }, |
||||
|
{ width: '40%', name: 'parent', label: $t('parent') }, |
||||
|
{ width: '40%', name: 'path', label: $t('path') }, |
||||
|
{ width: '40%', name: 'module', label: $t('module') }, |
||||
|
{ width: '40%', name: 'priority', label: $t('priority') }, |
||||
|
{ width: '40%', name: 'component', label: $t('component') }, |
||||
|
{ width: '40%', name: 'redirect', label: $t('redirect') }, |
||||
|
{ width: '40%', name: 'configurationFileUrl', label: $t('url') }, |
||||
|
]" |
||||
|
></w-grid> |
||||
</template> |
</template> |
||||
<script setup lang="ts"></script> |
<script setup lang="ts"> |
||||
|
import { Environment } from 'platform-core'; |
||||
|
</script> |
||||
|
@ -1,26 +1,17 @@ |
|||||
<template> |
<template> |
||||
<div class="row q-px-md q-py-md"> |
<w-grid |
||||
{{ $t('menu.developer.plugin.initializer') }} |
:title="$t('menu.developer.plugin.initializer')" |
||||
</div> |
:toolbar-actions="['refresh', 'separator', 'view', 'export']" |
||||
<q-table :rows="rows" :columns="columns" row-key="id" :pagination="{ rowsPerPage: 1000 }" /> |
:fetch-data-url="Environment.apiContextPath('/api/developer/plugins/initializer')" |
||||
|
row-key="id" |
||||
|
:columns="[ |
||||
|
{ width: '20%', name: 'order', label: $t('order'), align: 'right' }, |
||||
|
{ width: '40%', name: 'name', label: $t('name'), format: (value) => $t(value), align: 'left' }, |
||||
|
{ width: '40%', name: 'description', label: $t('description'), format: (value) => $t(value), align: 'left' }, |
||||
|
{ width: '40%', name: 'id', label: $t('className'), align: 'left' }, |
||||
|
]" |
||||
|
></w-grid> |
||||
</template> |
</template> |
||||
<script setup lang="ts"> |
<script setup lang="ts"> |
||||
import { ref } from 'vue'; |
import { Environment } from 'platform-core'; |
||||
import { useI18n } from 'vue-i18n'; |
|
||||
import { Environment, axios } from 'platform-core'; |
|
||||
|
|
||||
const { t } = useI18n(); |
|
||||
|
|
||||
const columns = [ |
|
||||
{ width: '20%', field: 'order', label: t('order'), align: 'right' }, |
|
||||
{ width: '40%', field: 'name', label: t('name'), format: (value) => t(value), align: 'left' }, |
|
||||
{ width: '40%', field: 'description', label: t('description'), format: (value) => t(value), align: 'left' }, |
|
||||
{ width: '40%', field: 'id', label: t('className'), align: 'left' }, |
|
||||
]; |
|
||||
|
|
||||
const rows = ref([]); |
|
||||
|
|
||||
axios.get(Environment.apiContextPath('/api/developer/plugins/initializer')).then((response) => { |
|
||||
rows.value = response.data; |
|
||||
}); |
|
||||
</script> |
</script> |
||||
|
@ -1,4 +1,17 @@ |
|||||
<template> |
<template> |
||||
<div>JsonSerializers</div> |
<w-grid |
||||
|
:title="$t('menu.developer.plugin.jsonSerializers')" |
||||
|
:toolbar-actions="['refresh', 'separator', 'view', 'export']" |
||||
|
:fetch-data-url="Environment.apiContextPath('/api/developer/plugins/jsonSerializers')" |
||||
|
row-key="id" |
||||
|
:columns="[ |
||||
|
{ width: '20%', name: 'className', label: $t('className') }, |
||||
|
{ width: '40%', name: 'serializer', label: $t('serializer') }, |
||||
|
{ width: '40%', name: 'deserializer', label: $t('deserializer') }, |
||||
|
{ width: '40%', name: 'configurationFileUrl', label: $t('url') }, |
||||
|
]" |
||||
|
></w-grid> |
||||
</template> |
</template> |
||||
<script setup lang="ts"></script> |
<script setup lang="ts"> |
||||
|
import { Environment } from 'platform-core'; |
||||
|
</script> |
||||
|
@ -1,4 +1,40 @@ |
|||||
<template> |
<template> |
||||
<div>Messages</div> |
<w-grid |
||||
|
:title="$t('menu.developer.plugin.messages')" |
||||
|
:toolbar-actions="['refresh', 'separator', 'view', 'export']" |
||||
|
:fetch-data-url="Environment.apiContextPath('/api/developer/plugins/messages')" |
||||
|
row-key="id" |
||||
|
:columns="[ |
||||
|
{ |
||||
|
width: '40%', |
||||
|
name: 'includes', |
||||
|
label: $t('include'), |
||||
|
format: (includes) => { |
||||
|
includes = includes || []; |
||||
|
let result = ''; |
||||
|
for (const include of includes) { |
||||
|
result += include + '<br/>'; |
||||
|
} |
||||
|
return result; |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
width: '40%', |
||||
|
name: 'excludes', |
||||
|
label: $t('exclude'), |
||||
|
format: (excludes) => { |
||||
|
excludes = excludes || []; |
||||
|
let result = ''; |
||||
|
for (const exclude of excludes) { |
||||
|
result += exclude + '<br/>'; |
||||
|
} |
||||
|
return result; |
||||
|
}, |
||||
|
}, |
||||
|
{ width: '40%', name: 'configurationFileUrl', label: $t('url') }, |
||||
|
]" |
||||
|
></w-grid> |
||||
</template> |
</template> |
||||
<script setup lang="ts"></script> |
<script setup lang="ts"> |
||||
|
import { Environment } from 'platform-core'; |
||||
|
</script> |
||||
|
@ -1,4 +1,27 @@ |
|||||
<template> |
<template> |
||||
<div>P6spy</div> |
<w-grid |
||||
|
:title="$t('menu.developer.plugin.p6spy')" |
||||
|
:toolbar-actions="['refresh', 'separator', 'view', 'export']" |
||||
|
:fetch-data-url="Environment.apiContextPath('/api/developer/plugins/p6spy')" |
||||
|
row-key="id" |
||||
|
:columns="[ |
||||
|
{ |
||||
|
width: '40%', |
||||
|
name: 'ignoredPatterns', |
||||
|
label: $t('ignored'), |
||||
|
format: (ignoredPatterns) => { |
||||
|
ignoredPatterns = ignoredPatterns || []; |
||||
|
let result = ''; |
||||
|
for (const ignoredPattern of ignoredPatterns) { |
||||
|
result += ignoredPattern + '<br/>'; |
||||
|
} |
||||
|
return result; |
||||
|
}, |
||||
|
}, |
||||
|
{ width: '40%', name: 'configurationFileUrl', label: $t('url') }, |
||||
|
]" |
||||
|
></w-grid> |
||||
</template> |
</template> |
||||
<script setup lang="ts"></script> |
<script setup lang="ts"> |
||||
|
import { Environment } from 'platform-core'; |
||||
|
</script> |
||||
|
@ -1,4 +1,20 @@ |
|||||
<template> |
<template> |
||||
<div>Parameters</div> |
<w-grid |
||||
|
:title="$t('menu.developer.plugin.parameters')" |
||||
|
:toolbar-actions="['refresh', 'separator', 'view', 'export']" |
||||
|
:fetch-data-url="Environment.apiContextPath('/api/developer/plugins/parameters')" |
||||
|
row-key="id" |
||||
|
:columns="[ |
||||
|
{ width: '20%', name: 'id', label: $t('id'), align: 'right' }, |
||||
|
{ width: '40%', name: 'parentId', label: $t('parentId') }, |
||||
|
{ width: '40%', name: 'defaultValue', label: $t('defaultValue') }, |
||||
|
{ width: '40%', name: 'order', label: $t('order') }, |
||||
|
{ width: '40%', name: 'priority', label: $t('priority') }, |
||||
|
{ width: '40%', name: 'description', label: $t('description') }, |
||||
|
{ width: '40%', name: 'configurationFileUrl', label: $t('className') }, |
||||
|
]" |
||||
|
></w-grid> |
||||
</template> |
</template> |
||||
<script setup lang="ts"></script> |
<script setup lang="ts"> |
||||
|
import { Environment } from 'platform-core'; |
||||
|
</script> |
||||
|
@ -1,4 +1,40 @@ |
|||||
<template> |
<template> |
||||
<div>Repositories</div> |
<w-grid |
||||
|
:title="$t('menu.developer.plugin.repositories')" |
||||
|
:toolbar-actions="['refresh', 'separator', 'view', 'export']" |
||||
|
:fetch-data-url="Environment.apiContextPath('/api/developer/plugins/repositories')" |
||||
|
row-key="id" |
||||
|
:columns="[ |
||||
|
{ |
||||
|
width: '40%', |
||||
|
name: 'includes', |
||||
|
label: $t('include'), |
||||
|
format: (includes) => { |
||||
|
includes = includes || []; |
||||
|
let result = ''; |
||||
|
for (const include of includes) { |
||||
|
result += include + '<br/>'; |
||||
|
} |
||||
|
return result; |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
width: '40%', |
||||
|
name: 'excludes', |
||||
|
label: $t('exclude'), |
||||
|
format: (excludes) => { |
||||
|
excludes = excludes || []; |
||||
|
let result = ''; |
||||
|
for (const exclude of excludes) { |
||||
|
result += exclude + '<br/>'; |
||||
|
} |
||||
|
return result; |
||||
|
}, |
||||
|
}, |
||||
|
{ width: '40%', name: 'configurationFileUrl', label: $t('url') }, |
||||
|
]" |
||||
|
></w-grid> |
||||
</template> |
</template> |
||||
<script setup lang="ts"></script> |
<script setup lang="ts"> |
||||
|
import { Environment } from 'platform-core'; |
||||
|
</script> |
||||
|
@ -1,4 +1,40 @@ |
|||||
<template> |
<template> |
||||
<div>RestartProperties</div> |
<w-grid |
||||
|
:title="$t('menu.developer.plugin.restartProperties')" |
||||
|
:toolbar-actions="['refresh', 'separator', 'view', 'export']" |
||||
|
:fetch-data-url="Environment.apiContextPath('/api/developer/plugins/restartProperties')" |
||||
|
row-key="id" |
||||
|
:columns="[ |
||||
|
{ |
||||
|
width: '20%', |
||||
|
name: 'container', |
||||
|
label: $t('webContainer'), |
||||
|
format: (containers) => { |
||||
|
containers = containers || []; |
||||
|
let result = ''; |
||||
|
for (const container of containers) { |
||||
|
result += container + '<br/>'; |
||||
|
} |
||||
|
return result; |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
width: '40%', |
||||
|
name: 'jar', |
||||
|
label: $t('jar'), |
||||
|
format: (jars) => { |
||||
|
jars = jars || []; |
||||
|
let result = ''; |
||||
|
for (const jar of jars) { |
||||
|
result += jar + '<br/>'; |
||||
|
} |
||||
|
return result; |
||||
|
}, |
||||
|
}, |
||||
|
{ width: '40%', name: 'configurationFileUrl', label: $t('url') }, |
||||
|
]" |
||||
|
></w-grid> |
||||
</template> |
</template> |
||||
<script setup lang="ts"></script> |
<script setup lang="ts"> |
||||
|
import { Environment } from 'platform-core'; |
||||
|
</script> |
||||
|
@ -1,4 +1,27 @@ |
|||||
<template> |
<template> |
||||
<div>Security</div> |
<w-grid |
||||
|
:title="$t('menu.developer.plugin.security')" |
||||
|
:toolbar-actions="['refresh', 'separator', 'view', 'export']" |
||||
|
:fetch-data-url="Environment.apiContextPath('/api/developer/plugins/security')" |
||||
|
row-key="id" |
||||
|
:columns="[ |
||||
|
{ |
||||
|
width: '40%', |
||||
|
name: 'permitPatterns', |
||||
|
label: $t('include'), |
||||
|
format: (permitPatterns) => { |
||||
|
permitPatterns = permitPatterns || []; |
||||
|
let result = ''; |
||||
|
for (const permitPattern of permitPatterns) { |
||||
|
result += permitPattern + '<br/>'; |
||||
|
} |
||||
|
return result; |
||||
|
}, |
||||
|
}, |
||||
|
{ width: '40%', name: 'configurationFileUrl', label: $t('url') }, |
||||
|
]" |
||||
|
></w-grid> |
||||
</template> |
</template> |
||||
<script setup lang="ts"></script> |
<script setup lang="ts"> |
||||
|
import { Environment } from 'platform-core'; |
||||
|
</script> |
||||
|
@ -1,4 +1,16 @@ |
|||||
<template> |
<template> |
||||
<div>SystemProperties</div> |
<w-grid |
||||
|
:title="$t('menu.developer.plugin.systemProperties')" |
||||
|
:toolbar-actions="['refresh', 'separator', 'view', 'export']" |
||||
|
:fetch-data-url="Environment.apiContextPath('/api/developer/plugins/systemProperties')" |
||||
|
row-key="id" |
||||
|
:columns="[ |
||||
|
{ width: '20%', name: 'name', label: $t('name') }, |
||||
|
{ width: '40%', name: 'value', label: $t('path') }, |
||||
|
{ width: '40%', name: 'configurationFileUrl', label: $t('url') }, |
||||
|
]" |
||||
|
></w-grid> |
||||
</template> |
</template> |
||||
<script setup lang="ts"></script> |
<script setup lang="ts"> |
||||
|
import { Environment } from 'platform-core'; |
||||
|
</script> |
||||
|
@ -0,0 +1,17 @@ |
|||||
|
<template> |
||||
|
<w-grid |
||||
|
:title="$t('menu.developer.plugin.ws')" |
||||
|
:toolbar-actions="['refresh', 'separator', 'view', 'export']" |
||||
|
:fetch-data-url="Environment.apiContextPath('/api/developer/plugins/ws')" |
||||
|
row-key="id" |
||||
|
:columns="[ |
||||
|
{ width: '20%', name: 'publish', label: $t('publish') }, |
||||
|
{ width: '40%', name: 'beanName', label: $t('beanName') }, |
||||
|
{ width: '40%', name: 'beanClass', label: $t('beanClass') }, |
||||
|
{ width: '40%', name: 'configurationFileUrl', label: $t('url') }, |
||||
|
]" |
||||
|
></w-grid> |
||||
|
</template> |
||||
|
<script setup lang="ts"> |
||||
|
import { Environment } from 'platform-core'; |
||||
|
</script> |
@ -1,4 +1,61 @@ |
|||||
<template> |
<template> |
||||
<div>Bean</div> |
<w-grid |
||||
|
:title="$t('menu.developer.springboot.bean')" |
||||
|
:toolbar-actions="['refresh', 'separator', 'view', 'export']" |
||||
|
:fetch-data-url="Environment.apiContextPath('/api/developer/springboot/beans')" |
||||
|
:checkbox-selection="true" |
||||
|
:pagination="{ |
||||
|
sortBy: 'name', |
||||
|
descending: false, |
||||
|
reqPageStart: 0, |
||||
|
rowsPerPage: 0, |
||||
|
}" |
||||
|
:columns="[ |
||||
|
{ width: 600, name: 'name', label: $t('name') }, |
||||
|
{ width: 500, name: 'type', label: $t('className') }, |
||||
|
{ width: 100, name: 'configurationFileUrl', label: $t('url') }, |
||||
|
]" |
||||
|
:viewer="{ |
||||
|
panel: { |
||||
|
columnNum: 1, |
||||
|
fields: [ |
||||
|
{ width: 100, name: 'name', label: $t('name') }, |
||||
|
{ width: 100, name: 'context', label: $t('context') }, |
||||
|
{ width: 100, name: 'scope', label: $t('scope') }, |
||||
|
{ width: 100, name: 'type', label: $t('className') }, |
||||
|
{ width: 100, name: 'resource', label: $t('resource') }, |
||||
|
{ |
||||
|
width: 100, |
||||
|
name: 'aliases', |
||||
|
label: $t('aliases'), |
||||
|
format: (aliases) => { |
||||
|
aliases = aliases || []; |
||||
|
let result = ''; |
||||
|
for (const aliase of aliases) { |
||||
|
result += aliase + '<br/>'; |
||||
|
} |
||||
|
return result; |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
width: 100, |
||||
|
name: 'dependencies', |
||||
|
label: $t('dependencies'), |
||||
|
format: (dependencies) => { |
||||
|
dependencies = dependencies || []; |
||||
|
let result = ''; |
||||
|
for (const dependency of dependencies) { |
||||
|
result += dependency + '<br/>'; |
||||
|
} |
||||
|
return result; |
||||
|
}, |
||||
|
}, |
||||
|
{ width: 100, name: 'configurationFileUrl', label: $t('url') }, |
||||
|
], |
||||
|
}, |
||||
|
}" |
||||
|
></w-grid> |
||||
</template> |
</template> |
||||
<script setup lang="ts"></script> |
<script setup lang="ts"> |
||||
|
import { Environment } from 'platform-core'; |
||||
|
</script> |
||||
|
@ -0,0 +1,23 @@ |
|||||
|
package io.sc.platform.developer.controller.plugins; |
||||
|
|
||||
|
import io.sc.platform.core.plugins.PluginManager; |
||||
|
import io.sc.platform.core.plugins.item.ApplicationProperties; |
||||
|
import io.sc.platform.orm.service.support.QueryResult; |
||||
|
import org.springframework.data.domain.Page; |
||||
|
import org.springframework.stereotype.Controller; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.ResponseBody; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@Controller |
||||
|
@RequestMapping("/api/developer/plugins/applicationProperties") |
||||
|
public class PluginApplicationPropertiesWebController { |
||||
|
@GetMapping("") |
||||
|
@ResponseBody |
||||
|
public Page<ApplicationProperties> applicationProperties(){ |
||||
|
List<ApplicationProperties> plugins = PluginManager.getInstance().getApplicationProperties(); |
||||
|
return QueryResult.page(plugins); |
||||
|
} |
||||
|
} |
@ -0,0 +1,23 @@ |
|||||
|
package io.sc.platform.developer.controller.plugins; |
||||
|
|
||||
|
import io.sc.platform.core.plugins.PluginManager; |
||||
|
import io.sc.platform.core.plugins.item.Component; |
||||
|
import io.sc.platform.orm.service.support.QueryResult; |
||||
|
import org.springframework.data.domain.Page; |
||||
|
import org.springframework.stereotype.Controller; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.ResponseBody; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@Controller |
||||
|
@RequestMapping("/api/developer/plugins/components") |
||||
|
public class PluginComponentsWebController { |
||||
|
@GetMapping("") |
||||
|
@ResponseBody |
||||
|
public Page<Component> components(){ |
||||
|
List<Component> plugins = PluginManager.getInstance().getComponents(); |
||||
|
return QueryResult.page(plugins); |
||||
|
} |
||||
|
} |
@ -0,0 +1,23 @@ |
|||||
|
package io.sc.platform.developer.controller.plugins; |
||||
|
|
||||
|
import io.sc.platform.core.plugins.PluginManager; |
||||
|
import io.sc.platform.core.plugins.item.Directory; |
||||
|
import io.sc.platform.orm.service.support.QueryResult; |
||||
|
import org.springframework.data.domain.Page; |
||||
|
import org.springframework.stereotype.Controller; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.ResponseBody; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@Controller |
||||
|
@RequestMapping("/api/developer/plugins/directories") |
||||
|
public class PluginDirectoriesWebController { |
||||
|
@GetMapping("") |
||||
|
@ResponseBody |
||||
|
public Page<Directory> directories(){ |
||||
|
List<Directory> plugins = PluginManager.getInstance().getDirectories(); |
||||
|
return QueryResult.page(plugins); |
||||
|
} |
||||
|
} |
@ -0,0 +1,24 @@ |
|||||
|
package io.sc.platform.developer.controller.plugins; |
||||
|
|
||||
|
import io.sc.platform.core.plugins.item.Message; |
||||
|
import io.sc.platform.mvc.plugins.PluginManager; |
||||
|
import io.sc.platform.mvc.plugins.item.FrontEndModule; |
||||
|
import io.sc.platform.orm.service.support.QueryResult; |
||||
|
import org.springframework.data.domain.Page; |
||||
|
import org.springframework.stereotype.Controller; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.ResponseBody; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@Controller |
||||
|
@RequestMapping("/api/developer/plugins/frontendModule") |
||||
|
public class PluginFrontendModuleWebController { |
||||
|
@GetMapping("") |
||||
|
@ResponseBody |
||||
|
public Page<FrontEndModule> frontendModule(){ |
||||
|
List<FrontEndModule> plugins = PluginManager.getInstance().getFrontEndModules(); |
||||
|
return QueryResult.page(plugins); |
||||
|
} |
||||
|
} |
@ -0,0 +1,24 @@ |
|||||
|
package io.sc.platform.developer.controller.plugins; |
||||
|
|
||||
|
import io.sc.platform.mvc.plugins.PluginManager; |
||||
|
import io.sc.platform.mvc.plugins.item.FrontEndModule; |
||||
|
import io.sc.platform.mvc.plugins.item.FrontEndRoute; |
||||
|
import io.sc.platform.orm.service.support.QueryResult; |
||||
|
import org.springframework.data.domain.Page; |
||||
|
import org.springframework.stereotype.Controller; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.ResponseBody; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@Controller |
||||
|
@RequestMapping("/api/developer/plugins/frontendRoute") |
||||
|
public class PluginFrontendRouteWebController { |
||||
|
@GetMapping("") |
||||
|
@ResponseBody |
||||
|
public Page<FrontEndRoute> frontendRoute(){ |
||||
|
List<FrontEndRoute> plugins = PluginManager.getInstance().getFrontEndRoutes(); |
||||
|
return QueryResult.page(plugins); |
||||
|
} |
||||
|
} |
@ -0,0 +1,24 @@ |
|||||
|
package io.sc.platform.developer.controller.plugins; |
||||
|
|
||||
|
import io.sc.platform.core.plugins.PluginManager; |
||||
|
import io.sc.platform.core.plugins.item.Directory; |
||||
|
import io.sc.platform.core.plugins.item.JsonSerializer; |
||||
|
import io.sc.platform.orm.service.support.QueryResult; |
||||
|
import org.springframework.data.domain.Page; |
||||
|
import org.springframework.stereotype.Controller; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.ResponseBody; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@Controller |
||||
|
@RequestMapping("/api/developer/plugins/jsonSerializers") |
||||
|
public class PluginJsonSerializersWebController { |
||||
|
@GetMapping("") |
||||
|
@ResponseBody |
||||
|
public Page<JsonSerializer> jsonSerializers(){ |
||||
|
List<JsonSerializer> plugins = PluginManager.getInstance().getJsonSerializers(); |
||||
|
return QueryResult.page(plugins); |
||||
|
} |
||||
|
} |
@ -0,0 +1,24 @@ |
|||||
|
package io.sc.platform.developer.controller.plugins; |
||||
|
|
||||
|
import io.sc.platform.core.plugins.PluginManager; |
||||
|
import io.sc.platform.core.plugins.item.Message; |
||||
|
import io.sc.platform.orm.plugins.item.Repository; |
||||
|
import io.sc.platform.orm.service.support.QueryResult; |
||||
|
import org.springframework.data.domain.Page; |
||||
|
import org.springframework.stereotype.Controller; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.ResponseBody; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@Controller |
||||
|
@RequestMapping("/api/developer/plugins/messages") |
||||
|
public class PluginMessagesWebController { |
||||
|
@GetMapping("") |
||||
|
@ResponseBody |
||||
|
public Page<Message> messages(){ |
||||
|
List<Message> plugins = PluginManager.getInstance().getMessages(); |
||||
|
return QueryResult.page(plugins); |
||||
|
} |
||||
|
} |
@ -0,0 +1,24 @@ |
|||||
|
package io.sc.platform.developer.controller.plugins; |
||||
|
|
||||
|
import io.sc.platform.core.plugins.item.JsonSerializer; |
||||
|
import io.sc.platform.jdbc.plugins.PluginManager; |
||||
|
import io.sc.platform.jdbc.plugins.item.P6spy; |
||||
|
import io.sc.platform.orm.service.support.QueryResult; |
||||
|
import org.springframework.data.domain.Page; |
||||
|
import org.springframework.stereotype.Controller; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.ResponseBody; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@Controller |
||||
|
@RequestMapping("/api/developer/plugins/p6spy") |
||||
|
public class PluginP6spyWebController { |
||||
|
@GetMapping("") |
||||
|
@ResponseBody |
||||
|
public Page<P6spy> p6spy(){ |
||||
|
List<P6spy> plugins = PluginManager.getInstance().getP6spys(); |
||||
|
return QueryResult.page(plugins); |
||||
|
} |
||||
|
} |
@ -0,0 +1,23 @@ |
|||||
|
package io.sc.platform.developer.controller.plugins; |
||||
|
|
||||
|
import io.sc.platform.mvc.plugins.PluginManager; |
||||
|
import io.sc.platform.mvc.plugins.item.Parameter; |
||||
|
import io.sc.platform.orm.service.support.QueryResult; |
||||
|
import org.springframework.data.domain.Page; |
||||
|
import org.springframework.stereotype.Controller; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.ResponseBody; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@Controller |
||||
|
@RequestMapping("/api/developer/plugins/parameters") |
||||
|
public class PluginParametersWebController { |
||||
|
@GetMapping("") |
||||
|
@ResponseBody |
||||
|
public Page<Parameter> parameters(){ |
||||
|
List<Parameter> plugins =PluginManager.getInstance().getParameters(); |
||||
|
return QueryResult.page(plugins); |
||||
|
} |
||||
|
} |
@ -0,0 +1,24 @@ |
|||||
|
package io.sc.platform.developer.controller.plugins; |
||||
|
|
||||
|
import io.sc.platform.core.plugins.item.Component; |
||||
|
import io.sc.platform.orm.plugins.PluginManager; |
||||
|
import io.sc.platform.orm.plugins.item.Repository; |
||||
|
import io.sc.platform.orm.service.support.QueryResult; |
||||
|
import org.springframework.data.domain.Page; |
||||
|
import org.springframework.stereotype.Controller; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.ResponseBody; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@Controller |
||||
|
@RequestMapping("/api/developer/plugins/repositories") |
||||
|
public class PluginRepositoriesWebController { |
||||
|
@GetMapping("") |
||||
|
@ResponseBody |
||||
|
public Page<Repository> repositories(){ |
||||
|
List<Repository> plugins = PluginManager.getInstance().getRepositories(); |
||||
|
return QueryResult.page(plugins); |
||||
|
} |
||||
|
} |
@ -0,0 +1,24 @@ |
|||||
|
package io.sc.platform.developer.controller.plugins; |
||||
|
|
||||
|
import io.sc.platform.core.plugins.PluginManager; |
||||
|
import io.sc.platform.core.plugins.item.ApplicationProperties; |
||||
|
import io.sc.platform.core.plugins.item.RestartProperties; |
||||
|
import io.sc.platform.orm.service.support.QueryResult; |
||||
|
import org.springframework.data.domain.Page; |
||||
|
import org.springframework.stereotype.Controller; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.ResponseBody; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@Controller |
||||
|
@RequestMapping("/api/developer/plugins/restartProperties") |
||||
|
public class PluginRestartPropertiesWebController { |
||||
|
@GetMapping("") |
||||
|
@ResponseBody |
||||
|
public Page<RestartProperties> restartProperties(){ |
||||
|
List<RestartProperties> plugins = PluginManager.getInstance().getRestartProperties(); |
||||
|
return QueryResult.page(plugins); |
||||
|
} |
||||
|
} |
@ -0,0 +1,24 @@ |
|||||
|
package io.sc.platform.developer.controller.plugins; |
||||
|
|
||||
|
import io.sc.platform.mvc.plugins.item.FrontEndRoute; |
||||
|
import io.sc.platform.orm.service.support.QueryResult; |
||||
|
import io.sc.platform.security.plugins.PluginManager; |
||||
|
import io.sc.platform.security.plugins.item.Security; |
||||
|
import org.springframework.data.domain.Page; |
||||
|
import org.springframework.stereotype.Controller; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.ResponseBody; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@Controller |
||||
|
@RequestMapping("/api/developer/plugins/security") |
||||
|
public class PluginSecurityWebController { |
||||
|
@GetMapping("") |
||||
|
@ResponseBody |
||||
|
public Page<Security> security(){ |
||||
|
List<Security> plugins = PluginManager.getInstance().getSecurities(); |
||||
|
return QueryResult.page(plugins); |
||||
|
} |
||||
|
} |
@ -0,0 +1,22 @@ |
|||||
|
package io.sc.platform.developer.controller.plugins; |
||||
|
|
||||
|
import io.sc.platform.jdbc.plugins.item.P6spy; |
||||
|
import io.sc.platform.mvc.plugins.PluginManager; |
||||
|
import io.sc.platform.orm.service.support.QueryResult; |
||||
|
import org.springframework.data.domain.Page; |
||||
|
import org.springframework.stereotype.Controller; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.ResponseBody; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@Controller |
||||
|
@RequestMapping("/api/developer/plugins/swagger") |
||||
|
public class PluginSwaggerWebController { |
||||
|
@GetMapping("") |
||||
|
@ResponseBody |
||||
|
public Page<P6spy> swagger(){ |
||||
|
return QueryResult.emptyPage(); |
||||
|
} |
||||
|
} |
@ -0,0 +1,35 @@ |
|||||
|
package io.sc.platform.developer.controller.plugins; |
||||
|
|
||||
|
import io.sc.platform.core.plugins.Plugin; |
||||
|
import io.sc.platform.core.plugins.PluginManager; |
||||
|
import io.sc.platform.developer.wrapper.plugins.SystemPropertyWrapper; |
||||
|
import io.sc.platform.orm.service.support.QueryResult; |
||||
|
import org.springframework.data.domain.Page; |
||||
|
import org.springframework.stereotype.Controller; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.ResponseBody; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
@Controller |
||||
|
@RequestMapping("/api/developer/plugins/systemProperties") |
||||
|
public class PluginSystemPropertiesWebController { |
||||
|
@GetMapping("") |
||||
|
@ResponseBody |
||||
|
public Page<SystemPropertyWrapper> systemProperties(){ |
||||
|
List<Plugin<Map<String, String>>> plugins = PluginManager.getInstance().getSystemPropertyPlugins(); |
||||
|
List<SystemPropertyWrapper> result =new ArrayList<>(); |
||||
|
for(Plugin<Map<String, String>> plugin : plugins){ |
||||
|
Map<String,String> map =plugin.getValue(); |
||||
|
for(String key : map.keySet()){ |
||||
|
SystemPropertyWrapper wrapper =new SystemPropertyWrapper(key,map.get(key)); |
||||
|
wrapper.setConfigurationFileUrl(plugin.getFileUrl()); |
||||
|
result.add(wrapper); |
||||
|
} |
||||
|
} |
||||
|
return QueryResult.page(result); |
||||
|
} |
||||
|
} |
@ -0,0 +1,24 @@ |
|||||
|
package io.sc.platform.developer.controller.plugins; |
||||
|
|
||||
|
import io.sc.platform.jdbc.plugins.item.P6spy; |
||||
|
import io.sc.platform.orm.service.support.QueryResult; |
||||
|
import io.sc.platform.ws.plugins.PluginManager; |
||||
|
import io.sc.platform.ws.plugins.item.JaxWsWebservice; |
||||
|
import org.springframework.data.domain.Page; |
||||
|
import org.springframework.stereotype.Controller; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.ResponseBody; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@Controller |
||||
|
@RequestMapping("/api/developer/plugins/ws") |
||||
|
public class PluginWsWebController { |
||||
|
@GetMapping("") |
||||
|
@ResponseBody |
||||
|
public Page<JaxWsWebservice> ws(){ |
||||
|
List<JaxWsWebservice> plugins = PluginManager.getInstance().getJaxWsWebservices(); |
||||
|
return QueryResult.page(plugins); |
||||
|
} |
||||
|
} |
@ -0,0 +1,73 @@ |
|||||
|
package io.sc.platform.developer.controller.springboot; |
||||
|
|
||||
|
import io.sc.platform.developer.wrapper.springboot.BeanWrapper; |
||||
|
import io.sc.platform.orm.service.support.QueryParameter; |
||||
|
import io.sc.platform.orm.service.support.QueryResult; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.boot.actuate.beans.BeansEndpoint; |
||||
|
import org.springframework.boot.actuate.beans.BeansEndpoint.BeanDescriptor; |
||||
|
import org.springframework.boot.actuate.beans.BeansEndpoint.ContextBeans; |
||||
|
import org.springframework.data.domain.Page; |
||||
|
import org.springframework.data.domain.Sort; |
||||
|
import org.springframework.data.domain.Sort.Order; |
||||
|
import org.springframework.stereotype.Controller; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.ResponseBody; |
||||
|
|
||||
|
import java.util.*; |
||||
|
|
||||
|
@Controller |
||||
|
@RequestMapping("/api/developer/springboot/beans") |
||||
|
public class SpringbootBeansWebController { |
||||
|
@Autowired BeansEndpoint beansEndpoint; |
||||
|
|
||||
|
@GetMapping("") |
||||
|
@ResponseBody |
||||
|
public Page<BeanWrapper> beans(QueryParameter queryParameter){ |
||||
|
List<BeanWrapper> result =new ArrayList<>(); |
||||
|
Map<String, ContextBeans> contexts =beansEndpoint.beans().getContexts(); |
||||
|
for(Map.Entry<String, ContextBeans> contextEntry : contexts.entrySet()){ |
||||
|
String context =contextEntry.getKey(); |
||||
|
ContextBeans contextBeans =contextEntry.getValue(); |
||||
|
Map<String, BeanDescriptor> beans =contextBeans.getBeans(); |
||||
|
for(Map.Entry<String, BeanDescriptor> beanEntry : beans.entrySet()){ |
||||
|
String beanName =beanEntry.getKey(); |
||||
|
BeanDescriptor beanDescriptor =beanEntry.getValue(); |
||||
|
result.add(new BeanWrapper(context,beanName,beanDescriptor)); |
||||
|
} |
||||
|
} |
||||
|
if(queryParameter!=null){ |
||||
|
Sort sort =queryParameter.getSort(); |
||||
|
if(sort!=null){ |
||||
|
Order order =sort.iterator().next(); |
||||
|
if(order!=null){ |
||||
|
if("name".equalsIgnoreCase(order.getProperty())){ |
||||
|
if(order.isAscending()){ |
||||
|
result.sort(new BeanNameAscComparator()); |
||||
|
}else{ |
||||
|
result.sort(new BeanNameDescComparator()); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
return QueryResult.page(result); |
||||
|
} |
||||
|
|
||||
|
private class BeanNameAscComparator implements Comparator<BeanWrapper> { |
||||
|
@Override |
||||
|
public int compare(BeanWrapper o1, BeanWrapper o2) { |
||||
|
return o1.getName().compareTo(o2.getName()); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
private class BeanNameDescComparator implements Comparator<BeanWrapper> { |
||||
|
@Override |
||||
|
public int compare(BeanWrapper o1, BeanWrapper o2) { |
||||
|
return o2.getName().compareTo(o1.getName()); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
@ -1,4 +1,4 @@ |
|||||
package io.sc.platform.developer.plugins.wrapper; |
package io.sc.platform.developer.wrapper.plugins; |
||||
|
|
||||
import io.sc.platform.core.initializer.ApplicationInitializer; |
import io.sc.platform.core.initializer.ApplicationInitializer; |
||||
|
|
@ -0,0 +1,40 @@ |
|||||
|
package io.sc.platform.developer.wrapper.plugins; |
||||
|
|
||||
|
public class SystemPropertyWrapper { |
||||
|
private String name; |
||||
|
private String value; |
||||
|
|
||||
|
//附加属性
|
||||
|
private String configurationFileUrl; //菜单贡献项配置文件位置
|
||||
|
|
||||
|
public SystemPropertyWrapper(){} |
||||
|
|
||||
|
public SystemPropertyWrapper(String name,String value){ |
||||
|
this.name =name; |
||||
|
this.value =value; |
||||
|
} |
||||
|
|
||||
|
public String getName() { |
||||
|
return name; |
||||
|
} |
||||
|
|
||||
|
public void setName(String name) { |
||||
|
this.name = name; |
||||
|
} |
||||
|
|
||||
|
public String getValue() { |
||||
|
return value; |
||||
|
} |
||||
|
|
||||
|
public void setValue(String value) { |
||||
|
this.value = value; |
||||
|
} |
||||
|
|
||||
|
public String getConfigurationFileUrl() { |
||||
|
return configurationFileUrl; |
||||
|
} |
||||
|
|
||||
|
public void setConfigurationFileUrl(String configurationFileUrl) { |
||||
|
this.configurationFileUrl = configurationFileUrl; |
||||
|
} |
||||
|
} |
@ -0,0 +1,81 @@ |
|||||
|
package io.sc.platform.developer.wrapper.springboot; |
||||
|
|
||||
|
import org.springframework.boot.actuate.beans.BeansEndpoint.BeanDescriptor; |
||||
|
|
||||
|
public class BeanWrapper { |
||||
|
private String context; |
||||
|
private String name; |
||||
|
private String[] aliases; |
||||
|
private String scope; |
||||
|
private Class<?> type; |
||||
|
private String resource; |
||||
|
private String[] dependencies; |
||||
|
|
||||
|
public BeanWrapper(String context, String name, BeanDescriptor beanDescriptor){ |
||||
|
this.context =context; |
||||
|
this.name =name; |
||||
|
if(beanDescriptor!=null){ |
||||
|
this.aliases =beanDescriptor.getAliases(); |
||||
|
this.scope =beanDescriptor.getScope(); |
||||
|
this.type =beanDescriptor.getType(); |
||||
|
this.resource =beanDescriptor.getResource(); |
||||
|
this.dependencies =beanDescriptor.getDependencies(); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public String getContext() { |
||||
|
return context; |
||||
|
} |
||||
|
|
||||
|
public void setContext(String context) { |
||||
|
this.context = context; |
||||
|
} |
||||
|
|
||||
|
public String getName() { |
||||
|
return name; |
||||
|
} |
||||
|
|
||||
|
public void setName(String name) { |
||||
|
this.name = name; |
||||
|
} |
||||
|
|
||||
|
public String[] getAliases() { |
||||
|
return aliases; |
||||
|
} |
||||
|
|
||||
|
public void setAliases(String[] aliases) { |
||||
|
this.aliases = aliases; |
||||
|
} |
||||
|
|
||||
|
public String getScope() { |
||||
|
return scope; |
||||
|
} |
||||
|
|
||||
|
public void setScope(String scope) { |
||||
|
this.scope = scope; |
||||
|
} |
||||
|
|
||||
|
public Class<?> getType() { |
||||
|
return type; |
||||
|
} |
||||
|
|
||||
|
public void setType(Class<?> type) { |
||||
|
this.type = type; |
||||
|
} |
||||
|
|
||||
|
public String getResource() { |
||||
|
return resource; |
||||
|
} |
||||
|
|
||||
|
public void setResource(String resource) { |
||||
|
this.resource = resource; |
||||
|
} |
||||
|
|
||||
|
public String[] getDependencies() { |
||||
|
return dependencies; |
||||
|
} |
||||
|
|
||||
|
public void setDependencies(String[] dependencies) { |
||||
|
this.dependencies = dependencies; |
||||
|
} |
||||
|
} |
@ -1,5 +1,6 @@ |
|||||
{ |
{ |
||||
"includes":[ |
"includes":[ |
||||
"io.sc.platform.developer.plugins.controller" |
"io.sc.platform.developer.controller.plugins", |
||||
|
"io.sc.platform.developer.controller.springboot" |
||||
] |
] |
||||
} |
} |
@ -1,5 +0,0 @@ |
|||||
{ |
|
||||
"includes":[ |
|
||||
|
|
||||
] |
|
||||
} |
|
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue