Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⚡ feat: 신규 v3 API로 코드 업데이트 #4

Merged
merged 2 commits into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 22 additions & 9 deletions nuxt.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { apiEndpoint } from './config.json'
import { apiEndpoint, apiTestEndpoint } from './config.json'
const { NODE_ENV } = process.env

export default {
// Global page headers: https://go.nuxtjs.dev/config-head
Expand All @@ -17,17 +18,29 @@ export default {
{ rel: 'icon', href: '/favicon.ico' },

/* Preconnect CDNs */
{ rel: 'preconnect', href:'https://cdn.jsdelivr.net', crossorigin: 'anonymous' },
{ rel: 'preconnect', href:'https://fonts.googleapis.com', crossorigin: 'anonymous' },
{ rel: 'preconnect', href:'https://fonts.gstatic.com', crossorigin: 'anonymous' },
{ rel: 'preconnect', href: 'https://cdn.jsdelivr.net', crossorigin: 'anonymous' },
{ rel: 'preconnect', href: 'https://fonts.googleapis.com', crossorigin: 'anonymous' },
{ rel: 'preconnect', href: 'https://fonts.gstatic.com', crossorigin: 'anonymous' },

/* Import Pretendard & Pretendard-Like font familes */
{ rel: 'stylesheet', href: 'https://cdn.jsdelivr.net/gh/wanteddev/[email protected]/packages/wanted-sans/fonts/webfonts/variable/split/WantedSansVariable.min.css' },
{ rel: 'stylesheet', href: 'https://cdn.jsdelivr.net/gh/wanteddev/[email protected]/packages/wanted-sans-std/fonts/webfonts/variable/split/WantedSansStdVariable.min.css' },
{ rel: 'stylesheet', href: 'https://cdn.jsdelivr.net/gh/orioncactus/[email protected]/packages/pretendard-jp/dist/web/variable/pretendardvariable-jp-dynamic-subset.min.css' },
{
rel: 'stylesheet',
href: 'https://cdn.jsdelivr.net/gh/wanteddev/[email protected]/packages/wanted-sans/fonts/webfonts/variable/split/WantedSansVariable.min.css',
},
{
rel: 'stylesheet',
href: 'https://cdn.jsdelivr.net/gh/wanteddev/[email protected]/packages/wanted-sans-std/fonts/webfonts/variable/split/WantedSansStdVariable.min.css',
},
{
rel: 'stylesheet',
href: 'https://cdn.jsdelivr.net/gh/orioncactus/[email protected]/packages/pretendard-jp/dist/web/variable/pretendardvariable-jp-dynamic-subset.min.css',
},

/* Import Be Vietnam Pro for support Vietnamese */
{ rel: 'stylesheet', href: 'https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap' },
{
rel: 'stylesheet',
href: 'https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap',
},
],
},

Expand Down Expand Up @@ -92,7 +105,7 @@ export default {
// Axios module configuration: https://go.nuxtjs.dev/config-axios
axios: {
// Workaround to avoid enforcing hard-coded localhost:3000: https://github.com/nuxt-community/axios-module/issues/308
baseURL: apiEndpoint || '/',
baseURL: (NODE_ENV === 'production' ? apiEndpoint : apiTestEndpoint) || '/',
},

// PWA module configuration: https://go.nuxtjs.dev/pwa
Expand Down
4 changes: 2 additions & 2 deletions pages/auth/callback.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ export default {
staging: Boolean(window.location.origin == 'https://console-v2stg.nguard.dev'),
})

localStorage.setItem('access_token', login.access_token)
localStorage.setItem('access_token', login.data.access_token)

