mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-22 20:23:49 +01:00
refactor(client): refactor import-export to use Composition API (#8579)
This commit is contained in:
parent
e0950fe5ea
commit
edf8f94fec
@ -37,8 +37,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts" setup>
|
||||||
import { defineComponent, onMounted, ref } from 'vue';
|
import { defineExpose, ref } from 'vue';
|
||||||
import MkButton from '@/components/ui/button.vue';
|
import MkButton from '@/components/ui/button.vue';
|
||||||
import FormSection from '@/components/form/section.vue';
|
import FormSection from '@/components/form/section.vue';
|
||||||
import FormGroup from '@/components/form/group.vue';
|
import FormGroup from '@/components/form/group.vue';
|
||||||
@ -48,23 +48,6 @@ import { selectFile } from '@/scripts/select-file';
|
|||||||
import * as symbols from '@/symbols';
|
import * as symbols from '@/symbols';
|
||||||
import { i18n } from '@/i18n';
|
import { i18n } from '@/i18n';
|
||||||
|
|
||||||
export default defineComponent({
|
|
||||||
components: {
|
|
||||||
FormSection,
|
|
||||||
FormGroup,
|
|
||||||
FormSwitch,
|
|
||||||
MkButton,
|
|
||||||
},
|
|
||||||
|
|
||||||
emits: ['info'],
|
|
||||||
|
|
||||||
setup(props, context) {
|
|
||||||
const INFO = {
|
|
||||||
title: i18n.ts.importAndExport,
|
|
||||||
icon: 'fas fa-boxes',
|
|
||||||
bg: 'var(--bg)',
|
|
||||||
};
|
|
||||||
|
|
||||||
const excludeMutingUsers = ref(false);
|
const excludeMutingUsers = ref(false);
|
||||||
const excludeInactiveUsers = ref(false);
|
const excludeInactiveUsers = ref(false);
|
||||||
|
|
||||||
@ -82,10 +65,10 @@ export default defineComponent({
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const onError = (e) => {
|
const onError = (ev) => {
|
||||||
os.alert({
|
os.alert({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
text: e.message,
|
text: ev.message,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -133,23 +116,12 @@ export default defineComponent({
|
|||||||
os.api('i/import-blocking', { fileId: file.id }).then(onImportSuccess).catch(onError);
|
os.api('i/import-blocking', { fileId: file.id }).then(onImportSuccess).catch(onError);
|
||||||
};
|
};
|
||||||
|
|
||||||
return {
|
defineExpose({
|
||||||
[symbols.PAGE_INFO]: INFO,
|
[symbols.PAGE_INFO]: {
|
||||||
excludeMutingUsers,
|
title: i18n.ts.importAndExport,
|
||||||
excludeInactiveUsers,
|
icon: 'fas fa-boxes',
|
||||||
|
bg: 'var(--bg)',
|
||||||
exportNotes,
|
}
|
||||||
exportFollowing,
|
|
||||||
exportBlocking,
|
|
||||||
exportUserLists,
|
|
||||||
exportMuting,
|
|
||||||
|
|
||||||
importFollowing,
|
|
||||||
importUserLists,
|
|
||||||
importMuting,
|
|
||||||
importBlocking,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user