Skip to content

Commit

Permalink
feat(pluginsUI): minor style improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
lideming committed Jun 14, 2023
1 parent 73dae9f commit b0335bc
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
1 change: 1 addition & 0 deletions src/I18n/i18n-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@
["Add plugin by code", "添加插件代码"],
["Enable", "启用"],
["Disable", "禁用"],
["loaded", "已加载"],
["Are you sure to remove plugin \"{0}\"?", "确定要移除插件 \"{0}\" 吗?"],
["Edit plugin code", "编辑插件代码"],
["Plugin code", "插件代码"],
Expand Down
27 changes: 16 additions & 11 deletions src/Plugins/pluginsUI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,17 +157,6 @@ export class PluginListViewItem extends ListViewItem {
return {
tag: "div.plugin-item",
child: [
type === "user-store" && new ButtonView({
text: () => I`Edit`,
type: "inline",
onActive: async (ev) => {
const item = plugins.getPluginCodeItem(key);
await item.get();
const dialog = new PluginCodeDialog("edit", item);
dialog.onSubmit.add(() => this.onChange.invoke());
dialog.show(ev);
},
}),
new ButtonView({
text: () => (this.data.enabled ? I`Disable` : I`Enable`),
type: "inline",
Expand Down Expand Up @@ -198,8 +187,24 @@ export class PluginListViewItem extends ListViewItem {
});
},
}),
type === "user-store" && new ButtonView({
text: () => I`Edit`,
type: "inline",
onActive: async (ev) => {
const item = plugins.getPluginCodeItem(key);
await item.get();
const dialog = new PluginCodeDialog("edit", item);
dialog.onSubmit.add(() => this.onChange.invoke());
dialog.show(ev);
},
}),
{
tag: "div.plugin-status",
update: (dom) => {
dom.style.color = this.data.loaded || this.data.enabled
? ""
: "var(--color-text-gray)";
},
text: () =>
[
this.data.enabled ? I`enabled` : I`disabled`,
Expand Down
2 changes: 1 addition & 1 deletion style.css
Original file line number Diff line number Diff line change
Expand Up @@ -1547,5 +1547,5 @@ body {
}

.add-plugins > .btn {
margin: 0 5px;
margin: 0 5px 0 0;
}

1 comment on commit b0335bc

@vercel
Copy link

@vercel vercel bot commented on b0335bc Jun 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

music-cloud – ./

music-cloud-lideming.vercel.app
music-cloud-git-master-lideming.vercel.app

Please sign in to comment.