Skip to content

Commit

Permalink
feat: 同步配置支持自定义图标
Browse files Browse the repository at this point in the history
  • Loading branch information
xream committed Jan 16, 2024
1 parent cab0732 commit c3d5654
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sub-store-front-end",
"version": "2.14.59",
"version": "2.14.60",
"private": true,
"scripts": {
"dev": "vite --host",
Expand Down
14 changes: 14 additions & 0 deletions src/components/ArtifactPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,19 @@
type="text"
/>
</nut-form-item>
<nut-form-item
:label="$t(`editorPage.subConfig.basic.icon.label`)"
prop="icon"
>
<nut-input
input-align="left"
class="nut-input-text"
:placeholder="$t(`editorPage.subConfig.basic.icon.placeholder`)"
v-model="editPanelData.icon"
type="text"
/>
</nut-form-item>

<nut-form-item
:label="$t(`syncPage.addArtForm.source.label`)"
required
Expand Down Expand Up @@ -142,6 +155,7 @@
const editPanelData = ref<Artifact>({
name: '',
displayName: '',
icon: '',
source: '',
type: 'file',
platform: 'Stash',
Expand Down
4 changes: 4 additions & 0 deletions src/components/ArtifactsListItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,10 @@ const sourceSub = computed(() => {
});
const icon = computed(() => {
const icon = artifact.value.icon
if (icon) {
return icon;
}
let platform = String(artifact.value.platform)
if (['file'].includes(artifact.value.type)) {
if (sourceSub.value?.icon) {
Expand Down
1 change: 1 addition & 0 deletions src/types/store/artifacts.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ type ArtifactType = 'collection' | 'subscription' | 'file';
interface Artifact {
name: string;
displayName?: string;
icon?: string;
type: ArtifactType;
source: string;
platform: ArtifactsPlatform;
Expand Down

0 comments on commit c3d5654

Please sign in to comment.