Compare commits

..

No commits in common. "68129cd5d03983f66bc08b00e458f56895a0c8c1" and "ab2e6220fc5b534a43661b06c8643e1cbb4c9b95" have entirely different histories.

9 changed files with 45 additions and 193 deletions

View File

@ -11,25 +11,23 @@
"test": "echo \"No test specified\" && exit 0"
},
"dependencies": {
"@quasar/extras": "^1.0.0",
"@waiting/base64": "^4.2.9",
"axios": "^1.2.1",
"js-base64": "^3.7.5",
"vuex": "^4.0.1",
"@quasar/extras": "^1.0.0",
"quasar": "^2.6.0",
"vue": "^3.0.0",
"vue-router": "^4.0.0",
"vuex": "^4.0.1"
"vue-router": "^4.0.0"
},
"devDependencies": {
"@quasar/app-vite": "^1.0.0",
"@types/node": "^12.20.21",
"@typescript-eslint/eslint-plugin": "^5.10.0",
"@typescript-eslint/parser": "^5.10.0",
"autoprefixer": "^10.4.2",
"eslint": "^8.10.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-vue": "^9.0.0",
"eslint-config-prettier": "^8.1.0",
"prettier": "^2.5.1",
"@types/node": "^12.20.21",
"@quasar/app-vite": "^1.0.0",
"autoprefixer": "^10.4.2",
"typescript": "^4.5.4"
},
"engines": {

View File

@ -85,11 +85,7 @@ module.exports = configure(function (/* ctx */) {
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#framework
framework: {
config: {
notify: {
/* look at QuasarConfOptions from the API card */
},
},
config: {},
// iconSet: 'material-icons', // Quasar icon set
// lang: 'en-US', // Quasar language pack
@ -102,7 +98,7 @@ module.exports = configure(function (/* ctx */) {
// directives: [],
// Quasar plugins
plugins: ['Notify'],
plugins: [],
},
// animations: 'all', // --- includes all animations

View File

@ -1,10 +0,0 @@
import { api } from 'src/boot/axios';
class getdata {
async get_server() {
return await api.get('https://api.shagain.club/api.php?type=list');
}
async text_server(url: string) {
return await api.post('http://149.129.107.38:1323/textserver', { url });
}
}
export { getdata };

View File

View File

@ -1,84 +0,0 @@
<template>
<div class="row">
<div class="col-12">
<h6 style="text-align: center;margin: 1rem;">{{ props.serve.tips }} <q-icon v-show="online" title="在线"
name="check_circle_outline" style="color: green;" /> <q-icon v-show="!online" title="离线" name="hide_source"
style="color: red;" /></h6>
<q-input v-model="outtext" filled autogrow />
<div style="text-align: center;margin-top: 1rem;">
<q-btn color="white" text-color="black" @click="copy" label="复制" />
</div>
</div>
</div>
</template>
<script lang="ts">
import {
defineComponent,
computed,
ref,
} from 'vue';
import { copyToClipboard } from 'quasar'
import { encode, decode } from 'js-base64';
import { useQuasar } from 'quasar'
import { getdata } from 'src/api/api'
export default defineComponent({
name: 'LinkItem',
props: {
serve: {
type: Object,
required: true
},
text: {
type: String
}
},
setup(props) {
const online = ref(false);
const isonline = () => {
let obj = JSON.parse(decode(props.text!.replace('vmess://', '')));
let http = props.serve.istls == 0 ? 'http' : 'https'
let reg = new RegExp(/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/);
let ip = obj.ps.match(reg)[0];
api.text_server(`${http}://${props.serve.ip}:${props.serve.port}/${ip}`).then(res => {
online.value = res.data.sataus == 400
})
}
const api = new getdata;
const $q = useQuasar()
const outtext = computed(() => {
let obj = JSON.parse(decode(props.text!.replace('vmess://', '')));
obj.add = props.serve.ip
obj.port = props.serve.port
obj.host = props.serve.host
obj.tls = props.serve.istls == 0 ? '' : 'tls'
let reg = new RegExp(/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/);
obj.path = '/' + obj.ps.match(reg)[0];
isonline()
return 'vmess://' + encode(JSON.stringify(obj))
})
const copy = () => {
// api.text_server('http://uszz.giaogiao.uk:8080/34.125.44.195').then(res => { console.log(res.data) })
copyToClipboard(outtext.value)
.then(() => {
// success!
$q.notify({
message: '复制成功',
color: 'purple',
position: 'top'
})
})
.catch(() => {
// fail
$q.notify({
message: '复制失败',
color: 'purple'
})
})
}
return { props, outtext, copy, online };
},
});
</script>

View File

@ -6,11 +6,3 @@ export interface Todo {
export interface Meta {
totalCount: number;
}
export interface server {
host: string;
id: number;
ip: string;
istls: number;
port: number;
tips: string;
}

View File

@ -1,8 +1,10 @@
<template>
<q-layout view="hHh lpR fFf">
<q-page-container>
<router-view />
</q-page-container>
</q-layout>
</template>

View File

@ -1,76 +1,44 @@
<template>
<div>
<div class="row">
<div class="col-xs-1 col-md-4"></div>
<div class="col-xs-10 col-md-4">
<h6 style="text-align: center;margin: 1rem;">节点<q-icon v-show="online" title="在线" name="check_circle_outline"
style="color: green;" /> <q-icon v-show="!online" title="离线" name="hide_source" style="color: red;" /></h6>
<q-input v-model="text" filled autogrow />
</div>
</div>
<div v-if="isobj">
<div class="row" v-for="(item, index) in serve" :key="index">
<div class="col-xs-1 col-md-4"></div>
<div class="col-xs-10 col-md-4">
<LinkItem :serve="item" v-model:text="text"></LinkItem>
</div>
</div>
</div>
</div>
<q-page class="row items-center justify-evenly">
<example-component title="Example component" active :todos="todos" :meta="meta"></example-component>
</q-page>
</template>
<script lang="ts">
import { server } from 'components/models';
import { computed, defineComponent, onMounted, ref } from 'vue';
import { getdata } from 'src/api/api'
import LinkItem from 'components/LinkItem.vue';
import { b64decode } from '@waiting/base64'
import { encode, decode } from 'js-base64';
import { Todo, Meta } from 'components/models';
import ExampleComponent from 'components/ExampleComponent.vue';
import { defineComponent, ref } from 'vue';
export default defineComponent({
name: 'IndexPage',
components: { LinkItem },
components: { ExampleComponent },
setup() {
const serve = ref(<server[]>[])
const api = new getdata;
const text = ref('');
const online = ref(false);
onMounted(() => {
api.get_server().then((res) => {
for (let index = 0; index < res.data.length; index++) {
serve.value.push(res.data[index]);
}
})
})
const isobj = computed(() => {
try {
let obj = JSON.parse(decode(text.value.replace('vmess://', '')));
if (obj.id != '2ee57806-f6e4-482a-ef08-7360c04cd3e5' || obj.net != 'ws') {
return false
}
isonline()
} catch (error) {
console.log(error);
return false
const todos = ref<Todo[]>([
{
id: 1,
content: 'ct1'
},
{
id: 2,
content: 'ct2'
},
{
id: 3,
content: 'ct3'
},
{
id: 4,
content: 'ct4'
},
{
id: 5,
content: 'ct5'
}
return true
})
const isonline = () => {
let obj = JSON.parse(decode(text.value!.replace('vmess://', '')));
let reg = new RegExp(/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/);
let ip = obj.ps.match(reg)[0];
api.text_server(`http://${ip}:9000/`).then(res => {
online.value = res.data.sataus == 400
})
}
return {
serve,
text,
isobj,
online
};
]);
const meta = ref<Meta>({
totalCount: 1200
});
return { todos, meta };
}
});
</script>

View File

@ -451,11 +451,6 @@
resolved "https://registry.npmmirror.com/@vue/shared/-/shared-3.2.47.tgz#e597ef75086c6e896ff5478a6bfc0a7aa4bbd14c"
integrity sha512-BHGyyGN3Q97EZx0taMQ+OLNuZcW3d37ZEVmEAyeoA9ERdGvm9Irc/0Fua8SNyOtV1w6BS4q25wbMzJujO9HIfQ==
"@waiting/base64@^4.2.9":
version "4.2.9"
resolved "https://registry.npmmirror.com/@waiting/base64/-/base64-4.2.9.tgz#fa7e98d1a317355fed0cfb0ebdf94c361b9a3acf"
integrity sha512-yzt9ih63oePux/sQM8Df6DTv1IeXGByaHrFiJoPszk0LaJwIGJ3IKhKhT/O6YMo2RignlP2cfxoo1lGmKZPIgQ==
accepts@~1.3.5, accepts@~1.3.8:
version "1.3.8"
resolved "https://registry.npmmirror.com/accepts/-/accepts-1.3.8.tgz#0bf0be125b67014adcb0b0921e62db7bffe16b2e"
@ -1941,11 +1936,6 @@ jake@^10.8.5:
filelist "^1.0.1"
minimatch "^3.0.4"
js-base64@^3.7.5:
version "3.7.5"
resolved "https://registry.npmmirror.com/js-base64/-/js-base64-3.7.5.tgz#21e24cf6b886f76d6f5f165bfcd69cc55b9e3fca"
integrity sha512-3MEt5DTINKqfScXKfJFrRbxkrnk2AxPWGBL/ycjz4dK8iqiSJ06UxD8jh8xuh6p10TX4t2+7FsBYVxxQbMg+qA==
js-sdsl@^4.1.4:
version "4.3.0"
resolved "https://registry.npmmirror.com/js-sdsl/-/js-sdsl-4.3.0.tgz#aeefe32a451f7af88425b11fdb5f58c90ae1d711"