Skip to content

Commit 65ac5e5

Browse files
committed
v.1.10
1 parent 35b0a7b commit 65ac5e5

18 files changed

+79
-100
lines changed

reader/src/ASTRv2/contentpage.vue

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ import {
177177
} from "@vicons/material";
178178
import { useLoadingBar, useDialog, useMessage, messageDark } from "naive-ui";
179179
import { defineComponent, ref } from "vue";
180+
import source from "./source.js";
180181
181182
export default {
182183
data() {
@@ -256,25 +257,20 @@ export default {
256257
this.loading = true;
257258
// using await
258259
try{
259-
let res = await fetch(
260-
"https://raw.githubusercontent.com/050644zf/ArknightsStoryJson/main/" +
261-
this.server +
262-
"/gamedata/story/" +
263-
this.path +
264-
".json"
265-
);
260+
// let res = await fetch(
261+
// "https://raw.githubusercontent.com/050644zf/ArknightsStoryJson/main/" +
262+
// this.server +
263+
// "/gamedata/story/" +
264+
// this.path +
265+
// ".json"
266+
// );
267+
let res = await source.getData(this.server, "/gamedata/story/" + this.path + ".json");
266268
let s = await res.json();
267269
let altserver = func.alt;
268270
if (altserver != "none"){
269271
try{
270272
271-
let res2 = await fetch(
272-
"https://raw.githubusercontent.com/050644zf/ArknightsStoryJson/main/" +
273-
altserver +
274-
"/gamedata/story/" +
275-
this.path +
276-
".json"
277-
);
273+
let res2 = await source.getData(altserver, "/gamedata/story/" + this.path + ".json");
278274
this.altserverdata = await res2.json();
279275
280276

reader/src/ASTRv2/export.vue

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@
1212
$t('eventpage.export2excel')
1313
}}</n-breadcrumb-item>
1414
</n-breadcrumb>
15+
16+
<n-alert type="warning" show-icon>
17+
{{ $t('eventpage.export.warning') }} <br/>
18+
<n-a href="https://github.com/codespaces/new?hide_repo_select=true&ref=main&repo=495279163">
19+
<n-image src="https://github.com/codespaces/badge.svg" preview-disabled></n-image>
20+
</n-a>
21+
</n-alert>
22+
1523
<n-data-table
1624
:columns="cols"
1725
:data="exportList"
@@ -103,6 +111,7 @@ import {
103111
ClearAllOutlined,
104112
FileDownloadOutlined,
105113
} from "@vicons/material";
114+
import source from "./source";
106115
107116
export default {
108117
data() {
@@ -197,13 +206,7 @@ export default {
197206
" " +
198207
story.storyName +
199208
"\n";
200-
let storyData = await fetch(
201-
"https://raw.githubusercontent.com/050644zf/ArknightsStoryJson/main/" +
202-
story.server +
203-
"/gamedata/story/" +
204-
story.path +
205-
".json"
206-
);
209+
let storyData = await source.getData(story.server, "/gamedata/story/" + story.path + ".json");
207210
storyData = await storyData.json();
208211
let storyList = this.reader(storyData);
209212
let sheet = xlsx.utils.aoa_to_sheet(storyList);

reader/src/ASTRv2/footer.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747

4848
<script>
4949
import { Github, Discord, Patreon } from "@vicons/fa";
50+
import source from "./source";
5051
5152
export default {
5253
data() {
@@ -60,9 +61,10 @@ export default {
6061
Patreon,
6162
},
6263
created() {
63-
fetch(
64-
"https://raw.githubusercontent.com/050644zf/ArknightsStoryJson/main/log.json"
65-
)
64+
// fetch(
65+
// "https://raw.githubusercontent.com/050644zf/ArknightsStoryJson/main/log.json"
66+
// )
67+
source.getData("", "log.json")
6668
.then((r) => r.json())
6769
.then((s) => {
6870
this.latestUpdate = s["latestCommitTime"];

reader/src/ASTRv2/header.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
</router-link>
3535
<n-text depth="3" class="astrversion">
3636
Arknights Story Text Reader <br />
37-
Version 1.9
37+
Version 1.10
3838
</n-text>
3939
</n-space>
4040
</n-space>

reader/src/ASTRv2/menu.vue

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
</template>
66

77
<script>
8+
import source from './source';
9+
810
export default {
911
data() {
1012
return {
@@ -23,16 +25,17 @@ export default {
2325
},
2426
methods: {
2527
async loadData() {
26-
this.data = await fetch(
27-
"https://raw.githubusercontent.com/Kengxxiao/ArknightsGameData/master/" +
28-
this.server +
29-
"/gamedata/excel/story_review_table.json"
30-
).then((res) => res.json());
31-
this.chardict = await fetch(
32-
"https://raw.githubusercontent.com/050644zf/ArknightsStoryJson/main/" +
33-
this.server +
34-
"/chardict.json"
35-
).then((res) => res.json());
28+
// this.data = await fetch(
29+
// "https://raw.githubusercontent.com/Kengxxiao/ArknightsGameData/master/" +
30+
// this.server +
31+
// "/gamedata/excel/story_review_table.json"
32+
this.data = await source.getData(this.server, "/gamedata/excel/story_review_table.json").then((res) => res.json());
33+
// this.chardict = await fetch(
34+
// "https://raw.githubusercontent.com/050644zf/ArknightsStoryJson/main/" +
35+
// this.server +
36+
// "/chardict.json"
37+
// ).then((res) => res.json());
38+
this.chardict = await source.getData("050644zf", "/chardict.json").then((res) => res.json());
3639
this.eventList = await this.getEventList(this.data, this.chardict);
3740
},
3841
async getEventList(reviewData, chardict) {

reader/src/ASTRv2/menupage/changelog.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
<template #header>
44
<n-h2 prefix="bar">Changelog</n-h2>
55
</template>
6+
<n-h4>v1.10</n-h4>
7+
<n-oi>
8+
<n-li>Migrate the ArknightsJson repo to Cloudflare R2 service. If the R2 is unavailable will fallback to githubusercontent.</n-li>
9+
</n-oi>
610
<n-h4>v1.9.2</n-h4>
711
<n-oi>
812
<n-li> Adding i18n keys for homepage.

reader/src/ASTRv2/menupage/events.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@
4949
<n-image
5050
v-if="eventype != 'or'"
5151
:src="
52-
'https://raw.githubusercontent.com/050644zf/ArknightsStoryJson/main/img/banners/' +
52+
'https://r2.m31ns.top/img/banners/' +
5353
edata.id +
5454
'.png'
5555
"
56-
fallback-src="https://raw.githubusercontent.com/050644zf/ArknightsStoryJson/main/img/banners/404.png"
56+
fallback-src="https://r2.m31ns.top/img/banners/404.png"
5757
preview-disabled
5858
/>
5959
<n-image
@@ -66,7 +66,7 @@
6666
'.png'
6767
"
6868
style="height: 64px"
69-
fallback-src="https://raw.githubusercontent.com/050644zf/ArknightsStoryJson/main/img/icons/404.png"
69+
fallback-src="https://r2.m31ns.top/img/icons/404.png"
7070
preview-disabled
7171
/>
7272
<n-flex vertical justify="space-around">

reader/src/ASTRv2/menupage/homepage.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
})
2323
">
2424
<template #cover>
25-
<n-image :src="'https://raw.githubusercontent.com/050644zf/ArknightsStoryJson/main/img/banners/' +
25+
<n-image :src="'https://r2.m31ns.top/img/banners/' +
2626
latestEvents[0].id +
2727
'.png'
28-
" fallback-src="https://raw.githubusercontent.com/050644zf/ArknightsStoryJson/main/img/banners/404.png"
28+
" fallback-src="https://r2.m31ns.top/img/banners/404.png"
2929
preview-disabled />
3030
</template>
3131
<template #header-extra>

reader/src/ASTRv2/menupage/maintheme.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@
2929
<template #cover>
3030
<n-image
3131
:src="
32-
'https://raw.githubusercontent.com/050644zf/ArknightsStoryJson/main/img/icons/' +
32+
'https://r2.m31ns.top/img/icons/' +
3333
eid +
3434
'.png'
3535
"
3636
class="mainicon"
3737
style="height: 100px; width: 100px; margin: auto"
3838
preview-disabled
39-
fallback-src="https://raw.githubusercontent.com/050644zf/ArknightsStoryJson/main/img/icons/404.png"
39+
fallback-src="https://r2.m31ns.top/img/icons/404.png"
4040
/>
4141
</template>
4242
<n-text strong>{{ mdata[eid].name }}</n-text>

0 commit comments

Comments
 (0)