UX: improve artifact styling add direct share link (#930)
Also remove uneeded sandboxing give this is all handled by artifacts directly
This commit is contained in:
parent
a0aec48606
commit
2652716398
|
@ -52,6 +52,11 @@ module DiscourseAi
|
||||||
padding: 0;
|
padding: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
border: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
iframe {
|
||||||
|
overflow: auto;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
|
@ -9,7 +9,10 @@ class AiArtifact < ActiveRecord::Base
|
||||||
|
|
||||||
def self.iframe_for(id)
|
def self.iframe_for(id)
|
||||||
<<~HTML
|
<<~HTML
|
||||||
<iframe sandbox="allow-scripts allow-forms" height="600px" src='#{url(id)}' frameborder="0" width="100%"></iframe>
|
<div class='ai-artifact'>
|
||||||
|
<iframe src='#{url(id)}' frameborder="0" height="100%" width="100%"></iframe>
|
||||||
|
<a href='#{url(id)}' target='_blank'>#{I18n.t("discourse_ai.ai_artifact.link")}</a>
|
||||||
|
</div>
|
||||||
HTML
|
HTML
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -104,7 +104,6 @@ export default class AiArtifactComponent extends Component {
|
||||||
src={{this.artifactUrl}}
|
src={{this.artifactUrl}}
|
||||||
width="100%"
|
width="100%"
|
||||||
frameborder="0"
|
frameborder="0"
|
||||||
sandbox="allow-scripts allow-forms"
|
|
||||||
></iframe>
|
></iframe>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#unless this.requireClickToRun}}
|
{{#unless this.requireClickToRun}}
|
||||||
|
|
|
@ -173,6 +173,8 @@ en:
|
||||||
title: Surprise
|
title: Surprise
|
||||||
|
|
||||||
discourse_ai:
|
discourse_ai:
|
||||||
|
ai_artifact:
|
||||||
|
link: "Show Artifact in new tab"
|
||||||
unknown_model: "Unknown AI model"
|
unknown_model: "Unknown AI model"
|
||||||
|
|
||||||
tools:
|
tools:
|
||||||
|
|
|
@ -627,3 +627,8 @@ aside.onebox h3 {
|
||||||
opacity: 0.85;
|
opacity: 0.85;
|
||||||
transition: opacity 0.25s ease-in-out;
|
transition: opacity 0.25s ease-in-out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ai-artifact iframe {
|
||||||
|
height: 600px;
|
||||||
|
max-height: 600px;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue