mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-06-13 02:49:37 +00:00
58838f225c
Rewrite of the UI using Typescript, Vue3, Windicss and Vite. The design should be close to the current one with some changes: - latest pipeline in a sidebar on the right - secrets and registry as part of the repo-settings (secrets and registry entries shouldn't be used as much so they can be "hidden" under settings IMO) - start page shows list of active repositories with button to enable / add new ones (currently you see all repositories and in most cases you only add new repositories once in a while)
49 lines
1,009 B
Vue
49 lines
1,009 B
Vue
<template>
|
|
<TextField v-model="innerValue" :placeholder="placeholder" type="number" />
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
import { computed, defineComponent, toRef } from 'vue';
|
|
|
|
import TextField from '~/components/form/TextField.vue';
|
|
|
|
export default defineComponent({
|
|
name: 'NumberField',
|
|
|
|
components: { TextField },
|
|
|
|
props: {
|
|
// used by toRef
|
|
// eslint-disable-next-line vue/no-unused-properties
|
|
modelValue: {
|
|
type: Number,
|
|
required: true,
|
|
},
|
|
|
|
placeholder: {
|
|
type: String,
|
|
default: '',
|
|
},
|
|
},
|
|
|
|
emits: {
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
'update:modelValue': (_value: number): boolean => true,
|
|
},
|
|
|
|
setup: (props, ctx) => {
|
|
const modelValue = toRef(props, 'modelValue');
|
|
const innerValue = computed({
|
|
get: () => modelValue.value.toString(),
|
|
set: (value) => {
|
|
ctx.emit('update:modelValue', parseFloat(value));
|
|
},
|
|
});
|
|
|
|
return {
|
|
innerValue,
|
|
};
|
|
},
|
|
});
|
|
</script>
|