fix: lint issues
This commit is contained in:
parent
3f91b55636
commit
7aa47f9473
@ -1,12 +1,4 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type {
|
|
||||||
ProtocolVersion,
|
|
||||||
ServerStatus,
|
|
||||||
ServerWorld,
|
|
||||||
SingleplayerWorld,
|
|
||||||
World,
|
|
||||||
} from '@/helpers/worlds.ts'
|
|
||||||
import { getWorldIdentifier, set_world_display_status } from '@/helpers/worlds.ts'
|
|
||||||
import {
|
import {
|
||||||
ClipboardCopyIcon,
|
ClipboardCopyIcon,
|
||||||
EditIcon,
|
EditIcon,
|
||||||
@ -44,6 +36,14 @@ import { computed } from 'vue'
|
|||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
|
|
||||||
import { copyToClipboard } from '@/helpers/utils'
|
import { copyToClipboard } from '@/helpers/utils'
|
||||||
|
import type {
|
||||||
|
ProtocolVersion,
|
||||||
|
ServerStatus,
|
||||||
|
ServerWorld,
|
||||||
|
SingleplayerWorld,
|
||||||
|
World,
|
||||||
|
} from '@/helpers/worlds.ts'
|
||||||
|
import { getWorldIdentifier, set_world_display_status } from '@/helpers/worlds.ts'
|
||||||
|
|
||||||
const { formatMessage } = useVIntl()
|
const { formatMessage } = useVIntl()
|
||||||
const formatRelativeTime = useRelativeTime()
|
const formatRelativeTime = useRelativeTime()
|
||||||
|
|||||||
@ -121,7 +121,22 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import ContextMenu from '@/components/ui/ContextMenu.vue'
|
import { PlusIcon, SearchIcon, SpinnerIcon, UpdatedIcon, XIcon } from '@modrinth/assets'
|
||||||
|
import {
|
||||||
|
Button,
|
||||||
|
ButtonStyled,
|
||||||
|
FilterBar,
|
||||||
|
type FilterBarOption,
|
||||||
|
GAME_MODES,
|
||||||
|
type GameVersion,
|
||||||
|
RadialHeader,
|
||||||
|
} from '@modrinth/ui'
|
||||||
|
import type { Version } from '@modrinth/utils'
|
||||||
|
import { defineMessages } from '@vintl/vintl'
|
||||||
|
import { computed, onUnmounted, ref, watch } from 'vue'
|
||||||
|
import { useRoute } from 'vue-router'
|
||||||
|
|
||||||
|
import type ContextMenu from '@/components/ui/ContextMenu.vue'
|
||||||
import ConfirmModalWrapper from '@/components/ui/modal/ConfirmModalWrapper.vue'
|
import ConfirmModalWrapper from '@/components/ui/modal/ConfirmModalWrapper.vue'
|
||||||
import AddServerModal from '@/components/ui/world/modal/AddServerModal.vue'
|
import AddServerModal from '@/components/ui/world/modal/AddServerModal.vue'
|
||||||
import EditServerModal from '@/components/ui/world/modal/EditServerModal.vue'
|
import EditServerModal from '@/components/ui/world/modal/EditServerModal.vue'
|
||||||
@ -154,20 +169,6 @@ import {
|
|||||||
type World,
|
type World,
|
||||||
} from '@/helpers/worlds.ts'
|
} from '@/helpers/worlds.ts'
|
||||||
import { handleError } from '@/store/notifications'
|
import { handleError } from '@/store/notifications'
|
||||||
import { PlusIcon, SearchIcon, SpinnerIcon, UpdatedIcon, XIcon } from '@modrinth/assets'
|
|
||||||
import {
|
|
||||||
Button,
|
|
||||||
ButtonStyled,
|
|
||||||
FilterBar,
|
|
||||||
type FilterBarOption,
|
|
||||||
GAME_MODES,
|
|
||||||
type GameVersion,
|
|
||||||
RadialHeader,
|
|
||||||
} from '@modrinth/ui'
|
|
||||||
import { Version } from '@modrinth/utils'
|
|
||||||
import { defineMessages } from '@vintl/vintl'
|
|
||||||
import { computed, onUnmounted, ref, watch } from 'vue'
|
|
||||||
import { useRoute } from 'vue-router'
|
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
|
||||||
|
|||||||
@ -5,18 +5,18 @@ import { useServersFetch } from '../servers-fetch.ts'
|
|||||||
import { ServerModule } from './base.ts'
|
import { ServerModule } from './base.ts'
|
||||||
|
|
||||||
export class GeneralModule extends ServerModule implements ServerGeneral {
|
export class GeneralModule extends ServerModule implements ServerGeneral {
|
||||||
server_id!: string;
|
server_id!: string
|
||||||
name!: string;
|
name!: string
|
||||||
owner_id!: string;
|
owner_id!: string
|
||||||
net!: { ip: string; port: number; domain: string };
|
net!: { ip: string; port: number; domain: string }
|
||||||
game!: string;
|
game!: string
|
||||||
backup_quota!: number;
|
backup_quota!: number
|
||||||
used_backup_quota!: number;
|
used_backup_quota!: number
|
||||||
status!: string;
|
status!: string
|
||||||
suspension_reason!: string;
|
suspension_reason!: string
|
||||||
loader!: string;
|
loader!: string
|
||||||
loader_version!: string;
|
loader_version!: string
|
||||||
mc_version!: string;
|
mc_version!: string
|
||||||
upstream!: {
|
upstream!: {
|
||||||
kind: 'modpack' | 'mod' | 'resourcepack'
|
kind: 'modpack' | 'mod' | 'resourcepack'
|
||||||
version_id: string
|
version_id: string
|
||||||
|
|||||||
@ -141,18 +141,18 @@ export async function useServersFetch<T>(
|
|||||||
}
|
}
|
||||||
|
|
||||||
const errorMessages: { [key: number]: string } = {
|
const errorMessages: { [key: number]: string } = {
|
||||||
400: "Bad Request",
|
400: 'Bad Request',
|
||||||
401: "Unauthorized",
|
401: 'Unauthorized',
|
||||||
403: "Forbidden",
|
403: 'Forbidden',
|
||||||
404: "Not Found",
|
404: 'Not Found',
|
||||||
405: "Method Not Allowed",
|
405: 'Method Not Allowed',
|
||||||
408: "Request Timeout",
|
408: 'Request Timeout',
|
||||||
429: "You're making requests too quickly. Please wait a moment and try again.",
|
429: "You're making requests too quickly. Please wait a moment and try again.",
|
||||||
500: "Internal Server Error",
|
500: 'Internal Server Error',
|
||||||
502: "Bad Gateway",
|
502: 'Bad Gateway',
|
||||||
503: "Service Unavailable",
|
503: 'Service Unavailable',
|
||||||
504: "Gateway Timeout",
|
504: 'Gateway Timeout',
|
||||||
};
|
}
|
||||||
|
|
||||||
const message =
|
const message =
|
||||||
statusCode && statusCode in errorMessages
|
statusCode && statusCode in errorMessages
|
||||||
@ -170,14 +170,14 @@ export async function useServersFetch<T>(
|
|||||||
`[Modrinth Servers] ${error.message}`,
|
`[Modrinth Servers] ${error.message}`,
|
||||||
statusCode,
|
statusCode,
|
||||||
error,
|
error,
|
||||||
);
|
)
|
||||||
throw new ModrinthServerError(
|
throw new ModrinthServerError(
|
||||||
`[Modrinth Servers] ${message}`,
|
`[Modrinth Servers] ${message}`,
|
||||||
statusCode,
|
statusCode,
|
||||||
fetchError,
|
fetchError,
|
||||||
module,
|
module,
|
||||||
v1Error,
|
v1Error,
|
||||||
);
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const baseDelay = statusCode && statusCode >= 500 ? 5000 : 1000
|
const baseDelay = statusCode && statusCode >= 500 ? 5000 : 1000
|
||||||
|
|||||||
@ -19,7 +19,8 @@ import {
|
|||||||
WrenchIcon,
|
WrenchIcon,
|
||||||
} from '@modrinth/assets'
|
} from '@modrinth/assets'
|
||||||
import { isAdmin as isUserAdmin, type User } from '@modrinth/utils'
|
import { isAdmin as isUserAdmin, type User } from '@modrinth/utils'
|
||||||
import { ModrinthServer } from '~/composables/servers/modrinth-servers.ts'
|
|
||||||
|
import type { ModrinthServer } from '~/composables/servers/modrinth-servers.ts'
|
||||||
import type { BackupInProgressReason } from '~/pages/servers/manage/[id].vue'
|
import type { BackupInProgressReason } from '~/pages/servers/manage/[id].vue'
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { BookOpenIcon } from '@modrinth/assets'
|
import { BookOpenIcon } from '@modrinth/assets'
|
||||||
|
import type { Project } from '@modrinth/utils'
|
||||||
|
|
||||||
import type { Stage } from '../../types/stage'
|
import type { Stage } from '../../types/stage'
|
||||||
import type { Project } from '@modrinth/utils'
|
|
||||||
|
|
||||||
function hasCustomSlug(project: Project): boolean {
|
function hasCustomSlug(project: Project): boolean {
|
||||||
return (
|
return (
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user