-
Notifications
You must be signed in to change notification settings - Fork 492
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: duplicate site config to remote #70
- Loading branch information
Showing
6 changed files
with
114 additions
and
12 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
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,51 @@ | ||
<script setup lang="ts"> | ||
import {computed, ref} from 'vue' | ||
import environment from '@/api/environment' | ||
import {useGettext} from 'vue3-gettext' | ||
const {$gettext} = useGettext() | ||
const props = defineProps(['target', 'map']) | ||
const emit = defineEmits(['update:target']) | ||
const data = ref([]) | ||
const data_map = ref({}) | ||
environment.get_list().then(r => { | ||
data.value = r.data | ||
r.data.forEach(node => { | ||
data_map[node.id] = node | ||
}) | ||
}) | ||
const value = computed({ | ||
get() { | ||
return props.target | ||
}, | ||
set(v) { | ||
if (typeof props.map === 'object') { | ||
v.forEach(id => { | ||
if (id !== 0) props.map[id] = data_map[id].name | ||
}) | ||
} | ||
emit('update:target', v) | ||
} | ||
}) | ||
</script> | ||
|
||
<template> | ||
<a-checkbox-group v-model:value="value" style="width: 100%"> | ||
<a-row> | ||
<a-col :span="8"> | ||
<a-checkbox :value="0">{{ $gettext('Local') }}</a-checkbox> | ||
</a-col> | ||
<a-col :span="8" v-for="node in data"> | ||
<a-checkbox :value="node.id">{{ node.name }}</a-checkbox> | ||
</a-col> | ||
</a-row> | ||
</a-checkbox-group> | ||
</template> | ||
|
||
<style scoped lang="less"> | ||
</style> |
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