添加了自动打包流程
Some checks failed
自动打包 / build (push) Failing after 1m46s

This commit is contained in:
cloudy2331 2025-04-23 12:20:48 +08:00
parent 7b376d0fbf
commit 49d33bc2ce
6 changed files with 108 additions and 76 deletions

View File

@ -0,0 +1,10 @@
name: 自动打包
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm install
- run: npm run build

View File

@ -5,7 +5,7 @@
</t-skeleton> </t-skeleton>
<template #actions> <template #actions>
<div class="actions"> <div class="actions">
<t-button size="small" theme="default" @click="$emit('toSubscribeItem', props.url, props.name)">编辑</t-button> <t-button size="small" theme="default" @click="$emit('toSubscribeItem', props.name)">编辑</t-button>
<t-button size="small" @click="urlVisible = !urlVisible">{{ <t-button size="small" @click="urlVisible = !urlVisible">{{
urlVisible ? "显示" : "隐藏" urlVisible ? "显示" : "隐藏"
}}</t-button> }}</t-button>
@ -48,7 +48,6 @@ import { onMounted, ref } from "vue";
import { DeleteIcon } from "tdesign-icons-vue-next"; import { DeleteIcon } from "tdesign-icons-vue-next";
const props = defineProps({ const props = defineProps({
url: String,
name: String name: String
}); });

View File

