-
-
Notifications
You must be signed in to change notification settings - Fork 256
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(manager): support bot create settings
- Loading branch information
Showing
15 changed files
with
234 additions
and
196 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 0 additions & 27 deletions
27
plugins/frontend/console/client/components/form/schema-group.vue
This file was deleted.
Oops, something went wrong.
33 changes: 0 additions & 33 deletions
33
plugins/frontend/console/client/components/form/schema-union.vue
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
plugins/frontend/console/client/components/form/schema/primitive.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<template> | ||
<div class="schema-item"> | ||
<div class="schema-header"> | ||
<div class="left"> | ||
<slot></slot> | ||
</div> | ||
<div class="right"> | ||
<el-switch v-if="schema.type === 'boolean'" v-model="config"></el-switch> | ||
<template v-else> | ||
<k-input v-model="config" | ||
:style="{ width: schema.meta.role === 'url' ? '18rem' : '12rem' }" | ||
:type="schema.type === 'number' ? 'number' : schema.meta.role === 'secret' && !showPass ? 'password' : 'text'"> | ||
<template #suffix v-if="schema.meta.role === 'url'"> | ||
<a :href="config" target="_blank" rel="noopener noreferrer"> | ||
<k-icon name="external"></k-icon> | ||
</a> | ||
</template> | ||
<template #suffix v-else-if="schema.meta.role === 'secret'"> | ||
<k-icon :name="showPass ? 'eye' : 'eye-slash'" @click="showPass = !showPass"></k-icon> | ||
</template> | ||
</k-input> | ||
</template> | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { computed, PropType, ref } from 'vue' | ||
import Schema from 'schemastery' | ||
const emit = defineEmits(['update:modelValue']) | ||
const props = defineProps({ | ||
schema: {} as PropType<Schema>, | ||
modelValue: {}, | ||
}) | ||
const showPass = ref(false) | ||
const config = computed({ | ||
get: () => props.modelValue, | ||
set: emit.bind(null, 'update:modelValue'), | ||
}) | ||
</script> |
64 changes: 64 additions & 0 deletions
64
plugins/frontend/console/client/components/form/schema/union.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<template> | ||
<k-schema v-if="choices.length === 1" :schema="choices[0]" :prefix="prefix" v-model="config"> | ||
<slot></slot> | ||
</k-schema> | ||
|
||
<div class="schema-item" v-else-if="isSelect"> | ||
<div class="schema-header"> | ||
<div class="left"> | ||
<slot></slot> | ||
</div> | ||
<div class="right"> | ||
<el-select v-model="config"> | ||
<el-option | ||
v-for="item in choices" | ||
:key="item.value" | ||
:label="item.value" | ||
:value="item.value" | ||
></el-option> | ||
</el-select> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="schema-item" v-else> | ||
<slot></slot> | ||
<ul v-if="choices.every(item => item.type === 'const')"> | ||
<li v-for="item in choices" :key="item.value"> | ||
<k-radio :label="item.value" v-model="selected">{{ item.meta.description || item.value }}</k-radio> | ||
</li> | ||
</ul> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { computed, ref } from 'vue' | ||
import type { PropType } from 'vue' | ||
import Schema from 'schemastery' | ||
const emit = defineEmits(['update:modelValue']) | ||
const props = defineProps({ | ||
schema: {} as PropType<Schema>, | ||
modelValue: {}, | ||
prefix: String, | ||
}) | ||
const config = computed({ | ||
get: () => props.modelValue, | ||
set: emit.bind(null, 'update:modelValue'), | ||
}) | ||
const choices = computed(() => { | ||
return props.schema.list.filter(item => item.type !== 'transform') | ||
}) | ||
const isSelect = computed(() => { | ||
return choices.value.every(item => item.type === 'const') | ||
&& choices.value.some(item => !item.meta.description) | ||
}) | ||
const selected = ref(props.schema.meta.default) | ||
</script> |
Oops, something went wrong.