mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-22 12:13:48 +01:00
[Client] Improve admin panel usability
This commit is contained in:
parent
f43a9b9fb0
commit
5f9a8b449b
@ -1151,6 +1151,9 @@ admin/views/announcements.vue:
|
|||||||
title: "タイトル"
|
title: "タイトル"
|
||||||
text: "内容"
|
text: "内容"
|
||||||
saved: "保存しました"
|
saved: "保存しました"
|
||||||
|
_remove:
|
||||||
|
are-you-sure: "「$1」を削除しますか?"
|
||||||
|
removed: "削除しました"
|
||||||
|
|
||||||
admin/views/hashtags.vue:
|
admin/views/hashtags.vue:
|
||||||
hided-tags: "Hidden Tags"
|
hided-tags: "Hidden Tags"
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
<span>%i18n:@text%</span>
|
<span>%i18n:@text%</span>
|
||||||
</ui-textarea>
|
</ui-textarea>
|
||||||
<ui-horizon-group>
|
<ui-horizon-group>
|
||||||
<ui-button @click="save">%fa:save R% %i18n:@save%</ui-button>
|
<ui-button @click="save()">%fa:save R% %i18n:@save%</ui-button>
|
||||||
<ui-button @click="remove(i)">%fa:trash-alt R% %i18n:@remove%</ui-button>
|
<ui-button @click="remove(i)">%fa:trash-alt R% %i18n:@remove%</ui-button>
|
||||||
</ui-horizon-group>
|
</ui-horizon-group>
|
||||||
</section>
|
</section>
|
||||||
@ -46,18 +46,31 @@ export default Vue.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
remove(i) {
|
remove(i) {
|
||||||
this.announcements = this.announcements.filter((_, j) => j !== i);
|
this.$swal({
|
||||||
this.save();
|
type: 'warning',
|
||||||
|
text: '%i18n:@_remove.are-you-sure%'.replace('$1', this.announcements.find((_, j) => j == i).title),
|
||||||
|
showCancelButton: true
|
||||||
|
}).then(res => {
|
||||||
|
if (!res.value) return;
|
||||||
|
this.announcements = this.announcements.filter((_, j) => j !== i);
|
||||||
|
this.save(true);
|
||||||
|
this.$swal({
|
||||||
|
type: 'success',
|
||||||
|
text: '%i18n:@_remove.removed%'
|
||||||
|
});
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
save() {
|
save(silent) {
|
||||||
(this as any).api('admin/update-meta', {
|
(this as any).api('admin/update-meta', {
|
||||||
broadcasts: this.announcements
|
broadcasts: this.announcements
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.$swal({
|
if (!silent) {
|
||||||
type: 'success',
|
this.$swal({
|
||||||
text: '%i18n:@saved%'
|
type: 'success',
|
||||||
});
|
text: '%i18n:@saved%'
|
||||||
|
});
|
||||||
|
}
|
||||||
}).catch(e => {
|
}).catch(e => {
|
||||||
this.$swal({
|
this.$swal({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
|
Loading…
Reference in New Issue
Block a user