feat: onlyoffice url config in settings
This commit is contained in:
parent
75e82522fc
commit
f140fe1ddf
@ -39,6 +39,7 @@ override the options.`,
|
|||||||
DisableExternal: mustGetBool(flags, "branding.disableExternal"),
|
DisableExternal: mustGetBool(flags, "branding.disableExternal"),
|
||||||
Files: mustGetString(flags, "branding.files"),
|
Files: mustGetString(flags, "branding.files"),
|
||||||
},
|
},
|
||||||
|
OnlyOffice: "",
|
||||||
}
|
}
|
||||||
|
|
||||||
ser := &settings.Server{
|
ser := &settings.Server{
|
||||||
|
|||||||
@ -55,6 +55,8 @@ you want to change. Other options will remain unchanged.`,
|
|||||||
set.Branding.DisableExternal = mustGetBool(flags, flag.Name)
|
set.Branding.DisableExternal = mustGetBool(flags, flag.Name)
|
||||||
case "branding.files":
|
case "branding.files":
|
||||||
set.Branding.Files = mustGetString(flags, flag.Name)
|
set.Branding.Files = mustGetString(flags, flag.Name)
|
||||||
|
case "onlyoffice":
|
||||||
|
set.OnlyOffice = mustGetString(flags, flag.Name)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -14,6 +14,7 @@ const theme = window.FileBrowser.Theme;
|
|||||||
const enableThumbs = window.FileBrowser.EnableThumbs;
|
const enableThumbs = window.FileBrowser.EnableThumbs;
|
||||||
const resizePreview = window.FileBrowser.ResizePreview;
|
const resizePreview = window.FileBrowser.ResizePreview;
|
||||||
const enableExec = window.FileBrowser.EnableExec;
|
const enableExec = window.FileBrowser.EnableExec;
|
||||||
|
const onlyOffice = window.FileBrowser.OnlyOffice;
|
||||||
|
|
||||||
export {
|
export {
|
||||||
name,
|
name,
|
||||||
@ -31,4 +32,5 @@ export {
|
|||||||
enableThumbs,
|
enableThumbs,
|
||||||
resizePreview,
|
resizePreview,
|
||||||
enableExec,
|
enableExec,
|
||||||
|
onlyOffice,
|
||||||
};
|
};
|
||||||
|
|||||||
@ -22,6 +22,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { files as api } from "@/api";
|
import { files as api } from "@/api";
|
||||||
import { mapState, mapMutations } from "vuex";
|
import { mapState, mapMutations } from "vuex";
|
||||||
|
import { onlyOffice } from "@/utils/constants";
|
||||||
|
|
||||||
import HeaderBar from "@/components/header/HeaderBar";
|
import HeaderBar from "@/components/header/HeaderBar";
|
||||||
import Breadcrumbs from "@/components/Breadcrumbs";
|
import Breadcrumbs from "@/components/Breadcrumbs";
|
||||||
@ -65,7 +66,7 @@ export default {
|
|||||||
) {
|
) {
|
||||||
return "editor";
|
return "editor";
|
||||||
} else if (
|
} else if (
|
||||||
this.req.type === "officedocument"
|
this.req.type === "officedocument" && onlyOffice !== ""
|
||||||
) {
|
) {
|
||||||
return "OnlyOfficeEditor";
|
return "OnlyOfficeEditor";
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -21,7 +21,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { mapState } from "vuex";
|
import { mapState } from "vuex";
|
||||||
import url from "@/utils/url";
|
import url from "@/utils/url";
|
||||||
import { baseURL } from "@/utils/constants";
|
import { baseURL, onlyOffice } from "@/utils/constants";
|
||||||
|
|
||||||
import HeaderBar from "@/components/header/HeaderBar";
|
import HeaderBar from "@/components/header/HeaderBar";
|
||||||
import Action from "@/components/header/Action";
|
import Action from "@/components/header/Action";
|
||||||
@ -80,7 +80,7 @@ export default {
|
|||||||
let onlyofficeScript = document.createElement("script");
|
let onlyofficeScript = document.createElement("script");
|
||||||
onlyofficeScript.setAttribute(
|
onlyofficeScript.setAttribute(
|
||||||
"src",
|
"src",
|
||||||
`http://10.10.2.1:8765/web-apps/apps/api/documents/api.js`
|
`${onlyOffice}/web-apps/apps/api/documents/api.js`
|
||||||
);
|
);
|
||||||
document.head.appendChild(onlyofficeScript);
|
document.head.appendChild(onlyofficeScript);
|
||||||
|
|
||||||
|
|||||||
@ -83,6 +83,20 @@
|
|||||||
id="branding-files"
|
id="branding-files"
|
||||||
/>
|
/>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
<h3>{{ $t("settings.onlyOffice") }}</h3>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<label for="onlyoffice-url">{{
|
||||||
|
$t("settings.onlyOfficeUrl")
|
||||||
|
}}</label>
|
||||||
|
<input
|
||||||
|
class="input input--block"
|
||||||
|
type="text"
|
||||||
|
v-model="settings.onlyoffice"
|
||||||
|
id="onlyoffice-url"
|
||||||
|
/>
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="card-action">
|
<div class="card-action">
|
||||||
|
|||||||
@ -16,6 +16,7 @@ type settingsData struct {
|
|||||||
Branding settings.Branding `json:"branding"`
|
Branding settings.Branding `json:"branding"`
|
||||||
Shell []string `json:"shell"`
|
Shell []string `json:"shell"`
|
||||||
Commands map[string][]string `json:"commands"`
|
Commands map[string][]string `json:"commands"`
|
||||||
|
OnlyOffice string `json:"onlyoffice"`
|
||||||
}
|
}
|
||||||
|
|
||||||
var settingsGetHandler = withAdmin(func(w http.ResponseWriter, r *http.Request, d *data) (int, error) {
|
var settingsGetHandler = withAdmin(func(w http.ResponseWriter, r *http.Request, d *data) (int, error) {
|
||||||
@ -27,6 +28,7 @@ var settingsGetHandler = withAdmin(func(w http.ResponseWriter, r *http.Request,
|
|||||||
Branding: d.settings.Branding,
|
Branding: d.settings.Branding,
|
||||||
Shell: d.settings.Shell,
|
Shell: d.settings.Shell,
|
||||||
Commands: d.settings.Commands,
|
Commands: d.settings.Commands,
|
||||||
|
OnlyOffice: d.settings.OnlyOffice,
|
||||||
}
|
}
|
||||||
|
|
||||||
return renderJSON(w, r, data)
|
return renderJSON(w, r, data)
|
||||||
@ -46,6 +48,7 @@ var settingsPutHandler = withAdmin(func(w http.ResponseWriter, r *http.Request,
|
|||||||
d.settings.Branding = req.Branding
|
d.settings.Branding = req.Branding
|
||||||
d.settings.Shell = req.Shell
|
d.settings.Shell = req.Shell
|
||||||
d.settings.Commands = req.Commands
|
d.settings.Commands = req.Commands
|
||||||
|
d.settings.OnlyOffice = req.OnlyOffice
|
||||||
|
|
||||||
err = d.store.Settings.Save(d.settings)
|
err = d.store.Settings.Save(d.settings)
|
||||||
return errToStatus(err), err
|
return errToStatus(err), err
|
||||||
|
|||||||
@ -42,6 +42,7 @@ func handleWithStaticData(w http.ResponseWriter, _ *http.Request, d *data, fSys
|
|||||||
"EnableThumbs": d.server.EnableThumbnails,
|
"EnableThumbs": d.server.EnableThumbnails,
|
||||||
"ResizePreview": d.server.ResizePreview,
|
"ResizePreview": d.server.ResizePreview,
|
||||||
"EnableExec": d.server.EnableExec,
|
"EnableExec": d.server.EnableExec,
|
||||||
|
"OnlyOffice": d.settings.OnlyOffice,
|
||||||
}
|
}
|
||||||
|
|
||||||
if d.settings.Branding.Files != "" {
|
if d.settings.Branding.Files != "" {
|
||||||
|
|||||||
@ -21,6 +21,7 @@ type Settings struct {
|
|||||||
Commands map[string][]string `json:"commands"`
|
Commands map[string][]string `json:"commands"`
|
||||||
Shell []string `json:"shell"`
|
Shell []string `json:"shell"`
|
||||||
Rules []rules.Rule `json:"rules"`
|
Rules []rules.Rule `json:"rules"`
|
||||||
|
OnlyOffice string `json:"onlyoffice"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetRules implements rules.Provider.
|
// GetRules implements rules.Provider.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user