script#admin-general-view-template(type="text/x-template")
  #admin-general
    h2 Firmware
    button.pure-button.pure-button-primary(@click="check") Check
    button.pure-button.pure-button-primary(@click="upgrade") Upgrade via Web
    label.pure-button.pure-button-primary(@click="upload_firmware") Upgrade via File
    form.upload-firmware.file-upload
      input(type="file", accept=".bz2", @change="upload")

    p
      input(type="checkbox", v-model="autoCheckUpgrade",
        @change="change_auto_check_upgrade")
      label(for="auto-check-upgrade") &nbsp; Automatically check for upgrades

    h2 Configuration
    button.pure-button.pure-button-primary(@click="backup") Backup

    label.pure-button.pure-button-primary(@click="restore_config") Restore
    form.restore-config.file-upload
      input(type="file", accept=".json", @change="restore")

    button.pure-button.pure-button-primary(@click="confirmReset = true") Reset    
    message(:show.sync="confirmReset")
      h3(slot="header") Reset to default configuration?
      p(slot="body") Non-network configuration changes will be lost.
      p(slot="body") Select defaults to restore:
      p.reset-variants(slot="body")
        input#tab1(type="radio", name="reset_variant" @click="reset_variant = 'machinist_x35'")
        label(for="tab1", title="Machinist X-35") Machinist X-35 / Original (16x16")

        input#tab2(type="radio", name="reset_variant" @click="reset_variant = 'woodworker_x35'")
        label(for="tab2", title="Woodworker X-35") Woodworker X-35 / Original (32x32")

        input#tab3(type="radio", name="reset_variant" @click="reset_variant = 'woodworker_x50'")
        label(for="tab3", title="Woodworker X-50") Woodworker X-50 / Pro (32x32")

        input#tab4(type="radio", name="reset_variant" @click="reset_variant = 'journeyman_x50'")
        label(for="tab4", title="Journeyman X-50") Journeyman X-50 / Pro (48x32")

        input#tab5(type="radio", name="reset_variant" @click="reset_variant = 'foreman_pro'")
        label(for="tab5", title="Foreman Pro") Foreman Pro (48x48")
      div(slot="footer")
        button.pure-button(@click="confirmReset = false") Cancel
        button.pure-button.pure-button-primary(@click="next") Next
        
    message(:show.sync="z_slider")
      h3(slot="header") Pick your Z Slider Type
      p(slot="body") Non-network configuration changes will be lost.
      p(slot="body") Select defaults to restore:
      p.reset-variants(slot="body")
        input#tab1(type="radio", name="z_slider_variant" @click="z_slider_variant = 'Z-16 Original'")
        label(for="tab1", title="Z-16 Original") Z-16 Original

        input#tab2(type="radio", name="z_slider_variant" @click="z_slider_variant = 'Z-20 Heavy Duty'")
        label(for="tab2", title="Z-20 Heavy Duty") Z-20 Heavy Duty
                
      div(slot="footer")
        button.pure-button(@click="z_slider = false") Cancel
        button.pure-button.pure-button-primary(@click="set_z_slider") Set Z slider
        
    h2 Debugging
    a(href="/api/log", target="_blank")
      button.pure-button.pure-button-primary View Log
    a(href="/api/bugreport")
      button.pure-button.pure-button-primary Bug Report
