|
| 1 | +- user_app = current_user.staff_applications.find_by(name: staff_application.key) |
| 2 | + |
| 3 | +%div.staff-application{ id: "staff_application_#{staff_application.key}" } |
| 4 | + - if user_app |
| 5 | + - oauth_app = user_app.application |
| 6 | + |
| 7 | + .title |
| 8 | + %h4= link_to(staff_application.name, oauth_app.uri) |
| 9 | + |
| 10 | + .info |
| 11 | + .app-config{ data: { controller: 'clipboard' } } |
| 12 | + .path |
| 13 | + .app-path |
| 14 | + == #{staff_application.name.chomp(' (Local)').downcase.gsub(' ', '_')}/ |
| 15 | + = staff_application.config_path |
| 16 | + .config-content |
| 17 | + .blocker{ onclick: "this.style.display = 'none'" } |
| 18 | + %span.button |
| 19 | + = inline_svg 'hero/20/pointer-click.svg' |
| 20 | + Click to view config |
| 21 | + %button.copy{ data: { action: 'clipboard#copy', clipboard_target: 'button' }, aria: { label: 'Copy' } } |
| 22 | + = inline_svg 'hero/20/duplicate.svg' |
| 23 | + Copy |
| 24 | + .copied.hidden{ data: { clipboard_target: 'notice' } } |
| 25 | + = inline_svg 'hero/20/circle-check.svg' |
| 26 | + Copied |
| 27 | + - if staff_application.config_prologue |
| 28 | + %pre.faded |
| 29 | + = format_staff_config(staff_application.config_prologue, oauth_app) |
| 30 | +
|
| 31 | + %pre{ data: { clipboard_target: 'source' } } |
| 32 | + = format_staff_config(staff_application.config_content, oauth_app) |
| 33 | +
|
| 34 | + - if staff_application.config_epilogue |
| 35 | + %pre.faded |
| 36 | + = format_staff_config(staff_application.config_epilogue, oauth_app) |
| 37 | + .reminder |
| 38 | + = inline_svg_tag 'hero/20/exclamation.svg' |
| 39 | + == Restart the #{staff_application.name.chomp(' (Local)')} application after changing the config! |
| 40 | +
|
| 41 | + .attributes |
| 42 | + %dl |
| 43 | + %dt Run command… |
| 44 | + %dd{ data: { controller: 'clipboard' }, style: 'display: flex; align-items: center; gap: 0.25rem' } |
| 45 | + %code{ data: { clipboard_target: 'source' } }= format_staff_run_command(staff_application.run_command, oauth_app) |
| 46 | + .command-copy |
| 47 | + %button.copy{ data: { action: 'clipboard#copy', clipboard_target: 'button' }, aria: { label: 'Copy' } } |
| 48 | + = inline_svg 'hero/20/duplicate.svg' |
| 49 | + Copy |
| 50 | + .copied{ data: { clipboard_target: 'notice' }, class: 'hidden' } |
| 51 | + = inline_svg 'hero/20/circle-check.svg' |
| 52 | + Copied! |
| 53 | + %dt |
| 54 | + = label_tag "staff_application_#{staff_application.key}_uri", 'Hosted at' |
| 55 | + %dd |
| 56 | + = form_tag inspect_staff_application_path(staff_application.key), method: :put do |
| 57 | + = text_field_tag :uri, oauth_app.uri, style: 'margin: 0', id: "staff_application_#{staff_application.key}_uri" |
| 58 | + %button.btn{ type: 'submit' } Change |
| 59 | + |
| 60 | + %p.host-help |
| 61 | + If you run the application at a different address, you must set the correct address |
| 62 | + here for authentication to work correctly. |
| 63 | + |
| 64 | + %p.host-help |
| 65 | + %mark If you change the address, you must also update the config file. |
| 66 | + - else |
| 67 | + .title |
| 68 | + %h4= staff_application.name |
| 69 | + |
| 70 | + %p |
| 71 | + This application is not configured. Set the location where you run the app. |
| 72 | + You can change this later. |
| 73 | + |
| 74 | + = form_tag inspect_staff_application_path(staff_application.key), method: :put do |
| 75 | + = label_tag "staff_application_#{staff_application.key}_uri", 'Hosted at' |
| 76 | + = text_field_tag :uri, staff_application.uri, style: 'margin: 0', id: "staff_application_#{staff_application.key}_uri" |
| 77 | + %button.btn{ type: 'submit' } Create application |
0 commit comments