fix(source): add /services/{name}/source endpoint; fix 404 for service code view in funcs-console
This commit is contained in:
@@ -416,7 +416,7 @@
|
||||
icon.style.transform = 'rotate(90deg)';
|
||||
if (!loaded) {
|
||||
loaded = true;
|
||||
loadSource(body, ns, fn.name);
|
||||
loadSource(body, ns, fn.name, fn.kind);
|
||||
}
|
||||
} else {
|
||||
body.style.display = 'none';
|
||||
@@ -458,12 +458,13 @@
|
||||
return btn;
|
||||
}
|
||||
|
||||
function loadSource(body, ns, fnName) {
|
||||
function loadSource(body, ns, fnName, fnKind) {
|
||||
var msg = $el('div', 'src-msg');
|
||||
msg.textContent = 'Загрузка кода…';
|
||||
body.appendChild(msg);
|
||||
|
||||
fetch('/funcs/' + ns + '/source/' + fnName)
|
||||
var kindParam = fnKind === 'service' ? '?kind=service' : '';
|
||||
fetch('/funcs/' + ns + '/source/' + fnName + kindParam)
|
||||
.then(function (r) {
|
||||
body.removeChild(msg);
|
||||
if (!r.ok) {
|
||||
|
||||
Reference in New Issue
Block a user