mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-01-16 04:22:05 +01:00
fixed filemanage v2
This commit is contained in:
@@ -769,10 +769,26 @@ newapp.controller('fileManagerCtrlV2', function ($scope, $http, FileUploader, $w
|
||||
|
||||
if (response.data.status === 1) {
|
||||
|
||||
// Define aceEditorMode with the appropriate mode for your content
|
||||
var aceEditorMode = "ace/mode/html"; // Change this according to your content type
|
||||
|
||||
// Then, proceed with your existing code
|
||||
var editor = ace.edit("htmlEditorContent");
|
||||
editor.setTheme("ace/theme/chrome");
|
||||
editor.getSession().setMode(aceEditorMode);
|
||||
editor.setValue(response.data.fileContents);
|
||||
|
||||
if (aceEditorMode) {
|
||||
editor.getSession().setMode(aceEditorMode);
|
||||
} else {
|
||||
console.error("aceEditorMode is not defined or invalid.");
|
||||
}
|
||||
|
||||
if (response.data && typeof response.data.fileContents === "string") {
|
||||
// console.log("Setting editor value:", response.data.fileContents);
|
||||
editor.setValue(response.data.fileContents);
|
||||
} else {
|
||||
console.error("Unable to set editor value. Check response.data.fileContents.");
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
$scope.errorMessageEditor = false;
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
<p class="font-bold w-32">Current Path</p>
|
||||
</div>
|
||||
<div>
|
||||
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" id="currentPath" ng-model="currentPath"
|
||||
<input type="text" class="w-80 bg-gray-100 rounded px-2 py-1" id="currentPath" ng-model="currentPath"
|
||||
readonly>
|
||||
</div>
|
||||
<div>
|
||||
@@ -609,10 +609,12 @@
|
||||
</div>
|
||||
<div class="p-4 md:p-5">
|
||||
<div>
|
||||
<div id="htmlEditorContent">
|
||||
<div id="htmlEditorContent" style="height: 300px;">
|
||||
<!-- Set a height for the editor -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div id="htmlEditorStyles" class="row">
|
||||
<div class="col-sm-12">
|
||||
@@ -629,8 +631,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end py-3 px-3">
|
||||
<button ng-click="putFileContents()" type="button" data-modal-toggle="edit"
|
||||
data-modal-hide="edit"
|
||||
<button ng-click="putFileContents()" type="button"
|
||||
|
||||
class="bg-orange-500 text-white font-bold px-4 py-1 text-xl">
|
||||
<i class="fa" aria-hidden="true"></i> {% trans "Save Changes" %}
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user