-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
190 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,7 @@ const external = [ | |
// 'lodash-es', | ||
'lowdb', | ||
'uuid', | ||
'axios', | ||
] | ||
|
||
const plugins = [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<template> | ||
<div> | ||
<div class="flex mb-10"> | ||
<a-input v-model="url" :disabled="loading" placeholder="https://" class="flex-1 mr-5" /> | ||
<a-button :disabled="!canSubmit" type="primary" :loading="loading" @click="submit">确定</a-button> | ||
</div> | ||
<div class="op-70"> | ||
<icon-exclamation-circle-fill /> | ||
网络不佳可能导致导入不成功 | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
import { Message } from '@arco-design/web-vue'; | ||
import { importRules } from '@/api'; | ||
const emit = defineEmits(['done']); | ||
const loading = ref(false); | ||
const url = ref(''); | ||
const canSubmit = computed(() => url.value && /https?:\/\/.{3,}/.test(url.value)); | ||
async function submit() { | ||
loading.value = true; | ||
const res = await importRules({ url: url.value }).catch(() => {}); | ||
loading.value = false; | ||
if (res.code === 0) { | ||
emit('done', res.data); | ||
} else { | ||
Message.warning({ | ||
content: `导入失败`, | ||
closable: true, | ||
resetOnHover: true | ||
}); | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export const isRule = (rule: any) => { | ||
if (typeof rule === 'string') { | ||
return rule.startsWith('eso://:'); | ||
} | ||
|
||
if (typeof rule !== 'object') return false; | ||
|
||
return rule.id && rule.host && rule.contentType; | ||
}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.