mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-27 02:13:08 +02:00
管理画面の広告を10個以上見えるように (#9990)
* 日付のフォーマット指定と変更がうまくいかない * もっとのボタンで応急処置 * Update packages/frontend/src/pages/admin/ads.vue Co-authored-by: syuilo <Syuilotan@yahoo.co.jp> * Update packages/frontend/src/pages/admin/ads.vue Co-authored-by: syuilo <Syuilotan@yahoo.co.jp> * Update packages/frontend/src/pages/admin/ads.vue Co-authored-by: syuilo <Syuilotan@yahoo.co.jp> * Revert "日付のフォーマット指定と変更がうまくいかない" This reverts commit c8a81364ef7aac3210723afba66723dacc5a221e. --------- Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
This commit is contained in:
parent
beb9cd5710
commit
543ba2b3b7
1 changed files with 20 additions and 4 deletions
|
@ -44,9 +44,11 @@
|
|||
<MkButton class="button" inline danger @click="remove(ad)"><i class="ti ti-trash"></i> {{ i18n.ts.remove }}</MkButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</MkSpacer>
|
||||
</MkStickyContainer>
|
||||
<MkButton class="button" @click="more()">
|
||||
<i class="ti ti-reload"></i>{{ i18n.ts.more }}
|
||||
</MkButton>
|
||||
</MkSpacer>
|
||||
</MkStickyContainer>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
|
@ -123,7 +125,21 @@ function save(ad) {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
function more() {
|
||||
os.api('admin/ad/list', { untilId: ads.reduce((acc, ad) => ad.id != null ? ad : acc).id }).then(adsResponse => {
|
||||
ads = ads.concat(adsResponse.map(r => {
|
||||
const exdate = new Date(r.expiresAt);
|
||||
const stdate = new Date(r.startsAt);
|
||||
exdate.setMilliseconds(exdate.getMilliseconds() - localTimeDiff);
|
||||
stdate.setMilliseconds(stdate.getMilliseconds() - localTimeDiff);
|
||||
return {
|
||||
...r,
|
||||
expiresAt: exdate.toISOString().slice(0, 16),
|
||||
startsAt: stdate.toISOString().slice(0, 16),
|
||||
};
|
||||
}));
|
||||
});
|
||||
}
|
||||
const headerActions = $computed(() => [{
|
||||
asFullButton: true,
|
||||
icon: 'ti ti-plus',
|
||||
|
|
Loading…
Reference in a new issue