manager: support App Profile template

This commit is contained in:
weishu
2023-10-21 13:19:59 +08:00
parent a4fb9e4031
commit 9b294682b0
13 changed files with 946 additions and 86 deletions

View File

@@ -148,20 +148,26 @@ enum Profile {
policy: String,
},
/// get template of <package-name>
/// get template of <id>
GetTemplate {
/// package name
package: String,
/// template id
id: String,
},
/// set template of <package-name> to <template>
/// set template of <id> to <template string>
SetTemplate {
/// package name
package: String,
/// template
/// template id
id: String,
/// template string
template: String,
},
/// delete template of <id>
DeleteTemplate {
/// template id
id: String,
},
/// list all templates
ListTemplates,
}
@@ -217,10 +223,11 @@ pub fn run() -> Result<()> {
Profile::SetSepolicy { package, policy } => {
crate::profile::set_sepolicy(package, policy)
}
Profile::GetTemplate { package } => crate::profile::get_template(package),
Profile::SetTemplate { package, template } => {
crate::profile::set_template(package, template)
}
Profile::GetTemplate { id } => crate::profile::get_template(id),
Profile::SetTemplate { id, template } => {
crate::profile::set_template(id, template)
},
Profile::DeleteTemplate { id } => crate::profile::delete_template(id),
Profile::ListTemplates => crate::profile::list_templates(),
},