-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable plugin options on view mode (#216)
* enable plugin options on view mode * run formatter
- Loading branch information
1 parent
16fe0ea
commit bed7312
Showing
18 changed files
with
325 additions
and
98 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
//! Server-side plugin options parsing | ||
use celerc::res::Resource; | ||
use celerc::{PluginOptions, PluginOptionsRaw}; | ||
|
||
use super::ServerResourceLoader; | ||
|
||
/// Parse the plugin options, and return the error message if the options are invalid | ||
pub async fn parse_plugin_options( | ||
plugin_options: &str, | ||
root_resource: &Resource<'_, ServerResourceLoader>, | ||
) -> Result<PluginOptions, String> { | ||
let raw_options: PluginOptionsRaw = | ||
serde_json::from_str(plugin_options).map_err(|e| e.to_string())?; | ||
let options = raw_options | ||
.parse(root_resource) | ||
.await | ||
.map_err(|e| e.to_string())?; | ||
Ok(options) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.