name: west
title: 西部数码授权
desc: ''
icon: tabler:map-west
input:
  scope:
    title: 权限范围
    component:
      name: a-select
      vModel: value
      options:
        - value: account
          label: 账户级别，对所有域名都有权限管理
        - value: domain
          label: 域名级别，仅能管理单个域名
    helper: 选择权限范围
    required: true
  username:
    title: 账号
    helper: 你的登录账号
    encrypt: false
    required: false
    mergeScript: |2-

          return {
            show:ctx.compute(({form})=>{
              return form.access.scope === 'account'
            })
          }
          
  apikey:
    title: ApiKey
    component:
      placeholder: 账户级别的key，对整个账户都有管理权限
    helper: |-
      账户级别的key，对整个账户都有管理权限
      前往https://www.west.cn/manager/API/APIconfig.asp，手动设置“api连接密码”
    encrypt: true
    required: false
    mergeScript: |2-

          return {
            show:ctx.compute(({form})=>{
              return form.access.scope === 'account'
            })
          }
          
  apidomainkey:
    title: apidomainkey
    component:
      placeholder: 域名级别的key，仅对单个域名有权限
    helper: |-
      域名级别的key，仅对单个域名有权限。 
      前往[西部数据域名管理](https://www.west.cn/manager/domain/)，点击域名，右上方点击ApiKey获取密钥
    encrypt: true
    required: false
    mergeScript: |2-

          return {
            show:ctx.compute(({form})=>{
              return form.access.scope === 'domain'
            })
          }
          
type: builtIn
pluginType: access
scriptFilePath: ../../../plugins/plugin-west/index.js
