This commit is contained in:
muwoo 2023-08-01 11:41:43 +08:00
parent 6516042809
commit 676c2b9c6a
24 changed files with 42 additions and 23 deletions

View File

@ -1,5 +1,5 @@
<template>
<div :class="{'main-container': true, dark: darkMode}">
<div class="main-container">
<div class="slider-bar">
<a-menu
v-model:selectedKeys="active"
@ -47,12 +47,6 @@ import {
} from '@ant-design/icons-vue';
import { useStore } from 'vuex';
const { remote } = window.require('electron');
const { perf } = remote.getGlobal('OP_CONFIG').get();
const darkMode = ref(perf.common.darkMode);
const router = useRouter();
const active = ref(['market']);
const changeMenu = (key: any) => {
@ -77,7 +71,6 @@ init();
.main-container {
display: flex;
align-items: flex-start;
background: var(--color-body-bg);
flex-direction: column;
.slider-bar {

View File

@ -1,6 +1,6 @@
{
"name": "rubick",
"version": "2.3.2",
"version": "2.3.3",
"author": "muwoo <2424880409@qq.com>",
"private": true,
"scripts": {

View File

@ -0,0 +1 @@
body,html{margin:0;padding:0;font-family:system-ui,PingFang SC,Helvetica Neue,Microsoft Yahei,sans-serif;-webkit-user-select:none;-moz-user-select:none;user-select:none;overflow:hidden}.detach{width:100%;height:60px;color:var(--color-text-primary);flex:1;display:flex;align-items:center;font-size:18px;padding-left:10px;font-weight:500;box-sizing:border-box;justify-content:space-between}.detach.darwin{padding-left:80px}.detach.darwin,.detach.win32{-webkit-app-region:drag}.detach img{width:36px;height:36px;margin-right:10px}.detach input{background-color:var(--color-body-bg);color:var(--color-text-primary);width:360px;height:36px;line-height:36px;border-radius:4px;font-size:14px;border:none;padding:0 10px;outline:none;-webkit-app-region:no-drag}.detach input::-webkit-input-placeholder{color:#aaa;-webkit-user-select:none;user-select:none}.detach .info{display:flex;align-items:center}.handle{display:flex;-webkit-app-region:no-drag}.handle>div{width:36px;height:36px;border-radius:18px;cursor:pointer;margin-right:6px}.handle>div:hover{background-color:#dee2e6}.handle .devtool{background:50% no-repeat url(../img/tool.4b0524aa.svg)}.handle-container,.window-handle{display:flex;align-items:center}.window-handle>div{width:48px;height:56px;cursor:pointer}.window-handle>div:hover{background-color:#dee2e6}.window-handle .minimize{background:50%/20px no-repeat url(../img/minimize.384634d1.svg)}.window-handle .maximize{background:50%/20px no-repeat url(../img/maximize.f11a5dfe.svg)}.window-handle .unmaximize{background:50%/20px no-repeat url(../img/unmaximize.36583168.svg)}.window-handle .close{background:50%/20px no-repeat url(../img/close.cc2cafaa.svg)}.window-handle .close:hover{background-color:#e53935!important;background-image:url(../img/close-hover.c92ca454.svg)!important}:root{--color-text-primary:rgba(0,0,0,0.85);--color-text-content:#141414;--color-text-desc:rgba(0,0,0,0.45);--color-body-bg:#fff;--color-menu-bg:#f3efef;--color-list-hover:#e2e2e2;--color-input-hover:#fff;--color-border-light:#f0f0f0}.dark{--color-text-primary:#e8e8f0;--color-text-content:#ccccd8;--color-text-desc:#8f8fa6;--color-body-bg:#1c1c28;--color-menu-bg:#1c1c28;--color-list-hover:#33333d;--color-input-hover:#33333d;--color-border-light:#33333d}

View File

@ -1 +0,0 @@
body,html{margin:0;padding:0;font-family:system-ui,PingFang SC,Helvetica Neue,Microsoft Yahei,sans-serif;-webkit-user-select:none;-moz-user-select:none;user-select:none;overflow:hidden}.detach{width:100%;height:60px;background:var(--color-body-bg);color:var(--color-text-primary);flex:1;display:flex;align-items:center;font-size:18px;padding-left:10px;font-weight:500;box-sizing:border-box;justify-content:space-between}.detach.darwin{padding-left:80px}.detach.darwin,.detach.win32{-webkit-app-region:drag}.detach img{width:36px;height:36px;margin-right:10px}.detach input{background-color:var(--color-body-bg);color:var(--color-text-primary);width:360px;height:36px;line-height:36px;border-radius:4px;font-size:14px;border:none;padding:0 10px;outline:none;-webkit-app-region:no-drag}.detach input::-webkit-input-placeholder{color:#aaa;-webkit-user-select:none;user-select:none}.detach .info{display:flex;align-items:center}.handle{display:flex;-webkit-app-region:no-drag}.handle>div{width:36px;height:36px;border-radius:18px;cursor:pointer;margin-right:6px}.handle>div:hover{background-color:#dee2e6}.detach .devtool{background:50%/18px no-repeat url(../img/devtool.87e078f5.svg)}:root{--color-text-primary:rgba(0,0,0,0.85);--color-text-content:#141414;--color-text-desc:rgba(0,0,0,0.45);--color-body-bg:#fff;--color-menu-bg:#f3efef;--color-list-hover:#e2e2e2;--color-input-hover:#fff;--color-border-light:#f0f0f0}.dark{--color-text-primary:#e8e8f0;--color-text-content:#ccccd8;--color-text-desc:#8f8fa6;--color-body-bg:#1c1c28;--color-menu-bg:#1c1c28;--color-list-hover:#33333d;--color-input-hover:#33333d;--color-border-light:#33333d}

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1618205429990" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2034" width="64" height="64" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><style type="text/css"></style></defs><path d="M529.066667 524.8l241.066666-241.066667c8.533333-8.533333 8.533333-21.333333 0-29.866666s-21.333333-8.533333-29.866666 0L499.2 494.933333 258.133333 253.866667c-8.533333-8.533333-21.333333-8.533333-29.866666 0s-8.533333 21.333333 0 29.866666L469.333333 524.8 228.266667 765.866667c-8.533333 8.533333-8.533333 21.333333 0 29.866666 4.266667 4.266667 10.666667 6.4 14.933333 6.4s10.666667-2.133333 14.933333-6.4L499.2 554.666667l241.066667 241.066666c4.266667 4.266667 10.666667 6.4 14.933333 6.4s10.666667-2.133333 14.933333-6.4c8.533333-8.533333 8.533333-21.333333 0-29.866666L529.066667 524.8z" fill="#ffffff" p-id="2035"></path></svg>

After

Width:  |  Height:  |  Size: 1011 B

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1618205429990" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2034" width="64" height="64" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><style type="text/css"></style></defs><path d="M529.066667 524.8l241.066666-241.066667c8.533333-8.533333 8.533333-21.333333 0-29.866666s-21.333333-8.533333-29.866666 0L499.2 494.933333 258.133333 253.866667c-8.533333-8.533333-21.333333-8.533333-29.866666 0s-8.533333 21.333333 0 29.866666L469.333333 524.8 228.266667 765.866667c-8.533333 8.533333-8.533333 21.333333 0 29.866666 4.266667 4.266667 10.666667 6.4 14.933333 6.4s10.666667-2.133333 14.933333-6.4L499.2 554.666667l241.066667 241.066666c4.266667 4.266667 10.666667 6.4 14.933333 6.4s10.666667-2.133333 14.933333-6.4c8.533333-8.533333 8.533333-21.333333 0-29.866666L529.066667 524.8z" fill="#888888" p-id="2035"></path></svg>

After

Width:  |  Height:  |  Size: 1011 B

View File

@ -1 +0,0 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1576121932768" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2610" width="32" height="32" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><style type="text/css"></style></defs><path d="M344.792 518.575L303.4 477.184a26.947 26.947 0 0 1 38.13-38.13l60.174 60.173a26.947 26.947 0 0 1 0.27 37.834L114.392 833.16a26.947 26.947 0 0 0 0.27 37.834l68.984 68.958a26.947 26.947 0 0 0 38.077 0l291.301-291.3a26.947 26.947 0 0 1 38.104 0l146.324 146.323a26.947 26.947 0 1 1-38.104 38.13L532.076 705.833 259.853 978.055a80.842 80.842 0 0 1-114.337 0L76.53 909.096a80.842 80.842 0 0 1-0.809-113.475l269.043-277.046z m473.546 155.54a26.947 26.947 0 1 1-38.104 38.104L597.288 529.273a26.947 26.947 0 0 1 0-38.103l148.13-148.103a26.947 26.947 0 0 1 15.36-7.653l88.603-12.18 89.627-170.927-56.697-60.39-167.37 97.254-16.546 85.53a26.947 26.947 0 0 1-7.384 13.96l-148.13 148.102a26.947 26.947 0 0 1-38.103 0l-77.474-77.474a26.947 26.947 0 1 1 38.104-38.103l58.422 58.422 123.23-123.23 17.273-89.466a26.947 26.947 0 0 1 12.935-18.19l196.5-114.175a26.947 26.947 0 0 1 33.173 4.85l84.48 90.004a26.947 26.947 0 0 1 4.203 30.963l-104.96 200.165a26.947 26.947 0 0 1-20.21 14.201l-93.346 12.854-122.637 122.637 163.867 163.894z" p-id="2611" fill="#888888"></path><path d="M610.816 784.573a26.947 26.947 0 0 1 38.104-38.104l52.089 52.09a26.947 26.947 0 0 1-38.104 38.103l-52.089-52.09zM368.371 543.42a26.947 26.947 0 1 1 37.995-38.185L705.671 803.22a26.947 26.947 0 0 1 7.814 21.45 111.373 111.373 0 0 0 31.475 87.471 107.79 107.79 0 1 0 68.662-183.727c-2.129 0.135-3.934 0.081-5.578-0.054a26.947 26.947 0 0 1-19.537-7.868L485.24 417.954a26.947 26.947 0 1 1 38.05-38.158l295.181 294.481A161.684 161.684 0 1 1 706.83 950.272a165.16 165.16 0 0 1-47.642-117.275L368.37 543.421z" p-id="2612" fill="#888888"></path><path d="M783.076 874.036a53.895 53.895 0 1 0 76.22-76.219 53.895 53.895 0 1 0-76.22 76.219zM421.807 588.989a26.947 26.947 0 0 1 38.104 38.13L221.723 865.28a26.947 26.947 0 1 1-38.104-38.104L421.807 588.99z m81.597-229.808a26.947 26.947 0 1 1-38.104 38.104l-37.996-37.996a26.947 26.947 0 0 1-5.847-29.345c0.808-1.914 1.05-2.426 3.368-7.06l0.189-0.432c0.754-1.509 1.24-2.506 1.159-2.263a188.632 188.632 0 0 0-43.601-198.818 187.877 187.877 0 0 0-129.698-55.215 189.736 189.736 0 0 0-73.135 13.15l-2.506 0.97-1.752 0.728a26.947 26.947 0 0 1-21.073-49.61c1.887-0.809 1.887-0.809 3.423-1.402l2.102-0.808a242.068 242.068 0 0 1 93.992-16.896 241.772 241.772 0 0 1 166.723 70.98 242.526 242.526 0 0 1 57.722 250.88l25.007 25.033zM25.869 160.013a26.947 26.947 0 0 1 49.61 21.02 187.284 187.284 0 0 0-14.74 65.374 188.039 188.039 0 0 0 55.054 141.743 188.632 188.632 0 0 0 44.463 33.037 26.947 26.947 0 1 1-25.411 47.536 242.526 242.526 0 0 1-57.129-42.47A241.907 241.907 0 0 1 6.9 244.035a243.443 243.443 0 0 1 18.97-84.022z m224.337 337.274a26.947 26.947 0 0 1-0.215-53.895 189.17 189.17 0 0 0 61.79-10.644c4.366-1.51 7.168-2.21 10.94-1.563a26.947 26.947 0 0 1 18.81 7.895l33.145 33.146a26.947 26.947 0 0 1-38.103 38.13l-21.99-22.016a243.308 243.308 0 0 1-64.377 8.947z" p-id="2613" fill="#888888"></path><path d="M148.48 77.824a26.947 26.947 0 1 1 38.104-38.104l161.792 161.82a26.947 26.947 0 0 1 7.087 25.6l-22.986 91.35a26.947 26.947 0 0 1-19.564 19.565L221.56 361.04a26.947 26.947 0 0 1-25.6-7.06L30.343 188.362a26.947 26.947 0 1 1 38.13-38.103L223.26 305.044l60.901-15.306 15.306-60.9L148.48 77.823z" p-id="2614" fill="#888888"></path></svg>

Before

Width:  |  Height:  |  Size: 3.5 KiB

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1618205323520" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1376" width="64" height="64" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><style type="text/css"></style></defs><path d="M832 832H192V192h640v640z m-597.333333-42.666667h554.666666V234.666667H234.666667v554.666666z" fill="#888888" p-id="1377"></path></svg>

After

Width:  |  Height:  |  Size: 510 B

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1618205449254" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2381" width="64" height="64" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><style type="text/css"></style></defs><path d="M768 533.333333H256c-12.8 0-21.333333-8.533333-21.333333-21.333333s8.533333-21.333333 21.333333-21.333333h512c12.8 0 21.333333 8.533333 21.333333 21.333333s-8.533333 21.333333-21.333333 21.333333z" fill="#888888" p-id="2382"></path></svg>

After

Width:  |  Height:  |  Size: 613 B

View File

@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?><svg width="20" height="20" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="48" height="48" fill="white" fill-opacity="0.01"/><path d="M44 16C44 22.6274 38.6274 28 32 28C29.9733 28 28.0639 27.4975 26.3896 26.6104L9 44L4 39L21.3896 21.6104C20.5025 19.9361 20 18.0267 20 16C20 9.37258 25.3726 4 32 4C34.0267 4 35.9361 4.50245 37.6104 5.38959L30 13L35 18L42.6104 10.3896C43.4975 12.0639 44 13.9733 44 16Z" fill="none" stroke="#888" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/></svg>

After

Width:  |  Height:  |  Size: 570 B

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1618205464128" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2718" width="64" height="64" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><style type="text/css"></style></defs><path d="M855.466667 168.533333h-554.666667V277.333333H192v554.666667h554.666667v-108.8h108.8v-554.666667zM704 789.333333H234.666667V320h469.333333v469.333333z m108.8-108.8H746.666667V277.333333H343.466667V211.2h469.333333v469.333333z" fill="#888888" p-id="2719"></path></svg>

After

Width:  |  Height:  |  Size: 642 B

View File

@ -1 +1 @@
<!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><title>detach</title><link href="css/app.85b4bec5.css" rel="preload" as="style"><link href="js/app.8bb84aa5.js" rel="preload" as="script"><link href="js/chunk-vendors.29c10bf6.js" rel="preload" as="script"><link href="css/app.85b4bec5.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but detach doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="js/chunk-vendors.29c10bf6.js"></script><script src="js/app.8bb84aa5.js"></script></body></html>
<!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><title>detach</title><link href="css/app.63fbfd69.css" rel="preload" as="style"><link href="js/app.9ca10dbc.js" rel="preload" as="script"><link href="js/chunk-vendors.f7d8e91b.js" rel="preload" as="script"><link href="css/app.63fbfd69.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but detach doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="js/chunk-vendors.f7d8e91b.js"></script><script src="js/app.9ca10dbc.js"></script></body></html>

View File

@ -1,2 +0,0 @@
(function(e){function t(t){for(var r,c,l=t[0],a=t[1],i=t[2],p=0,b=[];p<l.length;p++)c=l[p],Object.prototype.hasOwnProperty.call(u,c)&&u[c]&&b.push(u[c][0]),u[c]=0;for(r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r]);s&&s(t);while(b.length)b.shift()();return o.push.apply(o,i||[]),n()}function n(){for(var e,t=0;t<o.length;t++){for(var n=o[t],r=!0,l=1;l<n.length;l++){var a=n[l];0!==u[a]&&(r=!1)}r&&(o.splice(t--,1),e=c(c.s=n[0]))}return e}var r={},u={app:0},o=[];function c(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,c),n.l=!0,n.exports}c.m=e,c.c=r,c.d=function(e,t,n){c.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},c.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.t=function(e,t){if(1&t&&(e=c(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(c.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)c.d(n,r,function(t){return e[t]}.bind(null,r));return n},c.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return c.d(t,"a",t),t},c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},c.p="";var l=window["webpackJsonp"]=window["webpackJsonp"]||[],a=l.push.bind(l);l.push=t,l=l.slice();for(var i=0;i<l.length;i++)t(l[i]);var s=a;o.push([0,"chunk-vendors"]),n()})({0:function(e,t,n){e.exports=n("cd49")},4011:function(e,t,n){},9035:function(e,t,n){},cd49:function(e,t,n){"use strict";n.r(t);var r=n("79c4"),u=n("c965"),o=n.n(u);const c={class:"info"},l=["src"],a=["value","placeholder"],i={key:1};var s={__name:"App",setup(e){const{ipcRenderer:t}=window.require("electron"),n=Object(r["f"])(window.process.platform),u=Object(r["f"])(!1),s=localStorage.getItem("rubick-system-detach")||"{}",p=Object(r["f"])({});window.initDetach=e=>{p.value=e,u.value=e.subInput&&(!!e.subInput.value||!!e.subInput.placeholder),localStorage.setItem("rubick-system-detach",JSON.stringify(e))};try{window.initDetach(JSON.parse(s))}catch(v){}const b=o()(e=>{t.send("msg-trigger",{type:"detachInputChange",data:{text:e.target.value}})},500),d=()=>{t.send("msg-trigger",{type:"openPluginDevTools"})};return Object.assign(window,{setSubInputValue:({value:e})=>{p.value.subInput.value=e},setSubInput:e=>{p.value.subInput.placeholder=e},removeSubInput:()=>{p.value.subInput=null}}),(e,t)=>{var o,s;return Object(r["e"])(),Object(r["b"])("div",{class:Object(r["d"])([n.value,"detach"])},[Object(r["c"])("div",c,[Object(r["c"])("img",{src:p.value.logo},null,8,l),u.value?(Object(r["e"])(),Object(r["b"])("input",{key:0,autofocus:"",onInput:t[0]||(t[0]=(...e)=>Object(r["h"])(b)&&Object(r["h"])(b)(...e)),value:null===(o=p.value.subInput)||void 0===o?void 0:o.value,placeholder:null===(s=p.value.subInput)||void 0===s?void 0:s.placeholder},null,40,a)):(Object(r["e"])(),Object(r["b"])("span",i,Object(r["g"])(p.value.pluginName),1))]),Object(r["c"])("div",{class:"handle"},[Object(r["c"])("div",{class:"devtool",onClick:d,title:"开发者工具"})])],2)}}};n("e1d4");const p=s;var b=p;n("4011");Object(r["a"])(b).mount("#app")},e1d4:function(e,t,n){"use strict";n("9035")}});
//# sourceMappingURL=app.8bb84aa5.js.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,2 @@
(function(e){function t(t){for(var c,o,l=t[0],a=t[1],i=t[2],d=0,p=[];d<l.length;d++)o=l[d],Object.prototype.hasOwnProperty.call(r,o)&&r[o]&&p.push(r[o][0]),r[o]=0;for(c in a)Object.prototype.hasOwnProperty.call(a,c)&&(e[c]=a[c]);s&&s(t);while(p.length)p.shift()();return u.push.apply(u,i||[]),n()}function n(){for(var e,t=0;t<u.length;t++){for(var n=u[t],c=!0,l=1;l<n.length;l++){var a=n[l];0!==r[a]&&(c=!1)}c&&(u.splice(t--,1),e=o(o.s=n[0]))}return e}var c={},r={app:0},u=[];function o(t){if(c[t])return c[t].exports;var n=c[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.m=e,o.c=c,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var c in e)o.d(n,c,function(t){return e[t]}.bind(null,c));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="";var l=window["webpackJsonp"]=window["webpackJsonp"]||[],a=l.push.bind(l);l.push=t,l=l.slice();for(var i=0;i<l.length;i++)t(l[i]);var s=a;u.push([0,"chunk-vendors"]),n()})({0:function(e,t,n){e.exports=n("cd49")},"39c7":function(e,t,n){},4011:function(e,t,n){},cd49:function(e,t,n){"use strict";n.r(t);var c=n("79c4"),r=n("c965"),u=n.n(r);const o={class:"info"},l=["src"],a=["value","placeholder"],i={key:1},s={class:"handle-container"},d={key:0,class:"window-handle"};var p={__name:"App",setup(e){const{ipcRenderer:t}=window.require("electron"),n=Object(c["g"])(window.process.platform),r=Object(c["g"])(!1),p=localStorage.getItem("rubick-system-detach")||"{}",b=Object(c["g"])({});window.initDetach=e=>{b.value=e,r.value=e.subInput&&(!!e.subInput.value||!!e.subInput.placeholder),localStorage.setItem("rubick-system-detach",JSON.stringify(e))};try{window.initDetach(JSON.parse(p))}catch(g){}const v=u()(e=>{t.send("msg-trigger",{type:"detachInputChange",data:{text:e.target.value}})},500),f=()=>{t.send("msg-trigger",{type:"openPluginDevTools"})},O=()=>{t.send("detach:service",{type:"minimize"})},h=()=>{t.send("detach:service",{type:"maximize"})},j=()=>{t.send("detach:service",{type:"close"})};return Object.assign(window,{setSubInputValue:({value:e})=>{b.value.subInput.value=e},setSubInput:e=>{b.value.subInput.placeholder=e},removeSubInput:()=>{b.value.subInput=null}}),(e,t)=>{var u,p;return Object(c["f"])(),Object(c["c"])("div",{class:Object(c["e"])([n.value,"detach"])},[Object(c["d"])("div",o,[Object(c["d"])("img",{src:b.value.logo},null,8,l),r.value?(Object(c["f"])(),Object(c["c"])("input",{key:0,autofocus:"",onInput:t[0]||(t[0]=(...e)=>Object(c["i"])(v)&&Object(c["i"])(v)(...e)),value:null===(u=b.value.subInput)||void 0===u?void 0:u.value,placeholder:null===(p=b.value.subInput)||void 0===p?void 0:p.placeholder},null,40,a)):(Object(c["f"])(),Object(c["c"])("span",i,Object(c["h"])(b.value.pluginName),1))]),Object(c["d"])("div",s,[Object(c["d"])("div",{class:"handle"},[Object(c["d"])("div",{class:"devtool",onClick:f,title:"开发者工具"})]),"darwin"!==n.value?(Object(c["f"])(),Object(c["c"])("div",d,[Object(c["d"])("div",{class:"minimize",onClick:O}),Object(c["d"])("div",{class:"maximize",onClick:h}),Object(c["d"])("div",{class:"close",onClick:j})])):Object(c["b"])("",!0)])],2)}}};n("d305");const b=p;var v=b;n("4011");Object(c["a"])(v).mount("#app")},d305:function(e,t,n){"use strict";n("39c7")}});
//# sourceMappingURL=app.9ca10dbc.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,9 +1,13 @@
import { app, BrowserWindow, protocol } from 'electron';
import { BrowserWindow, ipcMain, nativeTheme } from 'electron';
import path from 'path';
export default () => {
let win: any;
const init = (pluginInfo, viewInfo, view) => {
ipcMain.on('detach:service', async (event, arg: { type: string }) => {
const data = await operation[arg.type]();
event.returnValue = data;
});
createWindow(pluginInfo, viewInfo, view);
};
@ -20,6 +24,7 @@ export default () => {
frame: true,
show: false,
enableLargerThanScreen: true,
backgroundColor: nativeTheme.shouldUseDarkColors ? '#1c1c28' : '#fff',
x: viewInfo.x,
y: viewInfo.y,
webPreferences: {
@ -28,6 +33,7 @@ export default () => {
backgroundThrottling: false,
contextIsolation: false,
webviewTag: true,
devTools: true,
nodeIntegration: true,
},
});
@ -70,6 +76,19 @@ export default () => {
const getWindow = () => win;
const operation = {
minimize: () => {
win.focus();
win.minimize();
},
maximize: () => {
win.isMaximized() ? win.unmaximize() : win.maximize();
},
close: () => {
win.close();
},
};
return {
init,
getWindow,

View File

@ -1,4 +1,4 @@
import main from "./main";
import runner from "./runner";
import detach from "./detach";
import main from './main';
import runner from './runner';
import detach from './detach';
export { main, runner, detach };

View File

@ -1,4 +1,4 @@
import { app, BrowserWindow, protocol } from 'electron';
import { app, BrowserWindow, protocol, nativeTheme } from 'electron';
import path from 'path';
import { createProtocol } from 'vue-cli-plugin-electron-builder/lib';
import versonHandler from '../common/versionHandler';
@ -19,6 +19,7 @@ export default () => {
title: '拉比克',
show: false,
skipTaskbar: true,
backgroundColor: nativeTheme.shouldUseDarkColors ? '#1c1c28' : '#fff',
webPreferences: {
webSecurity: false,
enableRemoteModule: true,

View File

@ -109,6 +109,7 @@ const sort = (options) => {
background: var(--color-body-bg);
color: var(--color-text-content);
border-color: var(--color-border-light);
border-bottom: 1px solid var(--color-border-light);
&.active {
background: var(--color-list-hover);
}