Skip to content

Commit 9e48f2e

Browse files
committed
feat: save secret #2
Signed-off-by: seven <[email protected]>
1 parent 7984b8c commit 9e48f2e

File tree

13 files changed

+67
-29
lines changed

13 files changed

+67
-29
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
with:
6666
tagName: ${{ steps.tag_release.outputs.version }}
6767
releaseName: ${{ steps.tag_release.outputs.version }}
68-
appVersion: ${{ steps.tag_release.outputs.version }}
68+
appVersion: "${{ steps.tag_release.outputs.versionNumber }}"
6969
releaseBody: |
7070
${{ steps.changelog.outputs.compareurl }}
7171

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />
5-
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
5+
<link rel="icon" type="image/ico" href="/icon.ico" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
77
<title>AnyTerm</title>
88
</head>

package-lock.json

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"oh-vue-icons": "^1.0.0-rc3",
2121
"pinia": "^2.1.7",
2222
"pinia-plugin-persistedstate": "^3.2.1",
23+
"ulidx": "^2.3.0",
2324
"vue": "^3.3.4",
2425
"vue-i18n": "^9.9.0",
2526
"vue-router": "^4.2.5"

public/vite.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

src-tauri/tauri.conf.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
"fullscreen": false,
3838
"resizable": true,
3939
"title": "AnyTerm",
40-
"width": 800,
41-
"height": 600
40+
"width": 1200,
41+
"height": 750
4242
}
4343
]
4444
}

src/assets/styles/theme.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ body,
66
width: 100%;
77
}
88
:root {
9-
--theme-color: #36ad6a;
10-
--theme-color-hover: #19934e;
9+
--theme-color: #FF8911;
10+
--theme-color-hover: #7F27FF;
1111
--dange-color: #cd2158;
1212
}
1313
:root[theme='light'] {
@@ -30,4 +30,4 @@ body {
3030
color: var(--text-color);
3131
transition: .3s;
3232
font-size: 14px;
33-
}
33+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export const naiveThemeOverrides = {
22
common: {
3-
primaryColor: '#36ad6a',
4-
primaryColorHover: '#19934e',
3+
primaryColor: '#FF8911',
4+
primaryColorHover: '#7F27FF',
55
},
66
};

src/store/secretStore.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { defineStore } from 'pinia';
2-
2+
import { ulid } from 'ulidx';
33
export enum SecretType {
44
SSH_KEY = 'SSH_KEY',
55
PASSWORD = 'PASSWORD',
@@ -22,5 +22,15 @@ export const useSecretStore = defineStore('secretStore', {
2222
};
2323
},
2424
getters: {},
25-
actions: {},
25+
actions: {
26+
saveSecret(secret: Secret) {
27+
if (!secret.id) {
28+
secret.id = ulid();
29+
this.secrets.push(secret);
30+
} else {
31+
const index = this.secrets.findIndex(s => s.id === secret.id);
32+
this.secrets[index] = secret;
33+
}
34+
},
35+
},
2636
});
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<template>
2+
<div class="secret-list">
3+
<n-card v-for="secret in secrets" :key="secret.id" :title="secret.name" hoverable> </n-card>
4+
</div>
5+
</template>
6+
7+
<script setup lang="ts">
8+
import { useSecretStore } from '../../../store';
9+
10+
const secretStore = useSecretStore();
11+
12+
const { secrets } = toRefs(secretStore);
13+
</script>
14+
15+
<style lang="scss" scoped>
16+
.n-card {
17+
max-width: 300px;
18+
}
19+
</style>

0 commit comments

Comments
 (0)