@ -1,5 +1,6 @@
<template> <template>
<div class="general-content"> <div class="general-content">
<t-loading :loading="loading" show-overlay style="min-height: 100vh">
<div class="control-bar"> <div class="control-bar">
<t-button size="large" @click="dialogVisible = true"> <t-button size="large" @click="dialogVisible = true">
<!-- icon莫名其妙的小或许是个bug也有可能和flex有关 --> <!-- icon莫名其妙的小或许是个bug也有可能和flex有关 -->
@ -8,7 +9,12 @@
</template> --> </template> -->
+ 添加订阅 + 添加订阅
</t-button> </t-button>
<t-input v-model="searchText" size="large" disabled style="margin: 0 48px 0 16px"> <t-input
v-model="searchText"
size="large"
disabled
style="margin: 0 48px 0 16px"
>
<template #prefix-icon> <template #prefix-icon>
<filter-icon /> <filter-icon />
</template> </template>
@ -19,7 +25,7 @@
<div class="card" v-for="i in Url" :key="i"> <div class="card" v-for="i in Url" :key="i">
<GeneralCard <GeneralCard
:name="i.name" :name="i.name"
@toSubscribeItem="(url, name) => $emit('toSubscribeItem', url, name)" @toSubscribeItem="(name) => $emit('toSubscribeItem', name)"
/> />
</div> </div>
</div> </div>
@ -37,6 +43,7 @@
size="small" size="small"
@current-change="onCurrentChange" @current-change="onCurrentChange"
/> />
</t-loading>
</div> </div>
<!-- dialog --> <!-- dialog -->
@ -53,7 +60,6 @@
<t-space direction="vertical" style="width: 100%"> <t-space direction="vertical" style="width: 100%">
<div class="dialog-content"> <div class="dialog-content">
<t-form :data="fromData" label-align="left"> <t-form :data="fromData" label-align="left">
<t-form-item label="订阅名称" name="name"> <t-form-item label="订阅名称" name="name">
<t-input></t-input> <t-input></t-input>
</t-form-item> </t-form-item>
@ -61,7 +67,6 @@
<t-form-item label="别名" name="url"> <t-form-item label="别名" name="url">
<t-input></t-input> <t-input></t-input>
</t-form-item> </t-form-item>
</t-form> </t-form>
</div> </div>
</t-space> </t-space>
@ -106,23 +111,27 @@ import { FilterIcon, AddIcon } from "tdesign-icons-vue-next";
import { computed, onBeforeMount, onMounted, ref } from "vue"; import { computed, onBeforeMount, onMounted, ref } from "vue";
import GeneralCard from "./Cards/GeneralCard.vue"; import GeneralCard from "./Cards/GeneralCard.vue";
import SleepWithSeconds from "../modules/Sleep.js";
const searchText = ref(""); const searchText = ref("");
const loading = ref(true);
//TODO //TODO
const Url = ref([]); const Url = ref([]);
onMounted(() => { onMounted(async () => {
//Url9 //Url9
// for (let i = 0; i < 10; i++) { for (let i = 0; i < 1; i++) {
// Url.value.push({
// name: "" + i,
// url: "vmess://" + i,
// });
// }
Url.value.push({ Url.value.push({
name: "all" name: "订阅" + i
}) });
console.log(Url); await SleepWithSeconds(1);
}
loading.value = false;
// Url.value.push({
// name: "all"
// });
// console.log(Url);
}); });
// //
@ -130,11 +139,11 @@ const filterUrl = computed(() => {
if (searchText.value.length > 0) { if (searchText.value.length > 0) {
return Url.value.filter((item) => { return Url.value.filter((item) => {
return item.name.includes(searchText.value); return item.name.includes(searchText.value);
}) });
} else { } else {
return Url.value; return Url.value;
} }
}) });
const dialogVisible = ref(false); const dialogVisible = ref(false);
const fromData = ref({ const fromData = ref({
@ -143,8 +152,8 @@ const fromData = ref({
/** /**
* 向服务器请求翻页数据 * 向服务器请求翻页数据
* @param index Int 页码 * @param {number} index 页码
* @param pageInfo Int 卡片总数 * @param {number} pageInfo 卡片总数
*/ */
function onCurrentChange(index, pageInfo) { function onCurrentChange(index, pageInfo) {
console.log(index, pageInfo); console.log(index, pageInfo);

View File

@ -34,20 +34,17 @@
</t-aside> </t-aside>
<t-layout> <t-layout>
<t-content style="overflow: auto"> <t-content style="overflow: auto">
<t-loading :loading="false" show-overlay style="height: 100vh;">
<div> <div>
<General <General
@toSubscribeItem="(url, name) => toSubscribeItem(url, name)" @toSubscribeItem="(name) => toSubscribeItem(name)"
v-if="menuValue === 'General'" v-if="menuValue === 'General'"
/> />
<SubscribeItem <SubscribeItem
@backToGeneral="menuValue = 'General'" @backToGeneral="menuValue = 'General'"
:propsData="Url"
:name="Name" :name="Name"
v-if="menuValue === 'SubscribeItem'" v-if="menuValue === 'SubscribeItem'"
/> />
</div> </div>
</t-loading>
</t-content> </t-content>
</t-layout> </t-layout>
</t-layout> </t-layout>
@ -59,7 +56,7 @@
width: 100vw; width: 100vw;
} }
.t-layout__sider{ .t-layout__sider {
width: auto !important; width: auto !important;
} }
</style> </style>
@ -72,7 +69,6 @@ import { ViewListIcon, AppIcon } from "tdesign-icons-vue-next";
const menuValue = ref("General"); const menuValue = ref("General");
const collapsed = ref(false); const collapsed = ref(false);
let Url = "";
let Name = ""; let Name = "";
function changeHandler(active) { function changeHandler(active) {
@ -80,9 +76,8 @@ function changeHandler(active) {
menuValue.value = active; menuValue.value = active;
} }
function toSubscribeItem(url, name) { function toSubscribeItem(name) {
// console.log(url); // console.log(url);
Url = url;
Name = name; Name = name;
menuValue.value = "SubscribeItem"; menuValue.value = "SubscribeItem";
} }

View File

@ -77,7 +77,7 @@ import { AddIcon, PasteIcon } from "tdesign-icons-vue-next";
import { MessagePlugin } from "tdesign-vue-next"; import { MessagePlugin } from "tdesign-vue-next";
const props = defineProps({ const props = defineProps({
name: String, name: String
}); });
let data = ref([]); let data = ref([]);
@ -156,7 +156,7 @@ const columns = ref([
/** /**
* 复制文本到剪贴板 * 复制文本到剪贴板
* @param text 复制的文本 * @param {String} text 复制的文本
*/ */
function copyToClipboard(text) { function copyToClipboard(text) {
try { try {
@ -204,8 +204,8 @@ function addNode() {
/** /**
* 编辑节点 * 编辑节点
* @param arg string 协议类型 * @param {String} arg 协议类型
* @param url string base64编码 * @param {String} url base64编码
*/ */
function editNode(arg, url) { function editNode(arg, url) {
// //

19
src/modules/Sleep.js Normal file
View File

@ -0,0 +1,19 @@
/**
* 延迟s秒后继续需要提供await关键字
* @param {number} s
* @return {Promise}
*/
export function SleepWithSeconds(s) {
return new Promise(resolve => setTimeout(resolve, s * 1000));
}
/**
* 延迟ms毫秒后继续需要提供await关键字
* @param {number} ms 毫秒
* @return {Promise}
*/
export function SleepWithMilliseconds(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
export default SleepWithSeconds;