diff --git a/test.sh b/test.sh
index 8b7e45d..2fe1998 100755
--- a/test.sh
+++ b/test.sh
@@ -2,7 +2,7 @@
export RUN_ENV='development'
-if [ $UID == 0 ]; then
+if [ $UID == 1000 ]; then
./usr/lib/debian-sources/debian-sources.py
else
export SUDO_ASKPASS=${HOME}/.local/bin/scripts/rofi_password.sh
diff --git a/usr/lib/debian-sources/webapp/app.js b/usr/lib/debian-sources/webapp/app.js
index d254c88..7ce9528 100644
--- a/usr/lib/debian-sources/webapp/app.js
+++ b/usr/lib/debian-sources/webapp/app.js
@@ -6,18 +6,18 @@
import 'es.shim'
import { html, css, Component } from 'wkit'
+import { createApp, createRouter } from 'wkitd'
import './components/sidebar.js'
-import './components/official.js'
+import router from './router.js'
-class App extends Component {
- static props = {
+createApp({
+ data: {
input: '',
img: '',
content: ''
- }
-
- static styles = [
+ },
+ styles: [
css`
:host {
display: flex;
@@ -28,21 +28,24 @@ class App extends Component {
display: flex;
width: 100%;
}
+ router-view {
+ flex: 1;
+ }
`
- ]
-
+ ],
+ methods: {
+ quit() {
+ native.quit()
+ }
+ },
render() {
return html`
-
+
`
}
-
- quit() {
- native.quit()
- }
-}
-
-App.reg('app')
+})
+ .use(router)
+ .mount()
diff --git a/usr/lib/debian-sources/webapp/components/keys.js b/usr/lib/debian-sources/webapp/components/keys.js
new file mode 100644
index 0000000..b9eae7d
--- /dev/null
+++ b/usr/lib/debian-sources/webapp/components/keys.js
@@ -0,0 +1,68 @@
+/**
+ * {}
+ * @author yutent
+ * @date 2023/08/08 18:19:17
+ */
+import { html, css, Component } from 'wkit'
+
+import 'ui/icon/index.js'
+import 'ui/space/index.js'
+import 'ui/form/input.js'
+import 'ui/form/switch.js'
+import 'ui/form/button.js'
+
+class Keys extends Component {
+ static props = {
+ foo: ''
+ }
+
+ static styles = [
+ css`
+ :host {
+ flex: 1;
+ }
+ .main {
+ width: 100%;
+ height: 100%;
+ padding: 32px;
+ color: var(--color-dark-1);
+ background: #f0f0f0;
+ }
+
+ wc-input {
+ flex: 1;
+ }
+
+ wc-button {
+ width: 100%;
+ }
+
+ .card {
+ width: 100%;
+ padding: 12px;
+ margin: 0 auto 24px;
+ border: 0;
+ box-shadow: 0 0 8px rgba(0, 0, 0, 0.075);
+ background: #fff;
+ }
+ legend {
+ -webkit-touch-callout: none;
+ user-select: none;
+ color: var(--color-dark-1);
+ font-weight: bold;
+ }
+ `
+ ]
+
+ render() {
+ return html`
+
+
+
+ `
+ }
+}
+
+Keys.reg('keys')
diff --git a/usr/lib/debian-sources/webapp/components/official.js b/usr/lib/debian-sources/webapp/components/official.js
index 9242ba4..0698989 100644
--- a/usr/lib/debian-sources/webapp/components/official.js
+++ b/usr/lib/debian-sources/webapp/components/official.js
@@ -5,11 +5,11 @@
*/
import { html, css, Component } from 'wkit'
-import '@bd/ui/icon/index.js'
-import '@bd/ui/space/index.js'
-import '@bd/ui/form/input.js'
-import '@bd/ui/form/switch.js'
-import '@bd/ui/form/button.js'
+import 'ui/icon/index.js'
+import 'ui/space/index.js'
+import 'ui/form/input.js'
+import 'ui/form/switch.js'
+import 'ui/form/button.js'
class Official extends Component {
static props = {
@@ -51,6 +51,16 @@ class Official extends Component {
color: var(--color-dark-1);
font-weight: bold;
}
+
+ .arrow {
+ display: inline-flex;
+ align-items: center;
+ --wc-icon-size: 12px;
+ margin-right: 8px;
+ }
+ .arrow wc-icon {
+ transform: rotate(-90deg);
+ }
`
]
@@ -62,7 +72,11 @@ class Official extends Component {
主站(bookworm)
-
+
+
+
+
+
diff --git a/usr/lib/debian-sources/webapp/components/sidebar.js b/usr/lib/debian-sources/webapp/components/sidebar.js
index dd13a56..29295be 100644
--- a/usr/lib/debian-sources/webapp/components/sidebar.js
+++ b/usr/lib/debian-sources/webapp/components/sidebar.js
@@ -4,7 +4,7 @@
* @date 2023/08/08 18:19:17
*/
import { html, css, Component } from 'wkit'
-import '@bd/ui/icon/index.js'
+import 'ui/icon/index.js'
class Sidebar extends Component {
static props = {
@@ -25,7 +25,7 @@ class Sidebar extends Component {
align-items: center;
height: 48px;
padding: 0 12px;
- --size: 16px;
+ --wc-icon-size: 16px;
}
.item:hover {
@@ -45,20 +45,22 @@ class Sidebar extends Component {
render() {
return html`
-