This commit is contained in:
mattyatea 2023-09-26 10:54:01 +09:00
parent ff2df67c57
commit 85c9b35d03
3 changed files with 87 additions and 8 deletions

View file

@ -20,8 +20,8 @@ SPDX-License-Identifier: AGPL-3.0-only
[$style.large]: large,
[$style.transparent]: transparent,
[$style.asLike]: asLike,
[$style.gamingDark]: gamingType === 'dark',
[$style.gamingLight]: gamingType === 'light',
[$style.gamingDark]: gaming === 'dark',
[$style.gamingLight]: gaming === 'light',
}
]"
:type="type"
@ -50,8 +50,8 @@ SPDX-License-Identifier: AGPL-3.0-only
[$style.large]: large,
[$style.transparent]: transparent,
[$style.asLike]: asLike,
[$style.gamingDark]: gamingType === 'dark',
[$style.gamingLight]: gamingType === 'light',
[$style.gamingDark]: gaming === 'dark',
[$style.gamingLight]: gaming === 'light',
}
]"
:to="to"
@ -90,9 +90,39 @@ const props = defineProps<{
name?: string;
value?: string;
}>();
const darkMode = computed(defaultStore.makeGetterSetter('darkMode'));
const gamingMode = computed(defaultStore.makeGetterSetter('gamingMode'));
// gamingref
let gaming = ref(''); // 0-off , 1-dark , 2-light
const gamingType = computed(defaultStore.makeGetterSetter('gamingType'));
// gaming.value
if (darkMode.value && gamingMode.value && props.primary || darkMode.value && gamingMode.value && props.gradate ) {
gaming.value = 'dark';
} else if (!darkMode.value && gamingMode.value && props.primary || darkMode.value && gamingMode.value && props.gradate ) {
gaming.value = 'light';
}else{
gaming.value = '';
}
watch(darkMode, () => {
if (darkMode.value && gamingMode.value && props.primary || darkMode.value && gamingMode.value && props.gradate ) {
gaming.value = 'dark';
} else if (!darkMode.value && gamingMode.value && props.primary|| darkMode.value && gamingMode.value && props.gradate) {
gaming.value = 'light';
}else{
gaming.value = '';
}
})
watch(gamingMode, () => {
if (darkMode.value && gamingMode.value && props.primary|| darkMode.value && gamingMode.value && props.gradate ) {
gaming.value = 'dark';
} else if (!darkMode.value && gamingMode.value && props.primary || darkMode.value && gamingMode.value && props.gradate ) {
gaming.value = 'light';
}else{
gaming.value = '';
}
})
const emit = defineEmits<{
(ev: 'click', payload: MouseEvent): void;

View file

@ -13,6 +13,8 @@
<MkButton inline @click="addTagBulk">Add tag</MkButton>
<MkButton inline @click="removeTagBulk">Remove tag</MkButton>
<MkButton inline @click="setLisenceBulk">Set Lisence</MkButton>
<MkButton inline @click="setisSensitiveBulk">Set isSensitive</MkButton>
<MkButton inline @click="setlocalOnlyBulk">Set localOnly</MkButton>
<MkButton inline danger @click="delBulk">Delete</MkButton>
</div>
<MkPagination ref="emojisPaginationComponent" :pagination="pagination" :displayLimit="100">
@ -62,7 +64,30 @@ const pagination = {
query: (query.value && query.value !== '') ? query.value : null,
})),
};
const setisSensitiveBulk = async () => {
const { canceled, result } = await os.switch1({
title: 'isSensitive',
type: "mksw"
});
if (canceled) return;
await os.apiWithDialog('admin/emoji/set-issensitive-bulk', {
ids: selectedEmojis.value,
isSensitive: result
});
emojisPaginationComponent.value.reload();
};
const setlocalOnlyBulk = async () => {
const { canceled, result } = await os.switch1({
title: 'localOnly',
type: "mksw"
});
if (canceled) return;
await os.apiWithDialog('admin/emoji/set-localonly-bulk', {
ids: selectedEmojis.value,
localOnly: result
});
emojisPaginationComponent.value.reload();
};
const selectAll = () => {
if (selectedEmojis.value.length > 0) {
selectedEmojis.value = [];
@ -123,6 +148,30 @@ const setLisenceBulk = async () => {
emojisPaginationComponent.value.reload();
};
const isLocalBulk = async () => {
const { canceled, result } = await os.inputText({
title: 'License',
});
if (canceled) return;
await os.apiWithDialog('admin/emoji/set-islocal-bulk', {
ids: selectedEmojis.value,
isLocal: result,
});
emojisPaginationComponent.value.reload();
};
const isSensitiveBulk = async () => {
const { canceled, result } = await os.inputText({
title: 'License',
});
if (canceled) return;
await os.apiWithDialog('admin/emoji/set-issensitive-bulk', {
ids: selectedEmojis.value,
license: result,
});
emojisPaginationComponent.value.reload();
};
const addTagBulk = async () => {
const { canceled, result } = await os.inputText({
title: 'Tag',

View file

@ -111,9 +111,9 @@ document.documentElement.style.setProperty("--localOnlyColor",hexToRgb(defaultSt
document.documentElement.style.setProperty('--gamingspeed', defaultStore.state.numberOfGamingSpeed+'s');
const iconOnly = ref(false);
let bannerUrl = ref(defaultStore.state.bannerUrl);
let bannerUrl = computed(defaultStore.makeGetterSetter('bannerUrl'));
let iconUrl = ref();
let gamingType = ref(defaultStore.state.gamingType);
let gamingType = computed(defaultStore.makeGetterSetter('gamingType'));
const gamingMode = computed(defaultStore.makeGetterSetter('gamingMode'));
const darkMode = computed(defaultStore.makeGetterSetter('darkMode'));