singleActions.js 800 B

123456789101112131415161718192021222324252627282930
  1. import { mapGetters } from 'vuex'
  2. // import { Base64 } from 'js-base64'
  3. // import qs from 'qs'
  4. import Actions from '../constants/actions'
  5. export default {
  6. computed: {
  7. ...mapGetters(['isAdminMode', 'isDomainMode', 'userInfo', 'auth', 'common']),
  8. enableMFA () {
  9. return this.userInfo.enable_mfa && this.auth.auth.system_totp_on
  10. },
  11. },
  12. created () {
  13. this.singleActions = Actions.getSingleActions.call(this)
  14. },
  15. methods: {
  16. openWebConsole (data) {
  17. this.$openWebConsole(data)
  18. },
  19. async fetchConnectUrl (containerId) {
  20. const { data } = await new this.$Manager('webconsole', 'v1').objectRpc({
  21. methodname: 'DoContainerExec',
  22. params: {
  23. container_id: containerId,
  24. },
  25. })
  26. return Promise.resolve(data)
  27. },
  28. },
  29. }