setTimeout(() => {
this.$router.push(`/${this.$route.query.state || this.$i18n.locale || 'ko'}/servers`)
}, 1000)
} catch (e) {
if (e.response.status != 400 && e.response.status != 429) {
alert(e.response.data.error.error_description || e)
alert(e.response.data.message || e)
}

this.$router.push(`/${this.$route.query.state || this.$i18n.locale || 'ko'}/auth/login`)
Expand Down
2 changes: 1 addition & 1 deletion pages/bot/callback.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default {
}

try {
opener.load_servers()
opener.location.reload(true)
window.close()
} catch (e) {
this.$router.push('/servers')
Expand Down
2 changes: 1 addition & 1 deletion pages/dashboard/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ export default {
async mounted() {
window.addEventListener('resize', this.resizeAlerts)

const socket = io('https://api.nguard.xyz/')
const socket = io('https://ws-api.nguard.xyz/')

socket.on('push:load', pushs => {
this.alerts.contents = pushs
Expand Down
80 changes: 40 additions & 40 deletions pages/dashboard/invite.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,51 +81,51 @@
</form>
</div>

<div class="mb-6">
<h2>
<!-- <div class="mb-6"> -->
<!-- <h2> -->
<!-- 커스텀 초대링크 -->
{{ $t('invite.category2.title') }}
</h2>
<p>
<!-- {{ $t('invite.category2.title') }} -->
<!-- </h2> -->
<!-- <p> -->
<!-- 소유하고 계신 도메인에 NGuard 초대링크를 설정할 수 있습니다. -->
{{ $t('invite.category2.description') }}
</p>
<form>
<div>
<label>
<!-- {{ $t('invite.category2.description') }} -->
<!-- </p> -->
<!-- <form> -->
<!-- <div> -->
<!-- <label> -->
<!-- 커스텀 초대링크 -->
{{ $t('invite.category2.toggle') }}
</label>
<div @click="inputSwitch('domain')" :class="{ switch_on: switch_.domain }" class="switch"></div>
</div>
<!-- {{ $t('invite.category2.toggle') }} -->
<!-- </label> -->
<!-- <div @click="inputSwitch('domain')" :class="{ switch_on: switch_.domain }" class="switch"></div> -->
<!-- </div> -->

<div class="vert" v-if="switch_.domain">
<p>
<!-- <div class="vert" v-if="switch_.domain"> -->
<!-- <p> -->
<!-- 도메인 설정 -->
{{ $t('invite.category2.link') }}
</p>
<div class="flex items-center">
<input
class="input-m"
id="inviteDomain_input"
type="text"
placeholder="도메인 입력"
v-model="select.domain"
v-bind:readonly="!isEnterprise"
@click="clickCustomDomain()"
/>
</div>
</div>

<div class="flex" v-if="switch_.domain">
<label>
<!-- {{ $t('invite.category2.link') }} -->
<!-- </p> -->
<!-- <div class="flex items-center"> -->
<!-- <input -->
<!-- class="input-m" -->
<!-- id="inviteDomain_input" -->
<!-- type="text" -->
<!-- placeholder="도메인 입력" -->
<!-- v-model="select.domain" -->
<!-- v-bind:readonly="!isEnterprise" -->
<!-- @click="clickCustomDomain()" -->
<!-- /> -->
<!-- </div> -->
<!-- </div> -->

<!-- <div class="flex" v-if="switch_.domain"> -->
<!-- <label> -->
<!-- SSL 설정 -->
{{ $t('invite.category2.ssl') }}
</label>
<div @click="inputSwitch('domain_ssl')" :class="{ switch_on: switch_.domain_ssl }" class="switch"></div>
</div>
</form>
</div>
<!-- {{ $t('invite.category2.ssl') }} -->
<!-- </label> -->
<!-- <div @click="inputSwitch('domain_ssl')" :class="{ switch_on: switch_.domain_ssl }" class="switch"></div> -->
<!-- </div> -->
<!-- </form> -->
<!-- </div> -->

<button class="btn-save" @click="checkSaveSettings()">
<!-- 저장하기 -->
Expand Down Expand Up @@ -349,7 +349,7 @@ export default {
})
).data

this.isPermission = settings.koreanbots.data.voted
this.isPermission = settings.koreanbots.voted
this.isEnterprise = settings.payData?.type === 'ENTERPRISE' && new Date().getTime() < settings.payData?.expire

if (settings.settings) {
Expand Down
6 changes: 4 additions & 2 deletions pages/dashboard/verify.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,13 @@
<!-- 성공적으로 저장했습니다! -->
</h2>
<div class="flex flex-col text-gray-400 pt-3 gap-2">
<span v-if="switch_.confirm" v-html="$t('verify.modal.applied')">
<span v-if="switch_.confirm">
<!-- 새로운 유저가 <code>/verify</code> 명령어로 인증할 수 있습니다. -->
{{ $t('verify.modal.applied') }}
</span>
<span v-else v-html="$t('verify.modal.deleted')">
<span v-else>
<!-- 새로운 유저는 더 이상 <code>/verify</code> 명령어로 인증할 수 없습니다. -->
{{ $t('verify.modal.deleted') }}
</span>

<br />
Expand Down
Loading