feat(client): プラグインのIDを不要に

This commit is contained in:
syuilo 2020-07-30 00:41:17 +09:00
parent 74d0e83a8a
commit 57203de4cb
2 changed files with 7 additions and 4 deletions

View File

@ -47,6 +47,7 @@
import Vue from 'vue'; import Vue from 'vue';
import { AiScript, parse } from '@syuilo/aiscript'; import { AiScript, parse } from '@syuilo/aiscript';
import { serialize } from '@syuilo/aiscript/built/serializer'; import { serialize } from '@syuilo/aiscript/built/serializer';
import { v4 as uuid } from 'uuid';
import { faPlug, faSave, faTrashAlt, faFolderOpen, faDownload, faCog } from '@fortawesome/free-solid-svg-icons'; import { faPlug, faSave, faTrashAlt, faFolderOpen, faDownload, faCog } from '@fortawesome/free-solid-svg-icons';
import MkButton from '../../components/ui/button.vue'; import MkButton from '../../components/ui/button.vue';
import MkTextarea from '../../components/ui/textarea.vue'; import MkTextarea from '../../components/ui/textarea.vue';
@ -106,8 +107,8 @@ export default Vue.extend({
}); });
return; return;
} }
const { id, name, version, author, description, permissions, config } = data; const { name, version, author, description, permissions, config } = data;
if (id == null || name == null || version == null || author == null) { if (name == null || version == null || author == null) {
this.$root.dialog({ this.$root.dialog({
type: 'error', type: 'error',
text: 'Required property not found :(' text: 'Required property not found :('
@ -133,8 +134,9 @@ export default Vue.extend({
}); });
this.$store.commit('deviceUser/installPlugin', { this.$store.commit('deviceUser/installPlugin', {
id: uuid(),
meta: { meta: {
id, name, version, author, description, permissions, config name, version, author, description, permissions, config
}, },
token, token,
ast: serialize(ast) ast: serialize(ast)

View File

@ -613,9 +613,10 @@ export default () => new Vuex.Store({
}, },
//#endregion //#endregion
installPlugin(state, { meta, ast, token }) { installPlugin(state, { id, meta, ast, token }) {
state.plugins.push({ state.plugins.push({
...meta, ...meta,
id,
active: true, active: true,
configData: {}, configData: {},
token: token, token: token,