udpate client code

This commit is contained in:
zizifn
2023-05-20 02:22:00 +08:00
committed by zizifn
parent b3ff76cea2
commit 5d8a646cfe
3 changed files with 23 additions and 33 deletions

View File

@@ -21,23 +21,10 @@
<h2> <h2>
Please refer to Please refer to
<a <a
href="https://github.com/zizifn/edgetunnel/blob/main/doc/edge-tunnel-deno.md#%E6%B5%81%E7%A8%8B%E6%BC%94%E7%A4%BA" href="https://edgetunnel.114567.xyz/guide/cf-pages.html#%E5%A1%AB%E5%86%99-pages-build-%E4%BF%A1%E6%81%AF"
>deno deploy guide</a >deno deploy guide</a
> >
</h2> </h2>
<h3>
Or maybe check below
<a
href="https://raw.githubusercontent.com/zizifn/edgetunnel/main/doc/deno-deploy2.gif"
>GIF</a
>
</h3>
<img
src="https://raw.githubusercontent.com/zizifn/edgetunnel/main/doc/deno-deploy2.gif"
alt="guide"
srcset=""
/>
<script> <script>
let uuid = URL.createObjectURL(new Blob([])).substr(-36); let uuid = URL.createObjectURL(new Blob([])).substr(-36);
document.getElementById('uuidSpan').textContent = uuid; document.getElementById('uuidSpan').textContent = uuid;

View File

@@ -17,14 +17,13 @@ const index401 = `
</h2> </h2>
<h3> You must use same UUID for login this page after config valid UUID Environment Variables <h3> You must use same UUID for login this page after config valid UUID Environment Variables
</h3> </h3>
<h2>Please refer to <a <h2>
href="https://github.com/zizifn/edgetunnel/blob/main/doc/edge-tunnel-deno.md#%E6%B5%81%E7%A8%8B%E6%BC%94%E7%A4%BA">deno Please refer to
deploy guide</a> <a
href="https://edgetunnel.114567.xyz/guide/cf-pages.html#%E5%A1%AB%E5%86%99-pages-build-%E4%BF%A1%E6%81%AF"
>Cloudflare pages deploy guide</a
>
</h2> </h2>
<h3>Or maybe check below <a
href="https://raw.githubusercontent.com/zizifn/edgetunnel/main/doc/deno-deploy2.gif">GIF</a> </h3>
<img src="https://raw.githubusercontent.com/zizifn/edgetunnel/main/doc/deno-deploy2.gif" alt="guide" srcset="">
<script> <script>
let uuid = URL.createObjectURL(new Blob([])).substr(-36); let uuid = URL.createObjectURL(new Blob([])).substr(-36);
document.getElementById('uuidSpan').textContent = uuid document.getElementById('uuidSpan').textContent = uuid

View File

@@ -41,7 +41,7 @@ export function EdgeApp() {
handleShare={handleShare} handleShare={handleShare}
v2option={v2Option} v2option={v2Option}
></ShareActions> ></ShareActions>
<SetUpAlert></SetUpAlert> {/* <SetUpAlert></SetUpAlert> */}
<ShareAnything handleShare={handleShare}></ShareAnything> <ShareAnything handleShare={handleShare}></ShareAnything>
</div> </div>
</div> </div>
@@ -209,7 +209,7 @@ function QRcodeImg({ text }: { text: string }) {
} }
return ( return (
<div className="flex flex-col border border-blue-300 overflow-hidden w-[500px] h-[420px] justify-start items-center"> <div className="flex flex-col border border-blue-300 overflow-hidden w-auto h-auto justify-start items-center">
<img <img
src={codeImg} src={codeImg}
width="350" width="350"
@@ -217,11 +217,11 @@ function QRcodeImg({ text }: { text: string }) {
alt="二维码" alt="二维码"
className="border-spacing-1" className="border-spacing-1"
/> />
<div className="flex flex-grow w-full bg-gray-200"> <div className="flex flex-grow w-auto bg-gray-200">
<span className="flex-grow break-normal overflow-scroll w-4/5"> <span className="flex-grow break-all break-word overflow-hidden w-4/5">
{text} {text}
</span> </span>
<div className="w-6 h-6 ml-auto"> <div className="w-6 h-6 ml-auto mr-5px">
<svg <svg
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
fill="none" fill="none"
@@ -302,6 +302,9 @@ function ShareActions({
handleShare: (text: string) => void; handleShare: (text: string) => void;
v2option: V2Option; v2option: V2Option;
}) { }) {
useEffect(() => {
handleShare(getVlessURL());
}, [v2option]);
function getPageURL() { function getPageURL() {
return window.location.href; return window.location.href;
} }
@@ -336,13 +339,6 @@ function ShareActions({
} }
return ( return (
<span className="inline-flex self-center mt-4 rounded-md shadow-sm isolate"> <span className="inline-flex self-center mt-4 rounded-md shadow-sm isolate">
<button
onClick={() => handleShare(getPageURL())}
type="button"
className="relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-l-md hover:border-indigo-500 focus:z-10 focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500"
>
</button>
<button <button
onClick={() => handleShare(getVlessURL())} onClick={() => handleShare(getVlessURL())}
type="button" type="button"
@@ -350,6 +346,14 @@ function ShareActions({
> >
V2ray V2ray
</button> </button>
<button
onClick={() => handleShare(getPageURL())}
type="button"
className="relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-l-md hover:border-indigo-500 focus:z-10 focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500"
>
</button>
</span> </span>
); );
} }