mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-01-20 14:19:59 -06:00
feat(ui): refresh plugin API button
This commit is contained in:
@@ -112,7 +112,8 @@
|
||||
},
|
||||
"report-bug": "Report bug",
|
||||
"translate": "Help translate",
|
||||
"dark-mode": "Toggle dark mode"
|
||||
"dark-mode": "Toggle dark mode",
|
||||
"reset-plugin-api": "Refresh plugins API"
|
||||
},
|
||||
"suggestion-bar": {
|
||||
"suggestion": "Suggestion",
|
||||
|
||||
@@ -70,6 +70,13 @@
|
||||
>
|
||||
<VueIcon icon="g_translate"/>
|
||||
</div>
|
||||
<div
|
||||
class="section action reset-plugin-api"
|
||||
v-tooltip="$t('components.status-bar.reset-plugin-api')"
|
||||
@click="resetPluginApi()"
|
||||
>
|
||||
<VueIcon icon="cached"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -79,6 +86,8 @@ import PROJECT_CURRENT from '../graphql/projectCurrent.gql'
|
||||
import CONSOLE_LOG_LAST from '../graphql/consoleLogLast.gql'
|
||||
import CONSOLE_LOG_ADDED from '../graphql/consoleLogAdded.gql'
|
||||
import DARK_MODE_SET from '../graphql/darkModeSet.gql'
|
||||
import PLUGIN_RESET_API from '../graphql/pluginResetApi.gql'
|
||||
import { resetApollo } from '../vue-apollo'
|
||||
|
||||
let lastRoute
|
||||
|
||||
@@ -174,6 +183,14 @@ export default {
|
||||
|
||||
toggleDarkMode () {
|
||||
this.applyDarkMode(!this.darkMode)
|
||||
},
|
||||
|
||||
async resetPluginApi () {
|
||||
await this.$apollo.mutate({
|
||||
mutation: PLUGIN_RESET_API
|
||||
})
|
||||
|
||||
await resetApollo()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ export default {
|
||||
}
|
||||
})
|
||||
|
||||
resetApollo()
|
||||
await resetApollo()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,6 +132,8 @@ function resetPluginApi (context) {
|
||||
if (currentView) views.open(currentView.id)
|
||||
}
|
||||
})
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
function runPluginApi (id, context, fileName = 'ui') {
|
||||
|
||||
@@ -18,6 +18,7 @@ extend type Mutation {
|
||||
pluginUpdate (id: ID!): Plugin
|
||||
pluginActionCall (id: ID!, params: JSON): PluginActionResult
|
||||
pluginsUpdate: [Plugin]
|
||||
pluginResetApi: Boolean
|
||||
}
|
||||
|
||||
extend type Subscription {
|
||||
@@ -82,7 +83,8 @@ exports.resolvers = {
|
||||
pluginFinishInstall: (root, args, context) => plugins.finishInstall(context),
|
||||
pluginUpdate: (root, { id }, context) => plugins.update(id, context),
|
||||
pluginActionCall: (root, args, context) => plugins.callAction(args, context),
|
||||
pluginsUpdate: (root, args, context) => plugins.updateAll(context)
|
||||
pluginsUpdate: (root, args, context) => plugins.updateAll(context),
|
||||
pluginResetApi: (root, args, context) => plugins.resetPluginApi(context)
|
||||
},
|
||||
|
||||
Subscription: {
|
||||
|
||||
3
packages/@vue/cli-ui/src/graphql/pluginResetApi.gql
Normal file
3
packages/@vue/cli-ui/src/graphql/pluginResetApi.gql
Normal file
@@ -0,0 +1,3 @@
|
||||
mutation pluginResetApi {
|
||||
pluginResetApi
|
||||
}
|
||||
Reference in New Issue
Block a user